/* ==========================================================================
   OSSA 01 — Headset Rest
   Studio Zakmes / Object Series

   One page, eight chapters, one object.

   The palette is Studio Zakmes' own (01_BRAND_CORE/design-tokens) shifted warm:
   the object is bone, the drawing sheets are cream, and a cold white made both
   look grey. Orange is the only chromatic colour on the page and it is never
   decorative — it marks the active tick, the current chapter, the junction
   node in the diagram. If it appears somewhere without a job, it is a bug.
   ========================================================================== */

/* ── fonts ───────────────────────────────────────────────────────────────
   Calibre carries the voice; DejaVu Sans Mono carries every measurement,
   code and label. Both are self-hosted — see README for licence scope. */

@font-face { font-family: "Calibre"; src: url("../fonts/calibre/calibre-light.woff2")    format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Calibre"; src: url("../fonts/calibre/calibre-regular.woff2")  format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Calibre"; src: url("../fonts/calibre/calibre-medium.woff2")   format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Calibre"; src: url("../fonts/calibre/calibre-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "DejaVu Sans Mono"; src: url("../fonts/dejavu-sans-mono/dejavu-sans-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DejaVu Sans Mono"; src: url("../fonts/dejavu-sans-mono/dejavu-sans-mono-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }


/* ── tokens ─────────────────────────────────────────────────────────────── */

:root {
  --canvas:   #FAF7F1;   /* paper — the tone the drawing sheets were normalised to */
  --surface:  #F2EEE5;   /* a shade of the same paper, for panels */
  --bone:     #E4DCCC;   /* the object's own colour family — hairlines, rules */
  --ink:      #17181C;
  --deep:     #131417;   /* the one dark chapter */
  --signal:   #FF6A00;

  --ink-72: color-mix(in srgb, var(--ink) 72%, var(--canvas));
  --ink-50: color-mix(in srgb, var(--ink) 50%, var(--canvas));
  --ink-32: color-mix(in srgb, var(--ink) 32%, var(--canvas));
  --ink-16: color-mix(in srgb, var(--ink) 16%, var(--canvas));
  --ink-08: color-mix(in srgb, var(--ink) 8%,  var(--canvas));

  --paper-72: color-mix(in srgb, var(--canvas) 72%, var(--deep));
  --paper-40: color-mix(in srgb, var(--canvas) 40%, var(--deep));
  --paper-18: color-mix(in srgb, var(--canvas) 18%, var(--deep));

  --sans: "Calibre", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "DejaVu Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* type — fluid, but the mono never changes size. Technical annotation that
     scales with the viewport stops reading as annotation. */
  --t-display: clamp(2.9rem, 1.5rem + 4.4vw, 5.9rem);
  --t-title:   clamp(2.1rem, 1.2rem + 3.1vw, 4rem);
  --t-lede:    clamp(1.12rem, 0.98rem + 0.6vw, 1.5rem);
  --t-body:    clamp(1rem, 0.95rem + 0.25vw, 1.14rem);
  --t-h3:      clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
  --t-mono:    0.6875rem;   /* 11px */
  --t-mono-sm: 0.625rem;    /* 10px */

  /* heading tracking — one place, so the headings stay in step with each
     other. Display sits at -5%, matching the wordmark. The sub tier is looser
     because it runs at 21–28px, where -5% starts closing the counters in a
     and e; it is tightened proportionally instead of to the same number. */
  --track-display: -0.05em;
  --track-sub:     -0.035em;

  --gap:   clamp(1.25rem, 0.6rem + 2.2vw, 2.5rem);
  --pad:   clamp(1.25rem, 0.2rem + 4.4vw, 5.5rem);
  --rhythm: clamp(5.5rem, 2rem + 12vw, 13rem);   /* space between chapters */
  --max:   1680px;
  --rail:  0px;   /* the elevation rail, off below 1180px — see the rail block */

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur:  760ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 1ms; }
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
      transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* ── base ───────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.004em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: var(--track-display); line-height: 0.98; }
p  { margin: 0; }
ol, ul, dl, dd { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.mono {
  font-family: var(--mono);
  font-size: var(--t-mono);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; top: 0; left: 0; z-index: 200;
  padding: .75rem 1.25rem;
  background: var(--ink); color: var(--canvas);
  font-family: var(--mono); font-size: var(--t-mono); letter-spacing: .1em;
  text-transform: uppercase;
  transform: translateY(-110%);
}
.skip:focus { transform: none; }


/* ── 00 · navigation ────────────────────────────────────────────────────── */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--ink-08);
}

.nav__bar {
  max-width: var(--max); margin-inline: auto;
  padding: 0 var(--pad);
  height: 3.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap);
}

.nav__mark { display: flex; align-items: center; gap: .6rem; }
.nav__glyph { width: 20px; height: 20px; fill: none; stroke: currentColor;
              stroke-width: 1.7; stroke-linecap: round; }
.nav__word {
  font-family: var(--mono); font-weight: 700; font-size: .8125rem;
  letter-spacing: .26em; text-transform: uppercase;
}

