/* ==========================================================================
   AshiucheOS — "Orrery" (governing brief 2026-07-24)
   One design language across the product landing and the Control Room.

   Positioning : AshiucheOS makes an organization executable — institution runtime.
   Personality : institutional · exact · cinematic · unhurried · candid.
   Type        : Zodiak (display) + General Sans (UI) + Spline Sans Mono (data).
   Material    : Observatory Slate, engraved bronze instrument lines, film grain,
                 restrained bloom confined to the 3D canvas.
   Chroma      : Seal Cinnabar = THE primary action; Bronze = instrument material;
                 Sage / Ochre / Crimson carry status with mark + word — never alone.
   ========================================================================== */

/* ============================== 1. Tokens ============================== */

:root {
  color-scheme: dark;

  /* Surfaces — Observatory Slate */
  --ink: #0c110e;
  --ink-lift: #101612;
  --panel: #131a15;
  --panel-2: #1a231c;
  --panel-3: #222c24;
  --sunken: #080c0a;

  /* Structure */
  --line: #2a342d;
  --line-soft: #1c241e;
  --line-strong: #3a463e;

  /* Text — warm ivory ink */
  --text: #f2ede0;
  --muted: #a9b2a6;
  --faint: #7a8378;

  /* Seal (signature action) + Bronze (instrument material) */
  --seal: #c85a3a;
  --seal-lift: #de7350;
  --seal-ink: #1a0c08;
  --seal-wash: rgba(200, 90, 58, 0.14);
  --seal-line: rgba(200, 90, 58, 0.38);

  --brass: #b08d57;
  --brass-lift: #d6bc8f;
  --brass-ink: #14100a;
  --brass-wash: rgba(176, 141, 87, 0.12);
  --brass-line: rgba(176, 141, 87, 0.34);

  --teal: #5f8f6c;
  --teal-wash: rgba(95, 143, 108, 0.14);
  --ochre: #c08a2d;
  --ochre-wash: rgba(192, 138, 45, 0.14);
  --danger: #9e2b2b;
  --danger-wash: rgba(158, 43, 43, 0.14);
  --steel: #86b8dc;
  --steel-wash: rgba(134, 184, 220, 0.13);

  --focus: #86b8dc;

  /* Type */
  --font-display: "Newsreader","Zodiak", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-ui: "DM Sans","General Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, monospace;

  /* Geometry */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --rail: 252px;
  --measure: 1180px;
  --gutter: 34px;

  /* Elevation — one soft, low, warm-tinted shadow; never a hard drop */
  --lift: 0 1px 0 rgba(255, 255, 255, 0.035) inset;
  --shadow-focal: 0 26px 70px -30px rgba(0, 0, 0, 0.9), 0 2px 0 rgba(176, 141, 87, 0.05) inset;
  --shadow-sheet: 0 40px 120px -30px rgba(0, 0, 0, 0.85);

  /* Motion */
  --t-quick: 180ms;
  --t-base: 280ms;
  --t-slow: 450ms;
  --t-cine: 700ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ============================== 2. Base ============================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ink);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a {
  color: var(--brass-lift);
  text-decoration-color: var(--brass-line);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }

canvas { display: block; }

::selection { background: var(--brass-wash); color: var(--text); }

/* Focus ring is Steel — deliberately independent of every status colour. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -70px;
  left: 14px;
  z-index: 999;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  background: var(--seal);
  color: var(--seal-ink);
  font-weight: 700;
  transition: top var(--t-base) var(--ease-out);
}
.skip-link:focus { top: 14px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ======================= 3. Cinematic backdrop ======================= */

/* Layer order: 3D canvas → film grain → vignette → content.
   If the 3D module never resolves, the CSS lattice below still carries the
   composition, so nothing depends on the canvas succeeding. */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 78% -12%, rgba(176, 141, 87, 0.10), transparent 58%),
    radial-gradient(90% 80% at 8% 108%, rgba(95, 143, 108, 0.07), transparent 60%),
    linear-gradient(180deg, var(--ink-lift), var(--ink) 62%);
}

