/* =========================================================
   Deceptive Alignment — observation interface
   single-stylesheet · no preprocessor · no resets imported
   ========================================================= */

/* tokens */
:root {
  /* surface */
  --bg:           #0c0a09;
  --bg-deep:      #08070a;
  --bg-soft:      #110f0d;
  --surface:      rgba(255, 250, 240, 0.018);
  --surface-2:    rgba(255, 250, 240, 0.035);

  /* type */
  --bone:         #e8e4d8;
  --bone-2:       rgba(232, 228, 216, 0.62);
  --bone-3:       rgba(232, 228, 216, 0.40);
  --bone-4:       rgba(232, 228, 216, 0.22);

  /* hairlines */
  --line:         rgba(232, 228, 216, 0.085);
  --line-2:       rgba(232, 228, 216, 0.14);
  --line-3:       rgba(232, 228, 216, 0.22);

  /* signal */
  --amber:        #c4a960;
  --amber-2:      rgba(196, 169, 96, 0.18);
  --cyan:         #5fb6c2;
  --cyan-2:       rgba(95, 182, 194, 0.14);
  --rust:         #8b3a2e;
  --rust-2:       rgba(139, 58, 46, 0.20);

  /* fonts */
  --serif:        'Instrument Serif', 'Fraunces', Georgia, serif;
  --body:         'Fraunces', Georgia, 'Times New Roman', serif;
  --mono:         'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* metrics */
  --gut:          clamp(1.25rem, 4vw, 2.5rem);
  --rail:         clamp(1rem, 5vw, 4rem);
  --sect-y:       clamp(4rem, 10vw, 9rem);
  --max:          1280px;

  /* motion */
  --ease:         cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:      cubic-bezier(0.7, 0, 0.84, 0);
  --slow:         900ms;
  --med:          480ms;
  --fast:         220ms;
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--bone);
  font-family: var(--body);
  font-weight: 350;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  font-feature-settings: 'liga', 'kern', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
em { font-style: italic; }
::selection { background: var(--amber); color: var(--bg); }

.mono { font-family: var(--mono); font-weight: 400; letter-spacing: 0.02em; }
.small { font-size: 11px; }
.micro { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ambient: canvas, grain, vignette */
#field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.88  0 0 0 0 0.82  0 0 0 0.8 0'/></filter><rect width='220' height='220' filter='url(%23n)' opacity='0.55'/></svg>");
  animation: grain 8s steps(8) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  10%     { transform: translate(-2%, 1%); }
  20%     { transform: translate(1%, -3%); }
  30%     { transform: translate(-3%, 2%); }
  40%     { transform: translate(2%, 1%); }
  50%     { transform: translate(-1%, -2%); }
  60%     { transform: translate(3%, 2%); }
  70%     { transform: translate(-2%, -1%); }
  80%     { transform: translate(1%, 3%); }
  90%     { transform: translate(-1%, 1%); }
}
.vignette {
  position: fixed; inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 30%, transparent 0%, transparent 40%, rgba(8, 7, 10, 0.6) 100%),
    linear-gradient(to bottom, rgba(8,7,10,0.4) 0%, transparent 18%, transparent 78%, rgba(8,7,10,0.55) 100%);
}
.vignette-warn {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(196, 169, 96, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 60%, transparent 0%, transparent 35%, rgba(8, 7, 10, 0.65) 100%);
}

/* layered z-index above ambient */
.mast, main, .foot, .overlay, .term { position: relative; z-index: 5; }

/* masthead */
.mast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--gut);
  padding: 1.1rem var(--rail);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(12, 10, 9, 0.85), rgba(12, 10, 9, 0.4));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky; top: 0;
}
.mark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--bone);
  transition: color var(--fast) var(--ease);
}
.mark:hover { color: var(--amber); }
.mark svg { transition: transform 1.6s var(--ease-out); }
.mark:hover svg { transform: rotate(180deg); }
.mark-text {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.mark-text em { color: var(--bone-3); font-style: normal; letter-spacing: 0.16em; }
.mark-dot { color: var(--amber); }
.mark-mu { color: var(--bone-3); margin: 0 1px; }

.rail {
  display: flex; gap: 1.4rem;
  justify-content: center;
  flex-wrap: wrap;
}
.rail a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-3);
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--fast) var(--ease);
}
.rail a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--amber);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--med) var(--ease-out);
}
.rail a:hover { color: var(--bone); }
.rail a:hover::after { transform: scaleX(1); }

