/* ==========================================================================
   Fio — The Couture Operating Platform
   Design system: "Maison Standard" (refined atelier light).
   Ivory document base, system-serif display voice over Inter, hairline
   print-grade structure, bordeaux + bronze used with restraint.
   Motion vocabulary is four verbs only: fade-rise, rule-draw, 2px lift,
   underline. QA display type against the Georgia fallback (Windows).
   ========================================================================== */

:root {
  color-scheme: light;

  /* Surfaces */
  --paper: #fbf9f4;
  --surface: #ffffff;
  --champagne: #f3ede1;
  --espresso: #16110c;
  --graphite: #231d16;

  /* Text */
  --ink: #14100c;
  --ink-soft: #2f2921;
  --muted: #6e6457;
  --ivory: #f5f1ea;
  --ivory-muted: #b3a99a;

  /* Hairlines */
  --hairline: #e6decf;
  --hairline-strong: #cfc2ac;
  --hairline-dark: #3a332c;

  /* Accents */
  --bordeaux: #7a1e15;
  --bordeaux-deep: #5f160f;
  --blush: #f6ebe2;
  --bronze: #8f6d2f;          /* decorative: rules, borders, glyphs */
  --bronze-ink: #7a5c20;      /* text-safe bronze on paper/champagne (AA) */
  --bronze-bright: #b28e4e;   /* text-safe bronze on espresso/graphite (AA) */
  --champagne-gold: #f3e9d2;
  --sage: #33604b;
  --sage-wash: #e7f0ea;

  /* Focus */
  --ring: #7a1e15;

  /* Elevation (warm, quiet) */
  --shadow-frame: 0 1px 2px rgba(20, 16, 12, 0.05), 0 24px 48px -24px rgba(20, 16, 12, 0.25);
  --shadow-plate: 0 1px 2px rgba(20, 16, 12, 0.05), 0 14px 32px -18px rgba(20, 16, 12, 0.22);

  /* Type */
  --serif: 'Didot', 'Bodoni 72', 'Hoefler Text', Georgia, 'Times New Roman', serif;
  --sans: 'InterLocal', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Rhythm */
  --container: 1200px;
  --space-section: clamp(5rem, 10vw, 8.5rem);
  --radius-frame: 10px;
  --radius-btn: 6px;
  --radius-seal: 2px;
}

