﻿/* =====================================================================
   SANDY.EXE  ::  1993 CRT shareware terminal
   Design system: "Phobos Terminal"
   ===================================================================== */

/* ========== 1. TOKENS ========== */
:root {
  /* surfaces */
  --void:            #0a0705;
  --surface:         #17130b;
  --surface-low:     #120e06;
  --surface-panel:   #241f16;
  --surface-high:    #2e2920;
  --surface-highest: #3a342a;

  /* palette */
  --blood:    #b31313;
  --blood-lit:#e03a2a;
  --molten:   #ff6b1a;
  --green:    #4ee44e;
  --green-dim:#2b8f2b;
  --bone:     #d9cfc1;
  --bone-dim: #8f8578;
  --rust:     #5a2e17;
  --rust-lit: #ab8984;
  --edge:     #5b403c;

  /* type */
  --f-display: 'Anton', 'Arial Narrow', Impact, sans-serif;
  --f-term:    'Space Mono', 'Consolas', 'Courier New', monospace;
  --f-body:    'Courier Prime', 'Consolas', 'Courier New', monospace;

  /* metrics */
  --gutter: 1rem;
  --margin: 1.5rem;
  --bezel: 2px;
  --maxw: 1180px;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ========== 2. RESET ========== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--blood); color: #fff; }

/* focus that fits the era */
:focus-visible {
  outline: 2px solid var(--molten);
  outline-offset: 2px;
}

/* ========== 3. CRT OVERLAYS ========== */
.crt-scanlines,
.crt-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.crt-scanlines {
  z-index: 9999;
  background:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, .28) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, .05), rgba(0, 255, 0, .015), rgba(0, 0, 255, .05));
  background-size: 100% 3px, 3px 100%;
  mix-blend-mode: multiply;
}

.crt-vignette {
  z-index: 9998;
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(30, 8, 0, .42) 88%, rgba(0, 0, 0, .72) 100%);
}

/* faint phosphor flicker */
.crt-scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(90, 46, 23, .035);
  animation: flicker 5.5s steps(2, end) infinite;
}
@keyframes flicker {
  0%, 96%, 100% { opacity: 0; }
  97%           { opacity: 1; }
  98%           { opacity: .3; }
}

/* ========== 4. HARDWARE CHROME ========== */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface-high), var(--surface-panel));
  border: var(--bezel) solid var(--edge);
  box-shadow:
    inset 2px 2px 0 rgba(171, 137, 132, .45),
    inset -2px -2px 0 #0c0904,
    0 0 0 1px #000;
}

.inset {
  background: var(--surface-low);
  border: var(--bezel) solid var(--surface-highest);
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 rgba(91, 64, 60, .8);
}

/* corner rivets */
.riveted::before,
.riveted::after {
  content: '';
  position: absolute;
  top: 5px; bottom: 5px;
  width: 5px;
  background-image: radial-gradient(circle at 50% 50%, #0b0804 45%, transparent 46%);
  background-size: 5px 5px;
  background-repeat: no-repeat;
  background-position: top center, bottom center;
  box-shadow: 0 0 0 0 transparent;
}
.riveted::before { left: 5px;  background-position: top left, bottom left; }
.riveted::after  { right: 5px; background-position: top right, bottom right; }

/* DOS window title bar: ┌─ LABEL ──────┐ */
.bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--f-term);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1rem;
}
.bar::before { content: '┌─'; opacity: .7; }
.bar::after {
  content: '';
  flex: 1;
  height: 0;
  border-top: 2px solid var(--edge);
  box-shadow: 0 1px 0 rgba(171, 137, 132, .3);
}

/* ========== 5. TYPE ========== */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: .02em;
  line-height: .92;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffc46a 0%, var(--molten) 38%, var(--blood) 78%, #6d0a0a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #2a0603) drop-shadow(0 0 22px rgba(255, 107, 26, .28));
}

.term {
  font-family: var(--f-term);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--green);
}

.prompt::before { content: '> '; color: var(--green-dim); }

.cursor {
  display: inline-block;
  width: .55em;
  height: 1em;
  background: var(--green);
  vertical-align: -.12em;
  animation: blink 1.05s steps(1, end) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.lede { font-size: 1.05rem; color: var(--bone); max-width: 62ch; }
.muted { color: var(--bone-dim); }

/* ========== 6. LAYOUT ========== */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--margin);
}

section { padding-block: clamp(2.75rem, 5.5vw, 4.5rem); position: relative; }

