/* =============================================================
   QUANTUM FORGE — SHARED FOUNDATION
   Warm-light theme · motion doctrine · delivery components.
   Page-specific devices (rail, curtain, pins, ticket) live inline.
   ============================================================= */

:root {
  /* Warm-light palette — same family, less grey, more light */
  --cream:        #FBF6E9;
  --cream-deep:   #F3ECD8;
  --ivory:        #FEFBF2;
  --paper:        #FFFEF8;
  --ink:          #191910;
  --ink-soft:     #403E31;
  --ink-mute:     #7E7461;
  --gold:         #BC9448;
  --gold-deep:    #97742F;
  --gold-glow:    #E2C078;
  --verdi:        #46705F;
  --verdi-soft:   #6B8F7E;
  --good:         #7A8B3C;
  --warn:         #A8452F;
  --rule:         rgba(188, 148, 72, 0.4);
  --rule-faint:   rgba(151, 116, 47, 0.14);
  --shadow-warm:  0 18px 44px rgba(130, 96, 30, 0.09);

  --display: "Cormorant Garamond", "Times New Roman", serif;
  --body:    "Outfit", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(24px, 5vw, 80px);
  --max:    1240px;

  /* Motion doctrine — settle in, then hold still */
  --dur-1: 0.35s;
  --dur-2: 0.8s;
  --dur-3: 1.2s;
  --ease-settle: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:    cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(130% 46vh at 50% -6vh, #FFFDF3 0%, rgba(255, 253, 243, 0) 70%),
    linear-gradient(180deg, #FCF8EC 0%, var(--cream) 26%, #F8F2E0 100%);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Paper grain — 2.5%, kills the flatness */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 2000;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
::selection { background: rgba(226, 192, 120, 0.45); }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 400;
}

.frame {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  position: relative;
  z-index: 1;
}

.frame.wide { max-width: 1440px; }

/* =============================================================
   READING HAIRLINE — a 1px gold thread that draws as you read
   ============================================================= */
.read-thread {
  position: fixed;
  top: 0;
  right: clamp(8px, 1.6vw, 22px);
  bottom: 0;
  width: 1px;
  background: var(--rule-faint);
  z-index: 60;
  pointer-events: none;
}

.read-thread::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  background: linear-gradient(var(--gold), var(--gold-glow));
  transform-origin: top;
  transform: scaleY(var(--readp, 0));
}

@media (max-width: 780px) { .read-thread { display: none; } }

/* =============================================================
   ENGRAVED ICONS
   ============================================================= */
.ic {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: var(--gold-deep);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.ic .alt { stroke: var(--verdi); }
.ic [pathLength] { stroke-dasharray: 1; stroke-dashoffset: 1; }

.in .ic [pathLength],
.ic.now [pathLength] { animation: ic-draw 1.1s var(--ease-out) forwards; }

.in .ic [pathLength]:nth-child(2) { animation-delay: 0.15s; }
.in .ic [pathLength]:nth-child(3) { animation-delay: 0.3s; }
.in .ic [pathLength]:nth-child(4) { animation-delay: 0.45s; }
.in .ic [pathLength]:nth-child(5) { animation-delay: 0.6s; }

@keyframes ic-draw { to { stroke-dashoffset: 0; } }

.ic-sm { width: 30px; height: 30px; }

/* Icon two-tone swap on hover */
.door:hover .ic { stroke: var(--verdi); }
.door:hover .ic .alt { stroke: var(--gold-deep); }

/* =============================================================
   DUOTONE IMAGERY — engraving at rest, color under the hand,
   with a slow Ken Burns drift once revealed
   ============================================================= */
.duo { position: relative; overflow: hidden; }

.duo img {
  filter: grayscale(0.85) sepia(0.28) contrast(1.04) brightness(1.03);
  transition: filter 0.9s var(--ease-settle);
}

.duo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(188,148,72,0.16), rgba(70,112,95,0.12));
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: opacity 0.9s var(--ease-settle);
}

.duo:hover img, a:hover .duo img { filter: none; }
.duo:hover::after, a:hover .duo::after { opacity: 0; }

/* =============================================================
   NAV — sliding gold marker instead of a static underline
   ============================================================= */