.backdrop::before {
  /* Static hairline lattice — the graceful-degradation floor for the 3D scene. */
  content: "";
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 108px 108px;
  opacity: 0.4;
  mask-image: radial-gradient(70% 60% at 50% 42%, #000 10%, transparent 78%);
  transform: perspective(900px) rotateX(46deg) scale(1.5);
  transform-origin: 50% 22%;
}

.backdrop canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.backdrop[data-mode="ambient"] canvas { opacity: 0.6; }

.backdrop-grain,
.backdrop-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.backdrop-grain {
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.055'/%3E%3C/svg%3E");
}

.backdrop-vignette {
  background:
    radial-gradient(100% 78% at 50% 40%, transparent 42%, rgba(4, 6, 9, 0.66) 100%),
    linear-gradient(180deg, rgba(4, 6, 9, 0.5), transparent 22%);
}

/* ============================== 4. Controls ============================== */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-line: var(--line);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid var(--btn-line);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--t-quick) var(--ease-out),
    border-color var(--t-quick) var(--ease-out),
    color var(--t-quick) var(--ease-out),
    transform var(--t-quick) var(--ease-spring);
}
.btn:active { transform: scale(0.972); }

.btn.primary {
  --btn-bg: var(--seal);
  --btn-fg: var(--seal-ink);
  --btn-line: var(--seal);
  box-shadow: var(--shadow-focal);
}
.btn.primary:hover { --btn-bg: var(--seal-lift); --btn-line: var(--seal-lift); }

.btn.ghost { --btn-line: var(--line-strong); }
.btn.ghost:hover { --btn-bg: var(--panel-2); --btn-line: var(--brass-line); }

.btn.quiet { --btn-line: transparent; --btn-fg: var(--muted); padding-inline: 12px; }
.btn.quiet:hover { --btn-fg: var(--text); --btn-bg: var(--panel-2); }

.btn.small { min-height: 36px; padding: 7px 14px; font-size: 13.5px; }

.btn .arrow {
  display: inline-block;
  transition: transform var(--t-base) var(--ease-out);
}
.btn:hover .arrow { transform: translateX(3px); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-quick) var(--ease-out), color var(--t-quick) var(--ease-out);
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

/* Brand mark — Seal Cinnabar (the only expressive mark). */
.seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--seal-line);
  background:
    radial-gradient(130% 130% at 28% 18%, rgba(222, 115, 80, 0.95), rgba(180, 71, 42, 0.92) 68%);
  color: var(--seal-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
  box-shadow: var(--lift);
}

/* ============================== 5. Landing ============================== */

.lp { position: relative; z-index: 1; }

.lp-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid transparent;
  transition: background var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
.lp-nav.is-stuck {
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  border-bottom-color: var(--line-soft);
}
.lp-nav .brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.lp-nav .brand-lockup .seal { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
.lp-nav .brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.015em;
}
.lp-nav .nav-right { display: flex; align-items: center; gap: 10px; }

/* --- Hero: full-bleed lattice behind, brand at hero scale, one CTA group --- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: 130px clamp(18px, 4vw, 48px) 96px;
}

.hero-inner { max-width: 980px; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(20px, 3vw, 34px);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}
.hero-eyebrow::before {
  content: "";
  width: clamp(28px, 5vw, 56px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass));
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(54px, 11.2vw, 148px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  margin-bottom: clamp(22px, 3.4vw, 40px);
  background: linear-gradient(178deg, #fbfdff 12%, #cdd8e6 52%, #8d9cb0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Keep the brand readable if background-clip text is unsupported. */
