/* ============================================================
   THE ECONOMIC WARFARE PROGRAMME — edition VI · the cloister
   Old money × Cold War intelligence × Oxbridge × Vatican gravitas.
   Palette and type per the client brief (Private Brief 01).
   ============================================================ */

:root {
  --night: #0A0D0E;
  --night-2: #0F1315;
  --night-3: #151A1C;
  --parchment: #E8E0D2;
  --archive: #D6CEBF;
  --oxblood: #6F1F28;
  --oxblood-bright: #8E2A35;
  --brass: #A98C57;
  --brass-bright: #C4A76B;

  --ink: #0A0D0E;
  --ink-soft: #3A3E40;
  --ink-muted: #6B6A62;

  --text-c: #BDB6A8;
  --muted: #7E7A70;
  --line: rgba(232, 224, 210, 0.10);
  --line-soft: rgba(232, 224, 210, 0.06);
  --line-brass: rgba(169, 140, 87, 0.42);
  --line-ink: rgba(10, 13, 14, 0.22);
  --line-ink-soft: rgba(10, 13, 14, 0.10);

  --display: "Cormorant Garamond", "Cormorant", "Georgia", serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --nav-h: 78px;
  --pad-section: clamp(6rem, 12vh, 10rem);
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-mech: cubic-bezier(0.4, 0, 0.2, 1);

  --fs-hero: clamp(2.9rem, 6.4vw, 6.2rem);
  --fs-h2: clamp(2rem, 3.6vw, 3.4rem);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; -webkit-text-size-adjust: 100%; }

/* ---------- scrollbar: a brass hairline on night ---------- */
html { scrollbar-width: thin; scrollbar-color: rgba(201, 168, 92, 0.55) var(--night); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: rgba(201, 168, 92, 0.5); border: 2px solid var(--night); }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 168, 92, 0.85); }
::-webkit-scrollbar-corner { background: var(--night); }
body {
  background: var(--night);
  color: var(--text-c);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ol, ul { list-style: none; }
::selection { background: var(--oxblood); color: var(--parchment); }
:focus-visible { outline: 1px solid var(--brass-bright); outline-offset: 3px; }

/* subtle paper grain over everything */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 2000; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  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%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

.container { width: min(1240px, 100% - clamp(2.4rem, 6vw, 6rem)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 400; }
.mono-soft { color: var(--muted); }

/* ---------- the door · you enter the site through it ----------
   One photograph of a door in a whitewashed wall on an Aegean island.
   The stage keeps the photo's 3:2 frame and covers the viewport; the
   scene layer is the photo with the doorway cut out (clip-path hole);
   two leaves, each clipping just its half of the wood, hang in that
   hole and swing inward on their hinges. The zoom layer then pushes the
   camera through the doorway so the hole grows to fill the screen and
   the library behind takes over.
   --dl/--dr/--dt/--db: the door's left/right/top/bottom as % of frame;
   --ds: the seam between the leaves, as % of frame width;
   --dd: how deep the wall is (the reveal), as % of frame width. */
.gate { --dl: 36.26; --dr: 63.35; --dt: 24.71; --db: 88.18; --ds: 49.74; --dd: 9; --dw: calc(var(--dr) - var(--dl)); --dh: calc(var(--db) - var(--dt)); position: fixed; inset: 0; z-index: 1900; overflow: hidden; background: transparent; transition: opacity 0.9s ease 2.3s; }
/* the stage covers the viewport; on wide/short windows it overhangs top and bottom, so rather
   than centring the photo we slide it so the door's centre sits at the viewport centre,
   clamped so the photo still covers the screen. --sh is the stage height. */
.gate__stage { --sw: max(100vw, 150vh); --sh: max(66.667vw, 100vh); position: absolute; left: 50%; top: clamp(100vh - var(--sh), 50vh - var(--sh) * (var(--dt) + var(--db)) / 200, 0px); width: var(--sw); height: var(--sh); transform: translateX(-50%); animation: gate-breathe 18s ease-in-out infinite alternate; will-change: transform; }
.gate__zoom { position: absolute; inset: 0; perspective: 1000px; perspective-origin: 50% 50%; transform-style: preserve-3d; transform-origin: calc((var(--dl) + var(--dr)) / 2 * 1%) calc((var(--dt) + var(--db)) / 2 * 1%); transition: transform 1.9s cubic-bezier(0.55, 0, 0.2, 1) 0.9s; will-change: transform; }
.gate__scene {
  position: absolute; inset: 0;
  background: url("../img/door.jpg") center / 100% 100% no-repeat;
  filter: brightness(0.94) saturate(0.96);
  clip-path: polygon(evenodd,
    0 0, 100% 0, 100% 100%, 0 100%, 0 0,
    calc(var(--dl) * 1%) calc(var(--dt) * 1%),
    calc(var(--dl) * 1%) calc(var(--db) * 1%),
    calc(var(--dr) * 1%) calc(var(--db) * 1%),
    calc(var(--dr) * 1%) calc(var(--dt) * 1%),
    calc(var(--dl) * 1%) calc(var(--dt) * 1%));
}
/* soft vignette so the bright island still reads as a threshold at dusk */
.gate__scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(8, 10, 12, 0.55) 100%); }
/* portrait phones: the photo is 3:2. Covering the viewport (same as desktop)
   crops the island left and right and keeps the door. A smaller walk-through
   scale, because the door already fills most of the width. */
