:root {
  --bg-deep: #fafafa;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f4f5f7;
  --border: #e2e4e9;
  --border-bright: #c8ccd4;

  --text-primary: #1a1d24;
  --text-secondary: #4b5363;
  --text-muted: #8891a4;

  --accent-cyan: #1a6fb5;
  --accent-cyan-dim: rgba(26, 111, 181, 0.07);
  --accent-cyan-glow: rgba(26, 111, 181, 0.15);
  --accent-green: #1a7d3f;
  --accent-amber: #b45309;
  --accent-red: #b91c1c;
  --accent-pink: #b5295a;
  --accent-purple: #6d28d9;

  --model-a: var(--accent-cyan);
  --model-b: var(--accent-pink);

  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 6px;
  --radius-lg: 8px;

  --grain-opacity: 0;
  --grid-opacity: 0;
  --header-bg: rgba(250, 250, 250, 0.92);
  --radar-grid: rgba(0, 0, 0, 0.08);
  --radar-grid-mid: rgba(0, 0, 0, 0.15);
  --radar-axis: rgba(0, 0, 0, 0.12);
  --radar-label: #4b5363;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ---- HEADER ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}

.brand-sigil {
  font-size: 20px;
  color: var(--accent-cyan);
  font-weight: 700;
}

.header-nav {
  display: flex;
  gap: 24px;
}

.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--accent-cyan);
}

/* ---- HERO ---- */

.hero {
  padding: 100px 0 80px;
  position: relative;
}


.hero-content {
  max-width: 700px;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--accent-cyan);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 6px;
}

/* ---- MODEL FIT ---- */

.model-fit {
  padding: 80px 0;
}

.fit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.fit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.fit-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.fit-profile {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  margin-bottom: 10px;
  line-height: 1.5;
}

.fit-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}

.fit-ranking {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.fit-ranking li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  border-radius: 4px;
  transition: background 0.15s;
}

.fit-ranking .rank-link:hover {
  background: var(--bg-elevated);
}

.rank-pos {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.fit-ranking li:first-child .rank-pos {
  color: var(--accent-cyan);
}

.rank-name {
  flex: 1;
  font-weight: 500;
}

.rank-link .rank-name {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-decoration-color: rgba(26, 111, 181, 0.3);
  text-underline-offset: 2px;
}

.rank-ref .rank-name {
  color: var(--text-primary);
}

.rank-score {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.fit-insight {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 20px 24px;
  border-left: 3px solid var(--accent-cyan);
}

.fit-insight p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---- WHY / USES ---- */

.why {
  padding: 80px 0;
}

.why-primary {
  margin-bottom: 48px;
}

.why-lead {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 720px;
  margin-bottom: 16px;
}

.why-lead a {
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 212, 255, 0.3);
  transition: border-color 0.2s;
}

.why-lead a:hover {
  border-color: var(--accent-cyan);
}

.why-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 720px;
}

.uses-heading {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.uses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.uses-heading {
  grid-column: 1 / -1;
}

.use-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}

.use-card:hover {
  border-color: var(--border-bright);
}

.use-number {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
  opacity: 0.5;
  margin-bottom: 10px;
}

.use-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.use-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---- REFERENCE PROFILE ---- */

.reference {
  padding: 40px 0 80px;
}

.ref-card {
  background: var(--bg-card);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.ref-header {
  margin-bottom: 12px;
}

.ref-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ref-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 4px;
}

.ref-card > p {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 600px;
  margin-bottom: 28px;
}

.ref-profile {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.profile-dim {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dim-name {
  font-size: 13px;
  color: var(--text-secondary);
  width: 160px;
  flex-shrink: 0;
}

.dim-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.dim-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent-cyan);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
}

.dim-fill.low-is-good {
  background: var(--accent-green);
}

.dim-score {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* ---- SECTION TITLES ---- */

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 640px;
  margin-bottom: 36px;
}

/* ---- FINDINGS ---- */

.findings {
  padding: 80px 0;
}

.findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.finding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--card-shadow);
}

.finding-card.finding-highlight {
  border-left: 3px solid var(--accent-amber);
}

.finding-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.finding-highlight .finding-icon {
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}

.finding-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

.finding-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---- COMPARISONS ---- */