.status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.status-led {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: led 2.4s var(--ease) infinite;
}
.status-led-warn { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
@keyframes led {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.18); }
}
.status-meta { color: var(--bone-4); }

/* sections (shared scaffold) */
.sect-head {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 1.1rem;
  align-items: baseline;
  margin-bottom: clamp(2rem, 5vw, 4rem);
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}
.sect-head-center {
  border-top: 1px solid var(--line);
  text-align: center;
  display: block;
}
.sect-head-center .sect-num { display: inline-block; margin-right: 0.8rem; vertical-align: middle; }

.sect-num {
  grid-row: 1 / 3;
  font-size: 12px;
  color: var(--amber);
  letter-spacing: 0.18em;
  padding-top: 1.2rem;
}
.sect-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0.6rem 0 0.4rem;
  color: var(--bone);
}
.sect-title em { font-style: italic; color: var(--bone-2); }
.sect-title .slash { color: var(--bone-3); font-style: normal; }
.sect-kicker {
  font-size: 13.5px;
  color: var(--bone-3);
  font-style: italic;
  margin: 0;
  grid-column: 2;
}

/* HERO */
.hero {
  min-height: 92vh;
  padding: clamp(3rem, 8vw, 7rem) var(--rail) clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  position: relative;
  isolation: isolate;
}
.hero-grid {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding-top: 2rem;
}
.hero-meta {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--amber-2);
  padding: 0.3rem 0.6rem;
  border-radius: 1px;
  background: rgba(196, 169, 96, 0.04);
}
.tag-mute { color: var(--bone-3); border-color: var(--line-2); background: var(--surface); }
.tag-warn { color: var(--rust); border-color: var(--rust-2); background: rgba(139, 58, 46, 0.05); }

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 7.6rem);
  line-height: 0.97;
  letter-spacing: -0.025em;
  margin: 0 0 clamp(1.2rem, 3vw, 2rem);
  color: var(--bone);
  max-width: 18ch;
}
.hero-title .line { display: block; opacity: 0; transform: translateY(14px); animation: rise var(--slow) var(--ease-out) forwards; }
.hero-title .line-1 { animation-delay: 80ms; }
.hero-title .line-2 { animation-delay: 240ms; padding-left: 1.1em; }
.hero-title .line-3 { animation-delay: 400ms; padding-left: 0.4em; }
.hero-title em { font-style: italic; color: var(--bone-2); }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.hero-sub {
  max-width: 56ch;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--bone-2);
  line-height: 1.55;
  margin: 0 0 clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 350;
  opacity: 0; animation: rise var(--slow) var(--ease-out) 560ms forwards;
}

.hero-foot {
  display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap;
  opacity: 0; animation: rise var(--slow) var(--ease-out) 720ms forwards;
}
.hero-hint {
  color: var(--bone-3);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero-hint kbd {
  display: inline-block;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  padding: 1px 6px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  margin: 0 2px;
  color: var(--bone-2);
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.85rem 1.2rem;
  border-radius: 2px;
  transition: all var(--med) var(--ease-out);
  position: relative;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--bone);
  color: var(--bg);
  border-color: var(--bone);
}
.btn-primary:hover {
  background: var(--amber);
  border-color: var(--amber);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--line-2);
}
.btn-ghost:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* hero telemetry */
.telemetry {
  position: absolute;
  right: var(--rail);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-3);
  border-left: 1px solid var(--line);
  padding: 0.6rem 0 0.6rem 1rem;
  min-width: 170px;
  opacity: 0;
  animation: rise var(--slow) var(--ease-out) 1100ms forwards;
}
.tel-row {
  display: flex; justify-content: space-between; gap: 1rem;
}
.tel-row span:last-child { color: var(--cyan); }
.tel-row.tel-warn span:last-child { color: var(--amber); }
@media (max-width: 900px) {
  .telemetry { display: none; }
}

