:root {
  color-scheme: dark;
  --bg: #0a0a0c;
  --surface: #121216;
  --line: rgba(243, 239, 230, 0.12);
  --line-2: rgba(243, 239, 230, 0.24);
  --text: #f7f3ec;
  --muted: #c4beb3;
  --faint: #8d877c;
  --accent: #ff3b4e;
  --accent-2: #ff7a6e;
  --term: #ffb4b4;
  --hot: #ff3b4e;
  --serif: "DM Serif Display", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --pad: clamp(16px, 4vw, 40px);
  --mx: -100vw;
  --my: -100vh;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.7 var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* soft light that follows the pointer */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(255, 59, 78, 0.10), transparent 65%);
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

#field { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
html { background:
  linear-gradient(rgba(243, 239, 230, 0.035) 1px, transparent 1px) 0 0 / 64px 64px,
  linear-gradient(90deg, rgba(243, 239, 230, 0.035) 1px, transparent 1px) 0 0 / 64px 64px,
  var(--bg); }
body { background: transparent; }
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0.05;
  background-image: 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)'/%3E%3C/svg%3E");
}

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--pad); }
.dim { color: var(--faint); }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--pad);
  background: linear-gradient(var(--bg), rgba(10, 10, 12, 0.6) 70%, transparent);
  backdrop-filter: blur(6px);
}
.brand { font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark { color: var(--accent); }
.nav nav { display: flex; gap: clamp(12px, 3vw, 28px); font-size: 13px; font-weight: 600; }
.nav nav a { color: var(--muted); transition: color 0.2s; }
.nav nav a:hover { color: var(--text); }

/* hero */
.hero {
  position: relative;
  min-height: calc(100svh - 70px);
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 40px; padding-bottom: 96px;
}
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; font-size: 13px; margin: 0 0 28px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255, 59, 78, 0.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 59, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 78, 0); } }