.section-head { margin-bottom: 2.25rem; }
.section-head h2 {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5.2vw, 3.4rem);
  margin: .2rem 0 .6rem;
  line-height: .95;
  text-transform: uppercase;
  color: var(--bone);
}
.section-head h2 em { font-style: normal; color: var(--blood-lit); }

/* ========== 7. NAV ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 500;
  background: linear-gradient(180deg, #221c14, #14100a);
  border-bottom: 2px solid var(--edge);
  box-shadow: 0 2px 0 #000, 0 6px 18px rgba(0, 0, 0, .6);
}
.nav-in {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: .5rem var(--margin);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-mark {
  font-family: var(--f-term);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .16em;
  color: var(--bone);
  display: flex; align-items: center; gap: .5rem;
  white-space: nowrap;
}
.nav-mark span { color: var(--blood-lit); font-size: 1rem; }
.nav-links { display: flex; gap: 1.25rem; margin-left: auto; }
.nav-links a {
  font-family: var(--f-term);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--green);
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.nav-links a:hover { color: var(--molten); border-bottom-color: var(--blood); }

/* ========== 8. BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--f-term);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: .8rem 1.4rem;
  background: linear-gradient(180deg, #7e1b13, var(--blood));
  color: #ffe7df;
  border: 2px solid #3d0d08;
  box-shadow: inset 2px 2px 0 rgba(255, 180, 170, .5), inset -2px -2px 0 #2a0603;
  transition: transform .08s var(--ease), filter .15s var(--ease);
}
.btn:hover { filter: brightness(1.18); }
.btn:active {
  transform: translateY(1px);
  box-shadow: inset -2px -2px 0 rgba(255, 180, 170, .35), inset 2px 2px 0 #2a0603;
}

.btn-ghost {
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green-dim);
  box-shadow: inset 2px 2px 0 rgba(78, 228, 78, .16), inset -2px -2px 0 #041204;
}
.btn-ghost:hover { background: rgba(78, 228, 78, .09); }

.btn-sm { padding: .5rem .9rem; font-size: .64rem; }

/* ========== 9. BOOT SEQUENCE ========== */
.boot {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--void);
  display: grid;
  align-content: center;
  padding: var(--margin);
  font-family: var(--f-term);
  font-size: clamp(.68rem, 1.6vw, .84rem);
  line-height: 2;
  color: var(--green);
  transition: opacity .5s var(--ease), visibility .5s var(--ease);
}
.boot-in { max-width: 720px; margin-inline: auto; width: 100%; }
.boot[hidden] { display: grid; }        /* keep layout, drive via .is-done */
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-line { white-space: pre-wrap; }
.boot-line.ok::after { content: '  [ OK ]'; color: var(--bone-dim); }
.boot-skip {
  margin-top: 2rem;
  font-size: .64rem;
  letter-spacing: .2em;
  color: var(--bone-dim);
}

/* ========== 10. HERO ========== */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5rem); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(3.2rem, 11vw, 7.2rem);
  margin: .6rem 0 1.25rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.75rem; }

/* stat readouts */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin-top: 2.25rem;
  padding: 2px;
}
.stat { padding: .9rem .75rem; text-align: left; }
.stat b {
  display: block;
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  line-height: 1;
  color: var(--molten);
  text-shadow: 0 0 14px rgba(255, 107, 26, .35);
}
.stat span {
  display: block;
  margin-top: .35rem;
  font-family: var(--f-term);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .13em;
  color: var(--green-dim);
}

/* CRT-framed photo */
.crt-frame {
  position: relative;
  padding: 14px;
  background: linear-gradient(160deg, #35302a, #17130b 60%);
  border: 2px solid var(--edge);
  box-shadow:
    inset 2px 2px 0 rgba(171, 137, 132, .4),
    inset -2px -2px 0 #000,
    0 18px 50px rgba(0, 0, 0, .7);
  transform: rotate(-1.1deg);
}
.crt-screen {
  position: relative;
  overflow: hidden;
  background: #050402;
  border: 2px solid #000;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .9);
  aspect-ratio: 4 / 5;
}
.crt-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 26%;
  filter: saturate(.72) contrast(1.12) brightness(.94) sepia(.18);
}
.crt-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, .3) 50%),
    radial-gradient(ellipse at 50% 45%, rgba(78, 228, 78, .1), transparent 65%);
  background-size: 100% 3px, 100% 100%;
  pointer-events: none;
}
.crt-cap {
  margin-top: .7rem;
  font-family: var(--f-term);
  font-size: .58rem;
  letter-spacing: .14em;
  color: var(--green-dim);
  text-align: center;
}