nav.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(253, 249, 238, 0.88);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  border-bottom: 1px solid var(--rule-faint);
}

nav.top .frame {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.wordmark {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark .dot {
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  display: inline-block;
  transition: background var(--dur-1) ease, transform var(--dur-1) ease;
  view-transition-name: qf-dot;
}

.wordmark:hover .dot { background: var(--verdi); transform: scale(1.25); }

nav.top ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: clamp(18px, 2.6vw, 40px);
  position: relative;
}

nav.top ul li { position: relative; }

nav.top ul a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.3s ease;
  padding: 6px 0;
  position: relative;
  display: inline-block;
}

nav.top ul a:hover { color: var(--gold-deep); }
nav.top ul a.current { color: var(--gold-deep); }

/* The traveling dot */
.nav-dot {
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  transform: translateX(var(--nx, 0px)) scale(0.6);
  transition: transform 0.45s var(--ease-settle), opacity 0.3s ease;
  pointer-events: none;
}

.nav-dot.on { opacity: 1; transform: translateX(var(--nx, 0px)) scale(1); }

nav.top .caret {
  display: inline-block;
  margin-left: 7px;
  font-size: 8px;
  color: var(--gold-deep);
  transform: translateY(-1px);
}

nav.top .sub {
  position: absolute;
  top: calc(100% + 12px);
  left: -22px;
  min-width: 196px;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 10px 0;
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  box-shadow: var(--shadow-warm);
}

nav.top li.has-sub::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  height: 14px;
}

nav.top li.has-sub:hover .sub,
nav.top li.has-sub:focus-within .sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

nav.top .sub li { display: block; }
nav.top .sub a {
  display: block;
  padding: 9px 22px;
  font-size: 10px;
  white-space: nowrap;
}
nav.top .sub a:hover { color: var(--gold-deep); padding-left: 26px; transition: padding-left 0.3s ease, color 0.3s ease; }

@media (max-width: 780px) {
  nav.top ul { display: none; }
}

/* =============================================================
   ATOM NAV — the mobile menu is the mark itself
   ============================================================= */
.atom-btn {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.atom-btn svg { width: 100%; height: 100%; overflow: visible; }
.atom-btn .orb { transform-box: view-box; transform-origin: 50% 50%; animation: orbit 7s linear infinite; }

@media (max-width: 780px) { .atom-btn { display: block; } }

@keyframes orbit { to { transform: rotate(360deg); } }

.atlas {
  position: fixed;
  inset: 0;
  z-index: 90;
  background:
    radial-gradient(120% 60% at 50% 0%, #FFFDF3 0%, rgba(255,253,243,0) 60%),
    var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

body.atlas-open .atlas { opacity: 1; visibility: visible; }
body.atlas-open { overflow: hidden; }

.atlas-ring {
  position: relative;
  width: min(78vw, 62vh);
  aspect-ratio: 1;
}

.atlas-ring .ring-line {
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
}

.atlas-ring .ring-electron {
  position: absolute;
  inset: 0;
  transform-box: fill-box;
  animation: orbit 9s linear infinite;
}

.atlas-ring .ring-electron::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px; height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--gold-deep);
  box-shadow: 0 0 0 3px var(--cream);
}

.atlas-nucleus {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(72px, 20vw, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 600;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-warm);
}

.atlas-node {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(min(78vw, 62vh) / -2)) rotate(calc(var(--a) * -1));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.5s ease var(--d, 0s), transform 0.5s var(--ease-settle) var(--d, 0s);
}

body.atlas-open .atlas-node { opacity: 1; }

.atlas-node .n-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--verdi);
  border: 2px solid var(--cream);
}

.atlas-node .n-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--cream);
  padding: 6px 10px;
  white-space: nowrap;
}

.atlas-node:active .n-label { color: var(--gold-deep); }

.atlas-close {
  position: absolute;
  top: 20px; right: var(--gutter);
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 12px;
  cursor: pointer;
}

/* =============================================================
   INTERIOR PAGE HERO — with the headline settle
   ============================================================= */
.page-hero {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 156px 0 64px;
}

.page-hero .eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(22px, 4vh, 38px);
}