@media (max-aspect-ratio: 4/5) {
  .gate__meta--bl, .gate__label .mono, .gate__label i { display: none; }
  .gate__label { padding: 0.4rem 1.2rem 0.5rem; }
  .gate__label em { font-size: 1.55rem; }
}
/* the reveal: four stone faces receding from the hole into the wall, so the doorway has depth */
.gate__reveal { position: absolute; left: calc(var(--dl) * 1%); top: calc(var(--dt) * 1%); width: calc(var(--dw) * 1%); height: calc(var(--dh) * 1%); transform-style: preserve-3d; pointer-events: none; }
.gate__jamb { position: absolute; backface-visibility: visible; }
.gate__jamb--l, .gate__jamb--r { top: 0; bottom: 0; width: calc(var(--dd) / var(--dw) * 100%); }
.gate__jamb--t, .gate__jamb--b { left: 0; right: 0; height: calc(var(--dd) * 1.5 / var(--dh) * 100%); }
/* sun comes from the left, so the left face is in shade and the right face is lit */
.gate__jamb--l { left: 0; transform-origin: left center; transform: rotateY(90deg); background: linear-gradient(90deg, #d3cbbc, #948c80 55%, #6f685f); }
.gate__jamb--r { right: 0; transform-origin: right center; transform: rotateY(-90deg); background: linear-gradient(-90deg, #f4ede0, #c9c1b3 55%, #9d968a); }
.gate__jamb--t { top: 0; transform-origin: center top; transform: rotateX(-90deg); background: linear-gradient(180deg, #b6aea2, #7a746b 60%, #57524b); }
.gate__jamb--b { bottom: 0; transform-origin: center bottom; transform: rotateX(90deg); background: linear-gradient(0deg, #cfc8ba, #a9a294 60%, #8a8477); }
/* leaves: a face (i) showing just this leaf's slice of the photograph, plus the slab's
   hinge-side edge (b) behind it. The leaf pivots on its BACK corner (transform-origin z = -thickness),
   as a real inward-opening door does, so as it swings the front corner moves into the opening
   and the hinge edge shows as a strip of end-grain next to the jamb. The seam edge turns
   away from the viewer and is never seen, so it is not built. --th: slab thickness, 10% of leaf width. */
.gate__leaf { --th: calc(var(--sw) * var(--lw) / 100 * 0.1); position: absolute; top: calc(var(--dt) * 1%); height: calc(var(--dh) * 1%); transform-style: preserve-3d; transition: transform 2.2s cubic-bezier(0.7, 0, 0.22, 1); will-change: transform; }
.gate__leaf i {
  position: absolute; inset: 0; display: block; backface-visibility: hidden;
  background-image: url("../img/door.jpg"); background-repeat: no-repeat;
  background-size: calc(100% * 100 / var(--lw)) calc(100% * 100 / var(--dh));
  background-position: calc(var(--lx) / (100 - var(--lw)) * 100%) calc(var(--dt) / (100 - var(--dh)) * 100%);
  filter: brightness(0.94) saturate(0.96);
}
/* shade gathers toward the seam and the hinge so the wood reads as heavy */
.gate__leaf i::after { content: ""; position: absolute; inset: 0; pointer-events: none; transition: opacity 1.6s ease; }
.gate__leaf--l i::after { background: linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0%, transparent 22%, transparent 86%, rgba(0, 0, 0, 0.32) 100%); }
.gate__leaf--r i::after { background: linear-gradient(-90deg, rgba(0, 0, 0, 0.28) 0%, transparent 22%, transparent 86%, rgba(0, 0, 0, 0.32) 100%); }
.gate__leaf b { position: absolute; top: 0; bottom: 0; width: var(--th); display: block; backface-visibility: visible; background-image: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 6px, rgba(0, 0, 0, 0.1) 6px 7px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }
.gate__leaf--l { --lw: calc(var(--ds) - var(--dl)); --lx: var(--dl); left: calc(var(--dl) * 1%); width: calc(var(--lw) * 1%); transform-origin: left center calc(-1 * var(--th)); }
.gate__leaf--l b { left: 0; transform-origin: left center; transform: rotateY(90deg); background-color: #6b4d24; background-image: linear-gradient(90deg, #8a6a38, #5c421f 55%, #3a2a12), repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 6px, rgba(0, 0, 0, 0.1) 6px 7px); }
.gate__leaf--r { --lw: calc(var(--dr) - var(--ds)); --lx: var(--ds); left: calc(var(--ds) * 1%); width: calc(var(--lw) * 1%); transform-origin: right center calc(-1 * var(--th)); }
.gate__leaf--r b { right: 0; transform-origin: right center; transform: rotateY(-90deg); background-color: #6b4d24; background-image: linear-gradient(-90deg, #9a7a44, #6a4e26 55%, #443016), repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 6px, rgba(0, 0, 0, 0.1) 6px 7px); }
/* the library's light, leaking through the crack between the leaves */
.gate__seam { position: absolute; left: calc(var(--ds) * 1%); top: calc(var(--dt) * 1%); height: calc(var(--dh) * 1%); width: 2px; margin-left: -1px; transform: translateZ(2px); background: linear-gradient(180deg, transparent, rgba(255, 241, 214, 0.95) 25%, rgba(255, 241, 214, 0.95) 75%, transparent); box-shadow: 0 0 22px 5px rgba(232, 196, 120, 0.45); animation: gate-seam 5s ease-in-out infinite; }
/* late sun from the left */
.gate__lamp { position: absolute; left: -12%; top: -25%; width: 60%; height: 85%; z-index: 3; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 214, 150, 0.16), transparent); mix-blend-mode: screen; animation: gate-lamp 11s ease-in-out infinite alternate; }
.gate__enter { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; cursor: pointer; background: transparent; border: 0; }
.gate__enter:focus-visible { outline: none; }
/* hairline plate frame; brightens when the button holds keyboard focus */
.gate::after { content: ""; position: absolute; inset: 12px; z-index: 5; pointer-events: none; border: 1px solid rgba(201, 168, 92, 0.35); transition: border-color 0.3s ease, opacity 0.4s ease; }
.gate:has(.gate__enter:focus-visible)::after { border-color: rgba(232, 200, 120, 0.8); }
.gate.is-open::after { opacity: 0; }
/* the invitation sits on the wood itself, centred over the seam, just above the lower rail */
.gate__label { position: absolute; z-index: 4; left: calc(var(--ds) * 1%); top: calc(var(--db) * 1%); transform: translate(-50%, calc(-100% - 1.6vmin)) translateZ(3px); display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.7rem 1.5rem 0.75rem; color: var(--parchment); white-space: nowrap; pointer-events: none; background: rgba(14, 11, 8, 0.62); border: 1px solid rgba(201, 168, 92, 0.5); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), inset 0 0 0 3px rgba(14, 11, 8, 0.62), inset 0 0 0 4px rgba(201, 168, 92, 0.22); transition: transform 0.6s var(--ease-out), opacity 0.4s ease, background-color 0.4s ease; }
.gate:has(.gate__enter:hover) .gate__label { background: rgba(14, 11, 8, 0.74); }
.gate__label .mono { color: var(--brass-bright); font-size: 0.58rem; letter-spacing: 0.26em; }
.gate__label i { display: none; }
/* the invitation is spoken in a different tongue every few seconds; the word rises in and out */
.gate__label em { font-family: var(--display); font-style: italic; font-weight: 300; font-size: 1.8rem; letter-spacing: 0.04em; line-height: 1.2; min-width: 10ch; text-align: center; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.95); }
.gate__label em span { display: inline-block; transition: opacity 0.55s ease, transform 0.55s var(--ease-out); }
.gate__label em.is-swapping span { opacity: 0; transform: translateY(0.35em); transition-timing-function: ease-in; }
.gate:has(.gate__enter:hover) .gate__label { transform: translate(-50%, calc(-100% - 1.6vmin - 4px)) translateZ(3px); }
.gate__meta { position: absolute; z-index: 4; color: var(--muted); font-size: 0.6rem; pointer-events: none; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); transition: opacity 0.4s ease; }
.gate__meta--bl { bottom: 1.6rem; left: clamp(1.4rem, 3vw, 3rem); }
.gate__meta--br { bottom: 1.6rem; right: clamp(1.4rem, 3vw, 3rem); }

.gate.is-open { opacity: 0; }
.gate.is-open .gate__stage { animation-play-state: paused; }
.gate.is-open .gate__zoom { transform: scale(4.4); }
@media (max-aspect-ratio: 4/5) {
  .gate.is-open .gate__zoom { transform: scale(2.05); }
}
.gate.is-open .gate__leaf--l { transform: rotateY(104deg); }
.gate.is-open .gate__leaf--r { transform: rotateY(-104deg); }
.gate.is-open .gate__leaf i::after { opacity: 0; }
.gate.is-open .gate__seam, .gate.is-open .gate__lamp, .gate.is-open .gate__label, .gate.is-open .gate__meta { opacity: 0; transition-duration: 0.5s; animation: none; }
.gate.is-open .gate__enter { pointer-events: none; }
.gate.is-done { display: none; }

@keyframes gate-breathe { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.03); } }
@keyframes gate-seam { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.5; } }
@keyframes gate-lamp { from { opacity: 0.7; transform: translate(0, 0); } to { opacity: 1; transform: translate(3%, 2%); } }
/* Library zoom. While the door is opening, body has BOTH is-gated and is-entering.
   Start-scale rules must not apply in that window or they pin the image until
   is-gated is removed (door gone, all text on screen) — which is the late punch-in. */
.hero__media img { transition: transform 2.9s cubic-bezier(0.55, 0, 0.2, 1); will-change: transform; }
body.is-gated:not(.is-entering) .hero__media img { transform: scale(0.8); }
body.is-entering .hero__media img { transform: scale(1); }
@media (min-aspect-ratio: 2/1) { body.is-gated:not(.is-entering) .hero__media img { transform: scale(0.9); } }
@media (min-aspect-ratio: 2.3/1) { body.is-gated:not(.is-entering) .hero__media img { transform: scale(0.93); } }

/* ---------- oxblood progress line ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1200; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--oxblood-bright); transform-origin: left; transform: scaleX(0); }

/* ---------- reveal system ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: var(--reveal-delay, 0ms); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* headline reveals by line, never by letter */
[data-reveal-lines] span { display: block; overflow: hidden; }
[data-reveal-lines] span::after { content: none; }
[data-reveal-lines] span > i, [data-reveal-lines] span { font-style: inherit; }
[data-reveal-lines] > span { clip-path: inset(0 0 100% 0); transform: translateY(0.35em); transition: clip-path 1.1s var(--ease-out), transform 1.1s var(--ease-out); }
[data-reveal-lines] > span:nth-child(2) { transition-delay: 160ms; }
[data-reveal-lines].is-visible > span { clip-path: inset(-0.1em 0 -0.2em 0); transform: none; }

/* stamp: archival label that lands with a slight settle */
.stamp {
  display: inline-block; padding: 0.28rem 0.55rem; margin-right: 0.7rem;
  border: 1px solid var(--oxblood-bright); color: var(--oxblood-bright);
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  transform: scale(1.12) rotate(-1.5deg); opacity: 0;
  transition: transform 0.5s var(--ease-mech) 0.15s, opacity 0.3s ease 0.15s;
}
.is-visible .stamp { transform: none; opacity: 1; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 1rem 1.9rem; border: 1px solid var(--parchment);
  font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--parchment); overflow: hidden;
  transition: color 0.35s var(--ease-mech), border-color 0.35s var(--ease-mech);
}
.btn::before { content: ""; position: absolute; inset: 0; background: var(--parchment); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease-mech); }
.btn span { position: relative; z-index: 1; }
.btn:hover { color: var(--night); }
.btn:hover::before { transform: scaleX(1); }
.btn--fill { background: var(--parchment); color: var(--night); }
.btn--fill::before { background: var(--brass-bright); }
.btn--fill:hover { color: var(--night); border-color: var(--brass-bright); }
.btn--ghost { border-color: rgba(232, 224, 210, 0.35); }
.btn--ghost:hover { border-color: var(--parchment); }