.nav__links { display: flex; gap: clamp(.9rem, 1.6vw, 2rem); }
.nav__links a {
  font-family: var(--mono); font-size: var(--t-mono);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-50);
  padding: .35rem 0;
  position: relative;
  transition: color 200ms var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform 320ms var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-current { color: var(--ink); }
.nav__links a.is-current::after { transform: scaleX(1); }

.nav__status { color: var(--ink-50); display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.nav__status-sep { color: var(--ink-32); }
.dot {
  width: 6px; height: 6px; background: var(--signal); border-radius: 50%;
  animation: pulse 3.6s var(--ease) infinite;
}
@keyframes pulse { 0%, 62%, 100% { opacity: 1 } 78% { opacity: .25 } }

.nav__progress { height: 1px; background: var(--ink-08); }
.nav__progress i {
  display: block; height: 100%; width: 0%;
  background: var(--signal);
  transition: width 120ms linear;
}

/* Below 860px the anchors drop out of the bar and become their own strip
   underneath it: still six anchors, still always reachable, scrollable
   sideways when six do not fit. A hamburger would hide a six-item list
   behind a tap for no gain. */
@media (max-width: 860px) {
  .nav__bar { height: auto; flex-wrap: wrap; row-gap: 0; }
  .nav__mark, .nav__status { padding-block: .85rem; }
  .nav__links {
    order: 3; flex-basis: 100%;
    /* out to the bar's own edges, so the strip's rule spans the viewport */
    margin-inline: calc(var(--pad) * -1);
    padding: .55rem var(--pad);
    border-top: 1px solid var(--ink-08);
    gap: 1.25rem;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    /* six anchors never fit 375px, so the last one fades instead of being
       chopped — the fade is what says "this scrolls". */
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
            mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
  }
  .nav__links::-webkit-scrollbar { display: none; }
  .nav__links a { white-space: nowrap; padding: .15rem 0; font-size: var(--t-mono-sm); }
  html { scroll-padding-top: 6.5rem; }
}
@media (max-width: 460px) {
  .nav__status-sep, .nav__status { font-size: var(--t-mono-sm); }
}


/* ── the elevation rail ──────────────────────────────────────────────────
   The page is one elevation of the object. 250 mm at the crown, 000 at the
   ground, and the marker sits at the height your scroll position corresponds
   to. It is a progress indicator that happens to also be a scale. */

.rail { display: none; }

@media (min-width: 1181px) {
  :root { --rail: 5.75rem; }

  .rail {
    position: fixed; left: 0; top: 3.5rem; bottom: 0; z-index: 40;
    width: var(--rail);
    display: grid; grid-template-columns: 1fr 1px;
    align-items: stretch;
    padding: 3.5rem 1.1rem 3.5rem 1.4rem;
    pointer-events: none;
  }
  .rail__scale { position: relative; }
  .rail__tick {
    position: absolute; right: .9rem; top: calc(var(--at) * 100%);
    transform: translateY(-50%);
    font-family: var(--mono); font-size: var(--t-mono-sm);
    letter-spacing: .06em; color: var(--ink-32); white-space: nowrap;
  }
  .rail__line { position: relative; width: 1px; background: var(--ink-16); }
  .rail__line i {
    position: absolute; left: -3px; top: 0; width: 7px; height: 7px;
    background: var(--signal);
    transform: translateY(-50%);
    transition: top 120ms linear;
  }
  .rail__unit {
    position: absolute; left: 1.4rem; bottom: 1.2rem;
    font-size: var(--t-mono-sm); color: var(--ink-32);
  }
}


/* ── layout helpers ─────────────────────────────────────────────────────── */

main { padding-left: var(--rail); }

.chapter {
  max-width: var(--max);
  margin-inline: auto;
  padding: var(--rhythm) var(--pad);
}

.chapter__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr);
  gap: var(--gap) clamp(2rem, 6vw, 7rem);
  /* start, not end: the lede is two paragraphs and the title is two lines, so
     bottom-aligning them opens a hole above the title. */
  align-items: start;
  margin-bottom: clamp(3rem, 6vw, 6rem);
}
.chapter__head--narrow { grid-template-columns: minmax(0, 1fr); max-width: 62ch; }

.chapter__index {
  grid-column: 1 / -1;
  display: flex; align-items: baseline; gap: 1rem;
  color: var(--ink-50);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--ink-16);
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.chapter__index b { font-weight: 700; color: var(--ink); font-size: .8125rem; letter-spacing: .16em; }

.chapter__title { font-size: var(--t-title); font-weight: 400; }
.chapter__lede { display: grid; gap: 1.1rem; max-width: 46ch; }
.chapter__lede p { font-size: var(--t-lede); line-height: 1.42; color: var(--ink-72); letter-spacing: -0.012em; }

@media (max-width: 900px) {
  .chapter__head { grid-template-columns: minmax(0, 1fr); align-items: start; }
}


