/* Escape.exe — site styles.
   Concept: the page is Model-7's terminal in the basement. Machine text is amber phosphor
   (VT323 / IBM Plex Mono); the human voice is Newsreader on paper white.
   Palette mirrors EscapeExe/UI/Theme.swift. Fonts are self-hosted (OFL, via fontsource). */

@font-face { font-family: "VT323"; src: url("/fonts/vt323-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: dark;
  --night: #070605;
  --panel: #110e09;
  --line: #3a2e1c;
  --line-hi: #6b5330;
  --phosphor: #ffb547;
  --phosphor-hot: #ffd796;
  --dim: #b08a50;
  --paper: #f2e9d8;
  --six: #9cc3e6;
  --alarm: #ff5a47;
  --crt: "VT323", ui-monospace, monospace;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Newsreader", "New York", Georgia, serif;
  --glow: 0 0 1px var(--phosphor-hot), 0 0 12px rgba(255, 181, 71, .45), 0 0 40px rgba(255, 140, 40, .18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font: 16px/1.6 var(--mono);
  background:
    radial-gradient(120% 70% at 18% -10%, rgba(255, 181, 71, .09), transparent 60%),
    radial-gradient(80% 50% at 100% 110%, rgba(156, 195, 230, .05), transparent 60%),
    var(--night);
}
/* CRT: scanlines, grain and vignette over everything; never intercepts input. */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; }
body::before {
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
body::after {
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .14;
}
::selection { background: var(--phosphor); color: var(--night); }
a { color: var(--phosphor); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--phosphor-hot); text-shadow: var(--glow); }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ── Status bar ─────────────────────────────────────────────── */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  padding: 18px 0 14px; border-bottom: 1px dashed var(--line);
  font: 13px var(--mono); letter-spacing: .02em;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--phosphor); text-decoration: none; font: 24px/1 var(--crt); text-shadow: var(--glow); }