/* ---------- header ---------- */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: var(--nav-h); transition: background 0.5s ease, border-color 0.5s ease; border-bottom: 1px solid transparent; }
.header.is-scrolled { background: rgba(10, 13, 14, 0.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom-color: var(--line); }
.header__inner { height: 100%; display: flex; align-items: center; gap: 2rem; padding-inline: clamp(1.4rem, 3vw, 3rem); }
.brand { display: inline-flex; align-items: center; gap: 0.9rem; color: var(--parchment); }
.brand__mark { width: 30px; height: 30px; color: var(--brass); flex: none; }
.brand__word { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; }
.nav { display: flex; gap: 1.6rem; margin-left: auto; align-items: center; }
.nav__link { position: relative; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-c); padding-block: 0.4rem; transition: color 0.3s; }
.nav__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--brass); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease-mech); }
.nav__link:hover, .nav__link.is-active { color: var(--parchment); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }
.nav__link--cta { color: var(--parchment); border: 1px solid rgba(232, 224, 210, 0.35); padding: 0.55rem 1rem; }
.nav__link--cta::after { display: none; }
.nav__link--cta:hover { border-color: var(--parchment); }
.header__folio { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); padding-left: 1.6rem; border-left: 1px solid var(--line); }
.header__folio .mono { font-size: 0.6rem; }
.header__folio [data-folio-section] { color: var(--brass); min-width: 7ch; }
.header__sep { width: 14px; height: 1px; background: var(--line-brass); }
.burger { display: none; width: 44px; height: 44px; position: relative; margin-left: auto; }
.burger span { position: absolute; left: 11px; right: 11px; height: 1px; background: var(--parchment); transition: transform 0.4s var(--ease-mech), top 0.4s var(--ease-mech); }
.burger span:nth-child(1) { top: 18px; }
.burger span:nth-child(2) { top: 26px; }
.burger.is-open span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.burger.is-open span:nth-child(2) { top: 22px; transform: rotate(-45deg); }

/* mobile menu */
.menu { position: fixed; inset: 0; z-index: 900; background: rgba(10, 13, 14, 0.97); opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.menu[hidden] { display: block; }
.menu.is-open { opacity: 1; pointer-events: auto; }
.menu__inner { height: 100%; padding: calc(var(--nav-h) + 1.5rem) clamp(1.4rem, 6vw, 3rem) 2rem; display: flex; flex-direction: column; overflow-y: auto; }
.menu__label { color: var(--muted); margin-bottom: 1.2rem; }
.menu__link { display: flex; align-items: baseline; gap: 1.2rem; padding: 0.95rem 0; border-top: 1px solid var(--line); font-family: var(--display); font-size: 1.7rem; font-weight: 400; color: var(--parchment); opacity: 0; transform: translateX(-10px); transition: opacity 0.4s ease, transform 0.5s var(--ease-out); }
.menu__link .mono { color: var(--brass); font-size: 0.6rem; min-width: 2.2ch; }
.menu.is-open .menu__link { opacity: 1; transform: none; }
.menu.is-open .menu__link:nth-child(2) { transition-delay: 60ms; } .menu.is-open .menu__link:nth-child(3) { transition-delay: 110ms; } .menu.is-open .menu__link:nth-child(4) { transition-delay: 160ms; } .menu.is-open .menu__link:nth-child(5) { transition-delay: 210ms; } .menu.is-open .menu__link:nth-child(6) { transition-delay: 260ms; } .menu.is-open .menu__link:nth-child(7) { transition-delay: 310ms; } .menu.is-open .menu__link:nth-child(8) { transition-delay: 360ms; } .menu.is-open .menu__link:nth-child(9) { transition-delay: 410ms; } .menu.is-open .menu__link:nth-child(10) { transition-delay: 460ms; }
.menu__foot { margin-top: auto; padding-top: 2rem; border-top: 1px solid var(--line); }
.menu__foot .btn { width: 100%; }

/* ---------- hero · threshold ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; isolation: isolate; }
.hero__media { position: absolute; inset: -4% 0; z-index: -2; will-change: transform; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; filter: saturate(0.88) contrast(1.06); }
.hero__scrim { position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10, 13, 14, 0.42) 0%, rgba(10, 13, 14, 0.06) 22%, rgba(10, 13, 14, 0.08) 72%, var(--night) 100%);
}
.hero__inner { width: min(1240px, 100% - clamp(2.4rem, 6vw, 6rem)); margin-inline: auto; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 3rem; align-items: end; padding-top: calc(var(--nav-h) + 3rem); padding-bottom: 5.5rem; }
.hero__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: clamp(1.5rem, 2.6vw, 2.3rem) clamp(1.4rem, 2.8vw, 2.4rem);
  background: rgba(10, 13, 14, 0.55);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.32);
}
.hero__class { color: var(--brass); margin-bottom: 1.8rem; }
.hero__title { font-family: var(--display); font-weight: 300; font-size: var(--fs-hero); line-height: 0.98; letter-spacing: -0.015em; color: #F3EBDD; margin-bottom: 1.2rem; }
.hero__title span:last-child { font-style: italic; font-weight: 300; }
.hero__kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.3;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin-bottom: 0.9rem;
}
.hero__sub {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(0.78rem, 1vw, 0.9rem);
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--parchment);
  max-width: 32em;
  margin-bottom: 1.5rem;
}
.hero__lede { font-size: clamp(1.05rem, 1.4vw, 1.25rem); line-height: 1.6; color: var(--archive); max-width: 34em; margin-bottom: 1.2rem; }
.hero__list { display: grid; gap: 0.2rem; margin: 0 0 1.2rem; max-width: 36em; }
.hero__list li { position: relative; padding-left: 1.3rem; font-family: var(--display); font-weight: 400; font-size: clamp(1.05rem, 1.25vw, 1.15rem); line-height: 1.4; color: var(--parchment); }
.hero__list li::before { content: "—"; position: absolute; left: 0; color: var(--oxblood-bright); }
.hero__body { font-size: 0.95rem; line-height: 1.6; max-width: 40em; margin-bottom: 1.1rem; color: var(--archive); }
.hero__meta { color: var(--brass-bright); font-size: 0.6rem; line-height: 1.9; margin-bottom: 1.6rem; max-width: 60em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero__foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1.4rem, 3vw, 3rem); border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 0.6rem; }

/* dispatch card */
.dispatch { position: relative; padding: 1.5rem 1.6rem 1.6rem; background: rgba(10, 13, 14, 0.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--line); max-width: 420px; justify-self: end; }
.dispatch::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--oxblood-bright); }
.dispatch__head { color: var(--brass); margin-bottom: 0.9rem; font-size: 0.6rem; }
.dispatch__title { font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--parchment); line-height: 1.1; margin-bottom: 0.7rem; }
.dispatch__body { font-size: 0.9rem; line-height: 1.6; color: var(--text-c); margin-bottom: 1.1rem; }
.dispatch__body--em { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 1.15rem; line-height: 1.35; color: var(--parchment); padding-top: 0.9rem; border-top: 1px solid var(--line); }
.dispatch__link { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--parchment); display: inline-flex; gap: 0.5rem; align-items: center; }
.dispatch__link i { font-style: normal; transition: transform 0.3s var(--ease-mech); }
.dispatch__link:hover i { transform: translateX(4px); }

/* redaction */
.redact { display: inline-block; background: var(--parchment); color: transparent; user-select: none; line-height: 0.9; padding: 0 0.15em; vertical-align: -0.05em; }
.redact--short { min-width: 3.2ch; }
.redact--long { min-width: 9ch; }
.paper .redact { background: var(--ink); }

/* ---------- sections ---------- */
.section { position: relative; padding-block: var(--pad-section); }
.section--deep { background: var(--night-2); }
/* faint cartographic grid on the deep sections */
.section--deep::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 120px 120px; mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 100%); -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 100%); }
/* Folio I: elevation modules, not a corporate square grid */
#anatomy.section--deep::before {
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(200, 196, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 196, 184, 0.045) 1px, transparent 1px);
  background-size: 84px 168px, 210px 84px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.section > .container { position: relative; }

/* rules draw across as the section enters */
.folio { position: relative; max-width: 760px; margin-bottom: clamp(3rem, 6vh, 4.5rem); padding-top: 1.6rem; }
.folio--wide { max-width: 900px; }
.folio::before { content: ""; position: absolute; top: 0; left: 0; height: 1px; width: 100%; background: linear-gradient(90deg, var(--brass) 0, var(--line-brass) 60%, transparent 100%); transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease-out) 0.1s; }
.folio.is-visible::before { transform: scaleX(1); }
.folio__label { color: var(--muted); margin-bottom: 1.4rem; display: flex; align-items: center; }
.folio__title { font-family: var(--display); font-weight: 300; font-size: var(--fs-h2); line-height: 1.05; letter-spacing: -0.01em; color: var(--parchment); margin-bottom: 1.3rem; }
.folio__intro { font-size: clamp(1rem, 1.25vw, 1.12rem); line-height: 1.65; max-width: 40em; }