/* Inter — 400/500/600 only; heavier weights retired (quiet-luxury move). */
@font-face {
  font-family: 'InterLocal';
  src: url('./assets/fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'InterLocal';
  src: url('./assets/fonts/Inter-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'InterLocal';
  src: url('./assets/fonts/Inter-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after { min-width: 0; }

::selection {
  background: var(--blush);
  color: var(--bordeaux-deep);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 em, h2 em, h3 em, .pullquote em {
  font-style: italic;
}

h4 { margin: 0; font-weight: 600; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

svg { display: block; flex-shrink: 0; }

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

/* Dark surfaces need a light ring — bordeaux vanishes on espresso/ink. */
.security :focus-visible,
.frame-bar :focus-visible,
.skip-link:focus-visible {
  outline-color: var(--ivory);
}

.container {
  width: min(var(--container), calc(100% - 3rem));
  margin: 0 auto;
}

.container-narrow {
  width: min(720px, calc(100% - 3rem));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 200;
  background: var(--ink);
  color: var(--ivory);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-btn);
  transition: top 160ms ease;
}

.skip-link:focus { top: 1rem; }

/* Provisional content — flip this class off as real facts land (PLAN.md §6). */
.is-provisional { display: none !important; }

/* Anchor targets clear the fixed header (nav ≈ 66px). */
main [id] {
  scroll-margin-top: 6.5rem;
}

/* ---------- Type helpers ---------- */
h1 {
  font-size: clamp(2.9rem, 6vw, 4.6rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  line-height: 1.12;
}

h3 {
  font-size: 1.45rem;
  line-height: 1.25;
}

.standfirst {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: 1.13rem;
  color: var(--muted);
}

.body-lg {
  margin-top: 1.15rem;
  max-width: 30rem;
  font-size: 1.05rem;
  color: var(--muted);
}

.eyebrow,
.eyebrow-plain {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze-ink);
  margin-bottom: 1.1rem;
}

.eyebrow-plain.on-dark { color: var(--ivory-muted); }

.center-head {
  text-align: center;
  max-width: 46rem;
  margin: 0 auto clamp(2.6rem, 6vh, 3.75rem);
}

.center-head .body-lg {
  margin-left: auto;
  margin-right: auto;
  max-width: 34rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.4rem;
  border-radius: var(--radius-btn);
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--ivory);
}

.btn-primary:hover {
  background: var(--bordeaux-deep);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border-color: var(--hairline-strong);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--ink);
}

.btn-lg { padding: 0.95rem 1.7rem; font-size: 0.98rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.84rem; }

.link-tertiary {
  display: inline-block;
  margin-top: 1.3rem;
  color: var(--bordeaux);
  font-weight: 500;
  font-size: 0.94rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-thickness 200ms ease, color 200ms ease;
}

.link-tertiary::after { content: ' \2192'; }

.link-tertiary:hover {
  text-decoration-thickness: 2px;
  color: var(--bordeaux-deep);
}

/* ---------- Status seals (stamps, not pills) ---------- */
.seal {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.55rem;
  border-radius: var(--radius-seal);
  border: 1px solid var(--hairline-strong);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.seal-review {
  border-color: #e3c9bd;
  background: var(--blush);
  color: var(--bordeaux);
}

.seal-ok {
  border-color: #c4d8cb;
  background: var(--sage-wash);
  color: var(--sage);
}

.seal-issued {
  border-color: #ddcda2;
  background: var(--champagne-gold);
  color: #6d5423;
}

.seal-ai {
  border-color: var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.seal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.3rem;
}

/* ---------- Fixed head ---------- */
.site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

/* ---------- Navigation ---------- */
.site-nav {
  background: rgba(251, 249, 244, 0);
  border-bottom: 1px solid transparent;
  transition: background 220ms ease, border-color 220ms ease;
}

.site-nav.scrolled {
  background: rgba(251, 249, 244, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--hairline);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.nav-links a {
  padding-bottom: 2px;
  background-image: linear-gradient(var(--bronze), var(--bronze));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: left calc(100% - 0px);
  transition: color 180ms ease, background-size 240ms ease;
}

.nav-links a:hover {
  color: var(--ink);
  background-size: 100% 1px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Sign-in split menu (details/summary, JS-free) */
.signin { position: relative; }

.signin summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.4rem 0.2rem;
  transition: color 180ms ease;
}

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

.signin summary::after {
  content: ' \25BE';
  font-size: 0.7em;
  color: var(--bronze);
}

.signin summary:hover { color: var(--ink); }

.signin-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 10.5rem;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-plate);
  padding: 0.35rem;
  z-index: 60;
}

.signin-menu a {
  display: block;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: 4px;
}

.signin-menu a:hover {
  background: var(--champagne);
  color: var(--ink);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 49;
  background: var(--paper);
  padding: 6rem 1.5rem 2rem;
  overflow-y: auto;
}

.nav-mobile.open { display: block; }

/* Never render the mobile overlay at desktop widths, whatever its state. */
@media (min-width: 721px) {
  .nav-mobile { display: none !important; }
}

.nav-mobile a {
  display: block;
  padding: 1rem 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--ink);
  border-bottom: 1px solid var(--hairline);
}

.nav-mobile .btn {
  margin-top: 1.75rem;
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  border-bottom: 0;
  color: var(--ivory);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(7.5rem, 14vh, 9.5rem) 0 clamp(4rem, 9vh, 6rem);
  border-bottom: 1px solid var(--hairline);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 4.5rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2.3rem;
}

.hero-actions.center { justify-content: center; }

/* Doctrine filmstrip */
.doctrine {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 5vh, 3.5rem);
  max-width: 34rem;
}

.doctrine-stat {
  border-top: 1px solid var(--hairline-strong);
  padding-top: 0.8rem;
}

.stat-numeral {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1;
  color: var(--ink);
  font-feature-settings: 'tnum' 1;
}

.stat-label {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Frame v2 (product mockup) ---------- */
.frame {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-frame);
  box-shadow: var(--shadow-frame);
  overflow: hidden;
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.chapter-visual:hover .frame,
.hero-visual:hover .frame {
  transform: translateY(-2px);
}

.frame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--graphite);
  color: var(--ivory-muted);
}

