/* ---------- Design Tokens ---------- */
:root {
  /* Dark-first tech palette: deep space + ember/amber (quiver-country glow) */
  --bg-0: #0a0c0b;
  --bg-1: #0f1211;
  --bg-2: #151918;
  --bg-3: #1c2120;
  --line: #2a302e;
  --line-strong: #3a4240;

  --fg: #e7ecea;
  --fg-muted: #8a938f;
  --fg-dim: #5a625f;

  --amber: #f0a544;
  --amber-bright: #ffc06b;
  --amber-dim: #a8732d;
  --ember: #e86a33;
  --lime: #a5d86a;
  --cyan: #6ad8d0;
  --magenta: #d86ac0;

  --accent: var(--amber);
  --accent-bright: var(--amber-bright);

  /* Typography */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: clamp(2.5rem, 5.5vw, 4.5rem);
  --fs-hero: clamp(3rem, 8vw, 7rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 6.5rem;
  --space-8: 10rem;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 240ms;

  --scan-color: rgba(255,255,255,0.012);
  --grid-opacity: 0.35;
  --shadow-soft: 0 10px 40px rgba(0,0,0,0.35);
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg-0: #f6f1e7;
  --bg-1: #ece6d8;
  --bg-2: #e0d9c7;
  --bg-3: #d4ccb8;
  --line: #cfc6b1;
  --line-strong: #aea38a;

  --fg: #1c1a15;
  --fg-muted: #5a5348;
  --fg-dim: #8a8270;

  --amber: #b76e12;
  --amber-bright: #d6851a;
  --amber-dim: #7f4c0a;
  --ember: #c4501f;
  --lime: #557d28;
  --cyan: #1f7a72;
  --magenta: #963880;

  --scan-color: rgba(0,0,0,0.025);
  --grid-opacity: 0.5;
  --shadow-soft: 0 10px 30px rgba(60,45,20,0.12);
}
[data-theme="light"] .t-kw  { color: #a33990; }
[data-theme="light"] .t-typ { color: #1f7a72; }
[data-theme="light"] .t-fn  { color: #a85a10; }
[data-theme="light"] .t-str { color: #4a6f1e; }
[data-theme="light"] .t-num { color: #8a5510; }
[data-theme="light"] .t-dec { color: #a85a10; }
[data-theme="light"] .t-pct { color: #4a4438; }
[data-theme="light"] .t-id  { color: #1c1a15; }
[data-theme="light"] .t-prompt { color: #1f7a72; }

/* ---------- Theme toggle button ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  padding: 0;
  color: var(--fg-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  transition: color 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease);
}
.theme-toggle:hover {
  color: var(--amber);
  border-color: color-mix(in oklab, var(--amber) 45%, var(--line));
  background: color-mix(in oklab, var(--amber) 8%, var(--bg-1));
}
.theme-toggle .ic-sun { display: none; }
.theme-toggle .ic-moon { display: inline-block; }
[data-theme="light"] .theme-toggle .ic-sun { display: inline-block; }
[data-theme="light"] .theme-toggle .ic-moon { display: none; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

::selection { background: var(--accent); color: var(--bg-0); }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 260ms var(--ease), color 260ms var(--ease);
}

/* Grid background */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: var(--grid-opacity);
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  z-index: 0;
}

/* scanline / noise overlay */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom, var(--scan-color) 0 1px, transparent 1px 3px
  );
  z-index: 1;
}

main, header, footer { position: relative; z-index: 2; }

/* ---------- Layout ---------- */
.container {
  width: min(100% - 2.5rem, 1320px);
  margin-inline: auto;
}
section { padding-block: var(--space-7); }

/* ---------- Mono helpers ---------- */
.mono { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.02em; }
.tag {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}
.tag--amber::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.tag--cyan::before { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  background: color-mix(in oklab, var(--bg-0) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 0.9rem;
  gap: var(--space-4);
}
.nav__actions {
  display: flex; align-items: center; gap: 0.6rem;
}
.brand {
  display: flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.brand__mark {
  width: 28px; height: 28px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px color-mix(in oklab, var(--accent) 50%, transparent));
}
.brand__name { display: flex; align-items: baseline; gap: 0; }
.brand__name b { font-weight: 600; }
.brand__name .brand__tld {
  color: var(--amber);
  font-weight: 500;
}

.nav__links {
  display: flex; gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.nav__links a { transition: color var(--dur) var(--ease); position: relative; }
.nav__links a::before { content: "/"; color: var(--fg-dim); margin-right: 0.3rem; }
.nav__links a:hover { color: var(--accent); }
@media (max-width: 800px) { .nav__links { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: all var(--dur) var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: var(--bg-0);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -8px color-mix(in oklab, var(--accent) 80%, transparent);
}
.btn--primary:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 0 1px var(--accent-bright), 0 12px 32px -8px color-mix(in oklab, var(--accent-bright) 90%, transparent);
  transform: translateY(-1px);
}
.btn--ghost {
  border-color: var(--line-strong);
  color: var(--fg);
  background: var(--bg-1);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(3rem, 9vw, 7rem) var(--space-7);
  position: relative;
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: center;
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
}
.hero__meta {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-hero);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 var(--space-4);
}
.hero h1 span.accent { color: var(--accent); }
.hero h1 span.cursor {
  display: inline-block;
  width: 0.55em; height: 0.85em;
  background: var(--accent);
  margin-left: 0.08em;
  vertical-align: -0.05em;
  animation: blink 1.1s steps(2, end) infinite;
  box-shadow: 0 0 12px var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

.hero__lede {
  max-width: 48ch;
  font-size: var(--fs-lg);
  color: var(--fg-muted);
  margin-bottom: var(--space-5);
}
.hero__cta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-5); }

.hero__stack {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-dim);
}
.hero__stack span {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
}

/* Terminal card */
.terminal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
  position: relative;
}
.terminal::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% -20%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 55%);
  pointer-events: none;
}
.terminal__bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.terminal__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bg-3); }
.terminal__dot.r { background: #e26060; }
.terminal__dot.y { background: #e2b760; }
.terminal__dot.g { background: #60c890; }
.terminal__title {
  margin-left: 0.6rem;
  color: var(--fg-dim);
  font-size: var(--fs-xs);
}
.terminal__body { padding: 1.25rem 1.25rem 1.5rem; position: relative; }
.terminal__line { display: flex; gap: 0.6rem; margin-block: 0.1rem; }
.terminal__line .prompt { color: var(--accent); user-select: none; }
.terminal__line .cmd { color: var(--fg); }
.terminal__line .out { color: var(--fg-muted); }
.terminal__line .key { color: var(--cyan); }
.terminal__line .val { color: var(--lime); }
.terminal__line .str { color: var(--amber-bright); }
.terminal__line .com { color: var(--fg-dim); }

.terminal__ascii {
  color: var(--accent);
  white-space: pre;
  font-size: 0.72rem;
  line-height: 1.15;
  opacity: 0.9;
  margin: 0.6rem 0;
  filter: drop-shadow(0 0 8px color-mix(in oklab, var(--accent) 40%, transparent));
}

/* ---------- Section heading ---------- */
.section-heading {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
  margin-bottom: var(--space-5);
}
.section-heading h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-3xl);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 18ch;
}
.section-heading h2 .accent { color: var(--accent); }
.section-heading__id {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---------- Services ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.service {
  background: var(--bg-1);
  padding: var(--space-4) var(--space-4) var(--space-5);
  display: flex; flex-direction: column; gap: 0.9rem;
  transition: background var(--dur) var(--ease);
  position: relative;
}
.service:hover { background: var(--bg-2); }
.service__head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.service__id { color: var(--accent); }
.service h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin: 0;
}
.service p { color: var(--fg-muted); margin: 0; font-size: var(--fs-sm); }
.service__stack {
  margin-top: auto; padding-top: 0.8rem;
  display: flex; gap: 0.35rem; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--fg-dim);
}
.service__stack span {
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

/* ---------- Work ---------- */
.work-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-1);
}
.work-item {
  display: grid;
  grid-template-columns: 4rem 1fr auto auto;
  gap: var(--space-4);
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
  transition: all var(--dur) var(--ease);
  font-family: var(--font-mono);
}
.work-item:first-child { border-top: none; }
.work-item:hover { background: var(--bg-2); padding-left: 2rem; }
.work-item__num { color: var(--accent); font-size: var(--fs-sm); }
.work-item__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.work-item__tag { font-size: var(--fs-xs); color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.work-item__arrow { color: var(--fg-dim); transition: all var(--dur) var(--ease); }
.work-item:hover .work-item__arrow { transform: translateX(6px); color: var(--accent); }
@media (max-width: 720px) {
  .work-item { grid-template-columns: 2.5rem 1fr auto; padding: 1rem; }
  .work-item:hover { padding-left: 1rem; }
  .work-item__tag { display: none; }
  .work-item__title { font-size: 1.1rem; }
}

/* ---------- Studio / valley ---------- */
.valley {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-6);
  align-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 85% 120%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
.valley > * { position: relative; }
.valley h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.05; letter-spacing: -0.025em;
  margin: 0.8rem 0 var(--space-3);
}
.valley h2 .accent { color: var(--accent); }
.valley p { color: var(--fg-muted); max-width: 44ch; }
.valley__stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
}
.stat { padding: 0.5rem; }
.stat__num {
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 500; line-height: 1;
  color: var(--fg);
  letter-spacing: -0.03em;
}
.stat__num .accent { color: var(--accent); }
.stat__label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--fg-dim); margin-top: 0.5rem;
}
@media (max-width: 820px) { .valley { grid-template-columns: 1fr; } }