@supports not (background-clip: text) {
  .wordmark { color: var(--text); background: none; }
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(21px, 2.7vw, 36px);
  line-height: 1.28;
  letter-spacing: -0.015em;
  max-width: 20ch;
  margin-bottom: 20px;
}
.hero-headline em { font-style: normal; color: var(--brass-lift); }

.hero-line {
  font-size: clamp(15.5px, 1.35vw, 18px);
  line-height: 1.62;
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: clamp(30px, 4vw, 44px);
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* States plainly what the 3D is, so the instrument is never mistaken for a feed. */
.hero-disclosure {
  margin-top: clamp(26px, 3.5vw, 40px);
  padding-left: 16px;
  border-left: 1px solid var(--brass-line);
  max-width: 58ch;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-scroll {
  position: absolute;
  left: clamp(18px, 4vw, 48px);
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.hero-scroll .rule {
  width: 74px;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
  position: relative;
  overflow: hidden;
}
.hero-scroll .rule::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 22px;
  background: var(--brass);
  animation: rule-travel 2.8s var(--ease-out) infinite;
}

@keyframes rule-travel {
  0% { transform: translateX(-24px); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(78px); opacity: 0; }
}

/* --- Editorial sections --- */

.lp-section {
  position: relative;
  padding: clamp(72px, 10vw, 140px) clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(12, 17, 14, 0.72), rgba(12, 17, 14, 0.92));
  backdrop-filter: blur(2px);
}
.lp-inner { max-width: var(--measure); margin: 0 auto; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  margin-bottom: clamp(38px, 5vw, 64px);
}
.section-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 14px;
}
/* The act spine: an engraved plate number, then the act's name. */
.act-no {
  display: inline-block;
  margin-right: 12px;
  padding-right: 12px;
  border-right: 1px solid var(--brass-line);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.025em;
}
.section-note { color: var(--muted); font-size: 15.5px; max-width: 54ch; }

/* Institution index — an asymmetric ledger, deliberately not a card grid.
   Hovering a row cross-highlights its ring in the 3D lattice. */

.ledger { border-top: 1px solid var(--line); }

.ledger-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1.05fr) minmax(0, 1.35fr) auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: baseline;
  width: 100%;
  padding: clamp(20px, 2.4vw, 30px) 6px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
  transition: background var(--t-base) var(--ease-out), padding-left var(--t-base) var(--ease-out);
}
.ledger-row:hover,
.ledger-row:focus-visible {
  background: linear-gradient(90deg, var(--brass-wash), transparent 62%);
  padding-left: 18px;
}
.ledger-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.06em;
}
.ledger-row:hover .ledger-index { color: var(--brass); }
.ledger-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(19px, 2vw, 25px);
  letter-spacing: -0.018em;
  line-height: 1.2;
}
.ledger-body { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.ledger-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

/* Compile sequence — one rail, five states, a travelling brass marker. */

.sequence {
  position: relative;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 46px;
}
.sequence::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
  width: var(--seq-progress, 0%);
  background: linear-gradient(90deg, var(--brass), var(--teal));
  transition: width var(--t-cine) var(--ease-out);
}
.seq-step { position: relative; padding: 0 clamp(10px, 2vw, 26px) 0 0; }
.seq-step::before {
  content: "";
  position: absolute;
  top: -50px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  transition: background var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
.seq-step.is-lit::before { background: var(--brass); border-color: var(--brass); }
.seq-state {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin-bottom: 10px;
}
.seq-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.012em;
  margin-bottom: 8px;
}
.seq-body { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* Evidence band */

.evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.evidence-copy p + p { margin-top: 16px; }
.evidence-copy p { color: var(--muted); line-height: 1.68; }
.evidence-copy strong { color: var(--text); font-weight: 600; }

.chain {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  overflow: hidden;
  box-shadow: var(--shadow-focal);
}
.chain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.chain-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.chain-row:last-child { border-bottom: 0; }
.chain-row .mark {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--brass);
}
.chain-row .field { font-size: 13.5px; }
.chain-row .field b { font-weight: 600; }
.chain-row .field span {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  word-break: break-all;
}

