/* body.css — THE BROADSHEET (everything after the hero).
 *
 * Concept (docs/DESIGN.md → "the annealing"): the molten chrome of the hero SETS as it leaves;
 * below, the same metal — cooled — is read as the studio's engineering broadsheet. A machinist's
 * document drawn on the permanent-dark plane, warm-lit from below by the annealing light. The
 * grammar is editorial-technical: drawn hairline rules with tick marks, monospace coordinate
 * metadata, big lowercase Archivo with the Instrument Serif italic-orange breath. The only fully
 * warm objects are the specimen plates — the artifacts the furnace made.
 *
 * Motion is disciplined: transform/opacity only, one shared easing (--ease, the hero's own
 * curve), at most one or two key elements moving per view. Everything degrades to fully-formed
 * under prefers-reduced-motion (see the block at the foot of this file + body.js).
 */

/* ── Broadsheet shell + shared layout ─────────────────────────────────────────────────────── */
.broadsheet {
  position: relative;
  z-index: 1; /* content paints over the fixed backdrop layers */
  padding: clamp(40px, 7vh, 96px) 0 0;
  font-family: var(--font-display);
}

.sheet {
  position: relative;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--page-x);
  padding-block: 0 var(--bay);
  scroll-margin-top: 5vh;
}

.sheet__head {
  /* No max-width here: the headings author their own line breaks via <span class="ln">, and a
     ch-based cap (measured against the small inherited font) would force the big display type to
     wrap — which the line-rise mask then clips. The mono index sits comfortably full-measure. */
  margin-bottom: clamp(34px, 5vh, 62px);
}

/* ── Type system (Archivo display · Instrument Serif breath · JetBrains Mono labels) ───────── */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: lowercase;
  letter-spacing: -0.04em;
  line-height: 0.92;
  font-size: clamp(2.2rem, 5.4vw, 4.9rem);
  color: var(--ink);
  margin: 0;
}
.display--xl {
  font-size: clamp(2.9rem, 8vw, 7.2rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}
.display em,
.lede em,
.pull em,
.spec__lede em,
.bench__stand em,
.dd em {
  font-family: var(--font-break);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent);
}

.index,
.kicker,
.datum__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 0.69rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.index {
  margin-bottom: clamp(18px, 2.4vh, 30px);
}
.index--center {
  justify-content: center;
}
.kicker__dot,
.live__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.lede {
  max-width: 44ch;
  margin: clamp(22px, 3vh, 34px) 0 0;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.56;
  color: var(--ink-dim);
}

/* ── Motion primitives ────────────────────────────────────────────────────────────────────
   Toggled by a single IntersectionObserver (body.js) adding .is-in. */

/* Block reveal — a quiet rise. Staggered inside [data-reveal-group] via JS transition-delay. */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--dur-rise) var(--ease),
    transform var(--dur-rise) var(--ease);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Heading line-rise — each line sets up into its mask, like type rising onto the plate. */
[data-anneal] .ln {
  display: block;
  overflow: hidden;
  padding-block: 0.08em;
  margin-block: -0.08em;
}
[data-anneal] .ln__in {
  display: block;
  /* Each authored line is one visual line — never let it wrap, or the line-rise mask
     (overflow:hidden on .ln) would clip a too-long word. Mobile re-enables wrapping below. */
  white-space: nowrap;
  transform: translateY(112%);
  transition: transform var(--dur-rise) var(--ease);
}
[data-anneal].is-in .ln__in {
  transform: none;
}
[data-anneal] .ln:nth-child(2) .ln__in {
  transition-delay: 0.07s;
}
[data-anneal] .ln:nth-child(3) .ln__in {
  transition-delay: 0.14s;
}

/* Drawn rule — a dimension line scribes itself left→right, then the tick marks set on. */
.datum,
.rule--ticked {
  position: relative;
  height: 24px;
}
.rule--ticked {
  margin-bottom: clamp(40px, 6vh, 78px);
}
.datum {
  margin-bottom: clamp(26px, 4.5vh, 54px);
}
.datum::before,
.rule--ticked::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 11px;
  height: 1px;
  background: var(--rule);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-rule) var(--ease);
}
.datum::after,
.rule--ticked::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 7px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--rule-strong) 0 1px,
    transparent 1px var(--tick-gap)
  );
  opacity: 0;
  transition: opacity 0.5s var(--ease) 0.28s;
}
.is-in.datum::before,
.is-in.rule--ticked::before {
  transform: scaleX(1);
}
.is-in.datum::after,
.is-in.rule--ticked::after {
  opacity: 1;
}

