:root {
  color-scheme: dark;
  --bg: #090814;
  --bg-elev: #110e20;
  --panel: #151226;
  --line: #2a2340;
  --line-hi: #443666;
  --ink: #f4f0fa;
  --muted: #b8accb;
  --accent: #ff4e7f;
  --accent-soft: rgba(255, 78, 127, 0.14);
  --ok: #38e59d;
  --ok-soft: rgba(56, 229, 157, 0.13);
  --err: #ff6b6b;
  --err-soft: rgba(255, 107, 107, 0.14);
  --sans: "Space Grotesk", "Noto Sans KR", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15.5px/1.6 var(--sans);
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 75% 0%, rgba(255, 78, 127, 0.14), transparent 60%),
    radial-gradient(ellipse 45% 40% at 15% 25%, rgba(56, 229, 157, 0.08), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}

a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(9, 8, 20, 0.84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 30px;
  font: 700 14px var(--mono);
  color: #090814;
  background: var(--accent);
  border-radius: 6px;
}
.brand-sub { font-size: 14px; color: var(--muted); font-weight: 600; }

.demo-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tab {
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.tab.active {
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 78, 127, 0.45);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }
.ghost-link { font-size: 13.5px; color: var(--muted); padding: 6px 10px; }
.ghost-link:hover { color: var(--accent); }
.lang-select {
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--line-hi);
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.lang-select:hover, .lang-select:focus { border-color: var(--accent); color: var(--accent); outline: none; }

/* Hero */
.hero {
  padding: clamp(36px, 5vw, 62px) 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 11.5px/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 78, 127, 0.3);
  margin-bottom: 16px;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(56, 229, 157, 0.2); }
.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4.3vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
  font-weight: 700;
}
:lang(ko) .hero h1 { letter-spacing: -0.03em; word-break: keep-all; line-height: 1.15; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { margin: 14px 0 0; max-width: 58ch; color: var(--muted); font-size: 16px; }

.commit-rail { display: flex; align-items: center; gap: 10px; }
.commit-card {
  min-width: 165px;
  padding: 13px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 3px;
}
.commit-card.bad { border-top: 2px solid var(--err); }
.commit-card.good { border-top: 2px solid var(--ok); }
.commit-label { font: 700 10.5px var(--mono); letter-spacing: 0.08em; color: var(--muted); }
.commit-card code { font: 700 18px var(--mono); color: var(--ink); }
.commit-card.bad code { color: var(--err); }
.commit-card.good code { color: var(--ok); }
.commit-sub { font-size: 12px; color: var(--muted); }
.commit-arrow { font: 700 20px var(--mono); color: var(--accent); }

/* Bench */
.bench {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}
.fixture-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.pill:hover { border-color: var(--line-hi); color: var(--ink); }
.pill.active { color: var(--ink); background: var(--accent-soft); border-color: var(--accent); }
.pill-tag {
  font: 700 10.5px var(--mono);
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
}
.pill.active .pill-tag { background: var(--accent); color: #090814; }

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 0;
  background: var(--accent);
  color: #090814;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.primary-btn:hover { background: #ff6e96; }
.primary-btn:disabled { opacity: 0.55; cursor: wait; }

.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font: 500 12.5px var(--mono);
  color: var(--muted);
  background: rgba(9, 8, 20, 0.55);
  border-bottom: 1px solid var(--line);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #f5b942; flex-shrink: 0; }
.status-bar[data-result="live"] .status-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-bar[data-result="live"] #status { color: var(--ok); }
.status-bar[data-result="error"] .status-dot { background: var(--err); }
.status-bar[data-result="error"] #status { color: var(--err); }
.rt-badge { margin-left: auto; color: var(--muted); font-size: 12px; }

/* Input Strip */
.input-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #0d0b1a;
}
.strip-col { padding: 13px 18px; }
.strip-col:first-child { border-right: 1px solid var(--line); }
.strip-label { display: block; font: 600 10.5px var(--mono); letter-spacing: 0.08em; color: var(--muted); margin-bottom: 7px; }
.strip-col pre {
  margin: 0;
  font: 12.5px/1.55 var(--mono);
  color: #ddd4ec;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bom-hl {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 78, 127, 0.45);
  color: var(--accent);
  font-weight: 700;
}

/* Comparison */
.comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.output-card { display: flex; flex-direction: column; min-width: 0; }
.output-card:first-child { border-right: 1px solid var(--line); }
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.sha-chip {
  margin-left: auto;
  font: 600 12px var(--mono);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 5px;
}
.verdict-pill {
  font: 700 10.5px var(--mono);
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.verdict-pill.pass { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(56, 229, 157, 0.35); }
.verdict-pill.fail { background: var(--err-soft); color: var(--err); border: 1px solid rgba(255, 107, 107, 0.4); }

iframe {
  display: block;
  width: 100%;
  height: 155px;
  border: 0;
  background: #120f21;
}
.raw-wrap {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: #0b0917;
  flex: 1;
}
.raw-label { display: block; font: 600 10.5px var(--mono); letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.raw-wrap pre {
  margin: 0;
  font: 12.5px/1.55 var(--mono);
  color: #cfc6e0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Evidence */
.evidence { padding: 42px 0 36px; }
.evidence-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}
.kicker { display: block; font: 600 11px var(--mono); letter-spacing: 0.09em; color: var(--accent); margin-bottom: 6px; }
.evidence h2 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.03em; }
.evidence-head p { margin: 0; color: var(--muted); font-size: 14.5px; }

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.step-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-hi);
}
.step-box:last-child { border-top-color: var(--ok); }
.step-tag { font: 700 11px var(--mono); letter-spacing: 0.08em; color: var(--accent); }
.step-box:last-child .step-tag { color: var(--ok); }
.step-box strong { font-size: 15px; line-height: 1.35; }
.step-box p { margin: 0; font-size: 13.5px; color: var(--muted); }
.step-box a { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
.step-box a:hover { text-decoration: underline; text-underline-offset: 4px; }
.step-links { margin-top: auto; padding-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 28px; color: var(--muted); font-size: 13.5px; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a:hover, .foot-inner > a:hover { color: var(--accent); }
.noscript-msg { padding: 16px 20px; color: var(--err); }

@media (max-width: 900px) {
  .hero, .input-strip, .comparison, .evidence-head, .timeline-grid { grid-template-columns: 1fr; }
  .strip-col:first-child, .output-card:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .commit-rail { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 28px); }
  .demo-tabs { display: none; }
}
