/* ============================================================
   marisjs site — deep-sea instrument panel
   Schibsted Grotesk (display + body) · Martian Mono (labels)
   Sonar cyan #22d3ee is the single signal color. No gradients.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bg: #05080f;
  --surface-1: #0a1120;
  --surface-2: #0e1830;
  --surface-3: #122040;
  --line: #1d2c49;
  --line-soft: rgba(29, 44, 73, 0.55);
  --text: #e8eef7;
  --dim: #9fb0c7;
  --faint: #6b819f;
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.08);
  --amber: #f5b84a;
  --err: #f87171;
  --ok: #4ade80;
  --font-body: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Martian Mono', ui-monospace, 'SFMono-Regular', 'Cascadia Mono', monospace;
  --radius: 12px;
  --maxw: 1120px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.032) 1px, transparent 1px);
  background-size: 64px 64px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
p { margin: 0 0 1em; }
a { color: var(--cyan); }
code, pre, kbd, samp {
  font-family: var(--font-mono);
}
::selection { background: rgba(34, 211, 238, 0.28); color: #e8f8fc; }
img { max-width: 100%; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- a11y ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cyan);
  color: #03121a;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- nav ---------- */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 8, 15, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.nav-logo { width: 26px; height: 26px; }
.brand > span {
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-links > a:not(.btn) {
  color: var(--dim);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.nav-links > a:not(.btn):hover {
  color: var(--cyan);
  border-bottom-color: rgba(34, 211, 238, 0.4);
}
.nav-toggle, .nav-burger { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 12px 22px;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--cyan);
  color: #03121a;
  border: 1px solid var(--cyan);
}
.btn-primary:hover { background: #4fdfef; border-color: #4fdfef; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-sm { padding: 8px 15px; font-size: 13.5px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);
  padding: clamp(32px, 5vw, 64px) 0;
}
.hero-rose {
  position: absolute;
  right: -9vw;
  top: 50%;
  width: min(760px, 62vw);
  opacity: 0.16;
  transform: translateY(-50%);
  pointer-events: none;
  animation: rose-drift 160s linear infinite;
}
@keyframes rose-drift {
  from { transform: translateY(-50%) rotate(0deg); }
  to   { transform: translateY(-50%) rotate(360deg); }
}
.hero-sonar {
  position: absolute;
  right: 3vw;
  top: 50%;
  width: 420px;
  height: 420px;
  transform: translateY(-50%);
  pointer-events: none;
}
.hero-sonar .ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 50%;
  animation: sonar-ring 8s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
}
.hero-sonar .r2 { animation-delay: 2.7s; }
.hero-sonar .r3 { animation-delay: 5.4s; }
@keyframes sonar-ring {
  0%   { transform: scale(0.18); opacity: 0; }
  12%  { opacity: 0.9; }
  100% { transform: scale(1.12); opacity: 0; }
}
.hero-inner { position: relative; z-index: 1; width: 100%; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 14px;
  margin-bottom: 26px;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--cyan);
}
.hero-title {
  font-weight: 800;
  font-size: clamp(2.65rem, 6.2vw, 4.4rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
}
.hero-title .line { display: block; }
.accent { color: var(--cyan); }
.hero-sub {
  font-size: 17.5px;
  line-height: 1.7;
  color: var(--dim);
  max-width: 56ch;
  margin: 0 0 30px;
}
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

/* ---------- install chip ---------- */
.install-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  background: #060b16;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  margin-bottom: 26px;
}
.install-dollar { color: var(--cyan); }
.install-cmd { color: var(--text); }
.install-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.install-copy:hover { color: var(--cyan); border-color: var(--cyan); }
.install-chip-static { margin-bottom: 24px; }

/* ---------- hero instrument (terminal) ---------- */
.terminal {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #060b16;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--line);
}
.terminal-bar .dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}
.terminal-bar .dot:nth-child(1) { background: var(--amber); }
.terminal-bar .dot:nth-child(2) { background: var(--faint); }
.terminal-bar .dot:nth-child(3) { background: var(--cyan); }
.term-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  margin-left: 6px;
  letter-spacing: 0.04em;
}
.terminal pre {
  margin: 0;
  padding: 18px 20px;
  font-size: 13px;
  line-height: 1.8;
  overflow-x: auto;
}
.t-prompt { color: var(--cyan); }
.t-cmd { color: var(--text); font-weight: 500; }
.t-out { color: var(--dim); }
.t-err { color: var(--err); }
.t-ok { color: var(--ok); }