.title {
  margin: 0;
  font: 400 clamp(2.6rem, 8.4vw, 6.6rem)/1.02 var(--serif);
  letter-spacing: -0.02em;
}
.title-inner { display: inline-block; }
.ben { color: var(--text); }
.word {
  font-style: italic;
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: 0.04em;
}
.caret {
  display: inline-block;
  width: 0.42em; height: 0.78em;
  margin-left: 0.06em;
  vertical-align: -0.04em;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
.caret.busy { animation: none; }
@keyframes blink { 50% { opacity: 0; } }

.lede { max-width: 56ch; color: var(--muted); font-size: clamp(16px, 2vw, 20px); font-weight: 600; margin: 32px 0 0; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 14px; color: var(--text);
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { background: #ff5566; border-color: #ff5566; }
.kbd { font-size: 11px; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 5px; color: var(--muted); }

.scroll-hint { position: absolute; left: var(--pad); bottom: 32px; width: 22px; height: 36px; border: 1px solid var(--line-2); border-radius: 12px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); animation: scroll 1.8s infinite; }
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* sections */
.section { padding-top: 96px; padding-bottom: 32px; scroll-margin-top: 40px; }
.section-head { margin-bottom: 40px; }
.label { color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 10px; }
h2 { font: 400 clamp(2.2rem, 5.5vw, 3.8rem)/1.05 var(--serif); letter-spacing: -0.015em; margin: 0; }
h2 em { color: var(--muted); }

/* project cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
@media (min-width: 980px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .card.wide { grid-column: span 2; flex-direction: row; }
  .card.wide .viz { flex: 1.1; height: auto; min-height: 260px; border-bottom: 0; border-right: 1px solid var(--line); }
  .card.wide .card-body { flex: 1; }
}
.card {
  --x: 50%; --y: 50%; --rx: 0deg; --ry: 0deg;
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)), var(--surface);
  overflow: hidden;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.25s ease-out, border-color 0.3s;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(380px circle at var(--x) var(--y), rgba(255, 59, 78, 0.14), transparent 60%);
}
.card:hover { border-color: var(--line-2); }
.card:hover::before { opacity: 1; }
.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; }
.card h3 { font: 400 2rem/1.1 var(--serif); margin: 10px 0 8px; }
.card p { color: var(--muted); font-size: 13.5px; font-weight: 500; margin: 0; }
.card p em { color: var(--text); }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 9px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); }
.tag.live { color: var(--term); border-color: rgba(255, 180, 180, 0.45); }
.tag.soon { color: var(--accent); border-color: rgba(255, 59, 78, 0.5); }
.stack { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 16px 0 0; font-size: 11.5px; font-weight: 500; color: var(--faint); }
.stack li::before { content: "/ "; color: var(--line-2); }
.card-link { margin-top: 20px; align-self: flex-start; color: var(--accent); font-weight: 600; font-size: 14px; }
.card-link span { display: inline-block; transition: transform 0.2s; }
.card-link:hover span { transform: translateX(4px); }
.card-link::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */

/* card visuals */
.viz { position: relative; height: 170px; border-bottom: 1px solid var(--line); overflow: hidden; background: rgba(0,0,0,0.25); }

.viz-term { padding: 22px 24px; font-size: 13px; display: flex; flex-direction: column; justify-content: space-between; }
.term-prompt { color: var(--term); }
.term-caret { display: inline-block; width: 0.6em; height: 1.05em; vertical-align: -0.2em; background: var(--accent); animation: blink 1.05s steps(1) infinite; }
.term-lane { position: relative; height: 26px; }
.mini-bug { position: absolute; left: 100%; white-space: nowrap; color: var(--text); animation: crawl 9s linear infinite; }
.mini-bug::before { content: "ж "; color: var(--hot); }
.term-lane.slow .mini-bug { animation-duration: 13s; animation-delay: -5s; }
@keyframes crawl { from { transform: translateX(0); } to { transform: translateX(calc(-100% - 100cqw)); } }
.viz-term { container-type: inline-size; }

.viz-wave { display: flex; align-items: center; gap: 3px; padding: 0 22px; }
.viz-wave i { flex: 1; border-radius: 2px; background: var(--faint); opacity: 0.55; }
.viz-wave i.sel { background: var(--accent); opacity: 1; }
.viz-wave::after {
  content: ""; position: absolute; top: 24px; bottom: 24px; width: 2px; background: var(--text);
  left: var(--a, 30%); animation: playhead 3.2s linear infinite;
}
@keyframes playhead { from { left: var(--a, 30%); } to { left: var(--b, 60%); } }

.viz-streak { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; padding: 24px; align-content: center; }
.viz-streak i { aspect-ratio: 1; border-radius: 3px; background: var(--term); }

.viz-ledger { padding: 22px 24px; font-size: 12.5px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.viz-ledger div { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 12px; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: 5px; }
.viz-ledger div:last-child { border-bottom: 0; }
.viz-ledger .pos { color: var(--term); }
.viz-ledger .neg { color: var(--hot); }

.viz-plot { display: grid; grid-template-columns: repeat(18, 1fr); padding: 18px 22px; align-content: center; }
.viz-plot i { aspect-ratio: 1; }
.viz-plot .claim { position: absolute; border: 2px dashed var(--accent); border-radius: 2px; animation: march 1.2s linear infinite; }
@keyframes march { 50% { border-color: rgba(255, 59, 78, 0.45); } }

/* closing statement */
.outro { padding-top: 120px; padding-bottom: 18vh; text-align: center; }
.outro h2 { font-size: clamp(2.4rem, 7vw, 5rem); }
.outro h2 em { color: var(--accent); }
.outro p { color: var(--muted); max-width: 46ch; margin: 18px auto 0; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 80px; padding-bottom: 40px; font-size: 12px; color: var(--muted); }
.footer a { color: var(--accent); }

/* scroll reveal */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.8,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* cards swing up into place, then their visuals build themselves */
.js .card.reveal { transform: perspective(1000px) translateY(70px) rotateX(18deg) scale(0.95); transform-origin: 50% 0; }
.js .card.reveal.in { transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)); transition: opacity 0.9s ease, transform 1.1s cubic-bezier(.16,1,.3,1), border-color 0.3s; }
.js .card.reveal.in.settled { transition: transform 0.25s ease-out, border-color 0.3s; }
.js .card.reveal .viz-wave i { transform: scaleY(0.06); transition: transform 0.7s cubic-bezier(.16,1,.3,1) calc(250ms + var(--i) * 14ms); }
.js .card.reveal .viz-streak i { transform: scale(0); transition: transform 0.45s cubic-bezier(.34,1.56,.64,1) calc(200ms + var(--i) * 22ms); }
.js .card.reveal .viz-plot i { transform: scale(0); transition: transform 0.4s cubic-bezier(.34,1.56,.64,1) calc(200ms + var(--i) * 30ms); }
.js .card.reveal .viz-plot .claim { opacity: 0; transition: opacity 0.5s ease 1.1s; }
.js .card.reveal .viz-ledger div { opacity: 0; transform: translateX(-18px); transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.16,1,.3,1); transition-delay: calc(250ms + var(--i) * 120ms); }
.js .card.reveal .term-line, .js .card.reveal .term-lane { opacity: 0; transform: translateY(8px); transition: opacity 0.5s ease 0.3s, transform 0.6s ease 0.3s; }
.js .card.reveal .term-lane { transition-delay: 0.6s; }
.js .card.reveal.in .viz i, .js .card.reveal.in .viz-ledger div, .js .card.reveal.in .term-line, .js .card.reveal.in .term-lane { transform: none; }
.js .card.reveal.in .viz-ledger div, .js .card.reveal.in .term-line, .js .card.reveal.in .term-lane, .js .card.reveal.in .viz-plot .claim { opacity: 1; }