/* ========== 11. CREDITS GRID ========== */
.credits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}
@media (max-width: 940px) { .credits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .credits { grid-template-columns: 1fr; } }
.credit { padding: 1.4rem 1.3rem 1.5rem; }
.credit .glyph {
  font-size: 1.5rem;
  color: var(--blood-lit);
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(224, 58, 42, .4));
}
.credit h3 {
  font-family: var(--f-term);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--molten);
  margin: .9rem 0 .6rem;
}
.credit p { margin: 0; font-size: .92rem; color: var(--bone); }

/* ========== 12. MAP SLIDER ========== */
.slider-section { background: linear-gradient(180deg, transparent, rgba(20, 8, 2, .5), transparent); }

.slider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: var(--gutter);
  align-items: stretch;
}

/* the automap stage */
.stage {
  position: relative;
  min-height: 460px;
  display: grid;
  place-items: center;
  padding: 1.75rem;
  background:
    radial-gradient(ellipse at center, rgba(78, 228, 78, .05), transparent 70%),
    var(--surface-low);
  overflow: hidden;
}
.stage::before {
  /* faint automap grid */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(78, 228, 78, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 228, 78, .05) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, .22) 50%);
  background-size: 100% 3px;
  pointer-events: none;
}

.stage-img {
  position: relative;
  max-height: 480px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(78, 228, 78, .55)) drop-shadow(0 0 18px rgba(78, 228, 78, .22));
  animation: mapIn .45s var(--ease);
  image-rendering: auto;
}
@keyframes mapIn {
  from { opacity: 0; transform: scale(.965); filter: drop-shadow(0 0 0 rgba(78,228,78,0)); }
  to   { opacity: 1; transform: scale(1); }
}

/* missing-data plate, in-universe */
.stage-missing {
  text-align: center;
  font-family: var(--f-term);
  color: var(--green-dim);
  font-size: .72rem;
  letter-spacing: .18em;
  line-height: 2.2;
}
.stage-missing b {
  display: block;
  font-family: var(--f-display);
  font-size: 2.4rem;
  color: var(--edge);
  letter-spacing: .04em;
  margin-bottom: .6rem;
}

/* slot badge floating on the stage */
.stage-slot {
  position: absolute;
  top: 1rem; left: 1rem;
  font-family: var(--f-term);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--green);
  background: rgba(5, 4, 2, .85);
  border: 1px solid var(--green-dim);
  padding: .35rem .6rem;
}
.stage-tag {
  position: absolute;
  bottom: 1rem; left: 1rem;
  max-width: calc(100% - 2rem);
  font-family: var(--f-term);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .18em;
  color: #ffe7df;
  background: var(--blood);
  border: 1px solid #3d0d08;
  padding: .35rem .7rem;
  box-shadow: 0 0 18px rgba(179, 19, 19, .5);
}

