/* ============================================================
   V4 — Khalid Alsuwailem
   Desert worlds behind (unchanged engine), v3 instrumented
   front above: Fraunces + IBM Plex Mono, the funnel gauge,
   world-reveal doors. Type: editorial serif scale; mono is
   instrumentation only, never body copy, never below 11px in
   the content flow.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

img, svg, canvas { display: block; max-width: 100%; }

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

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

ul { list-style: none; }

/* ---------- Tokens ---------- */
:root {
  /* Ink & bioluminescence (v3) */
  --ink: #f4f1ea;
  --ink-soft: rgba(244, 241, 234, 0.8);
  --ink-dim: rgba(244, 241, 234, 0.6);
  --gold: #a59882;
  --gold-hi: #c9b998;
  --core: #e8d9b8;
  --dim: #857b6f;
  --line: rgba(164, 152, 130, 0.3);
  --line-faint: rgba(164, 152, 130, 0.14);

  /* Navy system (canvas mirrors these) */
  --navy-0: #0a1e36;
  --navy-1: #081831;
  --navy-2: #050f22;
  --navy-3: #03091a;
  --navy-4: #02060f;

  /* Readability scrim: rgb triplet, no visible edges */
  --scrim: 2, 6, 15;

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", monospace;

  /* Rhythm */
  --sp-1: 0.5rem; --sp-2: 1rem; --sp-3: 1.5rem;
  --sp-4: 2.25rem; --sp-5: 3.5rem; --sp-6: 5.5rem; --sp-7: 8rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 68rem;
}

/* ---------- Base ---------- */
body {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.0625rem;           /* 17px floor for all reading text */
  line-height: 1.65;
  color: var(--ink);
  background: var(--navy-4);
  overflow-x: hidden;
}

::selection { background: rgba(164, 152, 130, 0.35); color: var(--core); }

.mono { font-family: var(--mono); }

/* The old site's signature: italic gold accent inside serif prose */
.accent { font-style: italic; color: var(--gold-hi); }

.wrap-anywhere { overflow-wrap: anywhere; word-break: break-word; }

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

.skip {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 300;
  padding: 0.6rem 1rem;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em;
  color: var(--core); background: var(--navy-3);
  border: 1px solid var(--line);
  transform: translateY(-300%);
  transition: transform 0.2s var(--ease-out);
}
.skip:focus-visible { transform: translateY(0); }

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

/* ---------- Background layers (desert, exactly as-is) ---------- */
#scene {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  display: block;
}

#veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 10%, transparent 40%, rgba(6, 14, 26, 0.55) 100%),
              radial-gradient(140% 120% at 50% 120%, rgba(6, 14, 26, 0.4), transparent 60%);
}

#grain {
  position: fixed; inset: -50%; z-index: 2; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-2%, -3%); }
  20% { transform: translate(3%, 2%); }
  30% { transform: translate(-3%, 3%); }
  40% { transform: translate(2%, -2%); }
  50% { transform: translate(-2%, 2%); }
  60% { transform: translate(3%, -3%); }
  70% { transform: translate(-3%, -2%); }
  80% { transform: translate(2%, 3%); }
  90% { transform: translate(-2%, 2%); }
}

/* ---------- No-3D fallback (v3 funnel-glow story) ---------- */
html.no3d body {
  background:
    radial-gradient(38% 52% at 50% calc(128% - var(--depthFrac, 0) * 36%),
      rgba(232, 217, 184, calc(0.10 - var(--depthFrac, 0) * 0.08)) 0%,
      rgba(201, 185, 152, calc(0.05 - var(--depthFrac, 0) * 0.04)) 34%,
      rgba(10, 30, 54, 0) 70%),
    radial-gradient(120% 90% at 50% calc(0% - var(--depthFrac, 0) * 22%),
      rgba(10, 30, 54, 0.9) 0%, rgba(8, 24, 49, 0.55) 38%, rgba(5, 15, 34, 0) 72%),
    radial-gradient(24% 30% at 50% calc(112% + var(--depthFrac, 0) * 10%),
      rgba(201, 185, 152, calc(0.04 + var(--depthFrac, 0) * 0.10)) 0%,
      rgba(2, 6, 15, 0) 62%),
    linear-gradient(to bottom,
      rgb(calc(10 - 9 * var(--depthFrac, 0)),
         calc(30 - 27 * var(--depthFrac, 0)),
         calc(54 - 45 * var(--depthFrac, 0))),
      rgb(calc(10 - 9 * var(--depthFrac, 0)),
          calc(30 - 27 * var(--depthFrac, 0)),
          calc(54 - 45 * var(--depthFrac, 0))));
  background-attachment: fixed;
}