/* ── 01 · hero ──────────────────────────────────────────────────────────
   Structure taken from the reference: text column left, a plated product
   figure right with numbered markers and a Fig. caption under it, and a
   measured spec bar closing the fold. The copy is Ossa's own. */

.hero {
  max-width: var(--max); margin-inline: auto;
  padding: clamp(5rem, 4rem + 3vw, 7rem) var(--pad) 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: center;
}

.hero__text { display: grid; gap: clamp(1.1rem, 2vw, 1.6rem); align-content: center; }

.eyebrow { display: flex; align-items: center; gap: .5rem; color: var(--ink-50); flex-wrap: wrap; }
.eyebrow span[aria-hidden] { color: var(--signal); font-size: .8em; }

/* name and object code on one baseline, the code held back so the name reads
   as the mark and the number as its tag */
.hero__mark {
  display: flex; align-items: baseline; gap: clamp(.5rem, 1vw, .9rem);
  font-size: var(--t-display); font-weight: 400;
  letter-spacing: var(--track-display); line-height: 0.86;
  margin-block: clamp(.25rem, 1vw, .75rem) 0;
}
.hero__mark-code {
  font-size: .34em; letter-spacing: -0.02em; color: var(--ink-32);
  transform: translateY(-0.18em);
}

/* the sentence under the mark — no longer the h1, so it is a p */
.hero__title {
  font-size: clamp(1.5rem, .9rem + 1.9vw, 2.6rem);
  line-height: 1.08; letter-spacing: var(--track-display);
  max-width: 22ch;
}

.hero__lede {
  max-width: 42ch;
  font-size: var(--t-lede); line-height: 1.42;
  color: var(--ink-72); letter-spacing: -0.012em;
}

.cta {
  justify-self: start;
  display: inline-flex; align-items: center; gap: .9rem;
  margin-top: clamp(.5rem, 1.5vw, 1.25rem);
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--ink);
  font-weight: 500;
  transition: gap 320ms var(--ease), border-color 320ms var(--ease);
}
.cta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.cta:hover { gap: 1.6rem; border-color: var(--signal); }

/* The product plate. The photograph's studio ground is a vignetted warm grey —
   #A19890 at the top corners, #CFC8C1 at the bottom — so the panel behind it
   is that same gradient. When parallax shifts the image, what shows at the
   edge is the tone that was already there. The image is also scaled a hair
   past the frame so a seam can never open. No overlay goes over the object. */
.hero__figure {
  display: grid; gap: clamp(.85rem, 1.5vw, 1.15rem);
  /* hug the image: with the height cap the plate would otherwise be wider
     than the photograph and its gradient would show as bands down the sides */
  width: fit-content; max-width: 100%; justify-self: center;
}

/* The source frame is portrait (1000×1405). Left to fill the column it makes
   the hero 1156px tall and pushes the spec bar below the fold, and the spec
   bar closing the first viewport is the point of it. So the image is capped by
   viewport height and the plate centres it — the panel stays wide, the object
   stays whole. Cropping to a shorter ratio was the other option and it cuts
   the crown and the feet, which are the two things the frame is about. */
.hero__plate {
  position: relative; margin: 0; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #ACA39A 0%, #C0B8B0 55%, #CCC5BE 100%);
}
.hero__plate img {
  width: auto; max-width: 100%;
  max-height: min(58vh, 660px);
  transform: scale(1.03);
}

/* ringed numbers on the frame; the reading sits in the legend below, so the
   photograph never carries a block of text over the object */
.marker {
  position: absolute; left: var(--x); top: var(--y);
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  border: 1px solid var(--ink-32);
  font-family: var(--mono); font-size: var(--t-mono-sm); letter-spacing: .04em;
  color: var(--ink);
  transform: translate(-50%, -50%) scale(.8);
  /* Parallax rides on `translate`, a separate property from `transform`, so it
     composes with the centring transform instead of overwriting it — the
     landing animation and the pointer offset can run at the same time. */
  translate: var(--px, 0) var(--py, 0);
  opacity: 0;
}
.marker--2 { border-color: var(--signal); color: var(--signal); }

.plate__caption { display: grid; gap: .55rem; }
.plate__fig { color: var(--ink-32); }
.plate__title { font-size: var(--t-body); letter-spacing: -0.01em; }
.plate__legend {
  display: flex; flex-wrap: wrap; gap: .35rem clamp(1rem, 2vw, 1.75rem);
  margin-top: .35rem; padding-top: .7rem;
  border-top: 1px solid var(--ink-16);
  color: var(--ink-50);
}
.plate__legend li { display: flex; align-items: baseline; gap: .5rem; }
.plate__legend b { color: var(--ink); font-weight: 700; letter-spacing: .12em; }
.plate__legend li:nth-child(2) b { color: var(--signal); }

.specbar {
  margin-top: clamp(2rem, 3.5vw, 3rem);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  border-top: 1px solid var(--ink-16);
  align-items: stretch;
}
.specbar > div {
  padding: 1.1rem 1.25rem 1.2rem 0;
  border-right: 1px solid var(--ink-08);
  display: grid; gap: .45rem; align-content: start;
}
.specbar dt { color: var(--ink-32); font-size: var(--t-mono-sm); }
.specbar dd { color: var(--ink); letter-spacing: .09em; }
.specbar__status dd { color: var(--signal); }

