:root {
  --bg: #08090c;
  --surface: #101218;
  --surface-2: #151821;
  --surface-3: #1b1f2b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f5f8;
  --text-dim: #9aa3b2;
  --text-muted: #6c7484;
  --accent: #ff5b1f;
  --accent-soft: rgba(255, 91, 31, 0.14);
  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --blue: #3b82f6;
  --radius: 14px;
  --radius-sm: 9px;
  --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background:
    radial-gradient(900px 420px at 14% -8%, rgba(255, 91, 31, 0.12), transparent 62%),
    radial-gradient(760px 420px at 88% 4%, rgba(59, 130, 246, 0.07), transparent 62%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: var(--font-mono); }
.muted { color: var(--text-dim); }
.small { font-size: 0.84rem; }
.accent { color: var(--accent); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.danger { color: var(--danger); }
.hidden { display: none !important; }

/* Honeypot trap link: completely invisible to humans & assistive tech */
.kz-hp-link {
  display: none !important;
  visibility: hidden !important;
}

.wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(8, 9, 12, 0.82);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff5b1f, #ff8142);
  color: #0b0c10;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 0 20px rgba(255, 91, 31, 0.35);
}

.brand-name {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.nav-links a:hover { color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ok);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ok-soft);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.status-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-sm { padding: 7px 12px; font-size: 0.82rem; }

.btn-primary {
  background: var(--accent);
  color: #0b0c10;
}
.btn-primary:hover { background: #ff6e38; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-3); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

/* Panels & Badges */
.panel {
  background: linear-gradient(180deg, rgba(22, 25, 34, 0.92), rgba(16, 18, 24, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.panel-head h2, .panel-head h3 { margin: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.badge-ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(16, 185, 129, 0.35); }
.badge-warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(245, 158, 11, 0.35); }
.badge-danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.35); }
.badge-accent { color: var(--accent); background: var(--accent-soft); border-color: rgba(255, 91, 31, 0.35); }

/* Sections */
.section {
  padding: 42px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
  margin: 0;
}

/* Hero */
.hero {
  padding: 46px 0 28px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 24px;
  align-items: stretch;
}

.hero-copy h1 {
  font-size: clamp(2.15rem, 4.1vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 56ch;
  margin: 0 0 22px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.curl-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #cbd5e1;
  overflow-x: auto;
}

.curl-bar code { white-space: nowrap; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.kpi-card span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}

.kpi-card strong {
  display: block;
  font-size: 1.35rem;
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* Live Score Card */
.verdict-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.verdict-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gauge-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 18px 0;
}

.gauge-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
}

.gauge-svg { width: 132px; height: 132px; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 10; }
.gauge-arc {
  fill: none;
  stroke: var(--ok);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-score {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
}

.gauge-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.verdict-summary h3 {
  margin: 6px 0 4px;
  font-size: 1.25rem;
}

.verdict-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.meta-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.meta-pill span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.meta-pill strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 6-Dimension Breakdown Grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cat-title {
  font-weight: 600;
  font-size: 1rem;
}

.cat-weight {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cat-score-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
}

.bar-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ok);
  transition: width 0.55s ease, background 0.3s ease;
}

.kv-list {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.kv-row span:first-child { color: var(--text-muted); }
.kv-row span:last-child {
  font-family: var(--font-mono);
  color: #dbe3ef;
  text-align: right;
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.chip-hit {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(245, 158, 11, 0.32);
}

.chip-crit {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.35);
}

/* Vector Classifier & Simulator */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
}

.vector-list {
  display: grid;
  gap: 12px;
}

.vector-item-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-bottom: 5px;
}

.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-btn {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.preset-btn:hover { border-color: var(--border-strong); color: var(--text); }
.preset-btn.is-active {
  background: var(--accent-soft);
  border-color: rgba(255, 91, 31, 0.55);
  color: #fff;
}

.sim-result-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.sim-reasons {
  margin: 10px 0 0;
  padding-left: 16px;
  font-size: 0.82rem;
  color: var(--text-dim);
  display: grid;
  gap: 5px;
}

/* Puzzle Lab */
.tab-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
}

.tab-btn.is-active {
  background: var(--accent);
  color: #090a0d;
  border-color: var(--accent);
}

.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.code-box {
  background: #06070a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 12px;
}

.code-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.code-box pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #d6deeb;
}

/* Kinetic Track */
.kinetic-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 12px;
}

.kinetic-track {
  position: relative;
  height: 52px;
  border-radius: 12px;
  background: #0a0c11;
  border: 1px solid var(--border-strong);
  margin: 10px 0;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.kinetic-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 91, 31, 0.22), rgba(16, 185, 129, 0.3));
  pointer-events: none;
}

.kinetic-target {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  pointer-events: none;
}

.kinetic-puck {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 44px;
  height: 42px;
  border-radius: 9px;
  border: 0;
  background: var(--accent);
  color: #08090c;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: grab;
  box-shadow: 0 4px 16px rgba(255, 91, 31, 0.35);
}

.kinetic-puck:active { cursor: grabbing; }

/* Tables */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

/* Scraper Gate Cards */
.mit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.mit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

/* SDK & Docs */
.sdk-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
}

.input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.text-input {
  flex: 1;
  background: #0a0c11;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
}

/* Gate & Protected standalone pages */
.gate-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-shell { width: 100%; max-width: 580px; }
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.gate-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.gate-meta-grid > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.gate-meta-grid span { display: block; font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); }
.gate-meta-grid strong { display: block; font-size: 0.86rem; margin-top: 4px; }

.gate-progress { margin-top: 16px; }
.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.35s ease, background 0.3s ease;
}

.gate-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.protected-wrap { width: 100%; max-width: 960px; display: grid; gap: 18px; }
.protected-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.protected-actions { display: flex; gap: 10px; }
.meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.meta-strip > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.meta-strip span { display: block; font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); }
.meta-strip strong { display: block; font-size: 0.85rem; margin-top: 3px; }

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 42px;
  margin-top: 24px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .hero-grid, .split-grid, .lab-grid, .sdk-grid { grid-template-columns: 1fr; }
  .cat-grid, .mit-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-row, .meta-strip { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}

@media (max-width: 640px) {
  .cat-grid, .mit-grid, .gate-meta-grid { grid-template-columns: 1fr; }
}