/* ---------- Headlamp (v3; above content so it lights everything) ---------- */
#lamp {
  position: fixed; top: 0; left: 0;
  width: 46rem; height: 46rem;
  margin: -23rem 0 0 -23rem;
  background: radial-gradient(
    circle closest-side,
    rgba(232, 217, 184, 0.14) 0%,
    rgba(201, 185, 152, 0.075) 26%,
    rgba(164, 152, 130, 0.032) 52%,
    rgba(164, 152, 130, 0) 74%
  );
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: transform;
}
#lamp.live { opacity: 1; }

/* The headlamp is a light that follows the pointer —
   the native cursor stays visible so the user is never lost */

/* Smaller light pool on small screens */
@media (max-width: 640px) {
  #lamp {
    width: 26rem; height: 26rem;
    margin: -13rem 0 0 -13rem;
  }
}

main, footer { position: relative; z-index: 5; }

/* ============================================================
   FUNNEL GAUGE — the soul instrument (v3 logic, stage bands)
   (fixed decoration: readouts may go to 10px, nowhere else)
   ============================================================ */
.gauge {
  position: fixed;
  left: clamp(1rem, 2.4vw, 2.5rem);
  top: 50%; transform: translateY(-50%);
  z-index: 40;
  display: flex; align-items: center; gap: 0.9rem;
  opacity: 0;
  transition: opacity 0.8s ease 0.4s;
  pointer-events: none;
}
html.js .gauge { opacity: 1; }
@media (max-width: 899px) { .gauge { display: none; } }

.g-scale {
  position: relative;
  width: 0.5rem; height: min(58vh, 34rem);
  border: 1px solid var(--line-faint);
  border-radius: 1px;
  overflow: hidden;
  background: rgba(2, 6, 15, 0.5);
}

/* Stage bands, heights = the five stages' share of the journey */
.g-band { position: absolute; left: 0; right: 0; }
.b-sun  { top: 0%;      height: 3.1%;   background: rgba(10, 30, 54, 0.9); }
.b-twi  { top: 3.1%;    height: 10.8%;  background: rgba(8, 24, 49, 0.9); }
.b-mid  { top: 13.9%;   height: 26.1%;  background: rgba(5, 15, 34, 0.92); }
.b-aby  { top: 40%;     height: 30.8%;  background: rgba(3, 9, 26, 0.95); }
.b-had  { top: 70.8%;   height: 29.2%;  background: var(--navy-4); }

.g-ticks {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(201, 185, 152, 0.4) 0 1px,
    transparent 1px calc(100% / 13)
  );
  opacity: 0.5;
}

.g-cursor {
  position: absolute; left: -0.35rem; right: -0.35rem;
  top: 0; height: 0;
  will-change: transform;
}
.g-cursor i {
  display: block; height: 1px;
  background: var(--core);
  box-shadow: 0 0 8px rgba(232, 217, 184, 0.8), 0 0 22px rgba(201, 185, 152, 0.35);
}
.g-cursor::before {
  content: "";
  position: absolute; left: -0.15rem; top: -2.5px;
  width: 6px; height: 6px;
  background: var(--core);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(232, 217, 184, 0.9);
}

