/* ============================================================
   THE DIGITAL COLLAB — "STILL"
   Shared design system. Paper, ink, one gold thread.
   Set in Fraunces (variable: opsz / wght / SOFT / WONK).
   ============================================================ */

:root {
  --paper: #FBF9F3;
  --ink: #1C1A16;
  --faint: #99938a;
  --mid: #6d675e;
  --gold: #A87B2F;
  --hair: rgba(28, 26, 22, 0.14);
  --f: "Fraunces", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper); color: var(--ink);
  font-family: var(--f);
  font-variation-settings: "opsz" 14, "wght" 380, "SOFT" 0, "WONK" 0;
  overflow-x: hidden;
  opacity: 0; transition: opacity 1.1s ease;
}
body.ready { opacity: 1; }
::selection { background: var(--gold); color: var(--paper); }
a { color: inherit; text-decoration: none; }
em, i { font-style: italic; }

/* cross-fade between pages where supported */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; }

/* ---------- type utilities ---------- */
.caps {
  font-size: 10px; letter-spacing: .34em; text-transform: uppercase;
  font-variation-settings: "opsz" 9, "wght" 480;
  color: var(--faint);
}
.caps-ink { color: var(--ink); }

/* ---------- grain (one fixed layer, ~2%) ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.028;
}

/* ---------- reading thread (scroll progress) ---------- */
.thread {
  position: fixed; top: 0; left: 0; height: 1px; width: 100%;
  background: var(--gold); z-index: 100;
  transform: scaleX(0); transform-origin: left;
}

/* ---------- nav ---------- */
header.site {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 34px clamp(28px, 5vw, 84px);
  background: linear-gradient(var(--paper) 55%, transparent);
}
.logo { font-variation-settings: "opsz" 30, "wght" 500; font-size: 17px; letter-spacing: .01em; white-space: nowrap; }
.logo:hover { font-style: italic; }
header.site nav { display: flex; gap: clamp(18px, 2.6vw, 44px); }
header.site nav a { position: relative; padding-bottom: 3px; color: var(--ink); }
header.site nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--gold);
  transition: right .7s cubic-bezier(.22,1,.36,1);
}
header.site nav a:hover::after { right: 0; }
header.site nav a[aria-current="page"] { color: var(--gold); }
header.site nav a[aria-current="page"]::after { right: 0; }
@media (max-width: 720px) {
  .logo { font-size: 13px; }
  header.site { padding: 26px 22px; }
  header.site nav { gap: 14px; }
  header.site nav a.thin { display: none; }
}

/* ---------- layout ---------- */
.shell { width: min(1180px, calc(100% - clamp(48px, 8vw, 160px))); margin: 0 auto; }
.shell-n { width: min(720px, calc(100% - clamp(48px, 8vw, 160px))); margin: 0 auto; } /* narrow, for prose */
section { padding: clamp(100px, 16vh, 210px) 0; }
.sec-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: clamp(50px, 9vh, 110px); }

/* ---------- rules ---------- */
.rule { width: 100%; height: 1px; background: var(--hair); position: relative; overflow: hidden; }
.rule::after {
  content: ""; position: absolute; inset: 0; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.6s cubic-bezier(.22,1,.36,1);
}
.rule.on::after { transform: scaleX(1); }

/* a rule with one quiet pulse — the signal motif */
.pulse { width: 100%; height: 44px; display: block; }
.pulse path { stroke: var(--hair); fill: none; stroke-width: 1; }
.pulse .sig { stroke: var(--gold); stroke-dasharray: 1200; stroke-dashoffset: 1200; transition: stroke-dashoffset 2.6s cubic-bezier(.22,1,.36,1) .2s; }
.pulse.on .sig { stroke-dashoffset: 0; }

/* ---------- reveals ---------- */
.rv { opacity: 0; transform: translateY(26px); transition: opacity 1.3s ease, transform 1.3s cubic-bezier(.22,1,.36,1); }
.rv.on { opacity: 1; transform: none; }
.rv.d1 { transition-delay: .15s; } .rv.d2 { transition-delay: .3s; } .rv.d3 { transition-delay: .45s; }

/* ---------- page hero (inner pages) ---------- */
.page-hero { padding: clamp(170px, 26vh, 300px) 0 clamp(70px, 10vh, 130px); }
.page-hero .kicker { display: block; margin-bottom: clamp(26px, 4vh, 44px); }
.page-hero h1 {
  font-size: clamp(58px, 10vw, 150px); line-height: 0.98;
  font-weight: 400; letter-spacing: -0.01em;
  font-variation-settings: "opsz" 144, "wght" 330;
}
.page-hero h1 em { color: var(--gold); font-variation-settings: "opsz" 144, "wght" 390, "SOFT" 80, "WONK" 1; }
.page-hero .standfirst {
  margin-top: clamp(30px, 5vh, 54px);
  font-style: italic; font-size: clamp(15px, 1.7vw, 21px);
  font-variation-settings: "opsz" 20, "wght" 360;
  color: var(--faint); max-width: 46ch; line-height: 1.9;
}
.page-hero .standfirst b { color: var(--ink); font-weight: 400; font-style: normal; }