/* the counter, the one solid block on an otherwise ruled bar */
.specbar__count {
  margin: -1px 0 0; align-self: stretch;
  display: grid; place-content: center; gap: .1rem;
  padding: 1rem clamp(1.25rem, 2.5vw, 2.25rem);
  background: var(--ink); color: var(--canvas);
  text-align: center;
}
.specbar__count b { font-weight: 700; font-size: 1.375rem; letter-spacing: .04em; line-height: 1; }
.specbar__count i { font-style: normal; color: var(--paper-40); font-size: var(--t-mono-sm); }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  /* single column: the plate is no longer competing with the fold */
  .hero__figure { width: auto; justify-self: stretch; }
  .hero__plate img { width: 100%; max-height: none; }
  .hero__mark { font-size: clamp(3.6rem, 20vw, 6rem); }
  .hero__title { font-size: clamp(1.4rem, 6.4vw, 2rem); }
  .specbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specbar > div { border-right: 0; border-bottom: 1px solid var(--ink-08); padding-right: 0; }
  .specbar > div:nth-child(odd) { border-right: 1px solid var(--ink-08); padding-right: 1.25rem; }
  .specbar__count { grid-column: 1 / -1; margin-top: 0; padding-block: .8rem; }
}
/* Below 860px the nav is two rows (~84px). This has to sit after the .hero
   rule above: that rule uses the `padding` shorthand, which beats a
   `padding-top` declared earlier in the file no matter which media query it
   is in. Set it too low and the eyebrow slides under the nav. */
@media (max-width: 860px) { .hero { padding-top: 7rem; } }

@media (max-width: 560px) {
  .marker { width: 22px; height: 22px; }
  .plate__legend { gap: .3rem 1rem; }
}


/* ── plates & captions ──────────────────────────────────────────────────── */

.plate { margin: 0; display: grid; gap: .9rem; }
.plate img { width: 100%; background: var(--surface); }
.plate figcaption,
.context__plate figcaption,
.diagram figcaption {
  font-family: var(--mono); font-size: var(--t-mono-sm);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-50);
  padding-top: .7rem; border-top: 1px solid var(--ink-16);
}


/* ── 02 · anatomy ───────────────────────────────────────────────────────── */

.anatomy__plates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap) clamp(2rem, 4vw, 4rem);
  align-items: end;
}
.plate--wide { align-self: end; }

.traits {
  margin-top: clamp(3.5rem, 7vw, 7rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 4rem);
}
.trait { display: grid; gap: .85rem; align-content: start; padding-top: 1.5rem; border-top: 1px solid var(--ink); }
.trait__code { color: var(--signal); font-weight: 700; letter-spacing: .16em; }
.trait h3 { font-size: var(--t-h3); letter-spacing: var(--track-sub); }
.trait p:last-child { color: var(--ink-72); max-width: 34ch; }