.g-read { font-family: var(--mono); color: var(--gold-hi); }
.g-depth {
  font-size: 1.1rem; color: var(--core);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px rgba(232, 217, 184, 0.25);
  white-space: nowrap;
}
.g-unit { font-size: 0.625rem; color: var(--dim); letter-spacing: 0.15em; }
.g-zone {
  margin-top: 0.3rem;
  font-size: 0.625rem; letter-spacing: 0.22em;
  color: var(--gold);
  white-space: nowrap;
}
.g-line {
  margin-top: 0.35rem;
  font-size: 0.625rem; letter-spacing: 0.1em;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Compact gauge — small screens */
.gauge-mini {
  position: fixed;
  left: 0.75rem; bottom: 0.75rem;
  z-index: 40;
  padding: 0.4rem 0.65rem;
  font-size: 0.625rem; letter-spacing: 0.08em;
  color: var(--gold-hi);
  background: rgba(2, 6, 15, 0.72);
  border: 1px solid var(--line-faint);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
@media (min-width: 900px) { .gauge-mini { display: none; } }
html:not(.js) .gauge-mini { display: none; }
.gm-sep { margin: 0 0.4em; color: var(--dim); }

/* ============================================================
   HEADER (v3)
   ============================================================ */
.site-head {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(2, 6, 15, 0.82), rgba(2, 6, 15, 0));
  padding: 1.1rem clamp(1rem, 4vw, 3rem) 2.2rem;
}

.head-inner {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 1rem;
}
/* The single logo lives in the hero; the header carries only the nav. */
.head-spacer { display: none; }

.site-nav { display: flex; gap: clamp(0.9rem, 2.4vw, 2rem); }
.site-nav a {
  font-size: 0.6875rem; letter-spacing: 0.12em;
  color: var(--ink-soft);
  padding: 0.3rem 0;
  position: relative;
  transition: color 0.25s ease;
}
.site-nav a .n { color: var(--dim); margin-right: 0.4em; font-size: 0.625rem; }
.site-nav a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--core); }
.site-nav a:hover::after, .site-nav a:focus-visible::after { transform: scaleX(1); }

@media (max-width: 640px) {
  .site-nav { gap: 0.8rem; }
  .site-nav a { font-size: 0.6875rem; letter-spacing: 0.06em; }
  .site-nav a .n { display: none; }
}
@media (max-width: 380px) {
  .site-nav { gap: 0.55rem; }
}

/* ============================================================
   LAYOUT — one continuous descent (v3)
   ============================================================ */
.wrap {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin-inline: auto;
}
.wrap-narrow { width: min(44rem, calc(100% - 2.5rem)); }

/* The mooring line: ONE unbroken thread through every stage */
main::before {
  content: "";
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(164, 152, 130, 0),
    rgba(164, 152, 130, 0.18) 4%,
    rgba(164, 152, 130, 0.18) 96%,
    rgba(164, 152, 130, 0)
  );
  z-index: 0;
  pointer-events: none;
}
@media (max-width: 899px) { main::before { display: none; } }

.station .wrap { position: relative; z-index: 1; }

/* ---------- Hero (v3, exactly) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 7rem 0 6rem;
}

/* Hero brand mark — the identity anchor, glowing above the fold.
   Wrapped in a link back to the top. */
.hero-logo-link {
  display: block;
  width: fit-content;
  margin-bottom: clamp(1.5rem, 3.5vh, 2.5rem);
}
.hero-logo {
  display: block;
  width: clamp(180px, 22vw, 320px);
  height: auto;
  filter: brightness(1.08) drop-shadow(0 10px 42px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 26px rgba(165, 152, 130, 0.28));
  transition: filter 0.5s ease;
}
.hero-logo:hover {
  filter: brightness(1.18) drop-shadow(0 10px 42px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 40px rgba(201, 185, 152, 0.45));
}

.zone-tag {
  font-size: 0.6875rem; letter-spacing: 0.26em;
  color: var(--gold);
  margin-bottom: var(--sp-3);
}