/* ---------- CTA ---------- */
.cta {
  text-align: center;
  padding-block: var(--space-8);
  position: relative;
}
.cta::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, color-mix(in oklab, var(--accent) 12%, transparent), transparent 60%);
  pointer-events: none;
}
.cta h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--fs-3xl);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 var(--space-3);
}
.cta h2 .accent { color: var(--accent); }
.cta p { color: var(--fg-muted); max-width: 52ch; margin: 0 auto var(--space-5); font-family: var(--font-mono); font-size: var(--fs-sm); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-dim);
}
.footer__inner {
  display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
  align-items: center;
}
.footer__links { display: flex; gap: var(--space-4); }
.footer__links a:hover { color: var(--accent); }
.footer__status {
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.footer__status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 8px var(--lime);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

/* ---------- Nav kbd hints ---------- */
.nav__links kbd {
  display: inline-block;
  min-width: 1.1em; padding: 0 0.25em;
  margin-right: 0.1em;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.4;
  text-align: center;
  transition: all 240ms var(--ease);
}
.nav__links kbd.is-hit {
  background: var(--accent); color: var(--bg-0);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 40%, transparent);
  transform: scale(1.1);
}

/* ---------- Reveal ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(20px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Recently shipped ---------- */
.shipped {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.shipped__card {
  background: var(--bg-1);
  padding: var(--space-4);
  display: flex; flex-direction: column; gap: 0.8rem;
  transition: background var(--dur) var(--ease);
  position: relative;
}
.shipped__card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
  transform: scaleY(0); transform-origin: top;
  transition: transform 400ms var(--ease);
}
.shipped__card:hover { background: var(--bg-2); }
.shipped__card:hover::before { transform: scaleY(1); }
.shipped__head {
  display: flex; justify-content: space-between; align-items: center;
}
.shipped__num {
  font-family: var(--font-mono); color: var(--fg-dim); font-size: var(--fs-xs);
}
.shipped__card h3 {
  font-family: var(--font-display); font-weight: 500; font-size: 1.3rem;
  letter-spacing: -0.02em; margin: 0;
}
.shipped__card p { color: var(--fg-muted); font-size: var(--fs-sm); margin: 0; }
.shipped__meta {
  margin-top: auto; padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 0.3rem;
  font-family: var(--font-mono); font-size: 0.72rem;
}
.shipped__meta .meta-key { color: var(--fg-dim); margin-right: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; }
.shipped__meta .meta-val { color: var(--fg); }