/* headings rise word by word from behind a mask */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform 0.9s cubic-bezier(.16,1,.3,1) calc(120ms + var(--i) * 70ms); }
.reveal.in .split .w > span, .reveal.in.split .w > span { transform: none; }

/* the closing line lights up as it scrolls into view */
.scrub .w > span { display: inline-block; opacity: calc(0.12 + 0.88 * var(--lit, 0)); transform: translateY(calc((1 - var(--lit, 0)) * 0.22em)); filter: blur(calc((1 - var(--lit, 0)) * 3px)); }
.outro h2.scrub em .w > span { text-shadow: 0 0 calc(var(--lit, 0) * 28px) rgba(255, 59, 78, 0.45); }

/* section labels type out like a prompt */
.label .ghost { color: transparent; }
.label.typing .ghost::before { content: ""; display: inline-block; width: 0.6em; height: 1.1em; margin-right: -0.6em; vertical-align: -0.2em; background: var(--accent); }

/* page progress line, and the hero easing away as you leave it */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 12px rgba(255, 59, 78, 0.6); transform-origin: 0 50%; transform: scaleX(var(--sp, 0)); }
.js .hero { opacity: calc(1 - var(--hx, 0) * 1.1); transform: translateY(calc(var(--hx, 0) * -80px)) scale(calc(1 - var(--hx, 0) * 0.05)); transform-origin: 50% 30%; }

/* game page */
.game-page .hero-sm { padding-top: 32px; padding-bottom: 20px; }
.game-page h1 { font: 400 clamp(2.6rem, 7vw, 4.6rem)/1 var(--serif); margin: 0 0 10px; letter-spacing: -0.02em; }
.game-page h1 em { color: var(--accent); }
.game-page h1 { font-weight: 400; }
.game-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72svh;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  overflow: hidden;
  background: #0c0c0f;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