.frame-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ivory);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-lock { color: var(--bronze); }

.frame-body { padding: 1.15rem 1.25rem; }

/* Workspace rows */
.ws-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 1.1rem;
  align-items: start;
}

/* Seals inside product mockups run slightly smaller so rows keep air. */
.frame .seal {
  font-size: 0.62rem;
  padding: 0.2rem 0.45rem;
  letter-spacing: 0.06em;
}

.ws-render {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper);
}

.ws-render img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.ws-render figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
}

.ws-side { display: flex; flex-direction: column; }

.ws-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0;
}

.ws-row + .ws-row { border-top: 1px solid var(--hairline); }

.ws-row-text { min-width: 0; }

.ws-row-text strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  font-feature-settings: 'tnum' 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-row-text span {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Receipt rows — the ledger-receipt motif */
.receipt {
  font-size: 0.74rem;
  color: var(--muted);
  font-feature-settings: 'tnum' 1;
  padding: 0.5rem 0 0;
}

.receipt em {
  font-style: italic;
  color: var(--bronze-ink);
}

.receipt .r-time {
  display: inline-block;
  min-width: 2.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.ws-side .receipt {
  margin-top: 0.4rem;
  border-top: 1px dashed var(--hairline-strong);
  padding-top: 0.7rem;
}

.receipt-strip {
  margin-top: 0.75rem;
  border-top: 1px dashed var(--hairline-strong);
  padding-top: 0.45rem;
}

.receipt-strip .receipt { padding: 0.22rem 0; }

/* Steps (portal mockup) */
.steps { display: flex; flex-direction: column; }

.step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.8rem 0;
}

.step + .step { border-top: 1px dashed var(--hairline); }

.step-no {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 0.82rem;
  flex-shrink: 0;
  background: var(--champagne);
  color: var(--muted);
}

.step.done .step-no { background: var(--sage); color: #fff; font-family: var(--sans); font-size: 0.72rem; }
.step.active .step-no { background: var(--bordeaux); color: #fff; }

.step-title {
  padding-top: 0.14rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}

.swatches {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.swatches i {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Ledger table */
.ledger-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.55rem 0.9rem 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
}

.ledger-tab {
  padding: 0.42rem 0.8rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.ledger-tab.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  border-color: var(--hairline);
  margin-bottom: -1px;
}

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-feature-settings: 'tnum' 1;
}

.ledger th {
  text-align: left;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--champagne);
  padding: 0.5rem 0.65rem;
}

.ledger td {
  padding: 0.62rem 0.65rem;
  border-top: 1px solid var(--hairline);
  color: var(--ink-soft);
}

.ledger .num { text-align: right; }

.ledger .total td {
  font-weight: 600;
  color: var(--ink);
  border-top: 1px solid var(--hairline-strong);
}

.ledger em { color: var(--bronze-ink); }

/* ---------- Plates (photo treatment) ---------- */
.plate {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-plate);
  transition: transform 260ms ease;
}

.plate:hover { transform: translateY(-2px); }

.plate-mat {
  display: block;
  padding: 10px;
}

.plate-mat img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.03);
}