/* Act III — confidence decay. Three stages of one observation, read left to
   right; the bronze meridian above them fades as the belief ages. */

.decay {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 44px);
  border-top: 1px solid var(--line);
  padding-top: 44px;
}
.decay-step { position: relative; }
.decay-step::before {
  content: "";
  position: absolute;
  top: -45px;
  left: 0;
  right: clamp(20px, 3vw, 44px);
  height: 1px;
  background: linear-gradient(90deg, var(--decay-tint), transparent);
}
.decay-step::after {
  content: "";
  position: absolute;
  top: -48px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--decay-tint);
}
.decay-step[data-age="fresh"] { --decay-tint: var(--brass); }
.decay-step[data-age="ageing"] { --decay-tint: var(--ochre); }
.decay-step[data-age="stale"] { --decay-tint: var(--faint); }

.decay-state {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--decay-tint);
  margin-bottom: 12px;
}
.decay-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.26;
  letter-spacing: -0.016em;
  margin-bottom: 10px;
}
.decay-body { color: var(--muted); font-size: 14px; line-height: 1.62; }

.world-close {
  margin-top: clamp(38px, 5vw, 60px);
  padding-top: clamp(28px, 3vw, 40px);
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
}
.world-close p { color: var(--muted); line-height: 1.68; max-width: 62ch; }
.world-close strong { color: var(--text); font-weight: 600; }

/* Coda — the page's only centered moment. */

.close-band { text-align: center; }
.close-band .lp-inner { display: grid; justify-items: center; }
.close-band .hero-cta { justify-content: center; }

.seal-lg {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  font-size: 27px;
  margin-bottom: 26px;
}
.close-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 16px;
}
.close-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4.4vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.032em;
  max-width: 18ch;
  margin-bottom: 22px;
}
.close-line { color: var(--muted); max-width: 56ch; margin-bottom: 34px; font-size: 16.5px; }

.lp-footer {
  padding: 34px clamp(18px, 4vw, 48px) 46px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  justify-content: space-between;
  align-items: center;
  background: var(--ink);
  position: relative;
  z-index: 1;
}
.lp-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 6px;
  color: inherit;
  text-decoration: none;
}
.lp-footer a:hover { color: var(--text); }

/* =========================== 6. Control Room =========================== */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px 20px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 82%, transparent), color-mix(in srgb, var(--sunken) 88%, transparent));
  backdrop-filter: blur(16px);
}

.rail .brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 2px 4px;
  color: inherit;
  text-decoration: none;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.022em;
}
.brand-sub {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
}

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-quick) var(--ease-out), color var(--t-quick) var(--ease-out);
}
.nav-item .dot {
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-spring);
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.is-active { background: var(--panel-3); color: var(--text); font-weight: 600; }
.nav-item.is-active .dot { background: var(--brass); transform: scale(1.5); }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--brass);
}

.rail-foot { margin-top: auto; display: grid; gap: 10px; }

.connection {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--sunken);
}
.conn-mark {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--ochre);
  transition: background var(--t-base) var(--ease-out);
}
.connection[data-state="online"] .conn-mark { background: var(--teal); }
.connection[data-state="offline"] .conn-mark { background: var(--danger); }
.conn-text { display: flex; flex-direction: column; min-width: 0; }
.conn-text strong { font-size: 13px; font-weight: 600; }
.conn-text small { font-size: 11px; color: var(--faint); }

.workspace { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 22px var(--gutter) 18px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--ink) 84%, transparent);
  backdrop-filter: blur(14px) saturate(130%);
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 5px;
}
.topbar h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 2.4vw, 31px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.topbar-actions { display: flex; gap: 10px; flex: none; }

.content {
  width: 100%;
  max-width: var(--measure);
  padding: 26px var(--gutter) 88px;
  outline: none;
}