.masthead {
  font-weight: 500;
  font-size: clamp(2.6rem, 9.6vw, 8.4rem);
  line-height: 1.04;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-shadow: 0 2px 40px rgba(2, 6, 15, 0.55);
  white-space: nowrap;
  width: fit-content;
  max-width: 100%;
}

/* On narrow screens a single-line ALSUWAILEM would shrink too far —
   let it break into the two stacked words only below 560px */
@media (max-width: 560px) {
  .masthead { white-space: normal; overflow-wrap: anywhere; }
}

.hero-copy { max-width: 34rem; text-shadow: 0 1px 22px rgba(2, 6, 15, 0.4); }
.hero-copy .lead {
  font-size: clamp(1.12rem, 1.8vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink);
}
.hero-copy p { color: var(--ink-soft); margin-top: var(--sp-3); }

/* Descent cue */
.descent-cue {
  position: absolute;
  left: 50%; bottom: 2rem;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-size: 0.6875rem; letter-spacing: 0.3em;
  color: var(--gold-hi);
  padding: 0.5rem;
  transition: color 0.3s ease;
}
.descent-cue:hover, .descent-cue:focus-visible { color: var(--core); }
.cue-line {
  position: relative;
  width: 1px; height: 3.4rem;
  background: linear-gradient(to bottom, var(--gold), transparent);
  overflow: hidden;
}
.cue-line::after {
  content: "";
  position: absolute; left: -1px; top: -30%;
  width: 3px; height: 30%;
  background: var(--core);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(232, 217, 184, 0.9);
  animation: bead 2.6s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
@keyframes bead {
  0%   { top: -30%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 105%; opacity: 0; }
}
.cue-arrow { font-size: 0.85rem; color: var(--gold); }

/* The four channels feeding the mouth — one line, under the cue */
.channel-caption {
  position: absolute;
  left: 50%; bottom: 0.8rem;
  transform: translateX(-50%);
  font-size: 0.6875rem;           /* 11px, same floor as the cue */
  letter-spacing: 0.24em;
  color: var(--gold);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 12px rgba(2, 6, 15, 0.7);
}
@media (max-width: 400px) {
  .channel-caption { letter-spacing: 0.12em; }
}

/* ============================================================
   STATIONS (v3 layouts)
   ============================================================ */
.station {
  position: relative;
  display: flex; align-items: center;
  min-height: 92vh;
  padding: clamp(6rem, 14vh, 10rem) 0;
  scroll-margin-top: 5.5rem;
}

/* Content floats on the worlds. A soft scrim — not a box — keeps
   the prose readable over the canvas. */
.flow {
  position: relative;
  z-index: 1;
  padding: clamp(1.25rem, 3vh, 2.5rem) clamp(0.75rem, 2.5vw, 2.5rem);
}
.flow::before {
  content: "";
  position: absolute;
  inset: -3rem -2.75rem;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to right,
      rgba(var(--scrim), 0) 0%,
      rgba(var(--scrim), 0.42) 16%,
      rgba(var(--scrim), 0.5) 50%,
      rgba(var(--scrim), 0.42) 84%,
      rgba(var(--scrim), 0) 100%),
    linear-gradient(to bottom,
      rgba(var(--scrim), 0) 0%,
      rgba(var(--scrim), 0.38) 9%,
      rgba(var(--scrim), 0.34) 91%,
      rgba(var(--scrim), 0) 100%);
}
@media (max-width: 700px) {
  .flow { padding: 1rem 0.5rem; }
  .flow::before { inset: -2rem -1.25rem; }
}

.station-head { margin-bottom: clamp(2.75rem, 7vh, 4.25rem); }
.station-head h2 {
  font-weight: 500;
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  line-height: 1.06;
  color: var(--ink);
  text-wrap: balance;
}
.station-note {
  margin-top: 1.25rem;
  max-width: 46rem;
  color: var(--ink-soft);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.6;
}