.plate-caption {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 10px 10px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.plate-caption span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.plate-rule {
  flex: 1;
  height: 1px;
  background: var(--bronze);
  opacity: 0.55;
}

/* Plate placed under a frame in chapter visuals */
.chapter-visual {
  display: grid;
  gap: 1.4rem;
}

.chapter-visual .plate-offset {
  width: min(58%, 15rem);
  justify-self: end;
}

.split.flip .chapter-visual .plate-offset { justify-self: start; }

/* Wide plates (security, economics) */
.plate-wide {
  max-width: 1080px;
  margin: clamp(2.5rem, 6vh, 3.5rem) auto 0;
}

.plate-wide .plate-mat img {
  aspect-ratio: 21 / 7;
}

.plate-wide.on-dark {
  background: var(--graphite);
  border-color: var(--hairline-dark);
}

.plate-wide.on-dark .plate-caption { color: var(--ivory-muted); }

/* ---------- Sections & chapters ---------- */
.section { padding: var(--space-section) 0; }

.chapter { padding: var(--space-section) 0; }

.chapter-tint { background: var(--champagne); }

.chapter-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: clamp(2.2rem, 5vh, 3.2rem);
}

.ch-no {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--bronze-ink);
  font-feature-settings: 'tnum' 1;
}

.chapter-eyebrow i {
  color: var(--bronze);
  font-style: normal;
}

.ch-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.ch-rule {
  flex: 1;
  height: 1px;
  background: var(--hairline-strong);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.split.flip { grid-template-columns: 1.1fr 1fr; }

.split.flip .chapter-visual { order: -1; }

/* ---------- Maison proof band ---------- */
.maisons {
  padding: clamp(2.2rem, 5vh, 3.2rem) 0;
  border-bottom: 1px solid var(--hairline);
  text-align: center;
}

.maisons-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem 1rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(20, 16, 12, 0.68);
}

.maisons-row span { transition: color 200ms ease; }
.maisons-row span:hover { color: var(--ink); }

.maisons-row i {
  font-style: normal;
  color: var(--bronze);
}

.maisons-note {
  margin-top: 0.9rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Two doors ---------- */
.doors-frame {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
}

.door {
  padding: clamp(1.8rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.door + .door { border-left: 1px solid var(--hairline); }

.door-kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze-ink);
  margin-bottom: 1rem;
}

.door h3 { max-width: 18ch; }

.door p:not(.seal-row) {
  margin-top: 0.9rem;
  max-width: 30rem;
  font-size: 0.98rem;
  color: var(--muted);
}

.door-plate {
  width: min(52%, 12rem);
  margin-top: 1.4rem;
  border: 1px solid var(--hairline);
}

.door-plate img {
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  object-position: center 20%;
  filter: saturate(0.92) contrast(1.03);
}

.door .link-tertiary { margin-top: auto; padding-top: 1.3rem; }

.door-join {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper);
  border: 1px solid var(--bronze);
  border-radius: var(--radius-seal);
  color: var(--bronze-ink);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}

/* ---------- Thread diagram ---------- */
.thread-figure {
  margin-top: clamp(3rem, 7vh, 4.5rem);
}

.thread-diagram {
  width: 100%;
  height: auto;
}

.thread-diagram rect {
  fill: var(--surface);
  stroke: var(--hairline-strong);
}

.thread-diagram rect.node-core {
  stroke: var(--bronze);
}

.thread-diagram text {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  fill: var(--ink-soft);
  text-anchor: middle;
}

.thread-diagram .text-core { fill: var(--bronze-ink); }

.thread-diagram .stitches path {
  fill: none;
  stroke: var(--bronze);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  stroke-linecap: round;
}

.js .thread-diagram .stitches {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1400ms cubic-bezier(0.22, 1, 0.36, 1) 300ms;
}

.js .thread-figure.in .stitches { clip-path: inset(0 0 0 0); }