@media (max-width: 640px) { .game-shell { aspect-ratio: 3 / 4; max-height: 64svh; } }
.game-shell canvas { display: block; width: 100%; height: 100%; cursor: text; }
.game-shell input { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; font-size: 16px; }
.howto { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.howto b { color: var(--text); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .caret, .term-caret { animation: none !important; }
}

/* Lifedash walkthrough */
.page-hero { padding-top: 48px; padding-bottom: 36px; }
.page-hero h1 { font: 400 clamp(3rem, 9vw, 6rem)/1 var(--serif); letter-spacing: -0.02em; margin: 0; }
.page-hero .lede { margin: 20px 0 18px; font-size: clamp(15px, 1.8vw, 18px); }

.tour-wrap { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .tour-wrap { grid-template-columns: 300px 1fr; align-items: start; } }

.tour-steps { position: relative; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tour-steps::-webkit-scrollbar { display: none; }
.tour-steps button {
  flex: none; display: flex; align-items: baseline; gap: 10px;
  padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--muted); font: 600 13px var(--mono); cursor: pointer; text-align: left;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.tour-steps button i { font-style: normal; font-size: 11px; color: var(--faint); }
.tour-steps button b { font-weight: 700; }
.tour-steps button span { display: none; }
.tour-steps button:hover { color: var(--text); border-color: var(--line-2); }
.tour-steps button[aria-selected="true"] { color: var(--text); border-color: var(--accent); background: rgba(255, 59, 78, 0.10); }
.tour-steps button[aria-selected="true"] i { color: var(--accent); }
@media (min-width: 1000px) {
  .tour-steps { flex-direction: column; overflow: visible; gap: 4px; }
  .tour-steps button { display: grid; grid-template-columns: 28px 1fr; gap: 2px 8px; padding: 12px 14px; border-radius: 12px; border-color: transparent; }
  .tour-steps button span { display: block; grid-column: 2; font-weight: 500; font-size: 12px; line-height: 1.55; color: var(--faint); max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
  .tour-steps button[aria-selected="true"] span { max-height: 6em; color: var(--muted); }
  .tour-steps button[aria-selected="true"] { border-color: rgba(255, 59, 78, 0.5); }
}

.tour-frame { margin: 0; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: #0b0d12; box-shadow: 0 30px 80px rgba(0,0,0,0.55); }
.frame-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.frame-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(243,239,230,0.18); }
.frame-bar span:first-child { background: var(--accent); }
.frame-bar em { margin-left: 10px; font-style: normal; font-size: 12px; color: var(--faint); }
.tour-shots { position: relative; aspect-ratio: 1600 / 1075; cursor: pointer; }
.tour-shots img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; opacity: 0; transition: opacity 0.45s ease; }
.tour-shots img.on { opacity: 1; }
.tour-nav { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--line); }
.tour-caption { flex: 1; font-size: 13px; color: var(--muted); }
.tour-caption b { color: var(--text); margin-right: 6px; }
.small-btn { padding: 6px 14px; background: transparent; cursor: pointer; font: 600 14px var(--mono); }
@media (min-width: 1000px) { .tour-caption { visibility: hidden; } }

.phones { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 3vw, 36px); max-width: 900px; margin: 0 auto; }
.phone { margin: 0; padding: clamp(5px, 1vw, 10px); border: 1px solid var(--line-2); border-radius: clamp(18px, 3.5vw, 38px); background: #050507; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.phone img { display: block; width: 100%; height: auto; border-radius: clamp(13px, 2.8vw, 30px); }
.phone { transform: translateY(var(--py, 0px)); }
.phone:nth-child(2) { transform: translateY(calc(var(--py, 0px) - 24px)); }
.tour-frame[data-tilt] { transform: perspective(1600px) rotateX(calc(var(--tilt, 0) * 20deg)) scale(calc(1 - var(--tilt, 0) * 0.06)); transform-origin: 50% 100%; }

.ld-note { text-align: center; color: var(--muted); max-width: 60ch; margin: 0 auto; }
.ld-note p { margin: 0 0 16px; }
.ld-note .card-link { align-self: center; }

/* nav fits four links on a phone */
.nav nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 460px) {
  .brand .dim { display: none; }
  .nav nav { gap: 12px; font-size: 12px; }
}

