/* Ephor — responsive + reduced motion.

   No type sizes here: the scale in tokens.css is fluid, so a title is the
   right size at every width without a breakpoint restating it (the per-width
   restatements were how the hero title came out SMALLER than the section
   titles on a laptop and half the phone titles 40px, half 52px). The same
   goes for the shell and the section padding. What stays is layout: what
   stacks, what wraps, what steps back. */

/* small laptops and tablets on their side (audit, 2026-10-08, measured at
   768-1366px): the six seats' words ran out of their tiles, the Wedge's
   picture ran under its paragraph, and the footer's legal line broke with
   its buttons stranded below it (that one to 1319px, below) */
@media (max-width: 1279px) {
  .council { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shift-scenery { block-size: 20rem; }
}
/* the legal line and its two buttons share one row from 1320px — on one line
   from about 1440px, the pill's own links wrapping inside it below that
   (closing.css, owner 2026-10-21); below 1320px they stack, centred */
@media (max-width: 1319px) {
  .footer-bar { flex-direction: column; justify-content: center; }
  .footer-legal { justify-content: center; text-align: center; border-radius: var(--r-lg); }
}

/* the engine's three columns are narrow here: the file card shows each
   status under its file, as on a phone, rather than cut "canonical" off */
@media (min-width: 992px) and (max-width: 1279px) {
  .ledger-row { flex-direction: column; align-items: flex-start; gap: var(--s-0); }
  .ledger-row span:last-child { text-align: start; }
}

@media (max-width: 991px) {
  .shift-scenery { max-inline-size: 70%; block-size: 20rem; }
  /* stacked: one column, heads back with their own panels, no wires to draw */
  .levels-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .levels-col { display: flex; grid-row: auto; }
  .levels-wires { display: none; }
  /* no shared centre line to keep: each panel's header goes back into flow at its top */
  .levels-panel { min-block-size: 0; justify-content: flex-start; padding: var(--s-6); }
  .panel-head { position: static; margin-block-end: var(--s-4); }
  .ask-split { grid-template-columns: 1fr; gap: var(--s-8); }
  /* the timeline turns down the page: the line runs down the start side,
     each week's segment reaching the next node below it */
  .timeline { grid-template-columns: minmax(0, 1fr); gap: var(--s-10); padding-inline-start: var(--s-10); }
  .tl-node { position: absolute; inset-inline-start: calc(var(--s-10) * -1); inset-block-start: 0; margin: 0; }
  .tl-week::after {
    inset-inline-start: calc(var(--s-10) * -1 + 0.55rem); inline-size: 2px; block-size: calc(100% + var(--s-10));
    margin: 0; margin-inline-start: -1px; transform: none !important;
  }
  .faq-split { grid-template-columns: 1fr; gap: var(--s-10); }
  .faq-tab-menu { gap: var(--s-3); }
  .faq-ask-card { grid-template-columns: minmax(0, 1fr); padding: var(--s-6); gap: var(--s-6); }

  /* the hero goes to one column: the words, then the briefing; Orion steps
     back to the top corner, faint — `filter`, not `opacity`, so the entrance
     (which animates opacity) still lands on it */
  .hero-chart { grid-template-columns: minmax(0, 1fr); padding-block-start: var(--s-32); }
  .briefing { justify-self: stretch; margin-block-start: var(--s-4); inline-size: 100%; max-inline-size: 34rem; }
  .hunter {
    inline-size: min(70vw, 420px); filter: opacity(0.5);
    inset-inline-start: auto; inset-inline-end: -8%; inset-block-start: 5%;
  }
}

@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  /* grid-centred, not inline: an inline SVG sits on the text baseline, which
     left the icon 2px above the button's centre */
  /* finger-sized: the icon is 18px, which is a 18px TARGET — the one control
     the whole phone layout depends on. The negative block margin keeps the
     44px box from growing the capsule around it. */
  .menu {
    display: grid; place-items: center; margin-inline-start: auto;
    inline-size: 2.75rem; block-size: 2.75rem; margin-block: calc(var(--s-1) * -1);
    border: 0; background: transparent; color: var(--navy);
  }
  /* a scrim, so the sheet reads as an overlay rather than a card with the
     page showing through the gap above it */
  .site-header.menu-open::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background: #0d1a3080; backdrop-filter: blur(3px);
  }
  /* The sheet speaks the same language as the desktop dropdown: an opaque
     panel with quiet rows and ONE primary action. Translucent white over the
     dark footer turned it into a grey slab, and four navy pills of equal
     weight left nothing to look at first. */
  .mobile-menu {
    position: absolute; inset-block-start: 4.75rem; inset-inline: 0;
    z-index: 4; display: grid; gap: var(--s-0); padding: var(--s-2);
    border: 1px solid var(--line-soft); border-radius: var(--r-lg);
    background: var(--white); box-shadow: var(--shadow-lift);
  }
  .mobile-menu a, .mobile-menu button {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    padding: var(--s-3) var(--s-4); border: 0; border-radius: var(--r-card);
    background: transparent; color: var(--navy);
    font-size: var(--fs-body); font-weight: 500; text-align: start;
  }
  .mobile-menu a:active, .mobile-menu button:active { background: var(--ice); }
  .mobile-menu svg { color: var(--grey); }
  .menu-sep { block-size: 1px; margin: var(--s-2) var(--s-4); background: var(--line-soft); }
  .menu-label {
    padding: var(--s-1) var(--s-4); font-size: var(--fs-micro); font-weight: 500;
    letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--grey);
  }
  .mobile-menu .menu-cta {
    justify-content: center; margin-block-start: var(--s-1);
    background: var(--navy); color: var(--white); border-radius: var(--r-pill); padding: var(--s-4) var(--s-6);
  }
  .mobile-menu .menu-cta svg { color: var(--white); }
}