/* ---------- Process ---------- */
.process {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  counter-reset: step;
}
.process__step {
  background: var(--bg-1);
  padding: var(--space-4);
  display: flex; gap: var(--space-3);
  transition: background var(--dur) var(--ease);
}
.process__step:hover { background: var(--bg-2); }
.process__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.4rem;
  height: fit-content;
  flex-shrink: 0;
}
.process__step h3 {
  font-family: var(--font-display); font-weight: 500; font-size: 1.15rem;
  margin: 0 0 0.3rem;
}
.process__step p { color: var(--fg-muted); font-size: var(--fs-sm); margin: 0; }

/* ---------- Contact ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: var(--space-5);
}
@media (max-width: 900px) { .contact__grid { grid-template-columns: 1fr; } }

.contact__info h3 {
  font-family: var(--font-display); font-weight: 500; font-size: 1.15rem;
  margin: 0 0 var(--space-3); letter-spacing: -0.01em;
}
.channels {
  list-style: none; padding: 0; margin: 0 0 var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  overflow: hidden;
  font-family: var(--font-mono); font-size: var(--fs-sm);
}
.channels li {
  display: grid; grid-template-columns: 4.5rem 1fr;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.channels li:first-child { border-top: none; }
.channels__key { color: var(--fg-dim); text-transform: uppercase; font-size: var(--fs-xs); letter-spacing: 0.1em; }
.channels a { color: var(--fg); transition: color 200ms var(--ease); }
.channels a:hover { color: var(--accent); }

.shortcuts-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  padding: var(--space-3);
  font-family: var(--font-mono);
}
.shortcuts-card__title {
  font-size: var(--fs-xs); color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: 0.14em;
  margin-bottom: 0.8rem;
}
.shortcuts-card dl {
  display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 0.9rem;
  margin: 0; font-size: var(--fs-xs);
}
.shortcuts-card dt { display: flex; gap: 0.15rem; align-items: center; }
.shortcuts-card dd { margin: 0; color: var(--fg-muted); }
.shortcuts-card kbd {
  display: inline-block;
  min-width: 1.4em; padding: 0.1em 0.35em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-align: center;
}

/* ---------- REPL form ---------- */
.repl {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}
.repl__bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.repl__progress {
  margin-left: auto;
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--fg-dim);
}
.repl__progress-track {
  display: inline-block;
  width: 80px; height: 4px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
}
.repl__progress-track span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--amber-bright));
  transition: width 300ms var(--ease);
  box-shadow: 0 0 8px var(--accent);
}