/* ---------- paper panel · parchment, the recurring material ---------- */
.paper {
  position: relative; color: var(--ink);
  background: radial-gradient(90% 70% at 100% 0%, rgba(255, 250, 240, 0.55), transparent 60%), linear-gradient(160deg, var(--parchment), var(--archive));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}
.paper::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line-ink); pointer-events: none; }
.paper .letter__label { color: var(--oxblood); }
.paper .btn { color: var(--ink); border-color: var(--ink); }
.paper .btn::before { background: var(--ink); }
.paper .btn:hover { color: var(--parchment); }
.paper .btn--fill { background: var(--ink); color: var(--parchment); }
.paper .btn--fill::before { background: var(--oxblood); }
.paper .btn--fill:hover { color: var(--parchment); border-color: var(--ink); }
.paper .btn--ghost { border-color: var(--line-ink); }
.paper .btn--ghost:hover { border-color: var(--ink); }

/* ---------- I · the anatomy of loss · the house that falls from within ---------- */
.house {
  display: grid;
  grid-template-columns: minmax(220px, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(1.6rem, 4vw, 3.6rem);
  align-items: start;
}
.house__plate {
  position: sticky;
  top: calc(var(--nav-h) + 0.6rem);
  margin: 0;
}
.palazzo {
  width: 100%;
  height: auto;
  max-height: calc(100svh - var(--nav-h) - 3.2rem);
  display: block;
  color: var(--archive);
  shape-rendering: geometricPrecision;
}
.palazzo path, .palazzo rect, .palazzo circle, .palazzo polygon { stroke-linecap: square; stroke-linejoin: miter; }
.palazzo .ink { stroke: var(--parchment); fill: none; }
.palazzo .gold { stroke: var(--brass); fill: none; }
.palazzo .ghost { stroke: rgba(232, 224, 210, 0.16); fill: none; }
.palazzo .blood { stroke: var(--oxblood-bright); }
.palazzo .fault-family .blood,
.palazzo .fault-influence .blood,
.palazzo .fault-behaviour .blood { stroke-width: 1.05; }
.palazzo .fault-spine { stroke-width: 0.95; }
.palazzo .fill-gold { fill: rgba(169, 140, 87, 0.10); stroke: none; }
.palazzo .anno { fill: rgba(232, 224, 210, 0.28); font-family: var(--mono); font-size: 7.5px; letter-spacing: 0.16em; }
.palazzo .fault { opacity: 0; transition: opacity 1.15s var(--ease-out); }
.palazzo .fault-spine {
  opacity: 1;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  transition: stroke-dashoffset 1.6s var(--ease-out);
}
.palazzo .crest-intact, .palazzo .door-shut, .palazzo .keystone-present { transition: opacity 1.1s var(--ease-out); }
.house.is-family .fault-family { opacity: 1; }
.house.is-family .crest-intact { opacity: 0.22; }
.house.is-family .fault-spine { stroke-dashoffset: 1180; }
.house.is-influence .fault-influence { opacity: 1; }
.house.is-influence .door-shut { opacity: 0.12; }
.house.is-influence .fault-spine { stroke-dashoffset: 980; }
.house.is-deals .fault-deals { opacity: 1; }
.house.is-deals .fault-spine { stroke-dashoffset: 820; }
.house.is-governance .fault-governance { opacity: 1; }
.house.is-governance .keystone-present { opacity: 0; }
.house.is-governance .fault-spine { stroke-dashoffset: 640; }
.house.is-behaviour .fault-behaviour { opacity: 1; }
.house.is-behaviour .fault-spine { stroke-dashoffset: 420; }
.house.is-marriage .fault-marriage { opacity: 1; }
.house.is-marriage .fault-spine { stroke-dashoffset: 220; }
.house.is-deception .fault-deception { opacity: 1; }
.house.is-deception .fault-spine { stroke-dashoffset: 0; }
.house__caption { margin-top: 0.7rem; color: var(--muted); letter-spacing: 0.14em; font-size: 0.58rem; }
.anatomy { border-top: 1px solid var(--line-brass); }
.anatomy__row { position: relative; display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 0.4rem 1.8rem; align-items: baseline; padding: 1.35rem 0 1.4rem; border-bottom: 1px solid var(--line); }
.anatomy__row::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: var(--oxblood-bright); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease-mech); }
.anatomy__row:hover::before, .anatomy__row.is-lit::before { transform: scaleX(1); }
.anatomy__row dt { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); align-items: baseline; font-family: var(--display); font-weight: 400; font-size: 1.55rem; line-height: 1.1; color: var(--parchment); }
.anatomy__row dt .mono { color: var(--brass); font-size: 0.6rem; }
.anatomy__row dd { font-size: 0.98rem; line-height: 1.6; max-width: 52ch; }
.house + .pull { margin-top: clamp(3rem, 6vh, 4.5rem); }

/* ---------- II · doctrine ---------- */
.letter { max-width: 900px; padding: clamp(2.4rem, 5vw, 4rem) clamp(1.8rem, 5vw, 4.5rem); margin-bottom: clamp(3.5rem, 7vh, 5.5rem); }
.letter__label { margin-bottom: 1.6rem; }
.letter__body p { font-family: var(--display); font-size: clamp(1.15rem, 1.6vw, 1.42rem); font-weight: 400; line-height: 1.5; color: var(--ink); }
.letter__body p + p { margin-top: 1.1rem; }
.letter__body p:first-child::first-letter { font-size: 3.4em; line-height: 0.8; float: left; padding: 0.08em 0.14em 0 0; color: var(--oxblood); font-weight: 400; }
.letter__sign { margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--line-ink); color: var(--ink-muted); }

.failures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; }
.failure { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.failure__num { color: var(--brass); margin-bottom: 1.2rem; }
.failure h3 { font-family: var(--display); font-weight: 400; font-size: 1.55rem; color: var(--parchment); line-height: 1.15; margin-bottom: 0.7rem; }
.failure p:last-child { font-size: 0.95rem; }
.failures--six { gap: 2.6rem 3rem; }
.failures--six .failure__num { margin-bottom: 0.9rem; }
.failures--six .failure h3 { font-size: 1.4rem; }
.failures--six .failure p:last-child { font-size: 0.92rem; }

/* small brass label that introduces a group inside a folio */
.group__label { color: var(--brass); margin-bottom: 1.4rem; }
.group__label--memo { margin-top: clamp(3.5rem, 7vh, 5.5rem); }

/* ---------- II · history · two ledgers, one pattern ---------- */
.ledger + .ledger { margin-top: clamp(3rem, 6vh, 4.5rem); }
.ledger__head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--brass); margin-bottom: 0.4rem; padding-bottom: 0.9rem; }
.cases { border-top: 1px solid var(--line-brass); }
.case { position: relative; display: grid; grid-template-columns: 6.5rem minmax(0, 15rem) minmax(0, 1fr) 9rem; gap: 0.4rem 2rem; align-items: baseline; padding: 1.05rem 0 1.1rem; border-bottom: 1px solid var(--line); transition: background 0.35s ease; }
.case::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: var(--oxblood-bright); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease-mech); }
.case:hover::before { transform: scaleX(1); }
.case__year { color: var(--brass); font-size: 0.62rem; font-variant-numeric: tabular-nums; }
.case__name { font-family: var(--display); font-weight: 400; font-size: 1.35rem; color: var(--parchment); line-height: 1.1; }
.case__text { font-size: 0.9rem; line-height: 1.55; }
.case__tag { color: var(--muted); font-size: 0.58rem; text-align: right; }
.pull--history { margin-top: clamp(3.5rem, 7vh, 5rem); max-width: 30em; }

.teach { margin-top: clamp(3.5rem, 7vh, 5.5rem); }
.teach__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.4rem 3rem;
  border-top: 1px solid var(--line-brass);
  padding-top: 0.35rem;
}
.teach__item { border-top: 1px solid var(--line); padding-top: 1.3rem; }
.teach__num { color: var(--brass); margin-bottom: 0.85rem; }
.teach__item h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--parchment);
  line-height: 1.15;
  margin-bottom: 0.65rem;
}
.teach__item p { font-size: 0.92rem; line-height: 1.6; }
.teach__lesson {
  margin-top: 2.1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-brass);
  max-width: 46em;
}
.teach__lesson > .mono { color: var(--oxblood-bright); margin-bottom: 0.8rem; }
.teach__verdict {
  font-family: var(--display);
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.45;
  color: var(--parchment);
}
.teach__ask-lead { margin-top: 1.15rem; font-size: 0.95rem; color: var(--text-c); }
.teach__ask { margin-top: 0.7rem; display: grid; gap: 0.45rem; }
.teach__ask li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-c);
}
.teach__ask li::before { content: "—"; position: absolute; left: 0; color: var(--oxblood-bright); }