.page-hero .eyebrow .l { width: 46px; height: 1px; background: var(--gold); transform-origin: left; animation: line-draw 1s var(--ease-settle) 0.15s backwards; }

@keyframes line-draw { from { transform: scaleX(0); } }

.page-hero h1 {
  font-family: var(--display);
  font-size: clamp(44px, 7.6vw, 104px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0;
  max-width: 16ch;
  animation: settle-wipe 0.9s var(--ease-settle) 0.1s backwards;
}

@keyframes settle-wipe {
  from { clip-path: inset(0 0 100% 0); transform: translateY(14px); }
  to   { clip-path: inset(-4% -4% -4% -4%); transform: translateY(0); }
}

.page-hero h1 em,
.headline em,
.headline-sm em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold-deep);
}

/* the gold word lands one beat later */
.page-hero h1 em { display: inline-block; animation: em-land 0.7s var(--ease-settle) 0.55s backwards; }

@keyframes em-land {
  from { opacity: 0; transform: translateY(0.25em); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-hero .sub {
  margin-top: clamp(26px, 4vh, 40px);
  max-width: 58ch;
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.page-hero .scroll { margin-top: clamp(32px, 5vh, 52px); display: inline-flex; }

/* Line-by-line reveal (forge.js splits marked elements) */
.ln {
  display: block;
  overflow: hidden;
}

.ln > span {
  display: block;
  transform: translateY(110%);
  transition: transform 0.7s var(--ease-settle);
}

.ln.in > span { transform: translateY(0); }

/* =============================================================
   SECTION SHELL — chapter numerals + lamp bands
   ============================================================= */
section.panel { padding: clamp(72px, 12vh, 156px) 0; position: relative; }
section.panel.tight { padding: clamp(52px, 8vh, 96px) 0; }

section.panel.band {
  background: linear-gradient(180deg, #FDFAF0 0%, #F7F1DF 100%);
  border-top: 1px solid var(--rule-faint);
  border-bottom: 1px solid var(--rule-faint);
  overflow: hidden;
}

/* the lamp — a warm pool of light that drifts as the band passes */
section.panel.band::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 8%;
  width: 60%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(226, 192, 120, 0.22), transparent 72%);
  pointer-events: none;
}

@supports (animation-timeline: view()) {
  section.panel.band::before {
    animation: lamp-drift linear both;
    animation-timeline: view();
  }
  @keyframes lamp-drift {
    from { transform: translate(-6%, 8%); }
    to   { transform: translate(14%, -10%); }
  }
}

/* faint chapter numeral behind each section (set by forge.js) */
section.panel[data-ch]::after {
  content: attr(data-ch);
  position: absolute;
  top: clamp(28px, 6vh, 64px);
  right: var(--gutter);
  font-family: var(--display);
  font-size: clamp(110px, 16vw, 230px);
  font-weight: 500;
  line-height: 0.8;
  color: rgba(188, 148, 72, 0.09);
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.4s ease, transform 1.4s var(--ease-settle);
  z-index: 0;
}

section.panel[data-ch].chin::after { opacity: 1; transform: translateY(0); }

.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(28px, 4.5vh, 48px);
}

.section-label .number {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold-deep);
}

.section-label .line {
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 190px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease-settle) 0.15s;
}

.in .section-label .line,
.section-label.in .line { transform: scaleX(1); }

.section-label .name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* anchor arrival pulse */
@keyframes label-pulse {
  0%, 100% { color: var(--gold-deep); }
  50% { color: var(--gold-glow); text-shadow: 0 0 12px rgba(226,192,120,0.8); }
}

.section-label.pulse .number { animation: label-pulse 1.1s ease 2; }

.headline {
  font-family: var(--display);
  font-size: clamp(34px, 5.4vw, 72px);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -0.015em;
  margin: 0 0 clamp(24px, 4vh, 40px) 0;
  max-width: 18ch;
}

/* headline settle on scroll-reveal */
.reveal .headline, .headline.reveal {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.9s var(--ease-settle);
}

.reveal.in .headline, .headline.reveal.in { clip-path: inset(-4% -4% -4% -4%); }