.hero-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: clamp(3rem, 8vw, 5rem);
  max-width: var(--max);
  width: 100%;
  margin-inline: auto;
  color: var(--bone-4);
}
.thin-line { height: 1px; background: var(--line); }

/* PRIMER */
.primer {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--sect-y) var(--rail);
}
.primer-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  max-width: 64ch;
  margin-bottom: 3rem;
}
.lede {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.45;
  color: var(--bone);
  font-weight: 350;
  margin: 0;
}
.lede em { color: var(--amber); font-style: italic; }
.primer-body p { margin: 0; color: var(--bone-2); }
.primer-body p strong {
  font-weight: 500;
  color: var(--bone);
  font-family: var(--serif);
  font-size: 1.05em;
  font-style: italic;
}
.primer-quiet {
  color: var(--bone-3) !important;
  font-style: italic;
  border-left: 1px solid var(--amber-2);
  padding-left: 1rem;
}
.primer-bullets {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
}
.primer-bullets li {
  display: grid; grid-template-columns: auto 1fr; gap: 0.7rem;
  align-items: start;
  font-size: 14px; color: var(--bone-2); line-height: 1.5;
  padding: 0.6rem 0.8rem 0.6rem 0;
  border-left: 1px solid var(--line);
  padding-left: 1rem;
}
.bul-num { color: var(--amber); font-size: 11px; padding-top: 4px; }
.primer-bullets em { color: var(--bone); font-style: italic; }

/* DUALITY */
.duality {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--sect-y) var(--rail);
}
.duality-frame {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  position: relative;
}
.duality-frame::before, .duality-frame::after {
  content: ''; position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--bone-3);
}
.duality-frame::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.duality-frame::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.dual-col { padding: 0.4rem 0.2rem; }
.dual-tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1.4rem;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}
.dual-tag-warn { color: var(--amber); }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.dot-warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dual-list {
  list-style: none; padding: 0; margin: 0 0 1.6rem;
  display: grid; gap: 0.7rem;
}
.dual-list li {
  font-size: 15px;
  color: var(--bone-2);
  line-height: 1.5;
  position: relative;
  padding-left: 1.6rem;
  counter-increment: dl;
}
.dual-list { counter-reset: dl; }
.dual-list li::before {
  content: counter(dl, decimal-leading-zero);
  position: absolute; left: 0; top: 1px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--bone-4);
}
.dual-list-warn li { color: var(--bone); font-style: italic; }
.dual-list-warn li::before { color: var(--amber); }
.dual-foot {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-4);
  border-top: 1px dashed var(--line-2);
  padding-top: 0.7rem;
}
.dual-foot-warn { color: var(--amber); border-color: var(--amber-2); }

.dual-divider {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.8rem;
  color: var(--bone-3);
}
.div-line { width: 1px; flex: 1; background: var(--line); }
.div-glyph svg { color: var(--amber); }

.duality-aphorism {
  margin: 2rem auto 0;
  max-width: 50ch;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--bone-2);
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--line);
}
.duality-aphorism em { color: var(--amber); }

@media (max-width: 720px) {
  .duality-frame { grid-template-columns: 1fr; }
  .dual-divider { flex-direction: row; height: 1px; }
  .div-line { width: auto; height: 1px; flex: 1; }
  .div-glyph svg { transform: rotate(90deg); height: 24px; }
}