#contact-form {
  padding: var(--space-4);
  display: flex; flex-direction: column; gap: 1rem;
  font-family: var(--font-mono);
}
.form-row {
  display: flex; flex-direction: column; gap: 0.35rem;
  position: relative;
}
.form-row label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--fs-xs);
}
.form-row .lbl { color: var(--accent); }
.form-row .req {
  color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.65rem;
}
.form-row .req--opt { color: var(--fg-dim); opacity: 0.7; }

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  padding: 0.75rem 0.9rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  outline: none;
  resize: vertical;
}
.form-row input::placeholder,
.form-row textarea::placeholder { color: var(--fg-dim); }
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent);
  background: var(--bg-1);
}
.form-row select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a938f' stroke-width='2.5' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
}

.form-row.is-valid input,
.form-row.is-valid select,
.form-row.is-valid textarea {
  border-color: var(--lime);
  box-shadow: inset 3px 0 0 var(--lime);
}
.form-row.is-invalid input,
.form-row.is-invalid select,
.form-row.is-invalid textarea {
  border-color: #e26060;
  box-shadow: inset 3px 0 0 #e26060;
}

.form-err {
  min-height: 1em;
  font-size: 0.7rem;
  color: #ff8585;
  letter-spacing: 0.02em;
}

.form-row-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
@media (max-width: 540px) { .form-row-grid { grid-template-columns: 1fr; } }

.form-row__footer {
  display: flex; justify-content: space-between; align-items: center;
}
.form-counter {
  font-size: 0.7rem; color: var(--fg-dim);
}