/* explore tiles on the home page */
.explore { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)), var(--surface);
  transition: border-color 0.25s, transform 0.25s;
}
.tile:hover { border-color: rgba(255, 59, 78, 0.55); transform: translateY(-3px); }
.tile .tile-k { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.tile b { font: 400 1.7rem/1.1 var(--serif); }
.tile p { margin: 0; color: var(--muted); font-size: 13px; }
.tile .go { margin-top: auto; padding-top: 10px; color: var(--accent); font-weight: 600; font-size: 13px; }
.tile .live-dot { position: absolute; top: 22px; right: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.tile .live-dot.up { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15); }
.tile .live-dot.down { background: var(--accent); }

/* write-up pages */
.shot { margin: 8px 0 0; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: #0b0d12; box-shadow: 0 30px 80px rgba(0,0,0,0.55); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.shot[data-tilt] { transform: perspective(1600px) rotateX(calc(var(--tilt, 0) * 16deg)) scale(calc(1 - var(--tilt, 0) * 0.05)); transform-origin: 50% 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.legend .sw { display: inline-block; width: 14px; height: 10px; margin-right: 8px; border: 2px solid; border-radius: 2px; vertical-align: -1px; }
.sw-town { border-color: #ffb84d; background: rgba(255, 184, 77, 0.15); }
.sw-claim { border-color: #ff3b3b; background: rgba(255, 59, 59, 0.15); }
.wu-cols { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .wu-cols { grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; } }
.wu-text p { color: var(--muted); margin: 0 0 16px; max-width: 62ch; }
code { font: 600 0.92em var(--mono); color: var(--term); background: rgba(255, 180, 180, 0.08); padding: 1px 6px; border-radius: 5px; }
.wu-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 10px; }
.wu-steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.wu-steps li::before { content: "0" counter(s); grid-row: span 2; color: var(--accent); font-weight: 700; font-size: 12px; padding-top: 3px; }
.wu-steps b { font-weight: 700; }
.wu-steps span { color: var(--faint); font-size: 12.5px; }
.jobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.job { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color 0.25s; }
.job:hover { border-color: var(--line-2); }
.job b { font: 400 1.35rem/1.2 var(--serif); }
.job p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.chat { padding: 18px 20px; border-radius: 12px; background: rgba(0,0,0,0.55); border: 1px solid var(--line); font-size: 13px; }
.chat p { margin: 0 0 4px; color: var(--muted); }
.chat b { color: var(--text); font-weight: 600; }
.chat .chat-h { color: #ffd76e; font-weight: 700; margin-bottom: 8px; }
.chat .chat-t { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--text); }
.chat .chat-note { margin-top: 12px; font-size: 11.5px; color: var(--faint); }
.pos { color: #7ee2a0; }
.neg { color: var(--hot); }

/* lab status */
.st-state { display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.st-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.st-state[data-state="up"] .st-dot, .st-apps .up .st-dot { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15); }
.st-state[data-state="down"] .st-dot, .st-apps .down .st-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 59, 78, 0.18); }
.st-state[data-state="wait"] .st-dot { animation: blink 1s steps(1) infinite; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.st-tile, .st-panel { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)), var(--surface); }
.st-k { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.st-v { margin: 6px 0 0; }
.st-v b { font: 400 3rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.st-v small { margin-left: 4px; color: var(--muted); font-size: 13px; }
.st-spark { display: block; width: 100%; height: 54px; margin: 12px 0 8px; }
.st-sub { margin: 0; font-size: 12px; color: var(--faint); }
.st-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin-top: 14px; }
.st-apps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.st-apps li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.st-apps em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--faint); }
.st-big { margin: 10px 0 2px; font: 400 2.4rem/1 var(--serif); }
.st-bar { height: 6px; margin: 16px 0 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.st-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.6s ease; }
.st .ld-note { padding-top: 64px; }