/* ---------- readouts (stats) ---------- */
.readouts {
  border-block: 1px solid var(--line);
  padding: clamp(40px, 6vw, 64px) 0;
}
.readout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(28px, 4vw, 56px);
}
.readout { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.readout-bearing {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--faint);
  transition: color 0.15s ease;
}
.readout:hover .readout-bearing { color: var(--cyan); }
.readout-value {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 10px;
}
.readout-unit {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.38em;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-left: 3px;
}
.readout-label {
  font-size: 13.5px;
  color: var(--dim);
  margin-top: 10px;
  max-width: 32ch;
}

/* ---------- sections ---------- */
.section { padding: clamp(80px, 11vw, 130px) 0; }
.section-alt {
  background: var(--surface-1);
  border-block: 1px solid var(--line);
}
.section-head { margin-bottom: clamp(36px, 5vw, 56px); }
.depth-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.depth-line::before {
  content: "";
  width: 44px;
  height: 1px;
  background: var(--cyan);
}
.depth-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}
.chart-ann {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.depth-line .chart-ann::before { display: none; }
.section-head h2 {
  font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.section-head h2 .line { display: block; }
.section-head p {
  color: var(--dim);
  font-size: 16.5px;
  margin: 0;
  max-width: 62ch;
}

/* ---------- pillars ---------- */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(32px, 4vw, 56px);
}
.pillar-card {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  position: relative;
}
.pillar-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 0.25s ease;
}
.pillar-card:hover::before { width: 56px; }
.pillar-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--cyan);
}
.pillar-card h3 { font-size: 1.25rem; margin: 12px 0 10px; }
.pillar-card p { color: var(--dim); font-size: 15px; margin: 0; }

/* ---------- spec grid (features) ---------- */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(32px, 5vw, 72px);
  border-top: 1px solid var(--line);
}
.spec-item { padding: 26px 0; border-bottom: 1px solid var(--line-soft); }
.spec-item h3 { font-size: 1.05rem; margin: 0 0 8px; }
.spec-item p { color: var(--dim); font-size: 15px; margin: 0; }

/* ---------- inline code ---------- */
code:not(pre code):not(.install-cmd):not(.footer-install):not(.route-1):not(.route-2):not(.route-3) {
  font-size: 0.82em;
  color: #7fd4e8;
  background: var(--cyan-soft);
  border-radius: 5px;
  padding: 2px 6px;
}

/* ---------- compare block ---------- */
.code-block-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.code-block-grid > div { min-width: 0; }
.compare-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
  padding: 0 4px 12px;
}
.compare-tag .dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}
.code-block-grid pre.code {
  height: auto;
  overflow: visible;
}
.code-block-grid pre { margin: 0; }