.repl__log {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  max-height: 200px;
  overflow-y: auto;
  color: var(--fg-muted);
  line-height: 1.8;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.repl__log:empty { display: none; }
.repl__log .log-line { animation: lineIn 200ms var(--ease); }
.repl__log .prompt { color: var(--accent); margin-right: 0.4rem; }
.repl__log .cmd { color: var(--fg); }
.repl__log .ok { color: var(--lime); }
.repl__log .err { color: #ff8585; }
.repl__log .val { color: var(--cyan); }
.repl__log .com { color: var(--fg-dim); }
.repl__log .link { color: var(--accent); text-decoration: underline; }
@keyframes lineIn {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: none; }
}

.form-actions {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.btn--block { flex: 1; justify-content: center; padding: 0.9rem 1.25rem; }
.btn__spinner { display: none; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading .btn__arrow { display: none; }
.btn.is-loading .btn__spinner { display: inline-block; }
.btn.is-loading { pointer-events: none; opacity: 0.85; }
.btn.is-done { background: var(--lime); box-shadow: 0 0 0 1px var(--lime), 0 0 20px color-mix(in oklab, var(--lime) 50%, transparent); }

.form-hint {
  font-size: var(--fs-xs); color: var(--fg-dim);
}
.form-hint kbd {
  display: inline-block;
  padding: 0.1em 0.35em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.is-sending #contact-form { opacity: 0.98; }
.is-sending .form-row input,
.is-sending .form-row select,
.is-sending .form-row textarea { pointer-events: none; }

/* ---------- Live code editor ---------- */
.editor {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
  position: relative;
  min-height: 420px;
  display: flex; flex-direction: column;
}
.editor::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 85% -15%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.editor__bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1;
}
.editor__tab {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-left: 0.6rem;
  padding: 0.35rem 0.7rem;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 0.78rem;
  color: var(--fg);
  border-bottom: none;
  position: relative;
  top: 1px;
}
.editor__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  transition: background 300ms var(--ease), box-shadow 300ms var(--ease);
}
.editor__lang {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
}

.editor__body {
  flex: 1;
  padding: 1rem 1.1rem 1.2rem 0.6rem;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.editor__code {
  font-size: 0.82rem;
  line-height: 1.55;
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.editor__code.is-fading { opacity: 0; transform: translateY(-4px); }

.ed-line {
  display: flex;
  white-space: pre;
  min-height: 1.55em;
}
.ed-ln {
  display: inline-block;
  width: 2.4rem;
  text-align: right;
  padding-right: 1rem;
  color: var(--fg-dim);
  opacity: 0.55;
  user-select: none;
  flex-shrink: 0;
}
.ed-code {
  flex: 1;
  color: var(--fg);
  min-width: 0;
}
.ed-caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  vertical-align: -0.15em;
  margin-left: 1px;
  animation: edBlink 1.05s steps(2, end) infinite;
  box-shadow: 0 0 8px var(--accent);
}
@keyframes edBlink { 50% { opacity: 0; } }

/* ---------- Output panel ---------- */
.editor__output {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 58%;
  transform: translateY(105%);
  transition: transform 540ms var(--ease);
  background: linear-gradient(180deg, var(--bg-0), var(--bg-1));
  border-top: 1px solid var(--line-strong);
  padding: 0.75rem 1rem 0.9rem;
  overflow: auto;
  z-index: 2;
  box-shadow: 0 -20px 40px -20px rgba(0,0,0,0.55);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.editor__output.is-open { transform: translateY(0); }

.editor__output-bar {
  display: flex; gap: 0.55rem; align-items: center;
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: 0.12em;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.45rem; margin-bottom: 0.7rem;
}
.out-light {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-dim);
  transition: all 260ms var(--ease);
}
.out-light.loading {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: pulse 1s ease-in-out infinite;
}
.out-light.ok { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.out-light.err { background: #e26060; box-shadow: 0 0 8px #e26060; }
.out-dur { color: var(--fg-muted); }
.out-status.ok { color: var(--lime); }
.out-status.err { color: #ff8585; }
.out-status.running { color: var(--amber); }

/* ---------- Output renderers ---------- */
.out-swatches { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.out-swatch { text-align: center; flex-shrink: 0; }
.out-swatch-chip {
  width: 46px; height: 46px; border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px -6px rgba(0,0,0,0.4);
}
.out-swatch-hex {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--fg-muted);
  margin-top: 0.3rem;
  letter-spacing: 0.02em;
}

.out-stat { font-family: var(--font-mono); }
.out-stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}
.out-stat-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  margin-top: 0.35rem;
}

.out-table {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-family: var(--font-mono); font-size: 0.76rem;
}
.out-table-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.35rem 0.6rem;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.out-mono { color: var(--fg); }
.out-num { color: var(--accent); }
.out-empty {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--fg-dim); padding: 0.5rem;
}

.out-ledger {
  font-family: var(--font-mono); font-size: 0.78rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.out-ledger-row {
  display: flex; justify-content: space-between;
  color: var(--fg-muted);
  padding: 0.25rem 0;
}
.out-ledger-row.out-ledger-total {
  border-top: 1px solid var(--line);
  padding-top: 0.5rem; margin-top: 0.25rem;
  color: var(--accent); font-weight: 500;
  font-size: 0.9rem;
}

.out-timeline { font-family: var(--font-mono); }
.out-timeline-track {
  position: relative; height: 18px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 0.4rem;
}
.out-timeline-dot {
  position: absolute; top: 3px;
  width: 10px; height: 10px; border-radius: 50%;
  transform: translateX(-50%);
  transition: all 200ms var(--ease);
}
.out-timeline-dot.fired { background: var(--lime); box-shadow: 0 0 6px var(--lime); }
.out-timeline-dot.dropped { background: var(--fg-dim); opacity: 0.55; }

/* ---------- Token colors ---------- */
.t-kw  { color: #e57dd6; }     /* keyword */
.t-typ { color: #6ad8d0; }     /* types */
.t-fn  { color: #f0a544; }     /* function calls */
.t-str { color: #a5d86a; }     /* strings */
.t-num { color: #f0b86b; }     /* numbers */
.t-com { color: var(--fg-dim); font-style: italic; }
.t-dec { color: #ffc06b; }     /* decorators / attributes */
.t-pct { color: #c9d1cf; }     /* punctuation */
.t-id  { color: #e7ecea; }
.t-ws  { color: inherit; }
.t-prompt { color: var(--cyan, #6ad8d0); font-style: italic; opacity: 0.9; }
.t-spinner { color: var(--amber); font-weight: 600; }

/* ---------- Editor controls ---------- */
.editor__controls {
  display: flex; align-items: center; gap: 0.4rem;
  margin-left: auto;
}
.ed-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  padding: 0;
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease);
}
.ed-btn:hover { color: var(--amber); border-color: color-mix(in oklab, var(--amber) 45%, var(--line)); background: color-mix(in oklab, var(--amber) 8%, transparent); }
.ed-btn:active { transform: translateY(1px); }
.ed-btn.is-copied { color: var(--lime); border-color: color-mix(in oklab, var(--lime) 50%, var(--line)); }
.ed-btn .ic-play { display: none; }
.ed-btn.is-paused .ic-pause { display: none; }
.ed-btn.is-paused .ic-play  { display: inline-block; color: var(--amber); }

/* ---------- CI / pipeline strip ---------- */
.ci-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 85%, transparent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  overflow: hidden;
}
.ci-strip__scroll {
  display: flex; gap: 1.25rem;
  align-items: center;
  padding: 0.55rem 1rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.ci-strip__scroll::-webkit-scrollbar { display: none; }
.ci-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.ci-chip em {
  font-style: normal;
  color: var(--fg);
  font-weight: 500;
}
.ci-chip__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-dim);
  display: inline-block;
}
.ci-chip__dot.ok {
  background: var(--lime);
  box-shadow: 0 0 6px color-mix(in oklab, var(--lime) 70%, transparent);
  animation: ci-pulse 2.2s ease-in-out infinite;
}
@keyframes ci-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
