/* ═══════════════════════════════════════════════════════════════════════════
   MARBLELENS V3 · ACT I — DEVELOP / HERO

   Three sheets in one grid cell, one geometry:

     .hero-draft    the graphite working drawing        (aria-hidden, inert)
     .hero-live     THE real DOM — the only accessible copy; revealed left of
                    the development boundary by a soft mask
     .hero-develop  the active transformation, clipped to the lens circle,
                    slightly magnified                   (aria-hidden, inert)

   REGISTRATION IS STRUCTURAL, NOT TUNED. All three sheets share the same
   layout classes; draft/develop modifiers may change ink, texture and
   decoration but never metrics (no font, size, spacing or border-width
   changes — draft boxes use transparent backgrounds and the SAME border
   width, restyled dashed). If the draft needs a mark the live page doesn't
   have, it goes in .draft-marks, an absolutely positioned overlay that
   cannot move the layout.

   The development boundary is `--reveal` (px, on .hero-pin), written by
   js/hero.js from the pure model. The live sheet is masked to the LEFT of
   it with a 36px feather that always sits under the lens glass during the
   sweep. `.is-live` removes the mask entirely — the finished page is a
   normal page, not a masked one.

   NO-JS AND REDUCED MOTION LAND HERE TOO: without html.js the mask never
   applies and the live sheet simply IS the page.
   ═══════════════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  overflow-x: clip;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

/* ── travel + pin ─────────────────────────────────────────────────────────
   The hero pins for one viewport plus the SUNRISE scrub travel. Scroll is
   the specimen's clock (owner-locked: scroll = time scrub), so the travel
   below the pin is what a visitor spends driving the sunrise. */
.hero-travel {
  height: calc(100vh + var(--sunrise-travel, 120vh));
  height: calc(100svh + var(--sunrise-travel, 120vh));
}
.hero-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
/* reduced motion / no sequence: the travel collapses — no dead screens */
.is-static .hero-travel,
.no-seq .hero-travel {
  height: 100vh;
  height: 100svh;
}

/* ── the three sheets ── */
.hero-sheet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
.hero-draft   { z-index: 1; }
.hero-live    { z-index: 2; }
.hero-develop {
  z-index: 3;
  visibility: hidden;
  /* the developer bath: warm, slightly soft, not yet committed */
  filter: sepia(0.24) saturate(1.28) contrast(0.93) brightness(1.03);
  will-change: clip-path, transform;
}
.hero-draft, .hero-develop { pointer-events: none; }

/* the development boundary — only under html.js, so a scriptless visit gets
   the finished page untouched */
html.js .hero-pin:not(.is-live) .hero-live {
  -webkit-mask-image: linear-gradient(90deg,
    #000 calc(var(--reveal, 0px) - 36px), transparent calc(var(--reveal, 0px) + 36px));
  mask-image: linear-gradient(90deg,
    #000 calc(var(--reveal, 0px) - 36px), transparent calc(var(--reveal, 0px) + 36px));
  pointer-events: none;
}

/* ── header ────────────────────────────────────────────────────────────────
   Real <header>/<nav>/<a> only in the live sheet; the copies use spans so
   the page never carries duplicate landmarks or focus stops. */
.v3-header {
  display: flex;
  align-items: baseline;
  gap: var(--s-5);
  padding: clamp(1rem, 0.8rem + 1vw, 1.6rem) var(--gutter) 0;
}
.v3-brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.v3-nav {
  display: flex;
  gap: clamp(0.9rem, 0.4rem + 1.4vw, 1.8rem);
  margin-inline: auto;
}
.v3-nav-link {
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}
.hero-live .v3-nav-link:hover,
.hero-live .v3-nav-link:focus-visible { border-bottom-color: var(--accent); outline: none; }
.v3-acct { display: flex; align-items: center; gap: var(--s-3); }
.v3-acct-link {
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--t-small);
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.45rem 0.2rem;
}
.v3-acct-primary {
  padding: 0.45rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
}
.hero-live .v3-acct-primary:hover,
.hero-live .v3-acct-primary:focus-visible { background: var(--ink); color: var(--paper-hi); outline: none; }

/* ── hero grid ── */
.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 6.4fr) minmax(0, 4.6fr);
  align-items: center;
  gap: clamp(1.5rem, 2vw + 1rem, 4rem);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(1.4rem, 3vh, 3rem);
  min-height: 0;
}