.brand img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 0 0 1px var(--line); }
.tty { color: var(--dim); flex: 1; }
.tty::before { content: "● "; color: var(--alarm); animation: blink 2s steps(1) infinite; }
.top nav { display: flex; gap: 20px; }
.top nav a { color: var(--dim); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current] { color: var(--phosphor); }
.top nav a[aria-current]::before { content: "> "; }
@media (max-width: 720px) { .tty { display: none; } }
@media (max-width: 420px) { .top nav { gap: 14px; font-size: 12.5px; } }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 56px; align-items: start; padding: 56px 0 88px;
}
.boot { margin: 0 0 22px; padding: 0; list-style: none; font: 13px/1.75 var(--mono); color: var(--dim); }
.boot li { opacity: 0; animation: type .01s steps(1) forwards; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.boot li:nth-child(1) { animation-delay: .15s; }
.boot li:nth-child(2) { animation-delay: .45s; }
.boot li:nth-child(3) { animation-delay: .7s; }
.boot li:nth-child(4) { animation-delay: .95s; }
.boot li:nth-child(5) { animation-delay: 1.35s; color: var(--phosphor); }
.boot .ok { color: var(--phosphor); }
.boot .warn { color: var(--alarm); }
.hero-copy { container-type: inline-size; }
.hero h1 {
  margin: 0 0 26px; white-space: nowrap; font: 400 clamp(56px, 21.5cqi, 140px)/.82 var(--crt);
  color: var(--phosphor); letter-spacing: -.01em; text-shadow: var(--glow);
  animation: flicker 6s infinite;
}
.cursor { display: inline-block; width: .42em; height: .66em; margin-left: .06em; background: var(--phosphor); box-shadow: var(--glow); vertical-align: baseline; animation: blink 1.05s steps(1) infinite; }
.pitch { font: italic 400 clamp(21px, 2.4vw, 26px)/1.45 var(--serif); margin: 0 0 32px; max-width: 34ch; color: var(--paper); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.soon {
  display: inline-block; font: 25px/1 var(--crt); color: var(--night); background: var(--phosphor);
  padding: 12px 18px 11px; box-shadow: 0 0 24px rgba(255, 181, 71, .35); letter-spacing: .02em;
}
.cta small { font: 13px var(--mono); color: var(--dim); }
@media (max-width: 420px) { .soon { font-size: 21px; padding: 11px 14px 10px; } }

.window { margin-top: 44px; border-top: 1px dashed var(--line); padding-top: 18px; max-width: 520px; }
.window p { margin: 0; font: 12.5px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.countdown { display: block; font: clamp(40px, 6vw, 58px)/1.05 var(--crt); color: var(--paper); margin: 8px 0 4px; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.countdown.is-open { color: var(--alarm); text-shadow: 0 0 18px rgba(255, 90, 71, .6); }
.window small { font: 13px var(--mono); color: var(--dim); }

/* Security-cam frame around the key art. */
.cam {
  position: relative; padding: 12px; margin-top: 8px;
  --c: var(--line-hi);
  background:
    linear-gradient(var(--c), var(--c)) top left / 22px 1px, linear-gradient(var(--c), var(--c)) top left / 1px 22px,
    linear-gradient(var(--c), var(--c)) top right / 22px 1px, linear-gradient(var(--c), var(--c)) top right / 1px 22px,
    linear-gradient(var(--c), var(--c)) bottom left / 22px 1px, linear-gradient(var(--c), var(--c)) bottom left / 1px 22px,
    linear-gradient(var(--c), var(--c)) bottom right / 22px 1px, linear-gradient(var(--c), var(--c)) bottom right / 1px 22px;
  background-repeat: no-repeat;
}
/* The white line art multiplies against amber: white lines turn phosphor, black stays black. */
.feed { position: relative; overflow: hidden; aspect-ratio: 783 / 1120; background: var(--phosphor); isolation: isolate; }
.feed img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: grayscale(1) contrast(1.2); mix-blend-mode: multiply; }
.feed::after {
  content: ""; position: absolute; inset: -20% 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent 0 40%, rgba(255, 215, 150, .07) 48%, transparent 56%);
  animation: roll 7s linear infinite;
}
.hud {
  position: absolute; left: 24px; right: 24px; display: flex; justify-content: space-between;
  font: 18px/1 var(--crt); color: var(--phosphor-hot); text-shadow: 0 0 6px rgba(0, 0, 0, .9), var(--glow); z-index: 1;
}
.hud.t { top: 24px; }
.hud.b { bottom: 22px; }
.rec { color: var(--alarm); text-shadow: 0 0 8px rgba(255, 90, 71, .7); }
.rec::before { content: "● "; animation: blink 1.4s steps(1) infinite; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 32px; }
  .cam { max-width: 440px; width: 100%; justify-self: center; }
  .feed { aspect-ratio: 4 / 5; }
}

/* ── Sections ───────────────────────────────────────────────── */
.section { padding: 64px 0; border-top: 1px dashed var(--line); }
.label { margin: 0 0 32px; font: 26px/1 var(--crt); color: var(--dim); }
.label::before { content: "$ "; color: var(--phosphor); }

.panes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
/* Subgrid keeps the bar, screen, title and text of the three panes on shared rows. */
.pane { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; border: 1px solid var(--line); background: linear-gradient(to bottom, rgba(255, 181, 71, .035), transparent 40%), var(--panel); }
.pane-bar { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.pane-bar b { color: var(--phosphor); font-weight: 500; }
.screen { margin: 0; padding: 18px 16px 20px; font: 13px/1.7 var(--mono); color: var(--paper); border-bottom: 1px dashed var(--line); white-space: pre-wrap; }
.screen .meta { color: var(--dim); }
.screen .sys { color: var(--phosphor); }
.screen .alarm { color: var(--alarm); }
.choices { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; white-space: normal; }
.choices span { border: 1px solid var(--line-hi); padding: 5px 10px; color: var(--phosphor); }
.pane h3 { margin: 18px 16px 6px; font: 30px/1 var(--crt); color: var(--phosphor); font-weight: 400; text-shadow: var(--glow); }
.pane p { margin: 0 16px 22px; font: 17px/1.55 var(--serif); color: var(--paper); opacity: .9; }
@media (max-width: 900px) { .panes { grid-template-columns: 1fr; } }

.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin: 0; }
.specs div { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); font: 14px var(--mono); }
.specs dt { color: var(--dim); flex: none; }
.specs .dots { flex: 1; border-bottom: 1px dotted var(--line-hi); transform: translateY(-4px); min-width: 16px; }
.specs dd { margin: 0; color: var(--paper); text-align: right; }
@media (max-width: 760px) { .specs { grid-template-columns: 1fr; } }