.writing-motto {
  margin-top: 1.25rem;
  font-size: clamp(1.5rem, 2.8vw, 2.05rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
  color: var(--gold-hi);
}

/* About prose — serif, 62 characters, generous air */
.prose { max-width: 62ch; }
.prose .lead {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink);
}
.prose p { margin-top: var(--sp-3); color: var(--ink-soft); }
.prose .sub {
  margin-top: clamp(3rem, 7vh, 4.5rem);
  font-size: 0.6875rem; letter-spacing: 0.28em;
  color: var(--gold);
  font-weight: 500;
}
.prose .sub + p { margin-top: var(--sp-2); }

/* ============================================================
   WORK — specimen observations (v3)
   ============================================================ */
.obs-list {
  display: grid;
  gap: clamp(3.5rem, 9vh, 6rem);
  max-width: 64rem;
}

.obs-head {
  display: flex; align-items: center; gap: 1.25rem;
  margin-bottom: clamp(1.25rem, 3vh, 1.9rem);
}
.obs-depth {
  font-size: 0.6875rem; letter-spacing: 0.22em;
  color: var(--gold);
  white-space: nowrap;
}
.obs-line {
  flex: 1; height: 1px;
  background: linear-gradient(to right, rgba(164, 152, 130, 0.55), rgba(164, 152, 130, 0.05));
  transform-origin: left center;
  transition: transform 1.2s var(--ease-out) 0.1s;
}
html.js .obs-line { transform: scaleX(0); }
html.js .observation.revealed .obs-line { transform: scaleX(1); }

.obs-body {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}
.obs-body h3 {
  font-weight: 500;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1.12;
  color: var(--core);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.obs-tag {
  margin-top: 0.85rem;
  font-size: 0.6875rem; letter-spacing: 0.24em;
  color: var(--gold);
}
.obs-text {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 56ch;
  padding-top: 0.35rem;
}
@media (max-width: 760px) {
  .obs-body { grid-template-columns: 1fr; gap: 1rem; }
}

/* ============================================================
   WRITING — specimens in the hold (v3)
   ============================================================ */
.jar-grid {
  display: grid;
  gap: clamp(3rem, 8vh, 5.5rem);
  max-width: 64rem;
}

.jar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(8.5rem, 11rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.75rem);
  padding-top: 1.5rem;
}
/* thin gold hairline, drawn on reveal */
.jar::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, rgba(164, 152, 130, 0.5), rgba(164, 152, 130, 0.05));
  transform-origin: left center;
  transition: transform 1.1s var(--ease-out) 0.1s;
}
html.js .jar::before { transform: scaleX(0); }
html.js .jar.revealed::before { transform: scaleX(1); }

.jar-flank { padding-top: 0.45rem; }
.jar-lid {
  font-size: 0.6875rem; letter-spacing: 0.2em;
  color: var(--dim);
}
.jar-meta {
  margin-top: 0.55rem;
  font-size: 0.6875rem; letter-spacing: 0.22em;
  color: var(--gold);
}
.jar-body h3 {
  font-weight: 500;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.16;
  color: var(--core);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.jar-body > p {
  margin-top: 0.9rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 58ch;
}
@media (max-width: 700px) {
  .jar { grid-template-columns: 1fr; gap: 0.9rem; }
  .jar-flank { display: flex; align-items: baseline; gap: 1.1rem; padding-top: 0; }
  .jar-meta { margin-top: 0; }
}

/* ============================================================
   NOW (v3)
   ============================================================ */
.now-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: clamp(2.5rem, 6vw, 4.5rem);
}
.now-grid .sub {
  font-size: 0.6875rem; letter-spacing: 0.28em;
  color: var(--gold);
  font-weight: 500;
}
.plain-list { margin-top: var(--sp-2); }
.plain-list li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.5rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-faint);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.plain-list li:last-child { border-bottom: 0; }
.plain-list li::before {
  content: "·";
  position: absolute; left: 0.2rem; top: 0.5rem;
  color: var(--gold);
  font-weight: 700;
}

/* ============================================================
   CONTACT — the bottom of the funnel (v3)
   ============================================================ */
.contact-station { padding-bottom: clamp(7rem, 18vh, 11rem); }