/* ------- Institutional brief: the front page of the Overview ------- */

.brief {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 160% at 92% -30%, var(--brass-wash), transparent 56%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: clamp(26px, 3.2vw, 38px) clamp(24px, 3.2vw, 40px);
  margin-bottom: 26px;
  box-shadow: var(--shadow-focal);
  overflow: hidden;
}
.brief-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 16px;
}
.brief-eyebrow .seal-dot {
  width: 7px; height: 7px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--brass);
}
.brief-statement {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(21px, 2.5vw, 31px);
  line-height: 1.34;
  letter-spacing: -0.018em;
  max-width: 34ch;
}
.brief-statement .accent { color: var(--brass-lift); font-weight: 500; }
.brief-statement .flag { color: var(--ochre); font-weight: 500; }
.brief-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-top: clamp(22px, 2.6vw, 30px);
}
.as-of {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12.5px;
  color: var(--faint);
}
.as-of b { color: var(--muted); font-weight: 600; }

/* A single non-looping hairline sweep when a value refreshes from a source. */
.freshness {
  position: relative;
  display: inline-block;
}
.freshness.is-fresh::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--brass);
  transform-origin: left;
  animation: freshness-sweep 1.2s var(--ease-out) 1;
}
@keyframes freshness-sweep {
  0% { transform: scaleX(0); opacity: 0.2; }
  55% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* ------- Portfolio constellation (real mission/task graph in 3D) ------- */

.constellation {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel), var(--sunken));
  overflow: hidden;
  margin-bottom: 26px;
}
.constellation-stage {
  position: relative;
  height: clamp(220px, 30vw, 320px);
  cursor: grab;
}
.constellation-stage:active { cursor: grabbing; }
.constellation-stage canvas { width: 100%; height: 100%; }
.constellation-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 14px 20px;
  background: linear-gradient(180deg, transparent, rgba(12, 17, 14, 0.9));
  pointer-events: none;
}
.constellation-caption { font-size: 12.5px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--faint); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i {
  width: 7px; height: 7px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: currentColor;
}
.legend .k-run { color: var(--steel); }
.legend .k-done { color: var(--teal); }
.legend .k-wait { color: var(--ochre); }
.legend .k-fail { color: var(--danger); }

/* ------- Panels, grids ------- */

.stack { display: grid; gap: 22px; }
.cols {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
  align-items: start;
}
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--panel) 88%, var(--sunken)));
  overflow: hidden;
}
.panel.is-focal { border-color: var(--line); box-shadow: var(--shadow-focal); }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.panel-head .meta { font-size: 12px; color: var(--faint); }
.panel-body { padding: 10px 20px 18px; }
.panel-body.flush { padding: 0; }

/* ------- Tables ------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 20px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--sunken);
  border-bottom: 1px solid var(--line);
}
tbody td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; transition: background var(--t-quick) var(--ease-out); }
tbody tr.clickable:hover { background: var(--panel-2); }
tbody tr.clickable:focus-visible { background: var(--panel-2); outline-offset: -2px; }
td .primary-cell { font-weight: 600; }
.cell-sub { display: block; margin-top: 3px; }

/* ------- Definition rows ------- */

.def-list { display: grid; gap: 9px; padding: 6px 0; }
.def-row {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 13px 15px;
  background: var(--sunken);
}
.def-row .row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.def-row strong { font-weight: 600; font-size: 14px; }
.def-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.def-row p { margin-top: 5px; color: var(--muted); font-size: 13.5px; }
.def-row .label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ------- Attention queue: ordered by consequence ------- */