/* ---------- philosophy + build log ---------- */
.phil-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.phil-copy h2 {
  font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.phil-copy > p { color: var(--dim); font-size: 16px; margin: 0 0 20px; max-width: 56ch; }
.rule-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.rule-list li {
  display: flex;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15.5px;
  color: var(--dim);
}
.rule-list .r-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--cyan);
  letter-spacing: 0.12em;
  padding-top: 3px;
  flex: none;
}
.build-log {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #060b16;
}
.build-log-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--line);
}
.build-log-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--dim);
  flex: 1;
  min-width: 0;
}
.build-log-status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--err);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.build-log-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
}
.build-replay {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.build-replay:hover { color: var(--text); border-color: var(--cyan); }
.build-log-body {
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--dim);
}
.build-line {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.build-line + .build-line { margin-top: 6px; }
.bl-code { color: var(--text); }
.bl-dim { color: var(--faint); }
.bl-ok { color: var(--ok); }
.bl-err { color: var(--err); }
.bl-err .bl-code { color: var(--text); }
.log-run .build-line {
  animation: log-line-in 0.32s ease-out both;
  animation-delay: calc(var(--i) * 0.16s);
}
@keyframes log-line-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- cta ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--surface-1);
}
.cta-card { padding: clamp(56px, 8vw, 96px) 0; }
.cta-card h2 {
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.cta-card p { color: var(--dim); font-size: 16.5px; max-width: 52ch; margin: 0 0 26px; }
.cta-card .hero-cta { margin: 0; }

/* ---------- playground section ---------- */
.play-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.play-grid .play-code, .play-grid .play-demo { min-width: 0; }
.play-grid .code { margin: 0; }
.play-caption { color: var(--faint); font-size: 14px; margin: 22px 0 0; max-width: 76ch; }

/* ---------- code blocks ---------- */
pre.code {
  position: relative;
  margin: 20px 0;
  padding: 46px 18px 18px;
  background: #060b16;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #c8d6e8;
  white-space: pre-wrap;
  word-break: break-word;
}
pre.code[data-file]::before {
  content: attr(data-file);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  background: var(--surface-1);
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  position: absolute;
  top: 7px;
  right: 10px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover { color: var(--text); border-color: var(--cyan); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }
.tk-k { color: var(--cyan); }
.tk-s { color: #8ab8ff; }
.tk-c { color: var(--faint); font-style: italic; }
.tk-n { color: #9fb0c7; }
.tk-t { color: #d7e2f0; }
.tk-d { color: var(--amber); }
.tk-a { color: #7fd4e8; }

/* ---------- play card island ---------- */
.play-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-1);
  overflow: hidden;
}
.play-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.play-card-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--dim);
}
.play-live {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.play-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
}
.play-body { padding: 20px; display: grid; gap: 20px; }
.slider-row {
  display: grid;
  grid-template-columns: 72px 1fr 40px;
  align-items: center;
  gap: 14px;
}
.slider-label { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.slider-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--cyan);
  text-align: right;
}
input[type="range"] { accent-color: var(--cyan); }
.bars { display: grid; gap: 10px; }
.bar-track {
  height: 26px;
  background: #060b16;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.bar-fill {
  height: 100%;
  background: var(--cyan);
  color: #03121a;
  border-radius: 4px 0 0 4px;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
  transition: width 0.25s ease;
}
.play-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.total-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #060b16;
}
.t-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: 6px;
}
.t-value {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--text);
}
.t-value em { font-style: normal; color: var(--cyan); }

/* ---------- demo islands ---------- */
.counter-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.counter-num {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}
.counter-btns { display: flex; gap: 10px; }
.counter-btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #03121a;
  background: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.counter-btn:hover { background: #4fdfef; }
.counter-reset {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 14px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.counter-reset:hover { color: var(--cyan); border-color: var(--cyan); }
.computed-wrap { display: grid; gap: 12px; }
.computed-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.form-wrap { display: grid; gap: 16px; }
.form-field { display: grid; gap: 8px; }
.form-field label { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); letter-spacing: 0.08em; }
.form-wrap input[type="text"] {
  background: #060b16;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px;
  transition: border-color 0.15s ease;
}
.form-wrap input[type="text"]:hover { border-color: var(--line); }
.form-wrap input[type="text"]:focus { outline: none; border-color: var(--cyan); }
.form-greeting {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
}
.form-meta { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.form-chip {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
}
.todo-wrap { display: grid; gap: 14px; }
.todo-input-row { display: flex; gap: 10px; }
.todo-input-row input[type="text"] {
  flex: 1;
  min-width: 0;
  background: #060b16;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px;
}
.todo-input-row input[type="text"]:focus { outline: none; border-color: var(--cyan); }
.todo-add-btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #03121a;
  background: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  padding: 7px 14px;
  cursor: pointer;
}
.todo-add-btn:hover { background: #4fdfef; }
.todo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 14px;
  background: #060b16;
}
.todo-toggle { accent-color: var(--cyan); width: 16px; height: 16px; flex: none; }
.todo-text { flex: 1; font-size: 15px; color: var(--text); }
.todo-del {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
.todo-del:hover { color: var(--err); }
.todo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
}
.todo-clear {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.todo-clear:hover { color: var(--err); border-color: var(--err); }

/* ---------- demo cards ---------- */
.demo-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-1);
  overflow: hidden;
}
.demo-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.demo-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--cyan);
}
.demo-card-title { font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; color: var(--text); }
.demo-card-desc { font-size: 12.5px; color: var(--faint); text-align: right; }
.demo-card-body { padding: 18px; min-height: 110px; }