.flow-contact {
  text-align: center;
  padding-top: clamp(3.5rem, 9vh, 5.5rem);
}

.station-head-center { text-align: center; }
.station-head-center .zone-tag { margin-bottom: var(--sp-2); }

.hadal-light {
  position: absolute;
  top: -2.6rem; left: 50%;
  transform: translateX(-50%);
  width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center;
}
.hadal-light .core {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--core);
  box-shadow:
    0 0 10px rgba(232, 217, 184, 0.95),
    0 0 28px rgba(201, 185, 152, 0.6),
    0 0 60px rgba(164, 152, 130, 0.35);
  animation: breathe 4.5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.3); }
}

.contact-copy {
  max-width: 32rem;
  margin: 0 auto;
  font-size: clamp(1.08rem, 1.5vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-soft);
}

.contact-links {
  margin-top: var(--sp-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
}

.contact-link {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.9rem; letter-spacing: 0.04em;
  color: var(--core);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.contact-link:hover, .contact-link:focus-visible {
  border-color: var(--gold-hi);
  background: rgba(164, 152, 130, 0.08);
  box-shadow: 0 0 26px rgba(201, 185, 152, 0.16);
}
.contact-link-alt { color: var(--ink-soft); }

/* ============================================================
   FOOTER (v3)
   ============================================================ */
.site-foot {
  position: relative;
  padding: var(--sp-6) 0 var(--sp-5);
  text-align: center;
}
.foot-line {
  font-size: 0.6875rem; letter-spacing: 0.3em;
  color: var(--dim);
  margin-bottom: 1rem;
}
.foot-copy {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ============================================================
   CONTENT LIGHTING — the beam reaches the stations (v3)
   ============================================================ */
.flow, .observation, .jar {
  position: relative;
  transition: filter 0.18s linear;
}

.block-light {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--lx, 50%) var(--ly, 50%),
    rgba(232, 217, 184, 0.1) 0%,
    rgba(232, 217, 184, 0.045) 30%,
    rgba(232, 217, 184, 0) 62%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}
.block-lit > .block-light { opacity: 1; }

/* ============================================================
   REVEAL — content emerges (v3)
   ============================================================ */
html.js [data-reveal] {
  opacity: 0;
  transition: opacity 1.1s var(--ease-out) var(--d, 0s);
}
html.js [data-reveal].revealed { opacity: 1; }

/* ============================================================
   WORLDS — every stage sealed behind a door (v3 system)
   ============================================================ */
.world-reveal {
  position: relative;
  /* Doors retract INTO the walls: clip horizontally so the parted
     panels never expand the page (360px no-overflow guarantee). */
  overflow-x: clip;
  /* per-world seal colour */
  --seal-a: #0a1e36;
  --seal-b: #061224;
}

/* Two doors. Absolutely positioned, pointer-transparent,
   translated only — cheap, compositable, reversible. */
html.js .world-reveal.doorable::before,
html.js .world-reveal.doorable::after {
  content: "";
  position: absolute;
  top: -3rem; bottom: -3rem;
  z-index: 3;
  pointer-events: none;
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.9s var(--ease-out), opacity 0.55s ease 0.3s;
  will-change: transform;
  backface-visibility: hidden;
}
.world-reveal.doorable::before {
  left: -2.75rem; right: 50%;
  background:
    radial-gradient(140% 90% at 18% 50%, rgba(10, 30, 54, 0.5), rgba(2, 6, 15, 0) 70%),
    linear-gradient(to bottom, var(--seal-b), var(--seal-a) 46%, var(--seal-b));
  box-shadow: inset -1px 0 0 rgba(164, 152, 130, 0.35);
}
.world-reveal.doorable::after {
  left: 50%; right: -2.75rem;
  background:
    radial-gradient(140% 90% at 82% 50%, rgba(10, 30, 54, 0.5), rgba(2, 6, 15, 0) 70%),
    linear-gradient(to bottom, var(--seal-b), var(--seal-a) 46%, var(--seal-b));
  box-shadow: inset 1px 0 0 rgba(164, 152, 130, 0.35);
}
@media (max-width: 700px) {
  html.js .world-reveal.doorable::before,
  html.js .world-reveal.doorable::after { top: -2rem; bottom: -2rem; }
  .world-reveal.doorable::before { left: -1.25rem; }
  .world-reveal.doorable::after { right: -1.25rem; }
}

/* The seal: a vertical gold seam with a rotating node where the
   doors meet. A child span so it can fade independently. */
.world-reveal .seal-node {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-0.5px);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.world-reveal .seal-node::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 1px;
  background: linear-gradient(to bottom,
    rgba(232, 217, 184, 0) 4%,
    rgba(232, 217, 184, 0.5) 30%,
    rgba(201, 185, 152, 0.5) 70%,
    rgba(232, 217, 184, 0) 96%);
}
/* diamond node at the meeting point */
.world-reveal .seal-node::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 0.6rem; height: 0.6rem;
  border: 1px solid var(--gold-hi);
  background: rgba(2, 6, 15, 0.5);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 14px rgba(201, 185, 152, 0.4), inset 0 0 8px rgba(232, 217, 184, 0.22);
}
/* faint hairlines trailing from the node */
.world-reveal .seal-node i {
  position: absolute;
  left: 0;
  width: 1px;
  height: 18%;
  background: linear-gradient(to bottom, rgba(164, 152, 130, 0), rgba(201, 185, 152, 0.38));
}
.world-reveal .seal-node i:first-child { top: calc(50% - 24%); }
.world-reveal .seal-node i:last-child  { top: calc(50% + 6%); background: linear-gradient(to bottom, rgba(201, 185, 152, 0.38), rgba(164, 152, 130, 0)); }