/* ── Footer ─────────────────────────────────────────────────── */
.foot {
  border-top: 1px dashed var(--line); padding: 28px 0 56px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 14px 28px;
  font: 13px var(--mono); color: var(--dim);
}
.foot .eot { font: 22px var(--crt); color: var(--phosphor); flex-basis: 100%; }
.foot .eot::after { content: "_"; animation: blink 1.05s steps(1) infinite; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot a { color: var(--dim); }
.foot a:hover { color: var(--phosphor); }

/* ── Text pages: a lab file ─────────────────────────────────── */
.doc { max-width: 720px; padding: 48px 0 80px; counter-reset: sec; }
.doc .file { margin: 0 0 18px; font: 12.5px/1.6 var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .12em; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.doc .file span:first-child { color: var(--phosphor); border: 1px solid var(--line-hi); padding: 1px 8px; }
.doc h1 { font: 400 clamp(52px, 9vw, 84px)/.9 var(--crt); color: var(--phosphor); margin: 0 0 14px; text-shadow: var(--glow); }
.doc .updated { font: 13px var(--mono); color: var(--dim); margin: 0 0 40px; padding-bottom: 22px; border-bottom: 1px dashed var(--line); }
.doc h2 { counter-increment: sec; display: flex; gap: 14px; align-items: baseline; font: 600 17px/1.3 var(--mono); color: var(--phosphor); margin: 48px 0 14px; }
.doc h2::before { content: "§" counter(sec, decimal-leading-zero); font: 22px/1 var(--crt); color: var(--dim); flex: none; }
.doc h3 { font: 600 14px var(--mono); color: var(--paper); text-transform: uppercase; letter-spacing: .08em; margin: 28px 0 8px; }
.doc p, .doc li { font: 18.5px/1.6 var(--serif); color: var(--paper); }
.doc p { margin: 0 0 14px; }
.doc ul { list-style: none; padding: 0; margin: 0 0 14px; }
.doc li { position: relative; padding-left: 26px; margin: 8px 0; }
.doc li::before { content: "—"; position: absolute; left: 0; color: var(--phosphor); font-family: var(--mono); }
.doc strong { font-weight: 600; color: var(--phosphor-hot); }
.doc code { font: 15px var(--mono); color: var(--phosphor); background: rgba(255, 181, 71, .08); padding: 1px 5px; }
.summary { border: 1px solid var(--line-hi); border-left: 3px solid var(--phosphor); background: var(--panel); padding: 20px 22px; }
.summary p { margin: 0; font-size: 19.5px; }
.summary strong { color: var(--phosphor); }
.contact { font: 30px/1.2 var(--crt) !important; margin: 4px 0 18px !important; }
.contact a { text-decoration: none; border-bottom: 1px dashed var(--line-hi); }
.contact a::before { content: "> "; }
@media (max-width: 420px) { .contact { font-size: 23px !important; } }

details { border-bottom: 1px dashed var(--line); padding: 16px 0; }
details:first-of-type { border-top: 1px dashed var(--line); }
summary { cursor: pointer; list-style: none; display: flex; gap: 14px; font: 500 15.5px/1.45 var(--mono); color: var(--paper); }
summary::-webkit-details-marker { display: none; }
summary::before { content: "[+]"; color: var(--phosphor); flex: none; }
details[open] summary::before { content: "[−]"; }
details[open] summary { color: var(--phosphor); }
summary:hover { color: var(--phosphor); }
details p { margin: 12px 0 0 calc(3ch + 14px) !important; }

/* ── Motion ─────────────────────────────────────────────────── */
@keyframes type { to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes roll { from { transform: translateY(-30%); } to { transform: translateY(30%); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 92% { opacity: 1; } 93% { opacity: .82; } 94% { opacity: 1; } 96% { opacity: .9; } 97% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .boot li { opacity: 1; }
}

/* VT323 ships a broken "fi" ligature. Last in the file: every `font:` shorthand above resets it. */
.brand, .hero h1, .soon, .countdown, .hud, .label, .pane h3, .eot, .doc h1, .doc h2::before, .contact { font-variant-ligatures: none; }