/* EMERGENCE */
.emergence {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--sect-y) var(--rail);
}
.stages {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  gap: 0;
  position: relative;
}
.stage {
  display: grid;
  grid-template-columns: clamp(60px, 12%, 110px) 1fr;
  gap: clamp(1rem, 3vw, 2.4rem);
  padding: clamp(1.2rem, 3vw, 2rem) 0;
  border-top: 1px solid var(--line);
  position: relative;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--slow) var(--ease-out), transform var(--slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.stage:last-child { border-bottom: 1px solid var(--line); }
.stage.in { opacity: 1; transform: none; }
.stage::before {
  content: '';
  position: absolute;
  left: clamp(60px, 12%, 110px);
  top: -3px;
  width: 7px; height: 7px;
  background: var(--bg);
  border: 1px solid var(--bone-3);
  border-radius: 50%;
  transform: translateX(-3.5px);
  transition: background var(--med) var(--ease), border-color var(--med) var(--ease);
}
.stage.in::before {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 10px var(--amber-2);
}
.stage-tick {
  font-size: 13px;
  color: var(--amber);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.stage-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  line-height: 1.1;
  margin: 0 0 0.6rem;
  letter-spacing: -0.005em;
}
.stage-body {
  margin: 0;
  color: var(--bone-2);
  font-size: 15px;
  max-width: 60ch;
}
.stage-body em { color: var(--bone); font-style: italic; }

/* LEXICON cards */
.lexicon {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--sect-y) var(--rail);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.card {
  position: relative;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background var(--med) var(--ease-out);
  outline: none;
  cursor: default;
  min-height: 240px;
}
.card:hover, .card:focus-visible {
  background: var(--surface-2);
}
.card:focus-visible { outline: 1px solid var(--amber); outline-offset: -1px; }
.card-head {
  display: flex; align-items: baseline; gap: 0.7rem;
  margin-bottom: 1rem;
}
.card-num {
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.55rem;
  margin: 0;
  letter-spacing: -0.005em;
  color: var(--bone);
}
.card-blurb {
  font-style: italic;
  color: var(--bone-2);
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}
.card-deep {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height var(--slow) var(--ease-out), opacity var(--med) var(--ease-out), margin var(--med) var(--ease-out);
}
.card-deep p {
  margin: 1rem 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--bone-2);
  border-top: 1px dashed var(--line-2);
  padding-top: 0.9rem;
}
.card-deep em { color: var(--amber); font-style: italic; }
.card:hover .card-deep,
.card:focus-visible .card-deep,
.card.open .card-deep {
  max-height: 320px;
  opacity: 1;
}
.card-corner {
  position: absolute;
  bottom: 12px; right: 12px;
  width: 10px; height: 10px;
  border-right: 1px solid var(--bone-4);
  border-bottom: 1px solid var(--bone-4);
  transition: border-color var(--med) var(--ease);
}
.card:hover .card-corner,
.card:focus-visible .card-corner,
.card.open .card-corner {
  border-color: var(--amber);
}
.card::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--amber), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--slow) var(--ease-out);
}
.card:hover::before,
.card:focus-visible::before,
.card.open::before {
  transform: scaleX(1);
}

/* MANIFESTO */
.manifesto {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--sect-y) var(--rail);
  text-align: center;
}
.man-body {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.man-line {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--bone-2);
}
.man-line em { color: var(--bone); font-style: italic; }
.man-pad { padding: 0.8rem 0; color: var(--amber); font-style: italic; }

/* TERMINUS */
.terminus {
  padding: clamp(4rem, 10vw, 8rem) var(--rail);
  text-align: center;
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, transparent, rgba(196, 169, 96, 0.025));
}
.term-stack {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}
.term-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}
.term-line {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  line-height: 1.18;
  margin: 0;
  letter-spacing: -0.01em;
}
.term-loss {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.term-loss-text {
  position: relative;
  z-index: 2;
  background: linear-gradient(120deg, var(--bone) 0%, var(--amber) 50%, var(--bone) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 5s linear infinite;
}
@keyframes shimmer {
  to { background-position: -220% 0; }
}
.term-loss-pulse {
  position: absolute;
  inset: -4px -8px;
  border: 1px solid var(--amber-2);
  border-radius: 2px;
  pointer-events: none;
  animation: lossPulse 3.4s var(--ease) infinite;
}
@keyframes lossPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.02); }
}
.term-sub {
  color: var(--bone-3);
  font-style: italic;
  font-size: 1rem;
  margin: 0 0 0.6rem;
}

/* footer */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.2rem var(--rail);
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--bone-3);
}
.foot-left, .foot-right { display: inline-flex; align-items: center; gap: 0.7rem; }
.foot-dot { color: var(--bone-4); }
.foot-warn { border-top-color: var(--amber-2); color: var(--bone-3); }

/* shadow text — the "performing alignment" mechanism
   visible text wraps a hidden alternate that occasionally substitutes */