.comparisons {
  padding: 80px 0;
}

.comparison-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  color: var(--text-primary);
  flex: 1;
  min-width: 160px;
}

.tab:hover {
  border-color: var(--border-bright);
  background: var(--bg-elevated);
}

.tab.active {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
}

.tab-model {
  font-size: 15px;
  font-weight: 600;
}

.tab-verdict {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.verdict-ok { color: var(--accent-green); }
.verdict-warn { color: var(--accent-amber); }
.verdict-bad { color: var(--accent-red); }

.comparison-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.radar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

#radarChart {
  max-width: 100%;
  height: auto;
}

.radar-legend {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.legend-dot.a { background: var(--accent-cyan); }
.legend-dot.b { background: var(--accent-pink); }

/* ---- DELTA TABLE ---- */

.delta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.delta-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.delta-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30, 45, 74, 0.5);
  vertical-align: middle;
}

.delta-table tr:last-child td {
  border-bottom: none;
}

.delta-table .dim-cell {
  font-weight: 500;
}

.delta-table .score-cell {
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  width: 52px;
}

.delta-table .delta-cell {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  width: 80px;
  border-radius: 4px;
}

.delta-ok { color: var(--accent-green); }
.delta-moderate { color: var(--accent-amber); }
.delta-significant { color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }

/* ---- DRILLDOWN ---- */

.drilldown {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.drilldown-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.drilldown-controls {
  margin-bottom: 20px;
}

.dim-select {
  appearance: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 36px 8px 14px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%238899b4' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.dim-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.drilldown-context {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  display: inline-block;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.prompt-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  transition: border-color 0.2s;
}

.prompt-cell:hover {
  border-color: var(--border-bright);
}

.prompt-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.prompt-scores {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
}

.prompt-a { color: var(--accent-cyan); }
.prompt-b { color: var(--accent-pink); }
.prompt-arrow { color: var(--text-muted); font-size: 10px; }

.prompt-delta {
  font-weight: 600;
  margin-left: auto;
}

.prompt-cell.sig .prompt-delta { color: var(--accent-red); }
.prompt-cell.mod .prompt-delta { color: var(--accent-amber); }
.prompt-cell.ok .prompt-delta { color: var(--accent-green); }
.prompt-cell.na { opacity: 0.4; }

/* ---- PATCH ---- */

.patch {
  padding: 80px 0;
}

.patch-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.patch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.patch-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.patch-target {
  font-size: 13px;
  color: var(--text-muted);
}

.patch-code {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.patch-dim {
  color: var(--accent-amber);
  font-weight: 500;
}

/* ---- METHODOLOGY ---- */

.methodology {
  padding: 80px 0;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.method-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.method-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.method-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.method-card code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--accent-cyan);
}

/* ---- FOOTER ---- */

.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--accent-cyan);
}

/* ---- RESPONSIVE ---- */

@media (max-width: 768px) {
  .header-nav {
    gap: 16px;
  }

  .hero {
    padding: 60px 0 50px;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 24px;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .radar-container {
    order: -1;
  }

  #radarChart {
    width: 320px;
    height: 320px;
  }

  .comparison-tabs {
    flex-direction: column;
  }

  .tab {
    min-width: unset;
  }

  .ref-profile {
    grid-template-columns: 1fr;
  }

  .prompt-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .patch-header {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
}

.nav-toggle {
  display: none;
  appearance: none;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 24px 16px;
    gap: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .header-nav.open {
    display: flex;
  }

  .header-nav a {
    padding: 10px 0;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
  }

  .header-nav a:last-child {
    border-bottom: none;
  }
}

@media (max-width: 480px) {
  .findings-grid {
    grid-template-columns: 1fr;
  }

  .method-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- ANIMATIONS ---- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-content,
.ref-card,
.finding-card,
.comparison-panel,
.patch-card,
.method-card {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.finding-card:nth-child(2) { animation-delay: 0.1s; }
.finding-card:nth-child(3) { animation-delay: 0.2s; }
.method-card:nth-child(2) { animation-delay: 0.05s; }
.method-card:nth-child(3) { animation-delay: 0.1s; }
.method-card:nth-child(4) { animation-delay: 0.15s; }
