:root {
  --bg: #0d1214;
  --bg-elev: #141b1e;
  --bg-panel: #182226;
  --line: rgba(220, 238, 236, 0.09);
  --text: #eef3f1;
  --text-dim: #c3cdca;
  --muted: #84918e;
  --accent: #62c1c9;
  --accent-bright: #8ad6dc;
  --accent-soft: rgba(98, 193, 201, 0.12);
  --good: #7fd18b;
  --serif: "Newsreader", ui-serif, Georgia, serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 14px;
  --max: 1160px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f4;
    --bg-elev: #ffffff;
    --bg-panel: #ffffff;
    --line: rgba(20, 40, 44, 0.1);
    --text: #121719;
    --text-dim: #3d4a4d;
    --muted: #6d7a7c;
    --accent: #1d6f79;
    --accent-bright: #155c65;
    --accent-soft: rgba(29, 111, 121, 0.09);
    --good: #2f8a43;
    color-scheme: light;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: -20vh -10vw auto auto;
  width: 70vw; height: 70vh;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  pointer-events: none; z-index: -1;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
em { font-style: italic; color: var(--accent); }

.eyebrow {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  max-width: var(--max); margin: 0 auto;
  padding: 18px 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.wordmark { font: 500 21px/1 var(--serif); text-decoration: none; letter-spacing: -0.01em; }
.wordmark span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14.5px; }
.nav-links a { text-decoration: none; color: var(--text-dim); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links .pill {
  color: var(--bg); background: var(--accent);
  padding: 8px 16px; border-radius: 999px; font-weight: 500;
}
.nav-links .pill:hover { color: var(--bg); background: var(--accent-bright); }
@media (max-width: 640px) {
  .nav-links a:not(.pill) { display: none; }
}

/* hero */
.hero { max-width: var(--max); margin: 0 auto; padding: 96px 24px 72px; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13.5px; color: var(--text-dim);
  border: 1px solid var(--line); background: var(--bg-elev);
  padding: 7px 14px 7px 12px; border-radius: 999px;
  margin-bottom: 34px;
}
.status i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .status i { animation: none; } }
h1 {
  font: 400 clamp(44px, 7.4vw, 88px)/1.02 var(--serif);
  letter-spacing: -0.025em;
  max-width: 17ch;
  margin-bottom: 28px;
}
.lead { font-size: clamp(17px, 1.6vw, 19.5px); color: var(--text-dim); max-width: 60ch; margin-bottom: 36px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center;
  padding: 13px 22px; border-radius: 10px;
  font-weight: 500; font-size: 15.5px; text-decoration: none;
  border: 1px solid var(--line); background: var(--bg-elev);
  transition: transform .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.primary { background: var(--accent); color: var(--bg); border-color: transparent; }
.btn.primary:hover { background: var(--accent-bright); }
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
  margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line);
  max-width: 820px;
}
.stats dt { font: 400 clamp(30px, 4vw, 42px)/1 var(--serif); letter-spacing: -0.02em; margin-bottom: 8px; }
.stats dd { color: var(--muted); font-size: 14px; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; gap: 20px; } }

/* work: scrolling steps beside a pinned stage */
.work {
  max-width: var(--max); margin: 0 auto; padding: 40px 24px 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px;
}
.step { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; padding: 48px 0; }
.step h2 {
  font: 400 clamp(32px, 3.6vw, 46px)/1.08 var(--serif);
  letter-spacing: -0.02em; margin-bottom: 20px; max-width: 18ch;
}
.step > p { color: var(--text-dim); max-width: 52ch; margin-bottom: 20px; }
.step > ul { list-style: none; display: grid; gap: 8px; margin-bottom: 22px; }
.step > ul li { position: relative; padding-left: 22px; color: var(--text-dim); font-size: 15.5px; }
.step > ul li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 10px; height: 1.5px; background: var(--accent);
}
.more { color: var(--accent); text-decoration: none; font-weight: 500; font-size: 15px; width: fit-content; }
.more:hover { color: var(--accent-bright); }
.stage {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.stage .visual {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(18px) scale(.985);
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
}
.stage .visual.on { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .stage .visual { transition: opacity .2s; transform: none; } }
.steps .visual { display: none; }
@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; gap: 0; }
  .stage { display: none; }
  .steps .visual { display: flex; justify-content: center; margin-top: 32px; }
  .step { min-height: auto; padding: 56px 0; border-top: 1px solid var(--line); }
}

