:root {
  color-scheme: dark;
  --bg: #090814;
  --bg-elev: #110e20;
  --panel: #151226;
  --panel-2: #1b1630;
  --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.12);
  --err: #ff7b72;
  --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 65% 45% at 72% 0%, rgba(255, 78, 127, 0.14), transparent 60%),
    radial-gradient(ellipse 45% 40% at 12% 20%, rgba(124, 92, 255, 0.12), 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;
  letter-spacing: -0.04em;
}
.brand-sub { font-size: 14px; color: var(--muted); font-weight: 600; }

.demo-tabs {
  display: flex;
  align-items: center;
  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;
  border-radius: 7px;
  transition: color 0.15s;
}
.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.09em;
  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.4vw, 3.6rem);
  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.14; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede {
  margin: 14px 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 16px;
}

.metrics-rail { display: flex; gap: 12px; }
.metric-card {
  min-width: 185px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 10px;
  display: grid;
  gap: 3px;
}
.metric-label { font: 600 10.5px var(--mono); letter-spacing: 0.08em; color: var(--muted); }
.metric-val { font: 700 24px/1.15 var(--mono); color: var(--ink); letter-spacing: -0.03em; }
.metric-val em { font-style: normal; color: var(--accent); font-size: 16px; }
.metric-sub { font-size: 12px; color: var(--muted); }

/* Workbench */
.workbench {
  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: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}
.scenario-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 13.5px;
  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-code {
  font: 700 11px var(--mono);
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
}
.pill.active .pill-code { 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;
  transition: transform 0.12s, background 0.15s;
}
.primary-btn:hover { background: #ff6e96; }
.primary-btn:active { transform: translateY(1px); }
.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-state="success"] .status-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-bar[data-state="success"] #status { color: var(--ok); }
.status-bar[data-state="error"] .status-dot { background: var(--err); }
.status-bar[data-state="error"] #status { color: var(--err); }
.pipe-chain { margin-left: auto; color: var(--muted); font-size: 12px; }
.pipe-chain b { color: var(--accent); margin-inline: 4px; }

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.steps { display: flex; flex-direction: column; }
.step-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.step-card:last-child { border-bottom: 0; }
.step-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.step-num {
  font: 700 11px var(--mono);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
}
.tool-badge {
  font: 700 13px var(--mono);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 78, 127, 0.35);
}
.tool-badge:hover { background: var(--accent); color: #090814; }
.step-desc { font-size: 14px; font-weight: 600; color: var(--ink); }
.cmd-chip {
  margin-left: auto;
  font: 500 11.5px var(--mono);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 5px;
  max-width: 100%;
  overflow-x: auto;
}

.out-box {
  margin: 0 0 10px;
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  color: var(--ink);
  font: 600 13.5px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.out-box.error-lines { border-left-color: var(--accent); color: #ffd4df; }

.inspect { color: var(--muted); font-size: 12.5px; }
.inspect summary {
  cursor: pointer;
  width: fit-content;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}
.inspect summary:hover { color: var(--ink); }
.inspect pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0b0917;
  border: 1px solid var(--line);
  color: #cfc6e0;
  font: 12px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 190px;
  overflow-y: auto;
}

.result-pane {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #0d0b1a;
}
.pane-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.dots { display: flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #362c50; display: block; }
.dots i:first-child { background: #ff5f56; }
.dots i:nth-child(2) { background: #ffbd2e; }
.dots i:nth-child(3) { background: #27c93f; }
.pane-head h2 { margin: 0; font: 600 13px var(--mono); color: var(--ink); }
.live-tag {
  margin-left: auto;
  font: 600 10.5px var(--mono);
  letter-spacing: 0.06em;
  color: var(--ok);
  background: var(--ok-soft);
  padding: 3px 8px;
  border-radius: 999px;
}
iframe {
  width: 100%;
  flex: 1;
  min-height: 360px;
  border: 0;
  background: #120f21;
}

/* 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; }
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ev-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color 0.16s, transform 0.16s;
}
.ev-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.ev-card strong { font-size: 14.5px; color: var(--ink); }
.ev-card span { font-size: 13px; color: var(--muted); }

/* 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 { grid-template-columns: 1fr; }
  .columns { grid-template-columns: 1fr; }
  .result-pane { border-left: 0; border-top: 1px solid var(--line); }
  .evidence-head, .evidence-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 28px); }
  .demo-tabs { display: none; }
  .metrics-rail { flex-direction: column; }
  .pipe-chain { display: none; }
}