.thread-figure figcaption {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- AI doctrine band ---------- */
.ai-band {
  background: var(--champagne);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: var(--space-section) 0;
}

.pullquote {
  position: relative;
  text-align: center;
  max-width: 30ch;
  margin: 0 auto;
}

.pullquote p {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}

.pullquote::before,
.pullquote::after {
  content: '';
  position: absolute;
  top: 50%;
  width: clamp(2rem, 6vw, 4rem);
  height: 1px;
  background: var(--bronze);
  opacity: 0.6;
}

.pullquote::before { right: calc(100% + 1.4rem); }
.pullquote::after { left: calc(100% + 1.4rem); }

.ai-sub {
  margin: 1.4rem auto 0;
  max-width: 36rem;
  text-align: center;
  font-size: 1.02rem;
  color: var(--muted);
}

.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-top: clamp(2.8rem, 6vh, 4rem);
}

.diptych {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.9rem;
}

.diptych figure {
  position: relative;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  padding: 8px;
}

.diptych img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.03);
}

.diptych figcaption {
  padding-top: 0.5rem;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.diptych-arrow {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--bronze);
}

.signoff-seal {
  position: absolute;
  right: -0.9rem;
  bottom: -0.9rem;
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 50%;
  border: 1px solid var(--bronze);
  background: var(--champagne-gold);
  color: #6d5423;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  text-align: center;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.3;
  box-shadow: var(--shadow-plate);
}

.ai-ledger-wrap .ledger {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
}

.ai-ledger-note {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- Security (dark chapter) ---------- */
.security {
  background: var(--espresso);
  color: var(--ivory-muted);
  padding: var(--space-section) 0;
}

.security h2 { color: var(--ivory); }

.security .body-lg { color: var(--ivory-muted); }

.spec-table {
  max-width: 760px;
  margin: 0 auto;
  border-top: 1px solid var(--hairline-dark);
}

.spec-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  align-items: center;
  gap: 1.2rem;
  padding: 1.05rem 0.25rem;
  border-bottom: 1px solid var(--hairline-dark);
}

.spec-row dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze-bright);
}

.spec-row dd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.98rem;
  color: var(--ivory);
}

.confirm {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #5d8a72;
  flex-shrink: 0;
}

.security-note {
  margin: 1.8rem auto 0;
  max-width: 760px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ivory-muted);
}

.security-note a {
  color: var(--ivory);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.security-note a::after { content: ' \2192'; }

.security-note a:hover { color: #fff; }

/* ---------- House economics ---------- */
.econ-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  counter-reset: stage;
  max-width: 1080px;
  margin: 0 auto;
}

.econ-rail::before {
  content: '';
  position: absolute;
  top: 1.15rem;
  left: 4rem;
  right: 4rem;
  height: 1px;
  background: var(--bronze);
  opacity: 0.4;
}

.econ-stage {
  position: relative;
  background: transparent;
  text-align: left;
}

.econ-no {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  border: 1px solid var(--bronze);
  background: var(--paper);
  color: var(--bronze-ink);
  font-family: var(--serif);
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
  font-feature-settings: 'tnum' 1;
}

.chapter-tint .econ-no { background: var(--champagne); }

.econ-stage h3 { font-size: 1.3rem; }

.econ-stage p {
  margin-top: 0.65rem;
  font-size: 0.94rem;
  color: var(--muted);
  max-width: 24rem;
}

/* ---------- Craft pledge band ---------- */
.craft-band {
  position: relative;
  overflow: hidden;
  min-height: clamp(16rem, 42vh, 24rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.craft-band > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.craft-band::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 17, 12, 0.45), rgba(22, 17, 12, 0.82));
}

.craft-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 46rem;
}

.craft-content p {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  line-height: 1.3;
  color: var(--ivory);
  text-wrap: balance;
}

.craft-content footer {
  margin-top: 1.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 241, 234, 0.72);
}

/* ---------- Closing invitation ---------- */
.invite {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  border: 1px solid var(--hairline-strong);
  outline: 1px solid var(--bronze);
  outline-offset: -7px;
  background: var(--surface);
  padding: clamp(3rem, 8vw, 5rem) clamp(1.75rem, 6vw, 4rem);
}