/* ── Section 0 — THE HANDOFF / MASTHEAD ───────────────────────────────────────────────────── */
.sheet--open {
  padding-top: clamp(20px, 4vh, 48px);
}
.datum__label {
  position: absolute;
  left: 0;
  top: -1px;
  z-index: 2; /* sit above the rule's ::after tick marks (which paint last in tree order) */
  padding-right: 16px;
  background: var(--surface); /* mask the drawn line + ticks behind the label */
  color: var(--accent);
}
.masthead {
  position: relative;
}
.masthead__corners {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(40px, 8vh, 96px);
}
.meta {
  font-family: var(--font-label);
  font-size: 0.66rem;
  line-height: 1.85;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.meta b {
  color: var(--ink-dim);
  font-weight: 500;
}
.meta--r {
  text-align: right;
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}
.meta--r .live {
  flex-direction: row-reverse;
}
.sheet--open .lede {
  max-width: 52ch;
}

/* ── Section 1 — THE STUDIO (the spec) ────────────────────────────────────────────────────── */
.spec {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 80px) clamp(32px, 6vw, 88px);
  align-items: start;
}
.spec__lede {
  font-family: var(--font-break);
  font-style: italic;
  font-size: clamp(1.35rem, 2.7vw, 2.15rem);
  line-height: 1.32;
  color: var(--ink);
  margin: 0;
}
.spec__lede em {
  font-style: italic;
}
.spec__grid {
  margin: 0;
  display: grid;
  gap: 0;
}
.spec__row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: clamp(12px, 2vw, 26px);
  padding: clamp(15px, 2.2vh, 22px) 0;
  border-top: 1px solid var(--rule);
}
.spec__row:last-child {
  border-bottom: 1px solid var(--rule);
}
.spec__row dt {
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 0.2em;
}
.coord {
  color: var(--accent);
  font-size: 0.62rem;
}
.spec__row dd {
  margin: 0;
  font-size: clamp(0.98rem, 1.25vw, 1.12rem);
  line-height: 1.5;
  color: var(--ink-dim);
}
.spec__row dd b {
  color: var(--ink);
  font-weight: 600;
}

/* ── Section 2 — HOW WE WORK (three movements) ────────────────────────────────────────────── */
.movements {
  list-style: none;
  margin: 0;
  padding: 0;
}
.movement {
  position: relative;
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr) 5rem;
  gap: clamp(16px, 3vw, 48px);
  align-items: baseline;
  padding: clamp(26px, 4vh, 44px) 0;
  border-top: 1px solid var(--rule);
}
.movement:last-child {
  border-bottom: 1px solid var(--rule);
}
.movement__no {
  font-family: var(--font-label);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.movement__title {
  font-family: var(--font-break);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
.movement__body {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(0.98rem, 1.2vw, 1.12rem);
  line-height: 1.55;
  color: var(--ink-dim);
}
.movement__dim {
  justify-self: end;
  font-family: var(--font-label);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ── Section 3 — THE CABINET (horizontal specimen bench) ──────────────────────────────────── */
.sheet--bench {
  max-width: none; /* the bench bleeds wider than the text column */
  padding-inline: 0;
}
.sheet--bench .rule--ticked,
.bench__head,
.bench__stand {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--page-x);
}
.bench__head {
  position: relative;
}
.bench__hint {
  position: absolute;
  right: var(--page-x);
  bottom: 4px;
  margin: 0;
  font-family: var(--font-label);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.bench__hint span {
  color: var(--accent);
  display: inline-block;
  animation: benchNudge 2.4s var(--ease) infinite;
}
@keyframes benchNudge {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(6px);
  }
}
.bench__rail {
  display: flex;
  gap: clamp(18px, 2.2vw, 30px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px clamp(20px, 5vw, 72px) 30px;
  margin-bottom: clamp(26px, 4vh, 44px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}
.bench__rail::-webkit-scrollbar {
  display: none;
}
.bench__rail.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}
.bench__rail:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* A specimen plate — warm stock, lit on its lower edge by the annealing light. The one fully
   warm object on the page; the tint is its identity, not a re-ground. */
.plate {
  --tint: 150, 120, 70;
  flex: 0 0 clamp(264px, 30vw, 340px);
  scroll-snap-align: center;
  position: relative;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 1.6vw, 24px);
  background:
    radial-gradient(120% 80% at 50% 8%, rgb(var(--tint) / 0.13) 0%, transparent 58%),
    var(--plate);
  color: var(--plate-ink);
  border-radius: 3px;
  box-shadow:
    0 1px 0 rgb(var(--tint) / 0.25) inset,
    0 -1px 0 rgba(255, 190, 130, 0.45) inset,
    0 2px 4px rgba(0, 0, 0, 0.45),
    0 26px 50px -22px rgba(0, 0, 0, 0.7);
  transition:
    transform 0.5s var(--ease),
    box-shadow 0.5s var(--ease);
}
.plate--marais {
  --tint: var(--tint-marais);
}
.plate--cipher {
  --tint: var(--tint-cipher);
}
.plate--code {
  --tint: var(--tint-code);
}
.plate--aeon {
  --tint: var(--tint-aeon);
}

.plate:hover {
  transform: translateY(-8px);
  box-shadow:
    0 1px 0 rgb(var(--tint) / 0.3) inset,
    0 -1px 0 rgba(255, 190, 130, 0.55) inset,
    0 2px 4px rgba(0, 0, 0, 0.45),
    0 40px 64px -24px rgba(0, 0, 0, 0.78);
}
.plate__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-label);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.plate__cap {
  color: var(--plate-ink-dim);
}
.plate__kind {
  color: rgb(var(--tint));
  font-weight: 500;
}
.plate__glyph {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-break);
  font-style: italic;
  font-size: clamp(5rem, 11vw, 7.5rem);
  line-height: 1;
  color: rgb(var(--tint));
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.plate__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.plate__title {
  margin: 0;
  font-family: var(--font-break);
  font-weight: 400;
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  line-height: 1;
  color: var(--plate-ink);
}
.plate__year {
  font-family: var(--font-label);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--plate-ink-dim);
}
.bench__stand {
  max-width: 40ch;
  margin-block: 0;
  font-family: var(--font-break);
  font-style: italic;
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  line-height: 1.3;
  color: var(--ink-dim);
}
.bench__stand em {
  font-style: italic;
}