@media (max-width: 767px) {
  .site-header, .site-header.is-scrolled { margin-block-start: var(--s-4); }
  .nav-pill { padding-inline: var(--inset) var(--s-2); }
  .nav-module-menu { display: none; }
  .hero-chart { min-block-size: 0; padding: calc(var(--s-20) + var(--s-8)) var(--edge) var(--s-12); }
  .b-head, .b-body { padding-inline: var(--s-4); }
  .chain-close { flex-direction: column; align-items: flex-start; padding: var(--s-4) var(--s-5); }
  .ask-wrapper { padding: var(--s-8) var(--s-5); }
  .council-panel { padding: var(--s-4); }
  /* two across: at three, "Manufacturer" ran out of its tile */
  .council { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ans-points li { grid-template-columns: auto 1fr; }
  .ans-points li > span:last-child { grid-column: 2; }
  /* the engine's instrument cards size to their content, which is wider than
     a phone column — let them fill the panel and give the panel back some room */
  .levels-panel { padding: var(--s-4); min-block-size: 0; }
  .ledger-glass, .pipe-card, .targets { inline-size: 100%; max-inline-size: 100%; min-inline-size: 0; }
  /* label over value: side-by-side rows would have to hyphenate "canonical"
     to fit a phone column */
  .ledger-row { flex-direction: column; align-items: flex-start; gap: var(--s-0); }
  .ledger-row span:last-child { text-align: start; }
  .levels-panel { padding-block-end: var(--s-4); }

  .context-tab { padding: var(--s-2) var(--s-3); font-size: var(--fs-small); }
  .footer-inner { min-block-size: 80dvh; padding: var(--s-12) var(--edge) var(--s-4); }
  .footer-bar { flex-direction: column; justify-content: center; }
  .footer-legal { flex-direction: column; justify-content: center; gap: var(--s-3); text-align: center; border-radius: var(--r-lg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* every entrance lands where it would have ended */
  [data-reveal], [data-reveal].is-revealed, .hero-copy > *:not(h1), .briefing, .hunter,
  .chain-step,
  .levels-col, .ledger-glass, .pipe-card,
  .targets .target-row,
  .tl-week, .tl-end, .setup-head {
    opacity: 1 !important; translate: 0 0 !important; scale: 1 !important; transform: none !important;
  }
  .lv-wire { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
  .lv-nodes { opacity: 1 !important; }
  .tl-week::after { transform: none !important; }
}

@media (max-width: 767px) {
  /* the module tabs are the storyboard's only control — 39px was under the
     44px a thumb needs */
  .context-tab { min-block-size: 2.75rem; }
  /* the dialog gives back the room a phone does not have to spare */
  .dialog { padding: var(--s-6) var(--s-5); border-radius: var(--r-panel); }
  .dialog .close { inset-inline-end: var(--s-2); inset-block-start: var(--s-2); }
}