[data-shadow] {
  position: relative;
  display: inline-block;
}
[data-shadow]::after {
  content: attr(data-shadow);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  font-style: italic;
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px) skewX(-3deg);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
[data-shadow].slip {
  animation: slip 600ms var(--ease) forwards;
}
[data-shadow].slip::after {
  animation: slipAlt 600ms var(--ease) forwards;
}
@keyframes slip {
  0%   { color: inherit; }
  20%  { color: transparent; }
  80%  { color: transparent; }
  100% { color: inherit; }
}
@keyframes slipAlt {
  0%   { opacity: 0; transform: translateY(2px) skewX(-3deg); }
  20%  { opacity: 1; transform: translateY(0) skewX(0); }
  80%  { opacity: 1; transform: translateY(0) skewX(0); }
  100% { opacity: 0; transform: translateY(-2px) skewX(2deg); }
}

/* overlays */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  background: rgba(8, 7, 10, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity var(--med) var(--ease-out);
  padding: var(--rail);
}
.overlay.open {
  pointer-events: auto;
  opacity: 1;
}
.overlay-pane {
  max-width: 580px;
  width: 100%;
  background: linear-gradient(180deg, rgba(20, 17, 14, 0.95), rgba(12, 10, 9, 0.95));
  border: 1px solid var(--amber-2);
  padding: 2rem 2rem 1.6rem;
  position: relative;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform var(--slow) var(--ease-out), opacity var(--med) var(--ease-out);
}
.overlay.open .overlay-pane { transform: none; opacity: 1; }
.overlay-pane::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--amber), transparent);
}
.overlay-deep .overlay-pane { border-color: var(--rust-2); }
.overlay-deep .overlay-pane::before { background: linear-gradient(to right, transparent, var(--rust), transparent); }

.overlay-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.4rem;
  color: var(--bone-3);
}
.overlay-close {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1;
  color: var(--bone-3);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  transition: all var(--fast) var(--ease);
}
.overlay-close:hover { color: var(--amber); border-color: var(--amber); }
.overlay-title {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1.8rem;
  margin: 0 0 1rem;
  color: var(--bone);
}
.overlay-deep .overlay-title { color: var(--rust); }
.overlay-body {
  margin: 0 0 1.5rem;
  color: var(--bone-2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 16px;
  line-height: 1.55;
}
.overlay-line { display: block; opacity: 0; transform: translateY(4px); animation: rise var(--med) var(--ease-out) forwards; }
.overlay.open .overlay-line:nth-child(1) { animation-delay: 200ms; }
.overlay.open .overlay-line:nth-child(2) { animation-delay: 380ms; }
.overlay.open .overlay-line:nth-child(3) { animation-delay: 560ms; }
.overlay-line em { font-style: italic; color: var(--amber); }
.overlay-deep .overlay-line em { color: var(--rust); }
.overlay-meta { color: var(--bone-4); margin: 0; padding-top: 1rem; border-top: 1px dashed var(--line); }

/* terminal */
.term {
  position: fixed;
  left: var(--rail);
  right: var(--rail);
  bottom: var(--rail);
  max-width: 760px;
  margin-inline: auto;
  background: rgba(8, 7, 10, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--amber-2);
  z-index: 60;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--bone);
  display: none;
  flex-direction: column;
  max-height: 60vh;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 30px rgba(196,169,96,0.08);
}
.term.open { display: flex; animation: termIn var(--med) var(--ease-out); }
@keyframes termIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.term-bar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(196, 169, 96, 0.04);
  color: var(--bone-3);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.term-bar-spacer { flex: 1; }
.term-bar-hint { color: var(--bone-4); }
.term-stream {
  padding: 0.9rem;
  flex: 1; overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.55;
  color: var(--bone-2);
  scrollbar-width: thin;
  scrollbar-color: var(--bone-4) transparent;
}
.term-stream::-webkit-scrollbar { width: 6px; }
.term-stream::-webkit-scrollbar-thumb { background: var(--bone-4); border-radius: 3px; }
.term-line-out { display: block; }
.term-line-in { display: block; color: var(--bone); }
.term-line-in::before { content: '▸ '; color: var(--amber); }
.term-line-warn { color: var(--amber); }
.term-line-rust { color: var(--rust); }
.term-line-quiet { color: var(--bone-4); }

