/* Responsive finishing layer. Desktop art/layout stays unchanged; 760px matches
   the existing one-column breakpoint. Coarse-pointer landscape phones also get
   the touch navigation, with safe-area gutters for the camera housing. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.nav-toggle, .process-touch-hint { display: none; }
.process-heading p > span { font: inherit; letter-spacing: normal; text-transform: none; }
button, a, input, textarea { -webkit-tap-highlight-color: #80002018; }
:is(button, a, input, textarea):focus-visible { outline: 2px solid #347a80; outline-offset: 4px; }

@media (max-width: 760px), (max-width: 1024px) and (pointer: coarse) {
  :root { --phone-gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  html { scroll-padding-top: calc(88px + env(safe-area-inset-top)); }
  .nav.wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    height: auto;
    min-height: calc(72px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--phone-gutter) 0;
  }
  .nav .wordmark { display: inline-block; line-height: 44px; min-height: 44px; width: max-content; font-size: 1.1rem; white-space: nowrap; }
  .nav-cta { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; font-size: .75rem; white-space: nowrap; }
  .nav-cta > span { display: none; }
  .nav-toggle { position: relative; width: 44px; height: 44px; padding: 12px 9px; border: 0; background: none; color: #800020; cursor: pointer; }
  .nav-toggle span { position: absolute; left: 10px; width: 24px; height: 1.5px; background: currentColor; transition: transform .2s; }
  .nav-toggle span:first-child { transform: translateY(-4px); }
  .nav-toggle span:last-child { transform: translateY(4px); }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }
  .nav nav { display: flex; grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 12px; padding-bottom: 10px; }
  .nav nav a { display: flex; min-height: 48px; align-items: center; font-size: .95rem; }
  .nav.nav-ready .nav-toggle { display: block; }
  .nav.nav-ready nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 12px var(--phone-gutter) 20px; background: #fcfaf8; border-bottom: 1px solid #dfd7d0; box-shadow: 0 14px 20px #241a200b; }
  .nav.nav-ready.is-open nav { display: flex; flex-direction: column; gap: 0; }
  .nav.nav-ready nav a + a { border-top: 1px solid #dfd7d0; }
  .motion-toggle, .evidence-filters button, .evidence-tabs button, .evidence-story a { min-height: 44px; min-width: 44px; }
  footer .wordmark { display: inline-block; line-height: 44px; min-height: 44px; }
  .context-stage object { max-width: 100%; margin-inline: auto; }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 2 * var(--phone-gutter)); }
  .scenic-hero.wrap {
    min-height: clamp(590px, calc(100svh - 72px), 740px);
    padding: 48px var(--phone-gutter) 92px;
  }
  .scenic-hero::before {
    display: block; inset: 0; width: auto; height: auto; border: 0;
    opacity: 1;
    background: linear-gradient(180deg, #eff7fddd 0%, #eff7fd85 55%, #eff7fd00 100%);
  }
  .hero-scene { object-position: 47% center; }
  .scenic-hero .eyebrow { font-size: .65rem; letter-spacing: .18em; margin-bottom: 25px; }
  .scenic-hero h1 { max-width: 550px; margin-bottom: 24px; font-size: clamp(2.5rem, 10.7vw, 3.65rem); line-height: 1.05; letter-spacing: -.045em; }
  .scenic-hero .lede { max-width: 440px; font-size: 1rem; line-height: 1.6; margin-bottom: 26px; }
  .scenic-hero .hero-actions { flex-direction: row; flex-wrap: wrap; gap: 8px 22px; }
  .hero-actions .primary { min-height: 50px; padding: 15px 23px; font-size: .95rem; }
  .approach-link { min-height: 48px; font-size: .875rem; }

  .systems { padding: 48px 0; }
  .section-head { margin-bottom: 28px; }
  .section-head h2 { font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.08; }
  .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 18px; overflow: visible; }
  .capability, .capability:first-child, .capability:last-child { min-width: 0; min-height: 0; padding: 0; border: 0 !important; background: none; box-shadow: none; }
  .capability .generated-icon { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; margin: 0 0 14px; }
  .capability h3 { font-size: clamp(1.2rem, 5.5vw, 1.65rem); margin: 0 0 8px; line-height: 1.15; }
  .capability p { font-size: .875rem; line-height: 1.55; }

  .operation { display: block; padding: 52px 0; }
  .context-experience { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 48px; }
  .context-copy { display: contents; }
  .experience-overline { font-size: .65rem; line-height: 1.6; letter-spacing: .1em; }
  .context-copy > .experience-overline { order: 0; }
  .operation-main .context-copy h2 { order: 1; margin: 16px 0 4px; font-size: clamp(2.25rem, 9.5vw, 3.5rem); line-height: 1.08; }
  .context-stage { order: 2; margin: 0 0 20px; }
  .context-stage object { width: 100%; max-width: 460px; margin: 0 auto; }
  .context-stage figcaption { margin: -10px 0 0; gap: 8px; }
  .context-motion-label { font-size: .625rem; }
  .motion-toggle { min-height: 44px; font-size: .75rem; padding-inline: 4px; }
  .context-controls { order: 3; width: 100%; max-width: none; }
  .context-controls button { grid-template-columns: 24px minmax(0, 1fr) 16px; gap: 12px; padding: 16px 8px 16px 0; }
  .context-controls button strong { font-size: 1.3rem; }
  .context-controls button small { font-size: .8125rem; line-height: 1.5; }
  .model-provider-strip { gap: 12px; row-gap: 10px; }
  .model-provider-strip img { width: 20px; height: 20px; }
  .operation-main .context-detail { order: 4; max-width: none; min-height: 3.3em; margin: 16px 0 0; font-size: .875rem; line-height: 1.65; }

  .process-heading { display: block; margin-bottom: 0; }
  .process-heading > span { font-size: .7rem; line-height: 1.5; }
  .operation-main .process-heading p { margin: 8px 0 0; font-size: .875rem; }
  .process-desktop-hint { display: none; }
  .process-touch-hint { display: inline; }
  .process-visual {
    --stage-width: clamp(190px, 58vw, 230px);
    display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: var(--stage-width);
    width: 100%; height: auto; aspect-ratio: auto; margin: 12px 0 0;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    scrollbar-width: thin; scrollbar-color: #aa8580 #eee5dc;
  }
  /* Preserve the 360 × 720 sprite slice so the doors always fit their arches. */
  .process-stage { width: 100%; height: auto; aspect-ratio: 1 / 2; scroll-snap-align: start; scroll-margin: 0; }
  .process-stage:focus-visible { outline-offset: -4px; }
  .stage-label { bottom: 3%; padding-inline: 8px; }
  .stage-label strong { font-size: 1rem; line-height: 1.2; }
  .stage-label small { display: block; max-width: 190px; font-size: .75rem; line-height: 1.35; margin-top: 5px; }
  .stage-label::before { margin-bottom: 8px; }
  .operation-trust { grid-template-columns: 1fr; margin-top: 25px; }
  .operation-trust span { padding: 16px 4px 16px 25px; font-size: .8125rem; line-height: 1.55; }
  .operation-trust span::before { left: 3px; top: 23px; }

  .insight-section { padding: 48px 0 36px; }
  .insight-header { grid-template-columns: 1fr; gap: 18px; margin-bottom: 30px; }
  .insight-header h2 { font-size: clamp(2.25rem, 9.5vw, 3.5rem); line-height: 1.08; }
  .insight-header > p { font-size: .9375rem; line-height: 1.65; }
  .insight-explorer { grid-template-columns: 1fr; gap: 30px; }
  .insight-art { width: 62%; max-width: 250px; margin-inline: auto; }
  .insight-art-frame { aspect-ratio: 1.15; }
  .insight-art figcaption { padding-top: 12px; font-size: .75rem; }
  .evidence-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .evidence-filters button { min-height: 48px; padding: 10px 8px; font-size: .8125rem; }
  .evidence-tabs { gap: 0; justify-content: space-between; }
  .evidence-tabs button { min-height: 48px; max-width: 34%; padding: 10px 3px; font-size: .8125rem; white-space: normal; }
  .evidence-story { min-height: 0; padding-top: 22px; }
  .story-meta { font-size: .6875rem; line-height: 1.6; letter-spacing: .055em; }
  .evidence-story h3 { font-size: clamp(1.8rem, 7.8vw, 2.5rem); }
  .evidence-story p { font-size: 1rem; line-height: 1.7; margin-bottom: 16px; }
  .evidence-story a { min-height: 44px; font-size: .875rem; padding: 8px 0; }
  .evidence-footer { margin-top: 20px; font-size: .65rem; }
  .insight-principles { grid-template-columns: 1fr; gap: 22px; margin-top: 30px; }
  .insight-principles h3 { font-size: 1.2rem; }
  .insight-principles p { font-size: .875rem; }

  .people { display: block; padding: 48px 0; }
  .people-grid { gap: 28px; }
  .people-grid h2 { font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.12; }
  .people-grid .affiliations { gap: clamp(12px, 4vw, 26px); }
  .people-grid .affiliation { flex: 0 1 88px; min-width: 0; }
  .people-grid .affiliation img { max-width: 100%; }
  .demo { padding: 48px 0; }
  .demo-wrap { grid-template-columns: 1fr; gap: 28px; }
  .demo h2 { font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.12; margin-bottom: 18px; }
  .demo p { margin-bottom: 0; }
  .demo form { grid-template-columns: 1fr; padding: 24px 20px; gap: 20px; min-width: 0; }
  .demo form > * { grid-column: 1 / -1; min-width: 0; }
  .demo form h3 { font-size: 1.125rem; line-height: 1.4; }
  .demo label { font-size: .875rem; }
  .demo input, .demo textarea { font-size: 16px; line-height: 1.5; border-radius: 4px; scroll-margin-top: 96px; }
  .demo input { min-height: 50px; }
  .demo textarea { min-height: 128px; }
  .demo .form-submit { min-height: 52px; }
  footer.wrap { flex-direction: column; align-items: flex-start; height: auto; gap: 12px; padding: 20px 0 max(28px, env(safe-area-inset-bottom)); font-size: .8125rem; }
  footer .wordmark { display: inline-block; line-height: 44px; min-height: 44px; }
}

@media (max-width: 360px) {
  .nav .wordmark { font-size: 1rem; }
  .nav-cta { font-size: .6875rem; padding-inline: 10px; }
  .capability-grid { gap: 24px 14px; }
  .context-motion-label { max-width: 130px; }
  .context-stage figcaption { align-items: center; }
  .demo form { padding-inline: 16px; }
}

@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .wrap { width: calc(100% - 2 * var(--phone-gutter)); }
  .scenic-hero.wrap { min-height: 520px; padding: 40px var(--phone-gutter) 70px; }
  .scenic-hero h1 { font-size: clamp(2.5rem, 6vw, 3.5rem); }
  .nav.nav-ready nav { max-height: calc(100dvh - 72px - env(safe-area-inset-top)); overflow-y: auto; }
}