/* ---------- examples page ---------- */
.page-hero {
  border-bottom: 1px solid var(--line);
  padding: clamp(48px, 8vw, 84px) 0 clamp(32px, 5vw, 48px);
}
.page-hero-slim {
  padding: clamp(24px, 4vw, 40px) 0 clamp(16px, 2.5vw, 26px);
}
.page-hero h1 {
  font-weight: 800;
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.page-hero p { color: var(--dim); font-size: 16.5px; max-width: 64ch; margin: 0; }
.example-rows { display: grid; gap: 28px; }
.example-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}
.example-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.example-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.example-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--cyan);
}
.example-head h3 { font-size: 1.05rem; margin: 0; flex: 1; }
.example-block > p {
  padding: 0 18px;
  margin: 0;
  color: var(--dim);
  font-size: 14.5px;
  padding-bottom: 14px;
}
.play-grid .play-code pre.code,
.example-block pre.code {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-width: thin;
}
.example-block pre.code {
  margin: 0;
  flex: 1;
  border: none;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
}
.play-grid .play-code pre.code::-webkit-scrollbar,
.example-block pre.code::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.play-grid .play-code pre.code::-webkit-scrollbar-thumb,
.example-block pre.code::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}
.play-grid .play-code pre.code:hover::-webkit-scrollbar-thumb,
.example-block pre.code:hover::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.5);
}
.example-row .demo-card {
  display: flex;
  flex-direction: column;
}
.example-row .demo-card-body { flex: 1; }