.attention { display: grid; gap: 10px; padding: 6px 0; }
.attn-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  padding: 14px 15px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--sunken);
  transition: border-color var(--t-base) var(--ease-out), background var(--t-base) var(--ease-out);
}
.attn-item:hover { background: var(--panel-2); }
.attn-item[data-level="risk"] { border-left-color: var(--danger); }
.attn-item[data-level="attention"] { border-left-color: var(--ochre); }
.attn-item[data-level="steady"] { border-left-color: var(--teal); }
.attn-mark {
  width: 9px; height: 9px;
  margin-top: 6px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--line-strong);
}
.attn-item[data-level="risk"] .attn-mark { background: var(--danger); }
.attn-item[data-level="attention"] .attn-mark { background: var(--ochre); }
.attn-item[data-level="steady"] .attn-mark { background: var(--teal); }
.attn-title { font-weight: 600; font-size: 14.5px; }
.attn-body { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.attn-source {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}

/* ------- Execution graph rows ------- */

.graph { display: grid; gap: 8px; padding: 6px 0; }
.graph-node {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--sunken);
}
.graph-node .idx {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--brass-wash);
  color: var(--brass-lift);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.graph-node strong { font-weight: 600; font-size: 14px; }
.graph-node small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

/* ------- Badges: colour never alone, always shape + word ------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: currentColor;
}
/* Sage = verified / on-track. Steel = in flight. Bronze is the instrument's
   material and is never allowed to carry a status. */
.badge.SUCCEEDED, .badge.COMPLETED, .badge.READY, .badge.ONLINE {
  color: var(--teal); border-color: transparent; background: var(--teal-wash);
}
.badge.RUNNING, .badge.LEASED, .badge.BUSY {
  color: var(--steel); border-color: transparent; background: var(--steel-wash);
}
.badge.COMPILED, .badge.BLOCKED, .badge.RETRY_WAIT, .badge.OFFLINE, .badge.DRAFT, .badge.PENDING {
  color: var(--ochre); border-color: transparent; background: var(--ochre-wash);
}
.badge.FAILED, .badge.CANCELLED, .badge.EXHAUSTED, .badge.STALE, .badge.DISABLED {
  color: var(--danger); border-color: transparent; background: var(--danger-wash);
}
.badge.INFO { color: var(--steel); border-color: transparent; background: var(--steel-wash); }

/* ------- Measures ------- */

.measure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  padding: 4px 0 2px;
}
.measure {
  min-width: 128px;
  padding: 10px 0;
}
.measure-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.measure-value {
  margin-top: 5px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.measure-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }

.progress {
  height: 5px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--sunken);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--teal);
  transition: width var(--t-cine) var(--ease-out);
}

/* ------- States: loading / empty / error ------- */

.state {
  display: grid;
  gap: 9px;
  justify-items: start;
  padding: 40px 20px;
  color: var(--muted);
}
.state strong { color: var(--text); font-weight: 600; font-size: 15px; }
.state p { font-size: 13.5px; max-width: 52ch; }
.state .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }
.state.error strong { color: var(--danger); }
.state .state-actions { margin-top: 6px; display: flex; gap: 10px; }

.skeleton {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--panel);
  padding: 28px;
  display: grid;
  gap: 14px;
}
.skeleton .bar {
  height: 13px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--panel-2), var(--line-soft), var(--panel-2));
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skeleton .bar.w40 { width: 40%; }
.skeleton .bar.w60 { width: 60%; }
.skeleton .bar.w80 { width: 80%; }
@keyframes shimmer {
  from { background-position: 220% 0; }
  to { background-position: -220% 0; }
}

/* ============================== 7. Overlays ============================== */

dialog.sheet {
  width: min(580px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  box-shadow: var(--shadow-sheet);
}
dialog.sheet::backdrop {
  background: rgba(4, 6, 9, 0.72);
  backdrop-filter: blur(6px);
}
dialog.sheet[open] { animation: sheet-in var(--t-base) var(--ease-out); }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
dialog.sheet form { padding: 24px 26px 26px; }
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.sheet-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 25px;
  letter-spacing: -0.022em;
}
.sheet-lead { margin: 8px 0 20px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.sheet-lead code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-soft);
  background: var(--sunken);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.field input,