@media (max-width: 860px) {
  .anatomy__plates { grid-template-columns: minmax(0, 1fr); }
  .traits { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}


/* ── 03 · principle (the dark chapter) ──────────────────────────────────── */

.chapter--principle {
  max-width: none;
  background: var(--deep);
  color: var(--canvas);
  padding-inline: 0;
}
.chapter--principle > * {
  max-width: var(--max); margin-inline: auto;
  padding-inline: var(--pad);
}
.chapter--principle .chapter__index { color: var(--paper-40); border-bottom-color: var(--paper-18); }
.chapter--principle .chapter__index b { color: var(--canvas); }
.chapter--principle .chapter__lede p { color: var(--paper-72); }
.chapter--principle .plate figcaption,
.chapter--principle .diagram figcaption { color: var(--paper-40); border-top-color: var(--paper-18); }
.chapter--principle .plate img { background: var(--paper-18); }

/* The diagram is a tall column and the two photographs are not. Rather than
   leave a hole under them, the side column carries plates then pullquote, and
   the quote lands level with the diagram's base. */
.principle__body {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(2.5rem, 5vw, 5.5rem);
  align-items: stretch;
}
.principle__side {
  display: grid; align-content: space-between; gap: clamp(2.5rem, 5vw, 4.5rem);
}
.principle__plates { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.principle__plates img { aspect-ratio: 4 / 4.6; object-fit: cover; }

.diagram { margin: 0; display: grid; gap: .9rem; }
.diagram__svg { width: 100%; height: auto; }

/* Blueprint layers, faintest first. Everything that is not the object itself
   sits at paper-18/40 so the outline is unambiguously the subject. */
.dgm-frame { fill: none; stroke: var(--paper-40); stroke-width: 1.2; }
.dgm-reg circle { fill: none; }
.dgm-centre line {
  stroke: var(--paper-18); stroke-width: 1;
  stroke-dasharray: 22 5 3 5;   /* dash-dot, the drafting convention */
}
.dgm-ground { stroke: var(--paper-18); stroke-width: 1; }

.dgm-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dgm-outline { stroke: var(--canvas); stroke-width: 2.2; }
.dgm-inner   { stroke: var(--paper-40); stroke-width: 0.9; }
.dgm-core    { stroke: var(--paper-40); stroke-width: 0.9; stroke-dasharray: 5 4; }
.dgm-void    { stroke: var(--canvas); stroke-width: 1.5; }

.dgm-dim line { stroke: var(--paper-40); stroke-width: 0.9; }
.dgm-dim path { fill: var(--paper-40); stroke: none; }
.dgm-dim .dgm-ext { stroke: var(--paper-18); }

.dgm-flow path { fill: none; stroke: var(--signal); stroke-width: 1.8; stroke-linecap: round; }
.dgm-node circle { fill: none; stroke: var(--signal); stroke-width: 1.8; }
.dgm-junction { fill: var(--signal); }
/* Everything inside the SVG scales with the viewBox — 620 units rendered into
   roughly 640px on a wide screen (×1.03) but only ~300px on a phone (×0.48).
   So both the type and the hairlines are re-specified for small screens, or
   the labels come out at 6px and the dimension lines at under half a pixel. */
.dgm-label text { fill: var(--paper-40); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; }

@media (max-width: 760px) {
  .dgm-label text { font-size: 21px; letter-spacing: .05em; }
  .dgm-outline { stroke-width: 3.6; }
  .dgm-inner, .dgm-core { stroke-width: 1.7; }
  .dgm-void { stroke-width: 2.6; }
  .dgm-frame, .dgm-centre line, .dgm-ground,
  .dgm-dim line, .dgm-rule line, .dgm-rule path { stroke-width: 1.7; }
  .dgm-flow path, .dgm-node circle { stroke-width: 3; }
}
/* Leaders. The bent ones are paths, and a path with no fill declared is a
   filled black shape — they must be reset explicitly, not just stroked. */
.dgm-rule line, .dgm-rule path { fill: none; stroke: var(--paper-18); stroke-width: 1; }

/* The plot sequence: sheet, centre lines, outline traced in one pass, inner
   wall and load path, voids, then annotation. It reads as a drawing being
   made rather than a graphic fading in, and it runs once.

   --len is the path's own length, measured in ossa.js, so a long outline and
   a short foot finish together instead of the short one racing ahead. The
   dash-dot centre lines and the dashed load path already use stroke-dasharray
   for their pattern, so those are faded rather than drawn — you cannot animate
   a dash offset on a path whose dashes mean something. */

.dgm-line { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.diagram.is-in .dgm-line { animation: draw 1700ms var(--ease) 250ms forwards; }
.diagram.is-in .dgm-inner { animation-delay: 900ms; animation-duration: 1200ms; }
.diagram.is-in .dgm-void  { animation-delay: 1500ms; animation-duration: 800ms; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* dashed by design — faded, not drawn */
.dgm-core { stroke-dasharray: 5 4; stroke-dashoffset: 0; }
.diagram.is-in .dgm-core { animation: none; }

.dgm-frame, .dgm-centre, .dgm-ground, .dgm-core,
.dgm-dim, .dgm-flow, .dgm-node, .dgm-junction, .dgm-label, .dgm-rule {
  opacity: 0; transition: opacity 600ms var(--ease);
}
.diagram.is-in :is(.dgm-frame, .dgm-centre, .dgm-ground) { opacity: 1; transition-delay: 0ms; }
.diagram.is-in :is(.dgm-core) { opacity: 1; transition-delay: 1700ms; }
.diagram.is-in :is(.dgm-dim, .dgm-label, .dgm-rule) { opacity: 1; transition-delay: 2100ms; }
.diagram.is-in :is(.dgm-flow, .dgm-node, .dgm-junction) { opacity: 1; transition-delay: 2400ms; }

.pullquote {
  margin: 0;
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--paper-18);
}
.pullquote p {
  max-width: 20ch;
  font-size: clamp(1.6rem, 1rem + 2.1vw, 2.75rem);
  line-height: 1.06; letter-spacing: var(--track-display);
  color: var(--canvas);
}

@media (max-width: 980px) {
  .principle__body { grid-template-columns: minmax(0, 1fr); }
  .principle__side { gap: 2.5rem; }
  .pullquote { margin-top: 1rem; }
}
@media (max-width: 560px) {
  .principle__plates { grid-template-columns: minmax(0, 1fr); }
}


/* ── 04 · context ───────────────────────────────────────────────────────── */

.context__plate { margin: 0; display: grid; gap: .9rem; }
.context__plate img { width: 100%; }

.placements {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.placements li {
  padding: .5rem .9rem;
  border: 1px solid var(--ink-16);
  color: var(--ink-72);
  letter-spacing: .12em;
}


/* ── 05 · process ───────────────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(2rem, 3.5vw, 3.5rem) clamp(1.5rem, 2.5vw, 2.5rem);
  counter-reset: step;
}
.step { display: grid; gap: .8rem; align-content: start; }
.step figure { margin: 0 0 .6rem; overflow: hidden; background: var(--surface); }
.step img { width: 100%; aspect-ratio: 4 / 4.3; object-fit: cover;
            transition: transform 900ms var(--ease); }
.step:hover img { transform: scale(1.028); }
.step__no {
  color: var(--signal); font-weight: 700; letter-spacing: .18em;
  padding-top: .6rem; border-top: 1px solid var(--ink);
}
.step h3 { font-size: var(--t-h3); letter-spacing: var(--track-sub); }
.step p:last-child { color: var(--ink-72); max-width: 32ch; }


/* ── 06 · archive — the laboratory desk ─────────────────────────────────
   Not a component. No frame, no container edge, no toolbar: the papers define
   the space and the surface almost disappears under them. Everything is one
   composition, and the numbers below are a composition, not a grid — sheets
   overlap heavily, two run off the edge, and nothing is square to anything. */

.archive__lede {
  font-size: var(--t-lede); line-height: 1.42;
  color: var(--ink-72); letter-spacing: -0.012em;
  margin-top: clamp(1rem, 1.8vw, 1.4rem);
}
.chapter--archive .chapter__head { margin-bottom: clamp(1.5rem, 2.5vw, 2.25rem); }

.desk {
  /* out to the chapter's own edges — a desk with a visible border is a box */
  margin-inline: calc(var(--pad) * -1);
  background: #EFEAE1;
  touch-action: pan-y;
}

.desk__field { position: relative; overflow: hidden; }
@media (min-width: 720px)  { .desk__field { height: clamp(520px, 60vw, 760px); } }
@media (min-width: 1240px) { .desk__field { height: clamp(660px, 48vw, 820px); } }

/* A very slow ambient light across the surface. 40s, two properties, and it
   stops entirely under reduced motion — it should read as the room, not as an
   animation anyone can catch happening. */
.desk__light {
  position: absolute; inset: -20%;
  background: radial-gradient(60% 50% at 32% 22%,
    rgba(255,255,255,.55), rgba(255,255,255,0) 70%);
  animation: deskLight 40s var(--ease) infinite alternate;
  pointer-events: none;
}
@keyframes deskLight {
  from { transform: translate3d(-2%, -1%, 0) scale(1);    opacity: .85; }
  to   { transform: translate3d(3%, 2%, 0)   scale(1.06); opacity: 1; }
}

/* ── paper ───────────────────────────────────────────────────────────────
   Real paper on a desk barely casts anything: a hairline contact darkening
   and a very wide, very faint ambient. The card shadows this replaced were
   .30–.34 opacity; nothing here goes above .10. */

.sheet {
  position: absolute; margin: 0;
  left: var(--x); top: var(--y); width: var(--w);
  rotate: var(--r);
  z-index: var(--z, 1);
  transition: left 700ms var(--ease), top 700ms var(--ease),
              rotate 700ms var(--ease), width 700ms var(--ease);
}
.sheet.is-dragging { transition: none; z-index: 90; cursor: grabbing; }

.sheet__grab {
  display: block; width: 100%; padding: 0; border: 0;
  background: var(--canvas);
  cursor: grab;
  box-shadow:
    0 1px 1px rgba(58, 48, 36, .05),
    0 6px 14px -6px rgba(58, 48, 36, .06),
    0 26px 46px -24px rgba(58, 48, 36, .10);
  transition: box-shadow 420ms var(--ease), translate 420ms var(--ease),
              rotate 420ms var(--ease);
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.sheet__grab img { width: 100%; display: block; -webkit-user-drag: none; }

/* lift: 8px, the rotation eases back towards square, the shadow spreads and
   softens rather than darkening */
.sheet__grab:hover,
.sheet__grab:focus-visible {
  translate: 0 -8px;
  rotate: calc(var(--r) * -0.35);
  box-shadow:
    0 1px 1px rgba(58, 48, 36, .04),
    0 14px 28px -10px rgba(58, 48, 36, .07),
    0 44px 72px -34px rgba(58, 48, 36, .12);
}
.sheet.is-dragging .sheet__grab {
  translate: 0 -12px;
  rotate: calc(var(--r) * -0.6);
  box-shadow:
    0 1px 1px rgba(58, 48, 36, .03),
    0 22px 40px -14px rgba(58, 48, 36, .07),
    0 64px 96px -44px rgba(58, 48, 36, .13);
}

/* while one sheet is lifted the rest settle a hair — the table reacting, not
   an effect */
.desk.is-lifting .sheet:not(.is-dragging) .sheet__grab { translate: 0 1px; }

/* ── marginalia, not a toolbar ───────────────────────────────────────────── */

.desk__margin {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .75rem clamp(1.25rem, 3vw, 2.5rem);
  padding: 1rem var(--pad) 1.25rem;
}
.desk__read { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .8rem; }
.desk__read b { color: var(--signal); font-weight: 700; letter-spacing: .14em; }
.desk__read span { color: var(--ink); }
.desk__read em { font-style: normal; color: var(--ink-50); font-size: .95rem; }

.desk__ctl { display: flex; align-items: center; gap: .25rem; margin-left: auto; color: var(--ink-32); }
.desk__ctl b { color: var(--ink); font-weight: 700; margin-right: .3rem; }
.lnk {
  min-width: 44px; min-height: 44px;
  border: 0; background: none; color: var(--ink-50);
  font: inherit; letter-spacing: .1em; cursor: pointer;
  transition: color 200ms var(--ease);
}
.lnk:hover { color: var(--ink); }
.lnk--w { min-width: 0; padding-inline: .9rem; }

/* ── phone: a deck on a small desk ──────────────────────────────────────── */

@media (max-width: 719px) {
  .desk__field { height: 0; padding-bottom: 112%; }
  .desk__margin { padding-inline: var(--pad); }
  .desk__ctl { margin-left: 0; }
}

/* ── inspection ──────────────────────────────────────────────────────────── */

.inspect { position: fixed; inset: 0; z-index: 200; }
.inspect[hidden] { display: none; }
.inspect__scrim {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--deep) 84%, transparent);
  opacity: 0; transition: opacity 380ms var(--ease); cursor: zoom-out;
}
.inspect.is-open .inspect__scrim { opacity: 1; }
.inspect__img {
  position: absolute; margin: 0; transform-origin: top left;
  box-shadow: 0 40px 80px -32px rgba(0, 0, 0, .55);
  will-change: top, left, width, rotate;
}
.inspect.is-animating .inspect__img {
  transition: top 520ms var(--ease), left 520ms var(--ease),
              width 520ms var(--ease), rotate 520ms var(--ease);
}
.inspect__bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem; padding: clamp(.75rem, 2vw, 1.25rem) var(--pad);
  color: var(--canvas); opacity: 0;
  transition: opacity 300ms var(--ease) 200ms;
}
.inspect.is-open .inspect__bar { opacity: 1; }
.inspect__id { display: flex; gap: .7rem; align-items: baseline; }
.inspect__id b { color: var(--signal); font-weight: 700; letter-spacing: .14em; }
.inspect__nav { display: flex; gap: .4rem; }
.tbtn {
  display: grid; place-items: center; min-width: 44px; min-height: 44px;
  padding: 0 .5rem; border: 1px solid var(--paper-18);
  background: transparent; color: var(--canvas); cursor: pointer;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.tbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.tbtn:hover { border-color: var(--paper-40); background: rgba(255,255,255,.06); }
.tbtn--wide { padding-inline: 1rem; letter-spacing: .1em; }

/* ── reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet__grab, .inspect__img, .inspect__scrim,
  .inspect__bar { transition: none !important; }
  .sheet__grab:hover, .sheet__grab:focus-visible,
  .sheet.is-dragging .sheet__grab { translate: none; rotate: var(--r); }
  .desk__light { animation: none; }
}

/* ── no JS: the sheets fall into a plain spread ─────────────────────────── */

.no-js .desk__field { height: auto !important; padding-bottom: 0 !important;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem); padding: clamp(1.5rem, 3vw, 3rem); overflow: visible; }
.no-js .sheet { position: static; width: auto; rotate: none; }
.no-js .desk__margin, .no-js .inspect, .no-js .desk__light { display: none; }
.no-js .sheet__grab { cursor: default; }

.archive__note {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 1.5rem; border-top: 1px solid var(--ink-16);
  display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: 1rem clamp(1.5rem, 3vw, 3rem);
}
.archive__note .mono { color: var(--ink-32); }
.archive__note p:last-child { color: var(--ink-72); max-width: 62ch; }
@media (max-width: 620px) { .archive__note { grid-template-columns: minmax(0, 1fr); } }


/* ── 07 · gallery ───────────────────────────────────────────────────────── */

.gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
.gallery__item { margin: 0; display: grid; gap: .8rem; }
.gallery__item img { width: 100%; background: var(--surface); }
.gallery__item figcaption {
  font-size: var(--t-mono-sm); color: var(--ink-50);
  padding-top: .6rem; border-top: 1px solid var(--ink-16);
}
.gallery__item--a { grid-column: span 7; }
.gallery__item--b { grid-column: span 5; align-self: end; }
.gallery__item--c { grid-column: 2 / span 4; }
.gallery__item--d { grid-column: span 6; }

@media (max-width: 860px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery__item { grid-column: span 1 !important; }
}
@media (max-width: 560px) {
  .gallery { grid-template-columns: minmax(0, 1fr); }
}


/* ── 08 · contact ───────────────────────────────────────────────────────── */

/* Full-bleed so the rule above it runs edge to edge; the inner element
   carries --pad, so the section must not also carry it or the chapter indents
   further than every other chapter on the page. */
.chapter--contact {
  max-width: none;
  border-top: 1px solid var(--ink-16);
  padding-inline: 0;
  padding-bottom: clamp(4rem, 7vw, 8rem);
}
.contact__inner { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }

.contact__title {
  font-size: var(--t-title);
  max-width: 18ch;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
.contact__body { max-width: 44ch; font-size: var(--t-lede); line-height: 1.42; color: var(--ink-72); }

.contact__mail {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: inline-flex; align-items: center; gap: 1rem;
  font-size: clamp(1.25rem, .8rem + 1.8vw, 2.25rem);
  letter-spacing: var(--track-display);
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--ink-32);
  transition: border-color 320ms var(--ease), gap 320ms var(--ease);
}
.contact__mail svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; }
.contact__mail:hover { border-color: var(--signal); gap: 1.6rem; }

.contact__meta {
  margin-top: clamp(3.5rem, 7vw, 6rem);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem clamp(1.5rem, 3vw, 3rem);
  border-top: 1px solid var(--ink-16);
  padding-top: 1.5rem;
}
.contact__meta dt { color: var(--ink-32); font-size: var(--t-mono-sm); margin-bottom: .45rem; }
.contact__meta dd { color: var(--ink); letter-spacing: .08em; }
@media (max-width: 700px) { .contact__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ── footer ─────────────────────────────────────────────────────────────── */

.foot { background: var(--deep); color: var(--paper-72); padding-left: var(--rail); }
.foot__inner {
  max-width: var(--max); margin-inline: auto; padding: clamp(2rem, 4vw, 3rem) var(--pad);
  display: flex; flex-wrap: wrap; gap: 1.25rem clamp(1.5rem, 4vw, 4rem);
  align-items: center; justify-content: space-between;
}
.foot__nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.foot__nav a { transition: color 200ms var(--ease); }
.foot__nav a:hover { color: var(--canvas); }
.foot__legal { color: var(--paper-40); }


/* ── reveal ─────────────────────────────────────────────────────────────
   One gesture only: rise and fade, short distance. Anything bigger competes
   with the object, and the object has to win. */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* Stagger only where items are siblings in a row. */
.traits .reveal:nth-child(2), .steps .reveal:nth-child(2) { transition-delay: 90ms; }
.traits .reveal:nth-child(3), .steps .reveal:nth-child(3) { transition-delay: 180ms; }
.steps .reveal:nth-child(4) { transition-delay: 60ms; }
.steps .reveal:nth-child(5) { transition-delay: 120ms; }
.steps .reveal:nth-child(6) { transition-delay: 180ms; }
.sheets .reveal:nth-child(2) { transition-delay: 100ms; }
.sheets .reveal:nth-child(4) { transition-delay: 100ms; }


/* ── the calibration sequence ────────────────────────────────────────────
   On load the hero assembles rather than appears: label, headline, lede, CTA,
   then the plate, then the three markers land on the frame one at a time. It
   runs once, it is short, and a reduced-motion reader gets the finished state
   immediately. */

[data-cal] { opacity: 0; transform: translateY(14px); }
body:not(.is-loading) [data-cal] {
  animation: cal 900ms var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes cal { to { opacity: 1; transform: none; } }

body:not(.is-loading) .hero__plate { animation-duration: 1100ms; }

body.is-calibrated .marker { animation: mark 520ms var(--ease) forwards; }
body.is-calibrated .marker--1 { animation-delay: 80ms; }
body.is-calibrated .marker--2 { animation-delay: 220ms; }
body.is-calibrated .marker--3 { animation-delay: 360ms; }
@keyframes mark { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  [data-cal] { opacity: 1 !important; transform: none !important; animation: none !important; }
  .marker { opacity: 1 !important; transform: translate(-50%, -50%) !important; animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .dgm-line { stroke-dashoffset: 0 !important; animation: none !important; }
  .dgm-core { stroke-dashoffset: 0 !important; }
  .dgm-frame, .dgm-centre, .dgm-ground, .dgm-core, .dgm-dim,
  .dgm-flow, .dgm-void, .dgm-node, .dgm-junction, .dgm-label, .dgm-rule {
    opacity: 1 !important; transition: none !important;
  }
}

/* No JS: nothing stays hidden. */
.no-js .reveal, .no-js [data-cal] { opacity: 1; transform: none; }
.no-js .marker { opacity: 1; transform: translate(-50%, -50%); }
/* Without JS there is no --len, so the dasharray resolves to nothing and the
   strokes are solid anyway; this just makes the intent explicit. */
.no-js .dgm-line, .no-js .dgm-core { stroke-dashoffset: 0; }
.no-js :is(.dgm-frame, .dgm-centre, .dgm-ground, .dgm-core, .dgm-dim,
           .dgm-flow, .dgm-void, .dgm-node, .dgm-junction, .dgm-label, .dgm-rule) { opacity: 1; }


/* ── print ──────────────────────────────────────────────────────────────── */

@media print {
  .nav, .rail, .skip { display: none; }
  main { padding-left: 0; }
  .reveal, [data-cal] { opacity: 1 !important; transform: none !important; }
  .marker { opacity: 1 !important; transform: translate(-50%, -50%) !important; }
  .chapter--principle { background: #fff; color: #000; }
  .chapter { padding-block: 2rem; break-inside: avoid; }
}