/* ---------- playground workbench ---------- */
.workbench {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-1);
  overflow: hidden;
  height: calc(100vh - 210px);
  min-height: 480px;
}
.workbench-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.workbench-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.pg-examples-bar { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.pg-example {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.pg-example:hover { color: var(--cyan); border-color: var(--cyan); }
.pg-status {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.pg-status.pg-ok { color: var(--ok); }
.pg-status.pg-err { color: var(--err); }
.pg-status.pg-busy { color: var(--amber); }
.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}
.workbench-panel { display: flex; flex-direction: column; min-width: 0; }
.workbench-panel + .workbench-panel { border-left: 1px solid var(--line); }
.workbench-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: #060b16;
}
.workbench-head .btn { margin-left: auto; }
.workbench-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text);
}
.workbench-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}
.workbench-head .btn + .workbench-meta { margin-left: 0; }
.pg-editor {
  flex: 1;
  min-height: 700px;
  resize: vertical;
  background: #060b16;
  border: none;
  outline: none;
  color: #c8d6e8;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 16px 18px;
  tab-size: 2;
  caret-color: var(--cyan);
}
.pg-editor:focus { box-shadow: inset 0 0 0 1px var(--cyan); }
.pg-preview-wrap { flex: 1; min-height: 700px; display: flex; background: #05080f; }
.pg-preview { flex: 1; border: none; background: #05080f; width: 100%; }
.workbench-panel.pg-full-panel {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #05080f;
}
.workbench-panel.pg-full-panel .pg-preview-wrap { min-height: 0; }
.pg-error {
  margin: 0;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--err);
  background: rgba(248, 113, 113, 0.06);
  border-top: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- docs ---------- */
.doc-header {
  border-bottom: 1px solid var(--line);
  padding: clamp(44px, 7vw, 72px) 0 40px;
}
.route-bar {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  margin-bottom: 22px;
}
.route-1 { color: var(--faint); }
.route-2 { color: var(--dim); }
.route-3 { color: var(--cyan); }
.route-sep { color: var(--line); }
.doc-header h1 {
  font-weight: 800;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.doc-header p { color: var(--dim); font-size: 16.5px; max-width: 64ch; margin: 0; }
.docs-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(36px, 5vw, 64px);
  padding: 44px 0 84px;
}
.docs-nav {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding-right: 10px;
}
.docs-nav-group { margin-bottom: 30px; }
.docs-nav-group h4 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 10px;
}
.docs-nav-link {
  display: block;
  font-size: 14.5px;
  color: var(--dim);
  text-decoration: none;
  padding: 5px 0 5px 16px;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.docs-nav-link:hover { color: var(--text); border-left-color: var(--line); }
.docs-nav-link.active { color: var(--cyan); border-left-color: var(--cyan); }
.docs-content { min-width: 0; max-width: 780px; }
.docs-content h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 56px 0 16px;
  padding-top: 32px;
  border-top: 1px solid var(--line-soft);
}
.docs-content h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.docs-content h3 { font-size: 1.12rem; margin: 28px 0 12px; }
.docs-content > p { color: var(--dim); font-size: 16px; margin: 0 0 18px; }
.docs-content > p strong { color: var(--text); font-weight: 600; }
.docs-content ul, .docs-content ol { color: var(--dim); font-size: 15.5px; padding-left: 22px; }
.docs-content li { margin: 7px 0; }
.docs-content li > p { margin: 0; }
.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  background: var(--surface-1);
  padding: 16px 18px;
  margin: 20px 0;
  font-size: 15px;
  color: var(--dim);
}
.callout-warn { border-left-color: var(--amber); }
.callout p { margin: 0; }
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14.5px;
}
.docs-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.docs-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--dim);
  vertical-align: top;
}
.docs-table td:first-child {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
}
.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 48px;
}
.docs-pager-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s ease;
}
.docs-pager-card:hover { border-color: var(--cyan); }
.docs-pager-prev { text-align: left; }
.docs-pager-next { text-align: right; }
.docs-pager-dir {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.docs-pager-card:hover .docs-pager-dir { color: var(--cyan); }
.docs-pager-title { font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; color: var(--text); }
.docs-pager-empty { visibility: hidden; }
.docs-end {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding-top: 22px;
  font-size: 14px;
  color: var(--faint);
}
.docs-lead { font-size: 17px; color: var(--dim); max-width: 72ch; margin: 0 0 40px; }
.docs-index-group { margin-bottom: 44px; }
.docs-index-group h3 { font-size: 1.05rem; margin: 0 0 14px; }
.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.docs-card-grid a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  background: var(--surface-1);
  transition: border-color 0.15s ease;
}
.docs-card-grid a:hover { border-color: var(--cyan); }
.docs-card h4 { font-size: 1rem; margin: 0 0 6px; color: var(--text); }
.docs-card p { font-size: 13.5px; color: var(--dim); margin: 0; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: #04070d;
  padding: clamp(48px, 7vw, 72px) 0 28px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.footer-brand .brand { margin-bottom: 14px; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.footer-brand p { color: var(--dim); font-size: 14px; max-width: 36ch; margin: 0; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 14px;
}
.footer-col a {
  display: block;
  color: var(--dim);
  font-size: 14.5px;
  text-decoration: none;
  padding: 3px 0;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--cyan); }
.footer-install {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  display: block;
  margin-bottom: 8px;
}
.footer-install-p { color: var(--faint); font-size: 13px; margin: 0; }
.footer-bottom {
  max-width: var(--maxw);
  margin: 44px auto 0;
  padding: 20px 24px 0;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 13px;
}
.footer-bottom code { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid, .phil-grid, .code-block-grid, .play-grid { grid-template-columns: 1fr; }
  .hero-sonar { right: -140px; }
  .workbench-grid { grid-template-columns: 1fr; }
  .workbench-panel + .workbench-panel { border-left: none; border-top: 1px solid var(--line); }
  .docs-grid { grid-template-columns: 1fr; }
  .docs-nav {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px 24px;
  }
  .docs-nav-group { margin-bottom: 12px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .spec-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #060b16;
    border-bottom: 1px solid var(--line);
    padding: 18px 24px;
  }
  .nav-links > a { padding: 8px 0; }
  .nav-burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 4px;
    cursor: pointer;
  }
  .nav-burger span { width: 22px; height: 2px; background: var(--text); transition: transform 0.15s ease, opacity 0.15s ease; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero-rose { opacity: 0.09; right: 12px; width: 240px; }
  .hero-sonar { right: 16px; width: 300px; height: 300px; }
  .example-row { grid-template-columns: 1fr; }
  .example-head { flex-wrap: wrap; }
  .demo-card-head { grid-template-columns: auto 1fr; }
  .demo-card-desc { text-align: left; grid-column: 2; }
  .footer-inner { grid-template-columns: 1fr; }
  .docs-pager { grid-template-columns: 1fr; }
  .terminal pre { font-size: 12px; }
  .slider-row { grid-template-columns: 64px 1fr 36px; gap: 10px; }
}
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .badge { font-size: 10.5px; letter-spacing: 0.08em; }
  .install-chip { font-size: 12.5px; flex-wrap: wrap; }
  .build-log-head { flex-wrap: wrap; }
}