.hero-headline {
  font-family: var(--serif);
  font-weight: 600;
  /* "Rough ideas. / Taking shape here." — a two-line lockup. Each line is a
     committed block that holds as ONE line in the split column (the endX
     trap: a wrapped anchor word collapses the sweep), and the sweep distance
     is line 2's own width. Wrap INSIDE a line is a stacked-mode decision. */
  font-size: clamp(2.4rem, 0.6rem + 3.9vw, 4.15rem);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-head);
  color: var(--ink);
  margin: 0 0 clamp(1rem, 1.8vh, 1.6rem);
}
.hl-line { display: block; white-space: nowrap; }
/* the sentence's final full stop is the docked brass lens. The slot is a
   BASELINE ANCHOR: a flat inline box that reserves exactly the instrument's
   docked width (--dock-d, written by js/hero.js from model.dockDFor — §12's
   ~40%-of-rolling-size stop) without stretching the line box; the parked
   instrument itself rests ON the baseline, rising above the caps the way a
   physical stop sits on a printed sheet. Scriptless fallback: a printed
   0.55em period (::after below). */
.fullstop-slot {
  position: relative;
  display: inline-block;
  width: var(--dock-d, 0.55em);
  height: 0.55em;
  margin-left: 0.09em;
}
html:not(.js) .hero-live .fullstop-slot::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0.55em;
  height: 0.55em;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--ink);
}

.hero-support {
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34em;
  margin: 0 0 clamp(1.4rem, 2.6vh, 2.2rem);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.v3-btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--t-small);
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
}
.v3-btn-primary { background: var(--ink); color: var(--paper-hi); }
.hero-live .v3-btn-primary:hover,
.hero-live .v3-btn-primary:focus-visible { background: var(--accent-ink); border-color: var(--accent-ink); outline: none; }
.v3-btn-ghost { color: var(--ink); background: transparent; }
.hero-live .v3-btn-ghost:hover,
.hero-live .v3-btn-ghost:focus-visible { border-color: var(--accent-ink); color: var(--accent-ink); outline: none; }

/* ── SUNRISE specimen ─────────────────────────────────────────────────────
   A real specimen container: the sequence canvas mounts inside
   .specimen-frame and takes the frame's width; 4:5 is the production asset
   contract (see ../ASSET_CONTRACT.md). Height-capped so the plate never
   leaves the pinned viewport on short screens. */
.specimen {
  margin: 0;
  justify-self: end;
  width: min(100%, 34rem, calc((100svh - 15rem) * 1.3333));
}
.specimen-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--paper-hi);
  border: 1px solid var(--line);
  box-shadow: var(--sh-mount);
  overflow: hidden;
}
.specimen-frame canvas { display: block; width: 100%; height: auto; }
.specimen-cue {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 1rem;
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--graphite-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out;
}
.hero-pin[data-specimen="waiting"] .specimen-cue { opacity: 1; }
.hero-pin:not([data-specimen="waiting"]) .specimen-cue,
.no-seq .specimen-cue { opacity: 0; }
.specimen-meta {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding-top: 0.7rem;
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.16em;
  color: var(--graphite);
}
.spec-name { color: var(--ink-2); letter-spacing: 0.22em; }
.spec-mark { font-size: 0.6rem; color: var(--accent-ink); }
.spec-time { margin-left: auto; letter-spacing: 0.1em; color: var(--graphite-2); }
/* the sequence failed to mount — say so honestly, in the frame's own voice */
.specimen-void {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.2em;
  color: var(--graphite-2);
}
.no-seq .specimen-void { display: grid; }

/* ═══════════════════════════════════════════════════════════════════════════
   THE WORKING DRAWING — same geometry, graphite ink
   ═══════════════════════════════════════════════════════════════════════════ */
.hero-draft { color: var(--graphite); }
.hero-draft .v3-brand { color: var(--graphite); }
.hero-draft .v3-nav-link,
.hero-draft .v3-acct-link { color: var(--graphite-2); border-bottom: 1px dashed var(--line); }
.hero-draft .v3-acct-primary { border: 1px dashed var(--graphite-2); color: var(--graphite); }