.reveal .headline em, .headline.reveal em {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.25em);
  transition: opacity 0.6s ease 0.4s, transform 0.6s var(--ease-settle) 0.4s;
}

.reveal.in .headline em, .headline.reveal.in em { opacity: 1; transform: translateY(0); }

.headline-sm {
  font-family: var(--display);
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 20px 0;
}

.lead {
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 60ch;
}

.lead p { margin: 0 0 22px 0; }
.lead p:last-child { margin-bottom: 0; }
.lead strong { color: var(--ink); font-weight: 500; }
.lead em { color: var(--gold-deep); }
.lead a { border-bottom: 1px solid var(--rule); transition: color 0.3s; }
.lead a:hover { color: var(--gold-deep); }

/* Front-loaded ink — first clause carries the weight (forge.js wraps) */
.front { font-weight: 400; color: var(--ink); }

.two-col {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: clamp(36px, 5.5vw, 88px);
  align-items: start;
}

@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }

/* =============================================================
   THE FOLD — "Continue the argument"
   First paragraph stands; the rest unfolds only if summoned.
   ============================================================= */
.fold-more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.7s var(--ease-settle);
}

.fold-more > div { overflow: hidden; }
.fold-more > div > p:first-child { margin-top: 22px; }

.fold.open .fold-more { grid-template-rows: 1fr; }

.fold-btn {
  margin-top: 18px;
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--rule);
  transition: gap 0.4s var(--ease-settle), color 0.3s, opacity 0.4s, visibility 0.4s;
}

.fold-btn:hover { gap: 18px; }
.fold.open .fold-btn { opacity: 0; visibility: hidden; }
.fold-btn .fb-arrow { transition: transform 0.4s var(--ease-settle); }

/* =============================================================
   CITATION MARK — rigor available, never imposed
   ============================================================= */
.citefold {
  position: relative;
  display: inline-block;
}

.citefold .deg {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold-deep);
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.citefold .deg:hover, .citefold.open .deg { background: var(--gold-deep); color: var(--cream); border-color: var(--gold-deep); }

.citefold .cite {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  min-width: min(340px, 74vw);
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-warm);
  padding: 12px 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-settle), visibility 0.3s;
  z-index: 10;
}

.citefold:hover .cite,
.citefold:focus-within .cite,
.citefold.open .cite {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cite {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1.7;
  color: var(--ink-mute);
  text-transform: none;
  max-width: 74ch;
}

.footnote {
  margin-top: clamp(26px, 4vh, 38px);
  color: var(--ink-mute);
  font-size: 13px;
  line-height: 1.65;
  max-width: 90ch;
}

.footnote a { color: var(--gold-deep); border-bottom: 1px solid var(--rule); }

/* =============================================================
   THE INTERLUDE — a full-viewport breath between arguments
   ============================================================= */
.interlude {
  min-height: 64vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(60px, 10vh, 120px) var(--gutter);
  position: relative;
}

.interlude .say {
  font-family: var(--display);
  font-size: clamp(34px, 6.2vw, 84px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 20ch;
  margin: 0;
}

.interlude .say em { font-style: italic; font-weight: 300; color: var(--gold-deep); }

.interlude::before,
.interlude::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  height: clamp(30px, 6vh, 60px);
  background: var(--rule);
  transform: translateX(-50%) scaleY(0);
  transition: transform 1s var(--ease-settle) 0.3s;
}

.interlude::before { top: 0; transform-origin: top; }
.interlude::after { bottom: 0; transform-origin: bottom; }
.interlude.in::before, .interlude.in::after { transform: translateX(-50%) scaleY(1); }

/* =============================================================
   THE STAMP — settles in with a small rotate
   ============================================================= */
.stamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-deep);
  border: 1.5px solid var(--gold-deep);
  padding: 7px 12px;
  transform: rotate(-3deg) scale(1.2);
  opacity: 0;
  transition: transform 0.5s var(--ease-settle) 0.5s, opacity 0.4s ease 0.5s;
}

.in .stamp, .stamp.in { transform: rotate(-3deg) scale(1); opacity: 0.9; }

/* =============================================================
   DOSSIER TABS — the case-file spine for service pages
   ============================================================= */