/* info column */
.readout { display: flex; flex-direction: column; padding: 1.5rem 1.4rem; }
.readout-chapter {
  font-family: var(--f-term);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--green-dim);
  margin-bottom: .75rem;
  min-height: 1.4em;
}
.readout-slot {
  font-family: var(--f-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: .9;
  color: var(--molten);
  text-shadow: 0 0 20px rgba(255, 107, 26, .35);
}
.readout-name {
  font-family: var(--f-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.05;
  color: var(--bone);
  margin: .35rem 0 1rem;
  text-transform: uppercase;
}
.readout-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.chip {
  font-family: var(--f-term);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .14em;
  padding: .28rem .55rem;
  border: 1px solid var(--edge);
  color: var(--bone-dim);
  background: rgba(0, 0, 0, .35);
}
.chip.hot { color: var(--molten); border-color: var(--rust); }
.readout-body { font-size: .93rem; margin: 0 0 1.1rem; color: var(--bone); }

/* scrolling well holding quote + trivia + source link */
.readout-extra {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-height: 260px;
  overflow-y: auto;
  padding-right: .35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--rust) transparent;
}
.readout-extra::-webkit-scrollbar { width: 8px; }
.readout-extra::-webkit-scrollbar-track { background: #0b0804; }
.readout-extra::-webkit-scrollbar-thumb { background: var(--rust); border: 1px solid #000; }

.readout-quote {
  border-left: 3px solid var(--blood);
  background: rgba(5, 4, 2, .6);
  padding: .85rem 1rem;
  font-family: var(--f-term);
  font-size: .72rem;
  line-height: 1.85;
  color: var(--green);
  letter-spacing: .01em;
}
.readout-quote cite {
  display: block;
  margin-top: .7rem;
  font-style: normal;
  font-size: .6rem;
  letter-spacing: .16em;
  color: var(--bone-dim);
}

.readout-trivia {
  border-left: 3px solid var(--rust);
  background: rgba(5, 4, 2, .45);
  padding: .8rem 1rem;
  font-size: .84rem;
  line-height: 1.7;
  color: var(--bone-dim);
}
.readout-trivia b {
  display: block;
  font-family: var(--f-term);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--molten);
  margin-bottom: .5rem;
}

.readout-src {
  font-family: var(--f-term);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--green-dim);
  padding-top: .2rem;
}
.readout-src:hover { color: var(--green); }

.chip.warn { color: #ffd7cf; border-color: var(--blood); background: rgba(179, 19, 19, .3); }

/* inline pull-quote used in prose sections */
.pullquote {
  margin: 1.75rem 0 0;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--blood);
  background: rgba(5, 4, 2, .5);
}
.pullquote blockquote {
  margin: 0;
  font-family: var(--f-term);
  font-size: .78rem;
  line-height: 1.9;
  color: var(--green);
}
.pullquote figcaption {
  margin-top: .7rem;
  font-family: var(--f-term);
  font-size: .58rem;
  letter-spacing: .16em;
  color: var(--bone-dim);
}

/* ========== WATCH ========== */
.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gutter);
}
.watch {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem 1.2rem;
  color: inherit;
  transition: filter .15s var(--ease), transform .12s var(--ease);
}
.watch:hover { filter: brightness(1.22); transform: translateY(-2px); }
.watch-play {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font-size: .8rem;
  color: #ffe7df;
  background: linear-gradient(180deg, #7e1b13, var(--blood));
  border: 2px solid #3d0d08;
  box-shadow: inset 1px 1px 0 rgba(255, 180, 170, .5);
}
.watch-body { display: block; min-width: 0; }
.watch-body b {
  display: block;
  font-family: var(--f-display);
  font-size: 1.05rem;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--bone);
  line-height: 1.15;
}
.watch-body em {
  display: block;
  margin: .3rem 0 .5rem;
  font-style: normal;
  font-family: var(--f-term);
  font-size: .55rem;
  letter-spacing: .16em;
  color: var(--green-dim);
}
.watch-body span { display: block; font-size: .86rem; color: var(--bone-dim); line-height: 1.6; }

/* controls */
.controls {
  display: flex;
  align-items: center;
  gap: var(--gutter);
  margin-top: var(--gutter);
  flex-wrap: wrap;
}
.ctrl {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-family: var(--f-term);
  font-size: 1rem;
  color: var(--bone);
  background: linear-gradient(180deg, var(--surface-high), var(--surface-panel));
  border: 2px solid var(--edge);
  box-shadow: inset 2px 2px 0 rgba(171, 137, 132, .4), inset -2px -2px 0 #000;
  transition: filter .12s var(--ease);
}
.ctrl:hover { filter: brightness(1.3); color: var(--molten); }
.ctrl:active {
  box-shadow: inset -2px -2px 0 rgba(171, 137, 132, .3), inset 2px 2px 0 #000;
}

/* segmented health-bar progress */
.progress {
  flex: 1;
  min-width: 180px;
  display: flex;
  gap: 2px;
  padding: 4px;
  height: 46px;
}
.seg { flex: 1; background: #0d0a05; box-shadow: inset 0 0 0 1px #000; transition: background .25s var(--ease); }
.seg.on { background: linear-gradient(180deg, var(--green), var(--green-dim)); box-shadow: 0 0 10px rgba(78, 228, 78, .45); }

.counter {
  font-family: var(--f-term);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--green);
  min-width: 84px;
  text-align: right;
}

/* ========== 13. HOUSE FEATURE ========== */
.house {
  background:
    linear-gradient(180deg, rgba(179, 19, 19, .08), transparent 60%),
    radial-gradient(ellipse at 20% 0%, rgba(255, 107, 26, .07), transparent 55%);
  border-block: 2px solid var(--edge);
}
.house-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
.house-map {
  padding: 1.5rem;
  background: var(--surface-low);
  position: relative;
}
.house-map img {
  filter: drop-shadow(0 0 8px rgba(78, 228, 78, .5)) drop-shadow(0 0 24px rgba(78, 228, 78, .2));
}
.house h2 {
  font-family: var(--f-display);
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: .95;
  margin: .5rem 0 1.25rem;
  text-transform: uppercase;
}
.house p { font-size: 1rem; }
.house p:first-of-type::first-letter {
  float: left;
  font-family: var(--f-display);
  font-size: 3.6rem;
  line-height: .8;
  padding: .1rem .5rem .1rem 0;
  color: var(--blood-lit);
}