/* ── Section 4 — VOICE ────────────────────────────────────────────────────────────────────── */
.sheet--voice .sheet__head {
  max-width: 30ch;
}
.pull {
  max-width: 20ch;
  margin: 0 0 clamp(40px, 7vh, 84px);
  font-family: var(--font-break);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.8rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.dd {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
}
.dd__h {
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.dd__col--dont .dd__h {
  color: var(--ink-faint);
}
.dd ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dd li {
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
  line-height: 1.45;
  color: var(--ink-dim);
  padding: 0.6rem 0;
  border-top: 1px solid rgba(244, 241, 236, 0.06);
}
.dd li:first-child {
  border-top: none;
}

/* ── Section 5 — THE CLOSE (begin) ────────────────────────────────────────────────────────── */
.begin {
  position: relative;
  padding: clamp(40px, 7vh, 90px) var(--page-x) clamp(90px, 16vh, 170px);
  text-align: center;
  overflow: hidden;
  scroll-margin-top: 5vh;
}
.begin .rule--ticked {
  max-width: var(--measure);
  margin-inline: auto;
  margin-bottom: clamp(56px, 10vh, 120px);
}
.begin__glow {
  position: absolute;
  bottom: -45%;
  left: 50%;
  transform: translateX(-50%);
  width: 72%;
  height: 85%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 92, 38, 0.32), transparent 64%);
  filter: blur(70px);
  animation: bGlow 9s ease-in-out infinite;
  pointer-events: none;
}
.begin__inner {
  position: relative;
  z-index: 2;
  max-width: var(--measure);
  margin-inline: auto;
}
.begin__h {
  margin-inline: auto;
}
.begin__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(34px, 5vh, 50px);
  padding: 16px 24px 16px 28px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground-dark-raised);
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}
.begin__cta .lbl {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.begin__cta-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ground-dark-raised);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.begin__note {
  margin: clamp(24px, 3.5vh, 32px) 0 0;
  font-family: var(--font-break);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-faint);
}

/* ── Footer — the colophon title block ────────────────────────────────────────────────────── */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  max-width: var(--measure);
  margin-inline: auto;
  padding: 30px var(--page-x);
  border-top: 1px solid var(--rule);
}
.foot__brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.foot__mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 34% 30%,
    #ffffff 0%,
    #e7ddcf 18%,
    #9a9489 46%,
    #3a3733 72%,
    #0a0a0a 100%
  );
}
.foot__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--ink);
}
.foot__name em {
  font-family: var(--font-break);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.foot__meta,
.foot__copy {
  font-family: var(--font-label);
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.foot__links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.foot__links a {
  font-family: var(--font-label);
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.4s var(--ease);
}
.foot__links a:hover {
  color: var(--ink);
}

/* ── Responsive ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* On narrow screens the big display lines may be wider than the viewport. Let them wrap and
     neutralise the line-rise mask so nothing clips or forces horizontal scroll; the heading
     simply presents in place (the block reveals still carry the motion). */
  [data-anneal] .ln {
    overflow: visible;
  }
  [data-anneal] .ln__in {
    white-space: normal;
    transform: none;
  }
}

@media (max-width: 860px) {
  .spec {
    grid-template-columns: 1fr;
    gap: clamp(24px, 4vh, 40px);
  }
  .movement {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .movement__dim {
    display: none;
  }
  .dd {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .masthead__corners {
    flex-wrap: wrap;
    gap: 28px;
  }
}

/* ── Reduced motion: present everything fully formed, no transforms, no ambient loops ──────── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-anneal] .ln__in {
    transition: none !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  [data-anneal] .ln__in {
    transform: none !important;
  }
  .datum::before,
  .rule--ticked::before {
    transform: scaleX(1);
    transition: none;
  }
  .datum::after,
  .rule--ticked::after {
    opacity: 1;
    transition: none;
  }
  .bench__hint span {
    animation: none;
  }
  .bench__rail {
    scroll-snap-type: none;
  }
}