.distinction { margin-top: clamp(3.5rem, 7vh, 5.5rem); }
.distinction .group__label { margin-bottom: 1.5rem; }
.distinction__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 4rem; }
.distinction__pair p {
  font-family: var(--display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.45rem, 2.3vw, 2.05rem);
  line-height: 1.2;
  color: var(--parchment);
  border-top: 1px solid var(--line-brass);
  padding-top: 1.4rem;
}
.distinction__pair .mono {
  display: block;
  font-style: normal;
  color: var(--brass);
  margin-bottom: 0.85rem;
}

/* the loss chain, reconstructed backwards from the outcome */
.chain { margin-top: clamp(3rem, 6vh, 4.5rem); }
.chain__label { color: var(--muted); margin-bottom: 1.2rem; }
/* seven cells in one row; the arrows live in the gutters between them */
.chain__line { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1.4rem; align-items: stretch; }
.chain__step { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--mono); font-size: 0.57rem; letter-spacing: 0.06em; line-height: 1.4; text-transform: uppercase; color: var(--parchment); padding: 0.65rem 0.5rem; border: 1px solid var(--line); background: var(--night); }
.chain__step:last-child { border-color: var(--oxblood-bright); color: var(--oxblood-bright); }
.chain__sep { display: none; color: var(--oxblood-bright); font-family: var(--mono); font-size: 0.75rem; }
.chain__sep + .chain__step::before { content: "→"; position: absolute; top: 50%; left: -1.4rem; width: 1.4rem; transform: translateY(-50%); text-align: center; color: var(--oxblood-bright); font-size: 0.75rem; letter-spacing: 0; }

.folio__intro + .folio__intro { margin-top: 1rem; }

/* ---------- IV · anatomy of human exposure · plate ---------- */
.codex { padding: clamp(1.5rem, 3.5vw, 2.8rem) clamp(1.3rem, 3.5vw, 3rem); margin-bottom: clamp(3.5rem, 7vh, 5.5rem); }
.codex__plate-label { color: var(--oxblood); margin-bottom: 1.5rem; }
.codex__layout { display: grid; grid-template-columns: minmax(240px, 0.95fr) minmax(0, 1.15fr); gap: 1.5rem 2.4rem; align-items: start; }
.codex__plate { margin: 0; position: sticky; top: calc(var(--nav-h) + 0.5rem); }
.anatomia-wrap { position: relative; background: #d9cbb0; }
.anatomia__img { width: 100%; height: auto; display: block; }
.anatomia { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); display: block; }
.anatomia .hit { fill: transparent; cursor: pointer; }
.anatomia .mark { fill: none; stroke: var(--oxblood-bright); stroke-width: 2.2; opacity: 0.55; transition: opacity 0.4s ease, stroke-width 0.4s ease; }
.anatomia .thread { stroke-width: 1.35; }
.anatomia .leaf { fill: rgba(111, 31, 40, 0.22); }
.anatomia .labyrinth { fill: none; stroke: rgba(10, 13, 14, 0.45); stroke-width: 1.2; }
.anatomia .horse { fill: none; stroke: var(--oxblood); stroke-width: 1.6; }
.anatomia .reveal { opacity: 0; transition: opacity 0.45s ease; pointer-events: none; }
.anatomia .myth { font-family: var(--display); font-style: italic; font-size: 22px; fill: var(--ink); }
.anatomia .words { fill: none; stroke: var(--oxblood); stroke-width: 1.2; stroke-dasharray: 4 5; }
@keyframes mark-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.85; }
}
.anatomia .mark { animation: mark-pulse 5.5s ease-in-out infinite; }
.codex[data-active] .mark { animation: none; opacity: 0.2; }
.codex[data-active="1"] .mark--1,
.codex[data-active="2"] .mark--2,
.codex[data-active="3"] .mark--3,
.codex[data-active="4"] .mark--4,
.codex[data-active="5"] .mark--5,
.codex[data-active="6"] .mark--6,
.codex[data-active="7"] .mark--7,
.codex[data-active="8"] .mark--8 { opacity: 1; stroke-width: 3; }
.codex[data-active="1"] .reveal--1,
.codex[data-active="2"] .reveal--2,
.codex[data-active="3"] .reveal--3,
.codex[data-active="4"] .reveal--4,
.codex[data-active="5"] .reveal--5,
.codex[data-active="6"] .reveal--6,
.codex[data-active="7"] .reveal--7,
.codex[data-active="8"] .reveal--8 { opacity: 1; }
.codex[data-active="6"] .thread { stroke-dasharray: 8 6; stroke-dashoffset: 0; animation: thread-draw 1.6s ease forwards; }
@keyframes thread-draw { from { stroke-dashoffset: 220; } to { stroke-dashoffset: 0; } }
.codex__caption { font-family: var(--display); font-style: italic; font-size: 0.9rem; line-height: 1.45; color: var(--ink-soft); margin-top: 1rem; }

.codex__key { display: grid; gap: 0; }
.vector { border-top: 1px solid var(--line-ink); padding: 1rem 0 0.9rem; outline: none; cursor: pointer; }
.vector__num { color: var(--oxblood); margin-bottom: 0.2rem; }
.vector h3 { font-family: var(--display); font-weight: 500; font-size: 1.32rem; color: var(--ink); line-height: 1.15; margin-bottom: 0.45rem; }
.vector > p { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.45rem; }
.vector__q { font-family: var(--display); font-style: italic; color: var(--ink) !important; font-size: 1.02rem !important; margin-bottom: 0 !important; }
.vector:hover, .vector:focus { background: rgba(111, 31, 40, 0.04); }
.codex[data-active="1"] .vector[data-n="1"],
.codex[data-active="2"] .vector[data-n="2"],
.codex[data-active="3"] .vector[data-n="3"],
.codex[data-active="4"] .vector[data-n="4"],
.codex[data-active="5"] .vector[data-n="5"],
.codex[data-active="6"] .vector[data-n="6"],
.codex[data-active="7"] .vector[data-n="7"],
.codex[data-active="8"] .vector[data-n="8"] { border-top-color: var(--oxblood); }

.marginalia { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.4rem; margin-top: clamp(1.8rem, 3vh, 2.6rem); padding-top: 1.2rem; border-top: 1px solid var(--line-ink); }
.marginalia li { padding: 0.85rem 0; border-bottom: 1px solid var(--line-ink-soft); }
.marginalia .mono { color: var(--oxblood); margin-bottom: 0.25rem; }
.marginalia h4 { font-family: var(--display); font-weight: 500; font-size: 1.12rem; color: var(--ink); margin-bottom: 0.3rem; }
.marginalia p { font-size: 0.88rem; color: var(--ink-soft); }

.failure-look { max-width: 48em; margin-bottom: clamp(3rem, 6vh, 4.5rem); }
.failure-look__line { font-family: var(--display); font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.35; color: var(--parchment); margin-bottom: 0.8rem; }
.failure-look__note { font-size: 0.98rem; max-width: 38em; }

.defence { margin-bottom: clamp(3rem, 6vh, 4.5rem); }
.defence__lead { margin-bottom: 1.1rem; max-width: 36em; }
.defence__list { display: grid; gap: 0.55rem; max-width: 46em; }
.defence__list li { position: relative; padding-left: 2.2rem; font-size: 1rem; color: var(--parchment); }
.defence__list li::before { content: counter(def, decimal-leading-zero); counter-increment: def; position: absolute; left: 0; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em; color: var(--brass); top: 0.35rem; }
.defence { counter-reset: def; }

.pressure { max-width: 46em; margin-bottom: clamp(3rem, 6vh, 4.5rem); }
.pressure p { margin-bottom: 1rem; }
.pressure__link a { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--parchment); display: inline-flex; gap: 0.5rem; align-items: center; }
.pressure__link i { font-style: normal; transition: transform 0.3s var(--ease-mech); }
.pressure__link a:hover i { transform: translateX(4px); }
.closing-note { margin-top: 1.4rem; color: var(--muted); font-size: 0.95rem; max-width: 36em; }

/* ---------- V · outer perimeter · the edge of the map ---------- */
.atlas { position: relative; border: 1px solid var(--line-brass); padding: clamp(1.6rem, 4vw, 2.8rem) clamp(1.2rem, 3.2vw, 2.6rem); margin-bottom: clamp(3rem, 6vh, 4.5rem); }
.atlas::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); pointer-events: none; }
.atlas__corner { position: absolute; width: 16px; height: 16px; border-color: var(--brass); border-style: solid; z-index: 1; }
.atlas__corners--tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.atlas__corners--tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.atlas__corners--bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.atlas__corners--br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.atlas__meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--brass); margin-bottom: 1.4rem; }

