/* Keep the portfolio comfortable on phones, tablets, and shorter laptops. */
:root {
  --page-gutter: clamp(20px, 5vw, 76px);
}

.section { padding-inline: var(--page-gutter); }
.site-header, .hero, .discipline-strip { width: 100%; }
.section-heading > *, .game-feature > *, .math-intro > *,
.archive-toolbar > *, .archive-colophon > *, .about-section > *,
.contact-main > * { min-width: 0; }

.hero {
  height: calc(100svh - var(--header-height));
  min-height: 620px;
  max-height: 900px;
}
.hero-content {
  width: 55%;
  padding: clamp(28px, 5svh, 56px) 0 108px var(--page-gutter);
}
.hero h1 { font-size: clamp(96px, 10.5vw, 160px); }
.sculpture {
  top: 7%;
  right: -4%;
  bottom: 8%;
  width: 58%;
  height: auto;
}

/* Full-page thumbnails remain upright, at a more compact browsing size. */
.paper-cover {
  height: 360px;
  min-height: 0;
  padding: 24px 30px 54px;
}
.paper-sheet {
  width: min(100%, 220px);
  height: 100%;
  max-height: 282px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
}
.paper-sheet > img {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 5px 10px 26px #0008;
}

.archive-toolbar { flex-wrap: wrap; gap: 12px 24px; }
.archive-filters { min-width: 0; gap: clamp(12px, 2.5vw, 28px); }
.archive-search {
  flex: 1;
  width: auto;
  min-width: min(220px, 100%);
}
.research-dialog, .media-dialog {
  width: min(1220px, calc(100vw - 24px));
}
.research-reader { grid-template-columns: minmax(180px, 22%) minmax(0, 1fr); }
.viewer-header { gap: 16px; }
.viewer-header h2 { overflow-wrap: anywhere; }

@media (min-width: 801px) and (max-height: 780px) {
  .hero { min-height: 560px; }
  .hero-content { padding-top: 26px; }
  .hero h1 { font-size: clamp(88px, 9.5vw, 128px); margin: 22px 0 16px; }
  .hero-intro { margin-top: 18px; }
  .hero-intro p { font-size: 27px; }
  .hero-description { font-size: 16px; margin-top: 14px; margin-bottom: 20px; }
  .hero-controls { bottom: 88px; }
  .interaction-hint { top: 22px; }
}

@media (max-width: 800px) {
  .hero { min-height: 720px; max-height: 880px; }
  .hero-content { width: 74%; padding-top: 32px; }
  .hero h1 { font-size: clamp(94px, 14.8vw, 114px); }
  .sculpture { top: 32%; right: -12%; bottom: 10%; width: 65%; }
  .archive-toolbar { gap: 0; }
  .archive-search { flex-basis: 100%; width: 100%; max-width: none; }
  .paper-cover { height: 320px; padding: 22px 26px 50px; }
  .paper-sheet { width: min(100%, 195px); }
}

@media (max-width: 700px) {
  .research-reader { display: flex; flex-direction: column; }
  .reader-sidebar {
    display: block;
    flex: none;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid #1a4d6755;
  }
  .reader-sidebar > label, #paper-nav, .collection-download { display: none; }
  #paper-select {
    display: block;
    width: 100%;
    min-height: 44px;
    background: #091b2c;
    color: #bedcef;
    border: 1px solid #24608080;
    padding: 10px;
    font: 14px/1.4 var(--body);
  }
}

@media (max-width: 650px) {
  .paper-cover { height: 300px; padding: 22px 26px 50px; }
  .paper-sheet { width: min(100%, 180px); }
  .paper-card-index { flex-wrap: wrap; }
  .paper-card-index > span:last-child { text-align: left; }
}

@media (max-width: 560px) {
  .hero {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    max-height: none;
  }
  .hero-content { width: 100%; padding: 24px var(--page-gutter) 0; }
  .hero-content .eyebrow { font-size: 10px; line-height: 1.5; }
  .hero-year { display: none; }
  .hero h1 {
    font-size: clamp(72px, 19vw, 104px);
    line-height: .9;
    margin: 20px 0 0;
  }
  .hero-intro { margin-top: 18px; }
  .hero-intro p { font-size: 26px; }
  .hero-description {
    padding-left: 0;
    max-width: 32ch;
    margin: 14px 0 18px;
    font-size: 16px;
    line-height: 1.5;
  }
  .hero-content .button { margin-left: 0; min-height: 48px; }
  .sculpture {
    position: relative;
    inset: auto;
    width: 100%;
    height: clamp(180px, 48vw, 250px);
    margin: 0;
    flex: none;
  }
  .sculpture-note, .object-label, .interaction-hint { display: none; }
  .hero-controls { right: var(--page-gutter); bottom: 76px; gap: 8px; }
  .hero-controls .view-mode, .hero-controls .remix-form { min-height: 44px; }
  .hero-bottom {
    position: relative;
    inset: auto;
    min-height: 64px;
    height: auto;
    margin: 0 var(--page-gutter);
    gap: 10px;
  }
  .hero-bottom .scroll-cue { font-size: 9px; }
  .hero-bottom .motion-toggle { font-size: 9px; }
  .section-top { flex-wrap: wrap; gap: 12px; }
  .section-heading h2 { font-size: clamp(40px, 11vw, 52px); }
  .math-intro h2 { font-size: clamp(60px, 18vw, 78px); }
  .paper-card h3 { font-size: clamp(24px, 6.8vw, 28px); }
  .page-toolbar { flex-wrap: wrap; gap: 6px; }
  .paper-stage.zoomed { height: clamp(230px, 45svh, 540px); }
  .viewer-header h2 { font-size: 21px; }
  .contact-links { flex-wrap: wrap; gap: 10px 24px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: clamp(60px, 19vw, 72px); }
  .hero-intro p { font-size: 24px; }
  .hero-description { font-size: 15px; }
  .sculpture { height: 160px; }
  .hero-controls .view-label { font-size: 8px; }
  .hero-controls .remix-form > span { font-size: 8px; }
  .paper-cover { height: 280px; padding-inline: 22px; }
}