/* panels */
.panel {
  width: min(460px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255,255,255,.02) inset;
  overflow: hidden;
}
.panel figcaption { font: 400 11.5px var(--mono); color: var(--muted); padding: 0 18px 14px; }
.mono { font-family: var(--mono); }

.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.term-bar span { margin-left: 8px; font: 400 12px var(--mono); color: var(--muted); }
.term pre {
  font: 400 12.5px/1.75 var(--mono); color: var(--text-dim);
  padding: 18px; white-space: pre-wrap; word-break: break-word;
}
.term .p { color: var(--accent); }
.term .d { color: var(--muted); }
.term .ok { color: var(--good); }
.term .m { color: var(--accent-bright); }

.report header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.tag { font: 500 11px var(--mono); color: var(--accent); background: var(--accent-soft); padding: 4px 9px; border-radius: 999px; }
.report ol { list-style: none; counter-reset: r; }
.report li {
  counter-increment: r;
  display: grid; grid-template-columns: 26px 1fr; column-gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.report li:last-child { border-bottom: 0; }
.report li::before { content: counter(r, decimal-leading-zero); grid-row: span 2; font: 400 12px var(--mono); color: var(--muted); padding-top: 3px; }
.report b { font-weight: 600; font-size: 15px; }
.report li span { color: var(--muted); font-size: 13.5px; }

.phone {
  width: min(290px, 72vw);
  padding: 10px; border-radius: 44px;
  background: #050708;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 40px 90px -30px rgba(0,0,0,.7);
}
.phone img { border-radius: 35px; }

.app { padding: 34px 28px 30px; text-align: center; }
.app .icon { margin: 0 auto 16px; border-radius: 18px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.app > p { font-size: 13px; color: var(--muted); margin-bottom: 22px; letter-spacing: .04em; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chips li { font-size: 13.5px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-dim); background: var(--bg-elev); }

.board { padding: 26px; width: min(400px, 100%); }
.board .grid { display: grid; grid-template-columns: repeat(5, 1fr); aspect-ratio: 1; border-radius: 8px; overflow: hidden; }
.board .grid span {
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(26px, 4vw, 38px); line-height: 1;
  background: color-mix(in srgb, var(--text) 7%, var(--bg-panel));
}
.board .grid span:nth-child(odd) { background: color-mix(in srgb, var(--text) 14%, var(--bg-panel)); }
.board .fog { filter: brightness(.55); }
.board .move { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft) !important; }
.board .foe { color: #e07a6b; }
.board .you { color: var(--accent); }

.arch { padding: 26px; display: grid; gap: 0; justify-items: center; }
.node {
  width: 100%; text-align: center;
  padding: 12px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-elev);
  font-weight: 500; font-size: 14.5px;
}
.node small { display: block; font: 400 11.5px var(--mono); color: var(--muted); margin-top: 3px; }
.node.accent { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.node.ghost { border-style: dashed; background: transparent; margin-top: 18px; }
.wire { width: 1.5px; height: 22px; background: color-mix(in srgb, var(--accent) 50%, transparent); }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.row3 .node { font-size: 13.5px; }

/* writing / about / contact */
.writing, .about, .contact { max-width: var(--max); margin: 0 auto; padding: 96px 24px; border-top: 1px solid var(--line); }
.essay {
  display: block; text-decoration: none;
  padding: 40px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-elev);
  max-width: 860px; position: relative;
}
.essay h2 { font: 400 clamp(28px, 3.4vw, 42px)/1.12 var(--serif); letter-spacing: -0.02em; margin-bottom: 16px; max-width: 24ch; }
.essay p { color: var(--text-dim); max-width: 62ch; }
.soon { display: inline-block; margin-bottom: 18px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.essay[aria-disabled="true"] { cursor: default; }

.about h2, .contact h2 { font: 400 clamp(34px, 4.4vw, 56px)/1.05 var(--serif); letter-spacing: -0.02em; margin-bottom: 28px; max-width: 20ch; }
.about-body { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; max-width: 980px; }
.about-body p { color: var(--text-dim); }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 56px; }
.principles div { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); }
.principles h3 { font: 500 20px/1.2 var(--serif); margin-bottom: 8px; }
.principles p { color: var(--muted); font-size: 15px; }
@media (max-width: 800px) {
  .about-body, .principles { grid-template-columns: 1fr; }
}
.contact > p { color: var(--text-dim); max-width: 58ch; margin-bottom: 30px; }

.footer {
  max-width: var(--max); margin: 0 auto; padding: 32px 24px 48px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--line);
}