.horizon { position: relative; width: min(440px, 88%); aspect-ratio: 1; margin: 0.6rem auto 2.6rem; container-type: size; }
.horizon__ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.horizon__grid { fill: none; stroke: var(--line-brass); stroke-width: 0.8; }
.horizon__ring line { stroke: var(--line); stroke-width: 0.6; }
.horizon__rose { fill: var(--oxblood-bright); }
.horizon__ring circle:not(.horizon__grid) { fill: none; stroke: var(--brass); stroke-width: 1.1; }
.horizon__ring circle:last-of-type { fill: var(--oxblood-bright); stroke: none; }
.horizon__cardinal { fill: var(--brass); font-family: var(--mono); font-size: 13px; text-anchor: middle; }
.horizon__core { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--brass); font-size: 0.58rem; line-height: 1.55; pointer-events: none; }
.horizon__stations { position: absolute; inset: 0; }
.horizon__stations li {
  position: absolute; left: 50%; top: 50%; width: 9rem; margin-left: -4.5rem;
  text-align: center; font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--parchment);
  transform: rotate(calc(var(--i) * 60deg)) translateY(calc(-40.5cqmin)) rotate(calc(var(--i) * -60deg));
}
.horizon__stations span { display: block; color: var(--oxblood-bright); margin-bottom: 0.2rem; font-size: 0.52rem; }

.outer { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.outer__item { padding: 1.5rem 1.4rem 1.4rem 0; border-bottom: 1px solid var(--line); }
.outer__item:nth-child(odd) { padding-right: 1.8rem; border-right: 1px solid var(--line); }
.outer__item:nth-child(even) { padding-left: 1.8rem; }
.outer__num { color: var(--brass); margin-bottom: 0.45rem; }
.outer__item h3 { font-family: var(--display); font-weight: 400; font-size: 1.45rem; color: var(--parchment); line-height: 1.15; margin-bottom: 0.55rem; }
.outer__item > p { font-size: 0.92rem; margin-bottom: 0.7rem; }
.outer__item ul { display: grid; gap: 0.3rem; margin-bottom: 0.9rem; }
.outer__item ul li { position: relative; padding-left: 1.15rem; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.outer__item ul li::before { content: "—"; position: absolute; left: 0; color: var(--oxblood-bright); }
.outer__cover { border-top: 1px dashed var(--line); padding-top: 0.75rem; font-size: 0.82rem; color: var(--text-c); }
.outer__cover .mono { display: block; color: var(--brass); margin-bottom: 0.3rem; }

.cartouche { padding: clamp(1.6rem, 3vw, 2.4rem) clamp(1.4rem, 3vw, 2.6rem); margin-top: 2rem; }
.cartouche .letter__label { margin-bottom: 0.9rem; }
.cartouche__lead { font-family: var(--display); font-size: 1.2rem; color: var(--ink); margin-bottom: 1rem; }
.cartouche ol { display: grid; gap: 0.45rem; margin-bottom: 1.2rem; }
.cartouche li { position: relative; padding-left: 2.1rem; color: var(--ink-soft); font-size: 0.98rem; }
.cartouche li::before { content: counter(ask, decimal-leading-zero); counter-increment: ask; position: absolute; left: 0; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em; color: var(--oxblood); top: 0.3rem; }
.cartouche { counter-reset: ask; }
.cartouche__close { color: var(--ink-soft); font-size: 0.95rem; padding-top: 1rem; border-top: 1px solid var(--line-ink); }

.atlas + .pull { margin-top: 0; }

.footnote { margin-top: 1.4rem; color: var(--muted); text-transform: none; letter-spacing: 0.02em; font-size: 0.68rem; max-width: 70em; line-height: 1.7; }

/* ---------- III · field test · command console ---------- */
.console { position: relative; background: var(--night-2); border: 1px solid var(--line); }
.console::after { content: ""; position: absolute; inset: 6px; border: 1px solid var(--line-soft); pointer-events: none; }
.console__head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.8rem; border-bottom: 1px solid var(--line); color: var(--brass); font-size: 0.62rem; }
.console__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.console__inputs { padding: 2rem 1.8rem; display: grid; gap: 1.7rem; border-right: 1px solid var(--line); }
.dial__row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.6rem; }
.dial__row label { font-size: 0.98rem; font-weight: 400; color: var(--parchment); }
.dial__row output { color: var(--brass-bright); font-size: 0.8rem; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.dial__why { margin-top: 0.55rem; color: var(--muted); font-size: 0.6rem; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type="range"]:focus-visible { outline-offset: 6px; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(90deg, var(--brass) var(--fill, 50%), rgba(232, 224, 210, 0.18) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 1px; background: rgba(232, 224, 210, 0.18); }
input[type="range"]::-moz-range-progress { height: 1px; background: var(--brass); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 10px; height: 18px; margin-top: -8.5px; background: var(--parchment); border: 0; border-radius: 0; box-shadow: 0 0 0 1px var(--night); transition: background 0.2s; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 18px; background: var(--parchment); border: 0; border-radius: 0; }
input[type="range"]:active::-webkit-slider-thumb, input[type="range"]:hover::-webkit-slider-thumb { background: var(--brass-bright); }

.console__readout { padding: 2rem 1.8rem; display: flex; flex-direction: column; background: var(--night); }
.readout__label { color: var(--muted); margin-bottom: 1.2rem; }
.readout__score { font-family: var(--display); font-weight: 300; font-size: clamp(4rem, 7vw, 6.2rem); line-height: 0.9; color: var(--parchment); font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 0.5rem; }
.readout__score small { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; color: var(--muted); }
.readout__bar { height: 2px; background: rgba(232, 224, 210, 0.12); margin: 1.4rem 0 1.3rem; }
.readout__bar span { display: block; height: 100%; width: 0; background: var(--brass); transition: width 320ms var(--ease-mech), background 320ms ease; }
.readout__verdict { font-family: var(--display); font-weight: 400; font-size: 1.7rem; line-height: 1.1; color: var(--parchment); margin-bottom: 0.8rem; transition: color 320ms ease; }
.console[data-band="critical"] .readout__verdict { color: #C0554F; }
.console[data-band="critical"] .readout__bar span { background: var(--oxblood-bright); }
.console[data-band="material"] .readout__bar span { background: var(--brass); }
.console[data-band="defensible"] .readout__bar span { background: var(--brass-bright); }
.console[data-band="strategic"] .readout__bar span { background: var(--parchment); }
.readout__note { font-size: 0.9rem; margin-bottom: 1.2rem; }
.readout__weak { margin-top: auto; padding-top: 1.1rem; border-top: 1px dashed var(--line); display: grid; gap: 0.4rem; color: var(--muted); font-size: 0.62rem; }
.readout__weak li { display: flex; justify-content: space-between; gap: 1rem; }
.readout__weak li b { font-weight: 400; color: var(--brass-bright); }
.console__foot { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding: 1.3rem 1.8rem; border-top: 1px solid var(--line); }
.console__disclaimer { color: var(--muted); text-transform: none; letter-spacing: 0.02em; font-size: 0.68rem; max-width: 48em; line-height: 1.6; }

/* ---------- V · programme ---------- */
.spec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem 3rem; margin-bottom: clamp(3.5rem, 7vh, 5.5rem); }
.spec__row { border-top: 1px solid var(--line); padding-top: 1rem; }
.spec__row dt { color: var(--brass); margin-bottom: 0.55rem; }
.spec__row dd { font-size: 0.93rem; line-height: 1.6; }

.modules { margin-bottom: clamp(3.5rem, 7vh, 5.5rem); }
.modules__list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3rem; border-top: 1px solid var(--line-brass); }
.modules__list li { display: grid; grid-template-columns: 3ch 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.modules__list li .mono { color: var(--brass); padding-top: 0.35rem; }
.modules__list strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.3rem; color: var(--parchment); line-height: 1.15; margin-bottom: 0.25rem; }
.modules__list em { display: block; font-size: 0.9rem; font-style: italic; color: var(--muted); }
.modules .footnote { margin-top: 1.2rem; }

.method { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem; margin-bottom: clamp(3.5rem, 7vh, 5.5rem); }
.method__step { border-top: 1px solid var(--line); padding-top: 1.5rem; display: flex; flex-direction: column; }
.method__num { font-family: var(--display); font-size: 2.6rem; font-weight: 300; letter-spacing: 0; text-transform: none; color: var(--brass); line-height: 1; margin-bottom: 1.2rem; }
.method__title { font-family: var(--display); font-weight: 400; font-size: 1.55rem; color: var(--parchment); line-height: 1.15; margin-bottom: 0.7rem; }
.method__step > p:not(.method__num):not(.method__out) { font-size: 0.93rem; margin-bottom: 1.2rem; }
.method__out { margin-top: auto; padding-top: 0.9rem; border-top: 1px dashed var(--line); color: var(--muted); text-transform: none; letter-spacing: 0.02em; font-size: 0.66rem; line-height: 1.6; }

.receives { padding: clamp(2.2rem, 4vw, 3.2rem); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 2rem 4rem; margin-bottom: clamp(3rem, 6vh, 4.5rem); }
.receives__kicker { font-family: var(--display); font-style: italic; font-size: 1.45rem; color: var(--ink); line-height: 1.25; margin: 0.55rem 0 0.9rem; }
.receives__note { color: var(--ink-soft); font-size: 0.95rem; }
.receives__list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 2.4rem; }
.receives__list li { position: relative; padding: 0.75rem 0 0.75rem 1.7rem; border-top: 1px solid var(--line-ink-soft); font-family: var(--display); font-size: 1.15rem; font-weight: 500; color: var(--ink); line-height: 1.3; }
.receives__list li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 9px; height: 9px; border: 1px solid var(--ink); }
.receives__outcome { grid-column: 1 / -1; }
.receives__outcome span { display: block; font-family: var(--sans); font-weight: 400; font-size: 0.78rem; font-style: italic; color: var(--ink-muted); margin-top: 0.35rem; line-height: 1.4; }