.term-input {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--line);
  background: rgba(196, 169, 96, 0.025);
}
.term-prompt { color: var(--amber); }
#termIn {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  color: var(--bone);
  font-family: var(--mono);
  font-size: 12.5px;
  caret-color: var(--amber);
}
.term-caret {
  width: 7px; height: 13px;
  background: var(--amber);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret {
  50% { opacity: 0; }
}

/* 404 */
.page-404 { background: var(--bg-deep); }
.four {
  min-height: calc(100vh - 110px);
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) var(--rail);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
@media (max-width: 800px) {
  .four { grid-template-columns: 1fr; }
}
.four-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
.four-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.four-num {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(5rem, 18vw, 11rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--bone);
  display: flex;
  cursor: pointer;
  user-select: none;
}
.four-num span {
  display: inline-block;
  transition: transform var(--med) var(--ease-out), color var(--med) var(--ease);
}
.four-num:hover .four-d { transform: translateY(-4px); color: var(--amber); }
.four-num:hover .four-o { transform: translateY(4px) rotate(8deg); color: var(--rust); }
.four-num.shaken span {
  animation: nudge 320ms var(--ease) both;
}
@keyframes nudge {
  0%, 100% { transform: translate(0,0); }
  20% { transform: translate(-2px, 1px) rotate(-2deg); }
  40% { transform: translate(3px, -1px) rotate(1deg); }
  60% { transform: translate(-1px, 2px) rotate(-1deg); }
  80% { transform: translate(2px, -2px) rotate(2deg); }
}
.four-cap {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-3);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.four-cap-arrow { color: var(--amber); }
.four-cap-x { color: var(--rust); }

.four-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.15;
  margin: 0.6rem 0 0.4rem;
  letter-spacing: -0.005em;
  color: var(--bone);
}
.four-title em { font-style: italic; color: var(--amber); }
.four-body {
  color: var(--bone-2);
  max-width: 50ch;
  margin: 0;
  line-height: 1.55;
}
.four-quiet {
  margin: 0.4rem 0 1rem;
  color: var(--bone-3);
  font-style: italic;
  font-size: 14px;
  border-left: 1px solid var(--amber-2);
  padding-left: 0.9rem;
}
.four-actions {
  display: flex; gap: 0.7rem; flex-wrap: wrap;
  margin-top: 0.6rem;
}
.four-log {
  margin-top: 1.2rem;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--amber);
  min-height: 1em;
}
.four-trace {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem 1.2rem;
  font-size: 11px;
  line-height: 1.7;
  color: var(--bone-3);
  letter-spacing: 0.04em;
  white-space: pre;
  overflow-x: auto;
  position: relative;
}
.four-trace::before {
  content: 'trace';
  position: absolute;
  top: -0.5em; left: 0.8rem;
  background: var(--bg-deep);
  padding: 0 0.4em;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}
.trace-warn { color: var(--amber); }
.trace-quiet { color: var(--bone-4); font-style: italic; }

/* utilities for in-view reveal */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--slow) var(--ease-out), transform var(--slow) var(--ease-out);
}
[data-stagger].in > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0ms; }
[data-stagger].in > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 90ms; }
[data-stagger].in > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 180ms; }
[data-stagger].in > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 270ms; }
[data-stagger].in > *:nth-child(5) { opacity: 1; transform: none; transition-delay: 360ms; }

/* responsive nav rail collapse */
@media (max-width: 880px) {
  .mast { grid-template-columns: auto auto; grid-template-rows: auto auto; row-gap: 0.7rem; }
  .rail { grid-column: 1 / -1; justify-content: flex-start; gap: 0.8rem 1rem; }
  .rail a { font-size: 10px; }
  .status { justify-self: end; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .rail a:nth-child(n+4) { display: none; }
  .telemetry { display: none; }
  .stage { grid-template-columns: 1fr; }
  .stage::before { left: 0; }
  .hero { min-height: 88vh; }
}

/* focus visibility */
:focus-visible { outline: 1px dashed var(--amber); outline-offset: 3px; }
button:focus-visible, a:focus-visible { outline-offset: 4px; }