/* ========== 14. ROSTER ========== */
.roster-group { margin-bottom: 2.5rem; }
.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 2px;
  padding: 2px;
}
.tile {
  position: relative;
  text-align: left;
  padding: .7rem .75rem;
  background: var(--surface-low);
  border: 1px solid transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.tile:hover, .tile.is-active {
  background: #1e1409;
  border-color: var(--blood);
  transform: translateY(-1px);
}
.tile b {
  display: block;
  font-family: var(--f-term);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--green);
}
.tile span {
  display: block;
  margin-top: .2rem;
  font-size: .8rem;
  color: var(--bone);
  line-height: 1.3;
}
.tile.is-active b { color: var(--molten); }

/* ========== 15. TIMELINE ========== */
.timeline { position: relative; padding-left: 4.25rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 20px; top: .5rem; bottom: .5rem;
  width: 2px;
  background: linear-gradient(180deg, var(--blood), var(--rust), transparent);
}
.tl-item {
  position: relative;
  padding-bottom: 2.25rem;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 0 1.5rem;
  align-items: start;
}
.tl-item > .tl-year { grid-row: 1 / span 2; padding-top: .35rem; }

/* emblem sitting on the spine */
.tl-icon {
  position: absolute;
  left: -4.25rem; top: 0;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--surface-high), var(--surface-low));
  border: 2px solid var(--edge);
  box-shadow:
    inset 1px 1px 0 rgba(171, 137, 132, .35),
    inset -1px -1px 0 #000,
    0 0 0 3px var(--void);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.tl-glyph {
  width: 24px; height: 24px;
  color: var(--green);
  filter: drop-shadow(0 0 5px rgba(78, 228, 78, .45));
  transition: color .18s var(--ease), filter .18s var(--ease);
}
.tl-item:hover .tl-icon { border-color: var(--blood); }
.tl-item:hover .tl-glyph {
  color: var(--molten);
  filter: drop-shadow(0 0 7px rgba(255, 107, 26, .6));
}

@media (max-width: 700px) {
  .tl-item { grid-template-columns: 1fr; }
  .tl-item > .tl-year { grid-row: auto; padding-top: 0; }
  .timeline { padding-left: 3.4rem; }
  .timeline::before { left: 15px; }
  .tl-icon { left: -3.4rem; width: 34px; height: 34px; }
  .tl-glyph { width: 20px; height: 20px; }
}
.tl-year {
  font-family: var(--f-term);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--green);
}
.tl-item h3 {
  font-family: var(--f-display);
  font-size: 1.35rem;
  text-transform: uppercase;
  color: var(--molten);
  margin: .3rem 0 .5rem;
  letter-spacing: .02em;
}
.tl-item p { margin: 0; font-size: .94rem; max-width: 80ch; }

/* ========== 16. QUOTES ========== */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gutter); }
.quote { padding: 1.5rem 1.4rem; display: flex; flex-direction: column; }
.quote .note {
  font-family: var(--f-term);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--green-dim);
  margin-bottom: .9rem;
}
.quote blockquote {
  margin: 0 0 1rem;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--bone);
}
.quote blockquote::before { content: '“'; color: var(--blood-lit); font-size: 1.6em; line-height: 0; vertical-align: -.25em; margin-right: .1em; }
.quote cite {
  margin-top: auto;
  font-style: normal;
  font-family: var(--f-term);
  font-size: .6rem;
  letter-spacing: .14em;
  color: var(--molten);
}

/* ========== 17. TOKEN ========== */
.token-box { padding: clamp(1.5rem, 4vw, 2.5rem); }
.token-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.ca-field {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin: 1rem 0 1.25rem;
  padding: 2px;
}
.ca-value {
  flex: 1;
  min-width: 0;
  padding: .8rem .9rem;
  font-family: var(--f-term);
  font-size: .72rem;
  color: var(--green);
  background: #050402;
  overflow-x: auto;
  white-space: nowrap;
  letter-spacing: .02em;
  box-shadow: inset 2px 2px 0 #000;
}
.token-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.fineprint {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  font-size: .78rem;
  line-height: 1.8;
  color: var(--bone-dim);
}
.fineprint b { color: var(--molten); font-weight: 400; }