.exposure { padding: clamp(2.2rem, 4vw, 3.2rem); margin-bottom: clamp(3rem, 6vh, 4.5rem); }
.exposure__title { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.2rem); color: var(--ink); line-height: 1.15; margin: 0.4rem 0 1.4rem; }
.exposure__body { display: grid; gap: 0.9rem; margin-bottom: 1.8rem; }
.exposure__body p { color: var(--ink-soft); font-size: 0.98rem; max-width: 68ch; }
.exposure .letter__label { margin-bottom: 1rem; }
.exposure__qs { display: grid; gap: 0.15rem; margin-bottom: 1.6rem; }
.exposure__qs li { position: relative; padding: 0.7rem 0 0.7rem 2.4rem; border-top: 1px solid var(--line-ink-soft); color: var(--ink); font-family: var(--display); font-size: 1.12rem; font-weight: 500; line-height: 1.35; }
.exposure__qs li::before { content: counter(q, decimal-leading-zero); counter-increment: q; position: absolute; left: 0; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em; color: var(--oxblood); top: 0.9rem; }
.exposure { counter-reset: q; }
.exposure__result { color: var(--ink-soft); font-size: 0.98rem; max-width: 68ch; padding-top: 1.2rem; border-top: 1px solid var(--line-ink); }

.discernment { margin-bottom: clamp(3rem, 6vh, 4.5rem); }
.discernment__lead { max-width: 42em; margin-bottom: 1.4rem; }
.blade { display: grid; gap: 0; max-width: 38em; border-top: 1px solid var(--line); }
.blade li { display: grid; grid-template-columns: minmax(0, 1fr) 3.4rem minmax(0, 1.2fr); gap: 0.8rem; align-items: baseline; padding: 0.75rem 0; border-bottom: 1px solid var(--line); font-family: var(--display); font-size: 1.35rem; color: var(--muted); }
.blade span:first-child { color: var(--parchment); text-align: right; }
.blade i { font-style: italic; font-size: 0.82rem; color: var(--oxblood-bright); text-align: center; }
.blade span:last-child { color: var(--muted); }

.pull { font-family: var(--display); font-weight: 300; font-style: italic; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.2; color: var(--parchment); max-width: 22em; }
.pull::before { content: ""; display: block; width: 48px; height: 1px; background: var(--oxblood-bright); margin-bottom: 1.4rem; }

/* ---------- V · council ---------- */
.disciplines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.6rem 3rem; margin-bottom: clamp(3.5rem, 7vh, 5.5rem); }
.discipline { border-top: 1px solid var(--line); padding-top: 1.3rem; }
.discipline h3 { font-family: var(--display); font-weight: 400; font-size: 1.45rem; color: var(--parchment); line-height: 1.15; margin-bottom: 0.6rem; }
.discipline p { font-size: 0.93rem; }
.standards { padding: clamp(2.2rem, 4vw, 3.2rem); }
.standards__title { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.3rem); color: var(--ink); line-height: 1.1; margin: 0.6rem 0 1.8rem; }
.standards__list { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 3rem; }
.standards__list div { border-top: 1px solid var(--line-ink); padding-top: 1rem; }
.standards__list dt { color: var(--oxblood); margin-bottom: 0.5rem; }
.standards__list dd { color: var(--ink-soft); font-size: 0.95rem; }
.disciplines--four { grid-template-columns: repeat(4, 1fr); gap: 2.4rem 2.6rem; }
.disciplines--four .discipline h3 { font-size: 1.3rem; }
.disciplines--four .discipline p { font-size: 0.9rem; }
.standards__body { display: grid; gap: 0.9rem; max-width: 72ch; }
.standards__body p { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.65; }

/* ---------- VI · intelligence · the memorandum ---------- */
.memo { max-width: 920px; padding: 0; }
.memo__head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.1rem clamp(1.4rem, 3.5vw, 2.8rem); border-bottom: 1px solid var(--line-ink); color: var(--ink-muted); font-size: 0.62rem; }
.memo__class { color: var(--oxblood); border: 1px solid var(--oxblood); padding: 0.2rem 0.55rem; transform: rotate(-1deg); }
.memo__body { padding: clamp(1.8rem, 4vw, 3rem) clamp(1.4rem, 3.5vw, 2.8rem); }
.memo__body p { font-size: 1rem; line-height: 1.7; color: var(--ink-soft); max-width: 66ch; }
.memo__body p + p { margin-top: 1rem; }
.memo__section { color: var(--oxblood) !important; margin: 1.6rem 0 0.9rem !important; }
.memo__section:first-child { margin-top: 0 !important; }
.memo__body em { color: var(--ink); font-style: italic; }
.memo__body .mono { font-size: 0.72rem; color: var(--ink); text-transform: none; letter-spacing: 0.06em; }
.memo__foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.1rem clamp(1.4rem, 3.5vw, 2.8rem); border-top: 1px solid var(--line-ink); color: var(--ink-muted); font-size: 0.62rem; }
.memo__foot a { color: var(--ink); display: inline-flex; gap: 0.5rem; }
.memo__foot a i { font-style: normal; }
.memo__foot a:hover { color: var(--oxblood); }

/* ---------- VII · admission ---------- */
.admission { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem 4rem; align-items: start; margin-bottom: clamp(4rem, 8vh, 6rem); }
.admission__criteria .letter__label { color: var(--brass); margin-bottom: 1.4rem; }
.criteria li { padding: 1.1rem 0; border-top: 1px solid var(--line); font-size: 0.95rem; }
.criteria li:last-child { border-bottom: 1px solid var(--line); }
.criteria strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.35rem; color: var(--parchment); margin-bottom: 0.3rem; }
.admission__process { padding: clamp(2rem, 4vw, 3rem); }
.process { display: grid; gap: 0.2rem; margin-top: 1.4rem; }
.process li { display: grid; grid-template-columns: 3ch 1fr; gap: 1.2rem; padding: 1rem 0; border-top: 1px solid var(--line-ink-soft); font-size: 0.95rem; color: var(--ink-soft); }
.process li .mono { color: var(--oxblood); padding-top: 0.25rem; }
.process strong { display: block; font-family: var(--display); font-weight: 500; font-size: 1.25rem; color: var(--ink); margin-bottom: 0.2rem; }
.admission__actions { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; margin-top: 1.8rem; padding-top: 1.6rem; border-top: 1px solid var(--line-ink); }
.admission__meta { color: var(--ink-muted); font-size: 0.6rem; }
.process .fee { font-family: var(--mono); font-weight: 500; font-size: 0.9rem; letter-spacing: 0.04em; color: var(--oxblood); }