.dossier-bar {
  position: sticky;
  top: 61px;
  z-index: 40;
  background: rgba(253, 249, 238, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--rule-faint);
  border-bottom: 1px solid var(--rule-faint);
}

.dossier-bar .frame {
  display: flex;
  gap: clamp(4px, 2vw, 8px);
  overflow-x: auto;
  scrollbar-width: none;
}

.dossier-bar .frame::-webkit-scrollbar { display: none; }

.dtab {
  background: none;
  border: none;
  padding: 16px clamp(12px, 2vw, 22px);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  position: relative;
  transition: color 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.dtab::after {
  content: "";
  position: absolute;
  left: clamp(12px, 2vw, 22px);
  right: clamp(12px, 2vw, 22px);
  bottom: -1px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-settle);
}

.dtab:hover { color: var(--ink); }
.dtab[aria-selected="true"] { color: var(--gold-deep); }
.dtab[aria-selected="true"]::after { transform: scaleX(1); }

body.dossier [data-dossier] { display: none; }
body.dossier [data-dossier].dopen { display: block; animation: fade-up 0.5s var(--ease-settle) both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================================
   DOORS
   ============================================================= */
.doors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.doors.four { grid-template-columns: repeat(4, 1fr); }

.door {
  display: block;
  padding: clamp(30px, 4vh, 46px) clamp(18px, 2.4vw, 30px);
  position: relative;
  transition: background 0.4s ease;
  background: transparent;
}

.door:not(:last-child) { border-right: 1px solid var(--rule-faint); }
.door:hover { background: var(--paper); }

.door .ic { margin-bottom: 20px; transition: transform 0.5s var(--ease-settle); }
.door:hover .ic { transform: translateY(-4px); }

.door .code {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.door .name {
  font-family: var(--display);
  font-size: clamp(23px, 2.4vw, 29px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.door:hover .name { color: var(--gold-deep); }

.door .desc {
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.55;
  max-width: 30ch;
  margin-bottom: 18px;
}

.door .go {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: gap 0.4s var(--ease-settle), color 0.3s;
}

.door:hover .go { gap: 18px; color: var(--gold-deep); }

@media (max-width: 1100px) {
  .doors.four { grid-template-columns: repeat(2, 1fr); }
  .doors.four .door:nth-child(2) { border-right: none; }
  .doors.four .door:nth-child(-n+2) { border-bottom: 1px solid var(--rule-faint); }
}

@media (max-width: 780px) {
  .doors, .doors.four { grid-template-columns: 1fr; }
  .door:not(:last-child) { border-right: none; border-bottom: 1px solid var(--rule-faint); }
}

/* =============================================================
   REPORT STRIP
   ============================================================= */
.report {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: linear-gradient(180deg, rgba(255, 254, 248, 0.6), transparent);
}

.report .cell {
  padding: clamp(26px, 4vh, 42px) clamp(14px, 2vw, 28px);
  text-align: center;
}

.report .cell:not(:last-child) { border-right: 1px solid var(--rule-faint); }

.report .num {
  font-family: var(--display);
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 500;
  line-height: 1;
  color: var(--good);
  font-variant-numeric: tabular-nums;
}

.report .lbl {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 12px;
}

.report-cap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 18px;
}

@media (max-width: 640px) {
  .report { grid-template-columns: 1fr 1fr; }
  .report .cell:nth-child(2) { border-right: none; }
  .report .cell:nth-child(-n+2) { border-bottom: 1px solid var(--rule-faint); }
}

/* =============================================================
   FEATURE / MENU LISTS
   ============================================================= */
.features { list-style: none; margin: 0; padding: 0; }

.features li {
  padding: 20px 0;
  border-top: 1px solid var(--rule-faint);
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 18px;
  align-items: baseline;
}

.features li:last-child { border-bottom: 1px solid var(--rule-faint); }

.features .marker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.features .item {
  font-family: var(--display);
  font-size: clamp(19px, 2.1vw, 23px);
  line-height: 1.3;
  color: var(--ink);
}

.features .item span {
  display: block;
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-mute);
  font-weight: 300;
  margin-top: 5px;
  letter-spacing: 0;
  line-height: 1.55;
  max-width: 52ch;
}

.features.menu li { grid-template-columns: 60px 1fr auto; }

.features .price {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.features .price small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 3px;
}

@media (max-width: 620px) {
  .features li, .features.menu li { grid-template-columns: 44px 1fr; }
  .features.menu .price { grid-column: 2; text-align: left; margin-top: 8px; }
}

/* =============================================================
   BENTO — the editorial plate wall
   Titles stand; sublines surface as each plate crosses center.
   ============================================================= */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(14px, 1.8vw, 24px);
}

.bento .plate-card {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: clamp(22px, 3vh, 34px) clamp(18px, 2.4vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.4s ease, transform 0.5s var(--ease-settle), box-shadow 0.5s ease;
}

.bento .plate-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--shadow-warm); }