/* ---------- index rows (shared list pattern) ---------- */
.idx-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: clamp(18px, 3vw, 54px);
  align-items: baseline; padding: clamp(30px, 4.6vh, 46px) 0;
  border-bottom: 1px solid var(--hair);
}
.idx-row:first-of-type { border-top: 1px solid var(--hair); }
.idx-row .n { font-size: 11px; color: var(--faint); font-variation-settings: "opsz" 9, "wght" 400; }
.idx-row h3, .idx-row .h {
  font-size: clamp(24px, 3vw, 44px); font-weight: 400;
  font-variation-settings: "opsz" 50, "wght" 340, "SOFT" 0, "WONK" 0;
  transition: font-variation-settings .7s cubic-bezier(.22,1,.36,1), color .5s, letter-spacing .7s;
}
a.idx-row:hover h3, .idx-row:hover > h3, a.idx-row:hover .h {
  font-style: italic; color: var(--gold); letter-spacing: .008em;
  font-variation-settings: "opsz" 50, "wght" 420, "SOFT" 100, "WONK" 1;
}
.idx-row .sig { justify-self: end; }
@media (max-width: 720px) {
  .idx-row { grid-template-columns: 44px 1fr; }
  .idx-row .sig { display: none; }
}

/* ---------- prose (journal / case body) ---------- */
.prose { font-size: clamp(16.5px, 1.6vw, 19px); line-height: 2.05; font-variation-settings: "opsz" 16, "wght" 375; }
.prose p { margin-bottom: 1.9em; }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-variation-settings: "opsz" 16, "wght" 400, "SOFT" 50, "WONK" 1; }
.prose .lead::first-letter {
  float: left;
  font-size: 4.9em; line-height: .78;
  padding: .08em .12em 0 0;
  font-style: italic; color: var(--gold);
  font-variation-settings: "opsz" 144, "wght" 400, "SOFT" 100, "WONK" 1;
}
.prose h2 {
  font-size: clamp(24px, 2.6vw, 34px); font-weight: 400; line-height: 1.3;
  font-variation-settings: "opsz" 40, "wght" 420;
  margin: 2.6em 0 1em;
}
.prose blockquote {
  margin: 2.4em 0; padding-left: clamp(22px, 3vw, 40px);
  border-left: 1px solid var(--gold);
  font-style: italic; font-size: 1.18em; line-height: 1.8; color: var(--mid);
  font-variation-settings: "opsz" 30, "wght" 350, "SOFT" 60, "WONK" 1;
}
.endmark { color: var(--gold); font-style: normal; }

/* ---------- pull quote (case studies) ---------- */
.pull {
  text-align: center;
  font-size: clamp(26px, 3.6vw, 52px); line-height: 1.35;
  font-variation-settings: "opsz" 60, "wght" 310;
  max-width: 26ch; margin: 0 auto;
  text-indent: -0.42ch; /* hang the opening quote */
}
.pull em { color: var(--gold); font-variation-settings: "opsz" 60, "wght" 380, "SOFT" 70, "WONK" 1; }
.pull-src { display: block; text-align: center; margin-top: 34px; }

/* ---------- numerals (results) ---------- */
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 60px); text-align: center; }
.nums .num {
  font-size: clamp(46px, 6.4vw, 96px); line-height: 1;
  font-variation-settings: "opsz" 144, "wght" 300;
  font-feature-settings: "onum" 0;
}
.nums .num i { color: var(--gold); font-variation-settings: "opsz" 144, "wght" 360, "SOFT" 80, "WONK" 1; }
.nums .caps { display: block; margin-top: 18px; }
@media (max-width: 720px) { .nums { grid-template-columns: 1fr; gap: 46px; } }

/* ---------- next (bottom of case/essay) ---------- */
.next { text-align: center; }
.next .caps { display: block; margin-bottom: 30px; }
.next a.big {
  font-size: clamp(40px, 7.4vw, 110px); line-height: 1.05;
  font-variation-settings: "opsz" 144, "wght" 320;
  transition: font-variation-settings .8s cubic-bezier(.22,1,.36,1), color .5s;
}
.next a.big:hover {
  font-style: italic; color: var(--gold);
  font-variation-settings: "opsz" 144, "wght" 400, "SOFT" 100, "WONK" 1;
}

/* ---------- footer ---------- */
footer.site { text-align: center; padding: clamp(90px, 14vh, 170px) 0 clamp(56px, 9vh, 110px); }
footer.site .word {
  font-size: clamp(40px, 7vw, 104px); line-height: 1;
  font-variation-settings: "opsz" 144, "wght" 320;
}
footer.site .word em { color: var(--gold); font-variation-settings: "opsz" 144, "wght" 380, "SOFT" 80, "WONK" 1; }
.mailline {
  display: inline-block; margin-top: clamp(34px, 5vh, 56px);
  font-size: clamp(15px, 1.8vw, 22px); font-style: italic;
  font-variation-settings: "opsz" 24, "wght" 380;
  position: relative; padding-bottom: 8px;
}
.mailline::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--gold);
  transition: right .9s cubic-bezier(.22,1,.36,1);
}
.mailline:hover::after { right: 0; }
.colophon {
  margin-top: clamp(70px, 11vh, 130px);
  display: flex; justify-content: center; gap: clamp(18px, 3.4vw, 48px); flex-wrap: wrap;
}
.colophon a:hover { color: var(--gold); }

/* ---------- motion prefs ---------- */
@media (prefers-reduced-motion: reduce) {
  .rv { transition: none; opacity: 1; transform: none; }
  .rule::after, .pulse .sig { transition: none; }
  .rule.on::after { transform: scaleX(1); }
  .pulse.on .sig { stroke-dashoffset: 0; }
  body { transition: none; }
  html { scroll-behavior: auto; }
}