/* terminal */
.tty-page .hero-sm { padding-top: 32px; padding-bottom: 20px; }
.tty-page h1 { font: 400 clamp(2.2rem, 6vw, 4rem)/1 var(--serif); margin: 0 0 10px; letter-spacing: -0.02em; }
.tty-page h1 em { color: var(--accent); }
.tty { position: relative; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: #0c0c0f; box-shadow: 0 30px 80px rgba(0,0,0,0.5); font-size: 14px; }
.tty-out { height: min(58svh, 520px); overflow-y: auto; padding: 16px 18px 4px; white-space: pre-wrap; word-break: break-word; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.tty-out > div { min-height: 1.7em; }
.tty-out .cmd { color: var(--text); margin-top: 6px; }
.tty-out .err { color: var(--accent-2); }
.tty-out .ok { color: #7ee2a0; }
.tty-out .dim { color: var(--faint); }
.tty-out .pre { white-space: pre; overflow-x: auto; }
.tty-out .dir { color: var(--accent); font-weight: 700; }
.tty-out .logo { color: var(--accent); font-weight: 700; }
.tty-out b { color: var(--accent-2); }
.tty-out .swatches { display: flex; gap: 4px; margin: 6px 0; }
.tty-out .swatches .sw { width: 22px; height: 12px; border-radius: 2px; }
.tty-ps { color: var(--term); font-weight: 600; white-space: nowrap; }
.tty-ps i { font-style: normal; color: var(--accent); }
.tty-line { display: flex; align-items: center; gap: 10px; padding: 4px 18px 16px; cursor: text; }
.tty-in { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: 500 16px var(--mono); caret-color: var(--accent); padding: 0; }
.tty-matrix { position: absolute; inset: 0; width: 100%; height: 100%; background: #0a0a0c; }

/* field playground */
.field-page { overflow: hidden; height: 100svh; }
#play-field { position: fixed; inset: 0; width: 100vw; height: 100svh; touch-action: none; cursor: crosshair; }
.field-page .nav { position: fixed; left: 0; right: 0; background: none; backdrop-filter: none; pointer-events: none; }
.field-page .nav a { pointer-events: auto; }
.fp-intro { position: fixed; left: var(--pad); bottom: 28px; pointer-events: none; max-width: 40ch; }
.fp-intro h1 { margin: 0; font: 400 clamp(2.6rem, 7vw, 4.6rem)/1 var(--serif); }
.fp-intro p { margin: 6px 0 0; font-size: 13px; }
.fp-panel { position: fixed; top: 76px; right: var(--pad); width: min(260px, calc(100vw - 2 * var(--pad))); border: 1px solid var(--line-2); border-radius: 14px; background: rgba(12, 12, 15, 0.82); backdrop-filter: blur(10px); font-size: 12.5px; }
.fp-toggle { display: block; width: 100%; padding: 10px 14px; background: none; border: 0; color: var(--muted); font: 700 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-align: left; cursor: pointer; }
.fp-toggle::after { content: "−"; float: right; }
.fp-panel.closed .fp-toggle::after { content: "+"; }
.fp-panel.closed .fp-body { display: none; }
.fp-body { display: grid; gap: 14px; padding: 2px 14px 14px; }
.fp-body label { display: grid; grid-template-columns: 1fr auto; gap: 6px; color: var(--muted); font-weight: 600; }
.fp-body output { color: var(--text); }
.fp-body input[type=range] { grid-column: span 2; width: 100%; accent-color: var(--accent); }
.fp-modes, .fp-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.fp-actions { grid-template-columns: repeat(3, 1fr); }
.fp-modes button, .fp-actions button { padding: 7px 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; color: var(--muted); font: 600 12px var(--mono); cursor: pointer; }
.fp-modes button[aria-checked="true"], .fp-actions button.on { color: var(--text); border-color: var(--accent); background: rgba(255, 59, 78, 0.12); }
.fp-swatches { display: flex; gap: 8px; }
.fp-swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.fp-swatches button[aria-checked="true"] { border-color: var(--text); }