/* Sealed state — only ever applied by JS with IO present */
html.js .world-reveal.doorable .seal-node { opacity: 1; }

/* Open state: the doors part and retract into the frame walls */
html.js .world-reveal.doorable.open::before { transform: translateX(-101%); opacity: 0; }
html.js .world-reveal.doorable.open::after  { transform: translateX(101%); opacity: 0; }
html.js .world-reveal.doorable.open .seal-node { opacity: 0; }

/* Depth cue: the world settles into place slightly after the
   panels part. */
.world-reveal.doorable > *:first-child {
  transition: transform 1.1s var(--ease-out) 0.15s;
  transform: scale(0.98) translateY(12px);
}
html.js .world-reveal.doorable.open > *:first-child { transform: none; }

/* The zone tag flashes gold as its world unseals */
@keyframes world-flash {
  0%   { color: var(--gold); }
  18%  { color: var(--core); text-shadow: 0 0 16px rgba(232, 217, 184, 0.45); }
  100% { color: var(--gold); }
}
.world-reveal.doorable.open .zone-tag { animation: world-flash 1.1s ease-out 0.1s 1; }

/* Per-stage seal colours — following each world's palette */
#about .world-reveal    { --seal-a: #12203a; --seal-b: #0b1628; }
#work .world-reveal     { --seal-a: #0e1a30; --seal-b: #081120; }
#writing .world-reveal  { --seal-a: #1a1408; --seal-b: #100c05; }
#now .world-reveal      { --seal-a: #16120e; --seal-b: #0d0b08; }
#contact .world-reveal  { --seal-a: #0a1e36; --seal-b: #061224; }

/* Contact: doors frame the narrow column, not the full width */
#contact .world-reveal.doorable::before,
#contact .world-reveal.doorable::after {
  border-radius: 2px;
}

/* ============================================================
   REDUCED MOTION — everything still, everything visible
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transition: none; }
  .cue-line::after, .hadal-light .core { animation: none; }
  #grain { animation: none; }
  /* doors never seal under reduced motion — content simply visible */
  .world-reveal.doorable::before,
  .world-reveal.doorable::after { content: none; }
  .world-reveal.doorable .seal-node { display: none; }
  .world-reveal.doorable > *:first-child { transform: none; transition: none; }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