.bento .plate-card .marker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.bento .plate-card .item {
  font-family: var(--display);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.2;
  color: var(--ink);
}

.bento .plate-card .item a { border-bottom: 1px solid var(--rule); }
.bento .plate-card .item a:hover { color: var(--gold-deep); }

.bento .plate-card .sub {
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.6;
  max-width: 46ch;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease, transform 0.7s var(--ease-settle);
}

.bento .plate-card.centered .sub { opacity: 1; transform: translateY(0); }

.b7 { grid-column: span 7; }
.b6 { grid-column: span 6; }
.b5 { grid-column: span 5; }
.b4 { grid-column: span 4; }

@media (max-width: 860px) {
  .b7, .b6, .b5, .b4 { grid-column: span 12; }
}

/* =============================================================
   CHIPS — with the drawn tick
   ============================================================= */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip { position: relative; display: inline-flex; }

.chip input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 11px 18px;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: all 0.25s ease;
  pointer-events: none;
  background: var(--paper);
}

.chip span::before {
  content: "\2713";
  display: inline-block;
  width: 0;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.4);
  transition: width 0.3s var(--ease-settle), opacity 0.3s, transform 0.3s var(--ease-settle), margin 0.3s;
}

.chip:hover span { border-color: var(--gold); color: var(--ink); }
.chip input:checked + span { background: var(--verdi); border-color: var(--verdi); color: var(--cream); }
.chip input:checked + span::before { width: 1em; opacity: 1; transform: scale(1); margin-right: 8px; }
.chip input:focus-visible + span { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

/* =============================================================
   FAQ
   ============================================================= */
.faq { border-top: 1px solid var(--rule); }

.faq details { border-bottom: 1px solid var(--rule-faint); }

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 24px 0;
  display: grid;
  grid-template-columns: 1fr 30px;
  align-items: center;
  gap: 18px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary .q {
  font-family: var(--display);
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.3;
  transition: color 0.3s;
}

.faq summary:hover .q { color: var(--gold-deep); }

.faq summary .tick {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--gold);
  text-align: right;
  transition: transform 0.35s var(--ease-settle), color 0.3s ease;
}

.faq details[open] summary .tick { transform: rotate(45deg); color: var(--verdi); }

.faq .a {
  padding: 0 0 26px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 64ch;
}

.faq .a a { border-bottom: 1px solid var(--rule); }
.faq .a a:hover { color: var(--gold-deep); }
.faq .a strong { color: var(--ink); font-weight: 500; }

.faq summary:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 4px; }

/* =============================================================
   EXIT BAND
   ============================================================= */