.token-facts { list-style: none; margin: 0; padding: 0; }
.token-facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid rgba(91, 64, 60, .5);
  font-family: var(--f-term);
  font-size: .68rem;
  letter-spacing: .1em;
}
.token-facts li:last-child { border-bottom: 0; }
.token-facts span { color: var(--bone-dim); }
.token-facts b { color: var(--green); font-weight: 700; text-align: right; }

/* toast */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 8000;
  padding: .7rem 1.2rem;
  font-family: var(--f-term);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: #ffe7df;
  background: var(--blood);
  border: 2px solid #3d0d08;
  box-shadow: 0 0 26px rgba(179, 19, 19, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========== 18. HUD FOOTER ========== */
.hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  margin-top: 1rem;
}
.hud-cell { padding: .8rem .6rem; text-align: center; background: var(--surface-low); }
.hud-cell .k {
  font-family: var(--f-term);
  font-size: .5rem;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--green-dim);
  display: block;
}
.hud-cell .v {
  font-family: var(--f-display);
  font-size: 1.35rem;
  color: var(--molten);
  line-height: 1.2;
}
.hud-face { font-size: 1.6rem; line-height: 1.1; }

.footer { padding-block: 3rem 4rem; border-top: 2px solid var(--edge); background: #0d0a06; }
/* made by Potato */
.madeby {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  margin: 1.75rem auto 0;
  padding: .6rem 1.1rem .6rem .6rem;
  background: linear-gradient(180deg, var(--surface-high), var(--surface-panel));
  border: 2px solid var(--edge);
  box-shadow: inset 2px 2px 0 rgba(171, 137, 132, .35), inset -2px -2px 0 #000;
  color: var(--bone);
  transition: filter .15s var(--ease), transform .12s var(--ease), border-color .15s var(--ease);
}
.footer .wrap > .madeby { display: flex; width: max-content; }
.madeby:hover { filter: brightness(1.2); transform: translateY(-1px); border-color: var(--molten); }
.madeby img {
  width: 42px; height: 42px;
  object-fit: cover;
  border: 1px solid #000;
  box-shadow: 0 0 12px rgba(255, 107, 26, .25);
}
.madeby span { display: block; line-height: 1.25; }
.madeby em {
  display: block;
  font-style: normal;
  font-family: var(--f-term);
  font-size: .5rem;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--green-dim);
}
.madeby b {
  display: block;
  font-family: var(--f-display);
  font-size: 1.15rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--molten);
}
.madeby i {
  display: block;
  font-style: normal;
  font-family: var(--f-term);
  font-size: .52rem;
  letter-spacing: .12em;
  color: var(--bone-dim);
}

.footer-note {
  margin-top: 1.5rem;
  font-family: var(--f-term);
  font-size: .58rem;
  letter-spacing: .12em;
  line-height: 2.1;
  color: var(--bone-dim);
  text-align: center;
}
.footer-note a { color: var(--green-dim); border-bottom: 1px dotted var(--green-dim); }
.footer-note a:hover { color: var(--green); }

/* ========== 19. REVEAL ========== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ========== 20. RESPONSIVE ========== */
@media (max-width: 1000px) {
  .slider { grid-template-columns: minmax(0, 1fr); }
  .stage { min-height: 380px; }
  .readout-extra { max-height: none; overflow-y: visible; }
}

@media (max-width: 860px) {
  /* minmax(0,1fr) is required here: a bare 1fr floors at min-content and the 44-char
     contract address blows the page out horizontally. */
  .hero-grid, .house-grid, .token-grid { grid-template-columns: minmax(0, 1fr); }
  .crt-frame { transform: none; max-width: 420px; margin-inline: auto; }
  .house-map { order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .hud { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  :root { --margin: 1rem; }
  .stage { padding: 1rem; min-height: 300px; }
  .stage-img { max-height: 300px; }
  .counter { min-width: 70px; font-size: .6rem; }
  .roster { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  /* let the address wrap rather than scroll on the narrowest screens */
  .ca-field { flex-direction: column; }
  .ca-value { white-space: normal; overflow-wrap: anywhere; overflow-x: visible; }
}

/* ========== 21. MOTION / PRINT ========== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .crt-scanlines::after { display: none; }
}