.isnot { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem 4rem; margin-bottom: clamp(3.5rem, 7vh, 5.5rem); }
.isnot__head { margin-bottom: 1rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.isnot__head--is { color: var(--brass); }
.isnot__head--not { color: var(--oxblood-bright); }
.isnot li { position: relative; padding: 0.45rem 0 0.45rem 1.4rem; font-size: 0.95rem; }
.isnot li::before { content: "—"; position: absolute; left: 0; color: var(--brass); }
.isnot__col:last-child li::before { color: var(--oxblood-bright); }

.standards--partners { margin-bottom: clamp(4rem, 8vh, 6rem); }
.standards--partners .standards__title { max-width: 26em; }
.closing { text-align: center; padding-top: clamp(2rem, 5vh, 4rem); border-top: 1px solid var(--line); }
.closing__text { font-family: var(--display); font-weight: 300; font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 1; color: var(--parchment); margin-bottom: 1rem; }
.closing__sub { max-width: 34em; margin-inline: auto; font-size: 1rem; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 4rem 0 2rem; background: var(--night-2); }
.footer__grid { display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr)); gap: 2.5rem 3rem; margin-bottom: 3rem; }
.footer__brand .brand__mark { width: 34px; height: 34px; margin-bottom: 1.2rem; }
.footer__name { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--parchment); margin-bottom: 0.7rem; }
.footer__line { font-size: 0.92rem; max-width: 30em; }
.footer__col { text-transform: none; letter-spacing: 0.04em; font-size: 0.7rem; color: var(--muted); display: grid; gap: 0.45rem; align-content: start; }
.footer__head { text-transform: uppercase; letter-spacing: 0.14em; color: var(--brass); font-size: 0.6rem; margin-bottom: 0.4rem; }
.footer__col a:hover { color: var(--parchment); }
.footer__legal { border-top: 1px solid var(--line); padding-top: 1.4rem; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 1rem 3rem; color: var(--muted); text-transform: none; letter-spacing: 0.02em; font-size: 0.64rem; line-height: 1.7; }
.footer__legal p:last-child { text-align: right; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10, 13, 14, 0.8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity 0.4s ease; }
.modal.is-open .modal__backdrop { opacity: 1; }
.modal__card { width: min(540px, 100%); max-height: calc(100vh - 3rem); max-height: calc(100svh - 3rem); overflow-y: auto; padding: clamp(2rem, 5vw, 3rem); opacity: 0; transform: translateY(20px); transition: opacity 0.45s var(--ease-out), transform 0.5s var(--ease-out); }
.modal.is-open .modal__card { opacity: 1; transform: none; }
.modal__card.paper::before { display: none; }
.modal__close { position: absolute; top: 1rem; right: 1rem; width: 40px; height: 40px; z-index: 2; }
.modal__close span { position: absolute; left: 10px; right: 10px; top: 19.5px; height: 1px; background: var(--ink); transition: background 0.3s; }
.modal__close span:nth-child(1) { transform: rotate(45deg); }
.modal__close span:nth-child(2) { transform: rotate(-45deg); }
.modal__close:hover span { background: var(--oxblood); }
.modal__class { color: var(--oxblood); margin-bottom: 1rem; }
.modal__title { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.05; color: var(--ink); margin-bottom: 0.9rem; }
.modal__sub { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 1.8rem; }

.form { display: flex; flex-direction: column; gap: 1.3rem; }
.form__field { display: flex; flex-direction: column; gap: 0.45rem; }
.form__field label { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }
.form__field label small { text-transform: none; letter-spacing: 0.02em; }
.form__field input, .form__field textarea { background: transparent; border: 0; border-bottom: 1px solid var(--line-ink); border-radius: 0; padding: 0.6rem 0.1rem; font-family: var(--sans); font-weight: 400; font-size: 1rem; color: var(--ink); transition: border-color 0.3s; resize: vertical; }
.form__field input:focus, .form__field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.form__error { font-size: 0.86rem; color: var(--oxblood); }
.form__alt { color: var(--ink-muted); text-align: center; text-transform: none; letter-spacing: 0.02em; font-size: 0.66rem; }
.form__alt a { color: var(--oxblood); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1500px) {
  .header__folio { display: none; }
}
@media (max-width: 1300px) {
  .nav { gap: 1.2rem; }
  .nav__link { letter-spacing: 0.1em; font-size: 0.6rem; }
}
@media (max-width: 1180px) {
  .nav { display: none; }
  .burger { display: block; }
}
@media (max-width: 1080px) {
  .hero__content { padding: 1.4rem 1.25rem 1.55rem; }
  .hero__inner { grid-template-columns: 1fr; align-items: start; gap: 2.5rem; }
  .dispatch { justify-self: start; max-width: 460px; }
  .codex__layout { grid-template-columns: 1fr; }
  .codex__plate { position: relative; top: auto; max-width: 440px; }
  .house { grid-template-columns: minmax(200px, 0.78fr) minmax(0, 1.22fr); }
  .anatomy__row { grid-template-columns: 1fr; gap: 0.35rem; }
  .method { grid-template-columns: 1fr 1fr; gap: 2.5rem 3rem; }
  .disciplines, .disciplines--four { grid-template-columns: 1fr 1fr; }
  .spec { grid-template-columns: 1fr 1fr; }
  .failures--six { grid-template-columns: 1fr 1fr; }
  .teach__grid { gap: 2rem 2.4rem; }
  .chain__line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.6rem; }
  .chain__step { padding: 0.6rem 0.85rem; }
  .chain__sep { display: inline; }
  .chain__sep + .chain__step::before { content: none; }
  .case { grid-template-columns: 6rem minmax(0, 1fr) 8rem; }
  .case__text { grid-column: 2 / 3; }
  .case__tag { grid-column: 3 / 4; grid-row: 1; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .console__grid { grid-template-columns: 1fr; }
  .console__inputs { border-right: 0; border-bottom: 1px solid var(--line); }
  .receives { grid-template-columns: 1fr; gap: 1.6rem; }
  .marginalia { grid-template-columns: 1fr; }
  .receives__list { grid-template-columns: 1fr; }
  .admission { grid-template-columns: 1fr; gap: 2.5rem; }
  .failures, .failures--six { grid-template-columns: 1fr; gap: 2rem; }
  .teach__grid, .distinction__pair { grid-template-columns: 1fr; }
  .outer { grid-template-columns: 1fr; }
  .outer__item:nth-child(odd) { padding-right: 0; border-right: 0; }
  .outer__item:nth-child(even) { padding-left: 0; }
  .house { grid-template-columns: 1fr; }
  .house__plate {
    position: sticky;
    top: var(--nav-h);
    z-index: 3;
    background: linear-gradient(180deg, var(--night-2) 72%, rgba(15, 19, 21, 0.92) 88%, transparent);
    padding-bottom: 0.35rem;
  }
  .palazzo { max-height: 50vh; }
  .palazzo .anno { display: none; }
  .anatomy__row { grid-template-columns: 1fr; gap: 0.35rem; padding: 1.1rem 0; }
  .anatomy__row dt { font-size: 1.4rem; }
  .standards__list { grid-template-columns: 1fr; }
  .modules__list { grid-template-columns: 1fr; }
  .isnot { grid-template-columns: 1fr; gap: 2rem; }
  .spec { grid-template-columns: 1fr; gap: 1.2rem; }
  .case { grid-template-columns: 1fr; gap: 0.3rem; padding: 1rem 0; }
  .case__text { grid-column: auto; }
  .case__tag { grid-column: auto; grid-row: auto; text-align: left; }
  .footer__legal { grid-template-columns: 1fr; }
  .footer__legal p:last-child { text-align: left; }
}
@media (max-width: 640px) {
  html { font-size: 16.5px; }
  .brand__word { display: none; }
  .hero__inner { padding-bottom: 4.5rem; }
  .hero__foot span:nth-child(2) { display: none; }
  .hero__actions .btn { width: 100%; }
  .codex { padding: 1.4rem 1.15rem; }
  .horizon { width: min(320px, 100%); margin-bottom: 1.8rem; }
  .method { grid-template-columns: 1fr; gap: 2.2rem; }
  .disciplines { grid-template-columns: 1fr; gap: 2rem; }
  .footer__grid { grid-template-columns: 1fr; }
  .console__foot .btn { width: 100%; }
  .admission__actions .btn { width: 100%; }
  .memo__head, .memo__foot { flex-direction: column; gap: 0.6rem; }
  .memo__class { align-self: flex-start; }
}
@media (max-width: 400px) {
  html { font-size: 16px; }
  .container, .hero__inner { width: calc(100% - 2rem); }
  .hero__title { font-size: 2.6rem; }
  .letter, .receives, .standards, .admission__process, .codex, .cartouche, .exposure { padding: 1.6rem 1.2rem; }
  .paper::before { inset: 6px; }
  .console__inputs, .console__readout { padding-inline: 1.2rem; }
  .console__head, .console__foot { padding-inline: 1.2rem; }
  .dispatch { padding: 1.2rem 1.2rem 1.3rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal], .stamp, .folio::before, [data-reveal-lines] > span { transition: none !important; opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .hero__media { transform: none !important; }
  .hero__media img { transition: none !important; transform: none !important; }
  .readout__bar span, .btn::before, .case::before, .anatomy__row::before, .nav__link::after { transition: none !important; }
  .palazzo .fault { opacity: 1 !important; }
  .palazzo .fault-spine { stroke-dashoffset: 0 !important; transition: none !important; }
  .palazzo .keystone-present, .palazzo .crest-intact, .palazzo .door-shut { opacity: 0.15 !important; }
  .anatomia .mark { animation: none !important; opacity: 0.7 !important; }
  .codex[data-active="6"] .thread { animation: none !important; }
  /* the door simply fades; no swing, no breathing */
  .gate__stage, .gate__seam, .gate__lamp { animation: none !important; }
  .gate__label em span { transition: none !important; }
  .gate { transition: opacity 0.6s ease 0s; }
  .gate.is-open .gate__zoom, .gate.is-open .gate__leaf--l, .gate.is-open .gate__leaf--r { transform: none; transition: none; }
}