/* ---------- deep ascent game ---------- */
.section-game { padding-top: 6px; }
.game-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  min-height: 540px;
}
.game-panel > [data-hydrate] {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.game-panel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.game-panel-bar .workbench-meta { margin-left: auto; }
.game-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sonar-board-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  background: #04070d;
  overflow-y: auto;
  overflow-x: hidden;
  container-type: inline-size;
}
.pong-board {
  position: relative;
  flex: none;
  aspect-ratio: 44 / 21;
  background: #05080f;
  border: 1px solid rgba(232, 238, 247, 0.35);
  overflow: hidden;
  touch-action: none;
}
.pong-centerline {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  background: repeating-linear-gradient(to bottom, rgba(232, 238, 247, 0.2) 0 50%, transparent 50% 100%);
  background-size: 100% calc(100% / 21);
}
.pong-paddle {
  position: absolute;
  background: #e8eef7;
  z-index: 2;
}
.pong-ball {
  position: absolute;
  background: #e8eef7;
  border-radius: 50%;
  z-index: 2;
}
.pong-score {
  position: absolute;
  z-index: 1;
}
.pong-digit {
  position: relative;
  width: 100%;
  height: 100%;
}
.pong-seg {
  position: absolute;
  background: rgba(232, 238, 247, 0.06);
}
.pong-seg.on { background: #e8eef7; }
.pong-seg.seg-a { top: 0; left: 8%; width: 84%; height: 12%; }
.pong-seg.seg-b { top: 0; right: 0; width: 12%; height: 44%; }
.pong-seg.seg-c { bottom: 0; right: 0; width: 12%; height: 44%; }
.pong-seg.seg-d { bottom: 0; left: 8%; width: 84%; height: 12%; }
.pong-seg.seg-e { bottom: 0; left: 0; width: 12%; height: 44%; }
.pong-seg.seg-f { top: 0; left: 0; width: 12%; height: 44%; }
.pong-seg.seg-g { top: 44%; left: 8%; width: 84%; height: 12%; }
.pong-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}
.pong-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-family: var(--font-mono);
  color: #e8eef7;
}
.pong-menu-title {
  font-size: clamp(18px, 6.5cqi, 46px);
  font-weight: 700;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: #ffffff;
}
.pong-menu-line {
  font-size: clamp(11px, 2.6cqi, 20px);
  letter-spacing: 0.1em;
  color: #e8eef7;
}
.pong-menu-levels {
  display: flex;
  gap: clamp(10px, 2.4cqi, 22px);
  font-size: clamp(11px, 2.6cqi, 20px);
  letter-spacing: 0.06em;
}
.pong-menu-level { color: rgba(232, 238, 247, 0.45); }
.pong-menu-level.active { color: #ffffff; font-weight: 700; }
.pong-menu-cmd {
  margin-top: 8px;
  font-size: clamp(10px, 2cqi, 15px);
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: #ffffff;
}
.pong-menu-hint {
  font-size: clamp(9px, 1.7cqi, 13px);
  letter-spacing: 0.1em;
  color: rgba(232, 238, 247, 0.5);
}
.game-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.game-actions .play-caption { margin: 0; flex: 1; min-width: 280px; }
@media (max-width: 640px) {
  .game-panel-bar { padding: 10px 14px; }
  .game-panel-bar .workbench-meta { display: none; }
  .sonar-board-wrap { padding: 10px; }
}

/* ---------- reduced motion ---------- */
@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;
  }
  .hero-rose { animation: none; }
  .hero-sonar .ring { animation: none; opacity: 0.25; }
  .log-run .build-line { animation: none; }
}