/* skeleton typography: the same Playfair metrics drawn as outline */
.hero-draft .hero-headline {
  color: transparent;
  -webkit-text-stroke: 1.3px rgba(110, 106, 99, 0.85);
}
@supports not (-webkit-text-stroke: 1px black) {
  .hero-draft .hero-headline { color: var(--graphite-2); }
}
/* the pencilled placeholder where the brass stop will land — drawn at the
   instrument's own docked size, seated on the baseline like the stop it
   awaits */
.hero-draft .fullstop-slot { -webkit-text-stroke: 0; }
.hero-draft .fullstop-slot::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--dock-d, 0.55em);
  height: var(--dock-d, 0.55em);
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1px dashed var(--graphite-2);
}
.hero-draft .hero-support { color: var(--graphite); }
.hero-draft .v3-btn { border-style: dashed; border-color: var(--graphite-2); }
.hero-draft .v3-btn-primary { background: transparent; color: var(--graphite); }
.hero-draft .v3-btn-ghost { color: var(--graphite); }

/* crossed, unfinished specimen frame */
.hero-draft .specimen-frame {
  background: transparent;
  border: 1px dashed var(--graphite-2);
  box-shadow: none;
  background-image:
    linear-gradient(to top right, transparent calc(50% - 0.5px), rgba(146, 141, 131, 0.55) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(to bottom right, transparent calc(50% - 0.5px), rgba(146, 141, 131, 0.55) 50%, transparent calc(50% + 0.5px));
}
.hero-draft .specimen-meta { color: var(--graphite-2); }
.hero-draft .spec-mark { color: var(--graphite-2); }

/* ── construction marks — overlay only, never in flow ── */
.draft-marks { position: absolute; inset: 0; pointer-events: none; }
/* registration crosses, four corners */
.reg-mark { position: absolute; width: 18px; height: 18px; opacity: 0.6; }
.reg-mark::before, .reg-mark::after {
  content: ""; position: absolute; background: var(--graphite-2);
}
.reg-mark::before { left: 0; right: 0; top: 50%; height: 1px; }
.reg-mark::after  { top: 0; bottom: 0; left: 50%; width: 1px; }
.reg-tl { top: 14px; left: 14px; }
.reg-tr { top: 14px; right: 14px; }
.reg-bl { bottom: 14px; left: 14px; }
.reg-br { bottom: 14px; right: 14px; }

/* baseline rules under the headline block */
.baseline-marks {
  position: absolute;
  height: 0;
  border-top: 1px dashed rgba(146, 141, 131, 0.4);
}

/* ═══ THE ROUTE OUT — the spine begins on this sheet ══════════════════════
   After the dock, the headline baseline leads the instrument left, around
   one rounded corner, onto the vertical margin rail — the page's ONE
   spine (see acts.css .v3-rail; same x, same ink, so the hero's segment
   and the next sheet's segment read as one line at the seam).
   --route-y (the baseline) and --route-len (stub length) are written by
   js/hero.js from the measured type; --bend-r is the one corner radius
   the whole route shares. */
.hero-route { position: absolute; inset: 0; pointer-events: none; }
.hero-route span { position: absolute; }
.hr-base {
  left: calc(var(--spine-left) + var(--bend-r, 32px));
  top: calc(var(--route-y, 200vh) - 1px);
  width: var(--route-len, 0px);
  border-top: 2px solid rgba(31, 31, 28, 0.22);
}
.hr-corner {
  left: calc(var(--spine-left) - 1.5px);
  top: calc(var(--route-y, 200vh) - 1px);
  width: var(--bend-r, 32px);
  height: var(--bend-r, 32px);
  border-left: 3px solid rgba(31, 31, 28, 0.2);
  border-top: 2px solid rgba(31, 31, 28, 0.22);
  border-top-left-radius: 100%;
}
.hr-rail {
  left: var(--spine-left);
  top: calc(var(--route-y, 200vh) + var(--bend-r, 32px));
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 2px;
  /* full strength to the sheet's edge — this end MEETS the next sheet's
     rail at the seam; a taper would dash the continuous line */
  background: rgba(31, 31, 28, 0.2);
}
/* the committed page prints its route: hidden while the film performs,
   part of the developed page's furniture the moment it goes live — so the
   rail is already under the instrument when the undock starts, and every
   later sheet's printed rail has a matching beginning. The draft plans the
   same route in pencil. */
.hero-live .hero-route { opacity: 0; }
.hero-pin.is-live .hero-live .hero-route { opacity: 1; }
/* dashed overrides PER DECLARED SIDE — a bare border-style on all four
   sides resurrects undeclared edges at the initial `medium` width and
   closes the corner into a dashed box */
.hero-draft .hero-route span { background: none; opacity: 0.75; }
.hero-draft .hr-base { border-top: 1px dashed var(--graphite-2); }
.hero-draft .hr-corner {
  border-left: 1px dashed var(--graphite-2);
  border-top: 1px dashed var(--graphite-2);
}
.hero-draft .hr-rail {
  width: 0;
  border-left: 1px dashed var(--graphite-2);
  background: none;
}
/* the handwritten notes — sparing, editorial, Caveat is already the site's
   pencil voice */
.draft-note {
  position: absolute;
  font-family: var(--pencil);
  font-size: clamp(0.95rem, 0.8rem + 0.5vw, 1.25rem);
  line-height: 1.15;
  color: var(--graphite);
  opacity: 0.85;
  white-space: nowrap;
}
.draft-note .note-arrow { font-family: var(--pencil); }

/* ═══════════════════════════════════════════════════════════════════════════
   LIVE / INTERACTION AUTHORITY
   ═══════════════════════════════════════════════════════════════════════════ */
/* while the film runs the live sheet is scenery; authority arrives with
   .is-live and is removed again only by an explicit replay */
.hero-pin.is-live .hero-draft,
.hero-pin.is-live .hero-develop { display: none; }
.hero-pin.is-live .hero-live { pointer-events: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — deliberate recomposition, not a scaled canvas
   (the 820px cut is the house `narrow` breakpoint used by every beat)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 819px) {
  .v3-header {
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0;
    padding-top: 0.9rem;
  }
  .v3-brand,
  .v3-nav-link,
  .v3-acct-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .v3-brand { font-size: 1.05rem; }
  .v3-acct { margin-left: auto; }
  .v3-acct-link { padding: 0 0.35rem; }
  .v3-acct-primary { padding-inline: 0.85rem; }
  .v3-nav {
    order: 3;
    width: 100%;
    margin-inline: 0;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.1rem 0 0.2rem;
  }
  .v3-nav::-webkit-scrollbar { display: none; }
  .v3-nav-link {
    padding-inline: 0.35rem;
    white-space: nowrap;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: clamp(1rem, 2.5vh, 1.8rem);
    padding-top: clamp(0.8rem, 2vh, 1.6rem);
  }
  .hero-headline { font-size: clamp(2.35rem, 1.2rem + 7.5vw, 3.4rem); }
  .hero-draft .hero-headline {
    -webkit-text-stroke-width: 1.45px;
    -webkit-text-stroke-color: rgba(92, 88, 81, 0.94);
  }
  /* narrow columns may wrap inside a line; the lockup's two lines remain */
  .hl-line { white-space: normal; }
  .hero-support { margin-bottom: clamp(1rem, 1.8vh, 1.6rem); }
  .specimen {
    justify-self: stretch;
    width: min(100%, calc((100svh - 27rem) * 0.8));
    margin-inline: auto;
  }
  .specimen-cue {
    padding: 0.55rem 0.8rem;
    text-align: center;
  }
}

/* tablet band: keep the split but let the plate breathe less */
@media (min-width: 820px) and (max-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .specimen { width: min(100%, 24rem, calc((100svh - 14rem) * 0.8)); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   REDUCED MOTION — the developed hero, arrived at rather than performed
   ═══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-develop { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   OWNER-DIRECTED · the lens reveal STAYS, the specimen is EXEMPT.

   The pencil headline revealing into ink as the lens arrives is wanted -- that
   is the whole point of the draft sheet. What is NOT wanted is the same
   travelling boundary uncovering the SPECIMEN, because the specimen has its own
   story (blank canvas -> develops -> runs) and being wiped in on top of that
   reads as a swipe.

   So: draft sheet and .hero-live mask both restored untouched. Only the two
   specimen copies are pulled out of the wipe -- the draft's crossed plate is
   hidden, and the live plate is exempted from the mask by js/hero.js, which
   lifts it into its own unmasked layer.
   ═══════════════════════════════════════════════════════════════════════════ */
.hero-draft .specimen { visibility: hidden; }
.hero-develop .specimen { visibility: hidden; }
/* the lifted, never-masked specimen layer */
.specimen-lifted {
  position: absolute;
  z-index: 4;                 /* above draft(1), live(2), develop(3) */
  pointer-events: none;
}