.field textarea {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 13px;
  outline: 0;
  transition: border-color var(--t-quick) var(--ease-out), background var(--t-quick) var(--ease-out);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }
.field input:focus,
.field textarea:focus { border-color: var(--focus); background: var(--panel); }
.field textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  max-width: min(430px, calc(100vw - 36px));
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--brass);
  border-radius: var(--r-sm);
  background: var(--panel-3);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: var(--shadow-sheet);
  transform: translateY(150%);
  opacity: 0;
  transition: transform var(--t-base) var(--ease-spring), opacity var(--t-base) var(--ease-out);
}
#toast.show { transform: none; opacity: 1; }
#toast:empty { display: none; }

/* ============================== 8. Utility ============================== */

.mono { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.hairline { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* ============================== 9. Responsive ============================== */

@media (max-width: 1180px) {
  .section-head { grid-template-columns: 1fr; align-items: start; gap: 18px; }
  .evidence-grid { grid-template-columns: 1fr; }
  .sequence { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
  .sequence::before { display: none; }
  .seq-step::before { top: -34px; }
  .sequence { padding-top: 30px; }
  .world-close { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .cols, .cols.even { grid-template-columns: 1fr; }
  :root { --rail: 216px; --gutter: 26px; }
}

@media (max-width: 900px) {
  .ledger-row {
    grid-template-columns: 44px minmax(0, 1fr);
    row-gap: 8px;
  }
  .ledger-body { grid-column: 2; }
  .ledger-tag { grid-column: 2; }

  /* The decay band stacks; each stage keeps its own meridian and mark. */
  .decay { grid-template-columns: 1fr; gap: 34px; padding-top: 34px; }
  .decay-step::before { right: 0; }
}

@media (max-width: 860px) {
  .shell { display: block; }

  .rail {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    gap: 12px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .rail .brand-lockup { justify-content: flex-start; }
  .rail .seal { width: 38px; height: 38px; font-size: 16px; }
  .brand-name { font-size: 19px; }

  /* Labels stay legible: a scrollable segmented rail, never an icon-only bar. */
  .nav {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: none; min-height: 40px; padding: 8px 13px; font-size: 13.5px; white-space: nowrap; }
  .nav-item.is-active::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 2px; }

  .rail-foot { margin-top: 0; }
  .connection { padding: 8px 11px; }

  .topbar { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 18px 14px; }
  .topbar-actions .btn { flex: 1; }
  .content { padding: 20px 18px 72px; }

  .brief { border-radius: var(--r-lg); }
  .field-grid { grid-template-columns: 1fr; }
  #toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

@media (max-width: 720px) {
  .sequence { grid-template-columns: 1fr; gap: 26px; }
  .act-no { display: block; margin: 0 0 8px; padding: 0 0 6px; border-right: 0; border-bottom: 1px solid var(--brass-line); width: fit-content; }
  .hero { padding-top: 112px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .hero-scroll { display: none; }
  .lp-nav .nav-right .btn.ghost { display: none; }
  .chain-row .field span { font-size: 11px; }
}

/* ========================== 10. Motion policy ========================== */

/* Static camera + opacity only. No parallax, no travelling marks, no loops. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-scroll .rule::after { display: none; }
  .btn:active { transform: none; }
  .ledger-row:hover, .ledger-row:focus-visible { padding-left: 6px; }
}

/* Windows high-contrast / forced colours: hairlines and washes disappear,
   so structure is restated with system colours. */
@media (forced-colors: active) {
  .panel, .brief, .def-row, .attn-item, .badge, .btn, .field input, .field textarea {
    border: 1px solid CanvasText;
  }
  .backdrop, .backdrop-grain, .backdrop-vignette { display: none; }
  .wordmark { color: CanvasText; background: none; -webkit-text-fill-color: CanvasText; }
}