.exits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.exit {
  padding: clamp(34px, 5vh, 54px) clamp(20px, 3vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.4s ease;
}

.exit:first-child { border-right: 1px solid var(--rule-faint); }
.exit:hover { background: var(--paper); }

.exit .k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.exit .t {
  font-family: var(--display);
  font-size: clamp(22px, 2.8vw, 32px);
  line-height: 1.15;
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  transition: color 0.3s;
}

.exit .t .arrow { transition: transform 0.4s var(--ease-settle); font-size: 0.8em; }
.exit:hover .t { color: var(--gold-deep); }
.exit:hover .t .arrow { transform: translateX(6px); }

@media (max-width: 680px) {
  .exits { grid-template-columns: 1fr; }
  .exit:first-child { border-right: none; border-bottom: 1px solid var(--rule-faint); }
}

/* =============================================================
   BUTTONS — press states + shimmer; forge.js adds magnetism
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 20px 34px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background 0.4s var(--ease-settle), border-color 0.4s var(--ease-settle), transform 0.25s var(--ease-settle);
  border: 1px solid var(--ink);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform: translate(var(--mx, 0), var(--my, 0));
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(226, 192, 120, 0.25) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform 0.9s var(--ease-settle);
  z-index: -1;
}

.btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn:hover::before { transform: translateX(110%); }
.btn:active { transform: translate(var(--mx, 0), calc(var(--my, 0) + 1px)); }
.btn .arrow { transition: transform 0.4s var(--ease-settle); }
.btn:hover .arrow { transform: translateX(6px); }
.btn:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn.ghost { background: none; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* the electron, moonlighting as a spinner */
.spin-atom {
  width: 16px;
  height: 16px;
  position: relative;
  display: none;
}

.spin-atom::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(250, 247, 238, 0.4);
  border-radius: 50%;
}

.spin-atom::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 5px; height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--gold-glow);
  transform-origin: 2.5px 10px;
  animation: orbit 0.9s linear infinite;
}

.btn.sending .spin-atom { display: inline-block; }
.btn.sending .arrow { display: none; }

.link-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  transition: gap 0.4s var(--ease-settle), color 0.3s ease;
}

.link-line:hover { gap: 20px; color: var(--gold-deep); }

/* =============================================================
   RIDGE
   ============================================================= */
.ridge {
  width: 100%;
  height: auto;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  opacity: 0.85;
}

/* =============================================================
   FOOTER
   ============================================================= */
footer.foot { padding: clamp(76px, 11vh, 132px) 0 40px; position: relative; z-index: 1; }

.foot-headline {
  font-family: var(--display);
  font-size: clamp(38px, 6.4vw, 88px);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.015em;
  margin: 0 0 44px 0;
  max-width: 16ch;
}

.foot-headline em { font-style: italic; font-weight: 300; color: var(--gold-deep); }

.foot-meta {
  margin-top: clamp(72px, 11vh, 112px);
  padding-top: 32px;
  border-top: 1px solid var(--rule-faint);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.foot-meta .col h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 16px 0;
  font-weight: 500;
}

.foot-meta .col p,
.foot-meta .col a {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 4px 0;
  display: block;
  transition: color 0.3s;
}

.foot-meta .col a:hover { color: var(--gold-deep); }

.foot-base {
  margin-top: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.foot-base .mono { font-size: 10px; }

@media (max-width: 720px) { .foot-meta { grid-template-columns: 1fr; gap: 38px; } }

/* =============================================================
   REVEAL + STAGGER
   ============================================================= */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-2) var(--ease-settle),
              transform var(--dur-2) var(--ease-settle);
}

.reveal.in { opacity: 1; transform: translateY(0); }

[data-stagger] > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease-settle),
              transform 0.8s var(--ease-settle);
}

[data-stagger] > *.in { opacity: 1; transform: translateY(0); }

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

/* =============================================================
   VIEW TRANSITIONS — one studio, one continuous room
   ============================================================= */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: vt-out 0.22s ease both; }
::view-transition-new(root) { animation: vt-in 0.26s ease both; }

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* =============================================================
   REDUCED MOTION — the site simply is, all at once
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal, [data-stagger] > * { opacity: 1; transform: none; }
  .section-label .line { transform: scaleX(1); }
  .ic [pathLength] { stroke-dashoffset: 0; animation: none; }
  .page-hero h1, .page-hero h1 em, .page-hero .eyebrow .l { animation: none; clip-path: none; opacity: 1; transform: none; }
  .reveal .headline, .headline.reveal { clip-path: none; }
  .reveal .headline em, .headline.reveal em { opacity: 1; transform: none; }
  .ln > span { transform: none; }
  .bento .plate-card .sub { opacity: 1; transform: none; }
  section.panel[data-ch]::after { opacity: 1; transform: none; }
  .stamp { opacity: 0.9; transform: rotate(-3deg); }
  .interlude::before, .interlude::after { transform: translateX(-50%) scaleY(1); }
}