.invite .body-lg {
  margin-left: auto;
  margin-right: auto;
}

.invite-note {
  margin-top: 1.8rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.invite-note a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.invite-note a:hover { color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: clamp(2.75rem, 6vw, 4rem) 0 2rem;
  color: var(--muted);
  font-size: 0.87rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 2.5rem 1.5rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--hairline);
}

.footer-brand .wordmark { font-size: 1.4rem; }

.footer-tagline {
  margin-top: 0.9rem;
  font-size: 0.86rem;
  line-height: 1.6;
  max-width: 16rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.footer-col h3 {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
  line-height: inherit;
}

.footer-col a {
  transition: color 160ms ease;
}

.footer-col a:hover { color: var(--ink); }

.footer-soon { color: var(--muted); }

.footer-soon i {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bronze-ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-seal);
  padding: 0.06rem 0.32rem;
  margin-left: 0.3rem;
  vertical-align: 1px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  font-size: 0.8rem;
}

.colophon {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
}

/* ---------- Motion: fade-rise + rule-draw ----------
   Hidden states are gated on html.js (set by an inline script in <head>)
   so the page renders fully without JavaScript. */
.js .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

.js .reveal.d-1 { transition-delay: 90ms; }
.js .reveal.d-2 { transition-delay: 180ms; }
.js .reveal.d-3 { transition-delay: 270ms; }

.js .rule-draw {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1) 200ms;
}

.js .rule-draw.in { transform: scaleX(1); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }

  /* Copy-first on small screens — the claim must lead above the fold;
     the workspace mockup follows it. */
  .hero-visual {
    max-width: 34rem;
    margin: 0 auto;
    width: 100%;
  }

  .split,
  .split.flip { grid-template-columns: 1fr; }

  .split .chapter-visual,
  .split.flip .chapter-visual {
    order: -1;
    max-width: 34rem;
    margin: 0 auto;
    width: 100%;
  }

  .doors-frame { grid-template-columns: 1fr; }

  .door + .door {
    border-left: 0;
    border-top: 1px solid var(--hairline);
  }

  .ai-grid { grid-template-columns: 1fr; }

  .diptych { max-width: 30rem; margin: 0 auto; width: 100%; }

  .econ-rail { grid-template-columns: 1fr; gap: 2.25rem; }
  .econ-rail::before { display: none; }
}

@media (max-width: 720px) {
  /* Slightly zoomed-out feel on phones — rem-based spacing scales together. */
  html { font-size: 93.75%; }

  .nav-links, .signin { display: none; }
  .nav-toggle { display: inline-flex; }

  .hero { padding: clamp(6.5rem, 18vw, 7.5rem) 0 clamp(2.5rem, 8vw, 3.5rem); }

  .section, .chapter, .ai-band, .security { padding: clamp(3.25rem, 12vw, 4.5rem) 0; }

  .doctrine { gap: 1rem; }

  .ws-grid { grid-template-columns: 1fr; }

  .ws-render { max-width: 16rem; }

  .pullquote::before, .pullquote::after { display: none; }

  .spec-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .craft-band { min-height: clamp(13rem, 36vh, 18rem); }

  .chapter-visual .plate-offset { width: min(70%, 15rem); }
}

@media (max-width: 560px) {
  .doctrine { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
  .stat-label { font-size: 0.64rem; }
  .maisons-row { font-size: 0.88rem; }
  .thread-figure { display: none; }
  .ledger { font-size: 0.8rem; }
  .signoff-seal { right: 0.4rem; bottom: 2.2rem; }
}

@media (max-width: 460px) {
  html { font-size: 90%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js .reveal,
  .js .rule-draw,
  .js .thread-diagram .stitches {
    opacity: 1;
    transform: none;
    transition: none;
    clip-path: none;
  }

  .frame, .plate, .btn { transition: none; }
}
