/* ═══════════════════════════════════════════
   Polyglot-Lion Project Page — Light Theme
   Matching knoveleng.github.io/steering style
   ═══════════════════════════════════════════ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'Aptos Serif';
  src: local('Aptos Serif'), local('Georgia');
  font-weight: 400;
  font-style: normal;
}

/* ── CSS Variables ── */
:root {
  --bg-primary: #ffffff;
  --bg-section: #f8fafd;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #78859b;
  --accent: #6366f1;
  --accent-dim: rgba(99, 102, 241, 0.08);
  --accent-gold: #d97706;
  --accent-green: #059669;
  --accent-blue: #2563eb;
  --accent-pink: #db2777;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s ease;
  --max-width: 960px;
  --font-serif: 'Aptos Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

body {
  font-family: var(--font-serif);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 72px 0;
}

/* ── Typography ── */
h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  text-align: center;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 16px;
}

h3 {
  font-size: 1.05rem;
}

.section-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ── Animations ── */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 100px 24px 48px;
  background: linear-gradient(180deg, #f0f2ff 0%, var(--bg-primary) 100%);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  margin-bottom: 18px;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-authors {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.hero-authors a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-muted);
}

.hero-authors a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-affiliation {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── Buttons ── */
.btn-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: none;
}

.btn-dark {
  background: var(--text-primary);
  color: #fff;
}

.btn-dark:hover {
  background: #334155;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* ═══════════════════════════════════════════
   STATS BAR
   ═══════════════════════════════════════════ */
.stats-bar {
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.stat-card {
  padding: 24px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card:nth-child(1)::before {
  background: var(--accent-gold);
}

.stat-card:nth-child(2)::before {
  background: var(--accent);
}

.stat-card:nth-child(3)::before {
  background: var(--accent-green);
}

.stat-card:nth-child(4)::before {
  background: var(--accent-pink);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card:nth-child(1) .stat-value {
  color: var(--accent-gold);
}

.stat-card:nth-child(2) .stat-value {
  color: var(--accent);
}

.stat-card:nth-child(3) .stat-value {
  color: var(--accent-green);
}

.stat-card:nth-child(4) .stat-value {
  color: var(--accent-pink);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════
   ABSTRACT
   ═══════════════════════════════════════════ */
.abstract-section {
  background: var(--bg-primary);
}

.abstract-card {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 0;
}

.abstract-card p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.9;
  text-align: justify;
}

.abstract-card strong {
  color: var(--text-primary);
}

.abstract-card code {
  font-size: 0.88rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════
   RESULTS
   ═══════════════════════════════════════════ */
.results-chart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 24px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.results-chart img {
  width: 100%;
  display: block;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  white-space: nowrap;
}

.results-table thead {
  background: var(--bg-section);
}

.results-table th {
  padding: 12px 12px;
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.results-table th:first-child,
.results-table td:first-child {
  text-align: left;
  padding-left: 16px;
  padding-right: 12px;
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 180px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
}

.results-table th:nth-child(2),
.results-table td:nth-child(2) {
  position: sticky;
  left: 180px;
  z-index: 3;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
}

.results-table thead th:first-child {
  background: var(--bg-section);
  z-index: 6;
}

.results-table thead th:nth-child(2) {
  background: var(--bg-section);
  z-index: 5;
}

.results-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.results-table tbody tr {
  transition: background 0.2s ease;
}

.results-table tbody tr:hover {
  background: #f0f0fb;
}

.results-table tbody tr:hover td:first-child,
.results-table tbody tr:hover td:nth-child(2) {
  background: #f0f0fb;
}

.results-table tr.row-ours {
  background: #f0effc;
}

.results-table tr.row-ours td {
  color: var(--text-primary);
  font-weight: 600;
}

.results-table tr.row-ours td:first-child {
  color: var(--accent);
  background: #e8e7fa;
}

.results-table tr.row-ours td:nth-child(2) {
  background: #f0effc;
}

.results-table tr.row-ours:hover td:first-child {
  background: #e4e3f7;
}

.results-table tr.row-ours:hover td:nth-child(2) {
  background: #eae9f8;
}

.results-table tr.row-ours td.best {
  color: var(--accent-gold);
  font-weight: 700;
}

.results-table td.best {
  color: var(--accent-gold);
  font-weight: 700;
}

.lang-header {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════
   METHOD
   ═══════════════════════════════════════════ */
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

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

.method-card:hover {
  box-shadow: var(--shadow-md);
}

.method-card h3 {
  color: var(--text-primary);
  margin-bottom: 12px;
  font-size: 1rem;
}

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

.method-card img {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

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

.data-card h3 {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 1rem;
}

.data-card img {
  width: 100%;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════
   COST & SPEED
   ═══════════════════════════════════════════ */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.comparison-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.comparison-card:hover {
  box-shadow: var(--shadow-md);
}

.comparison-card-header {
  padding: 20px 24px 16px;
}

.comparison-card-header h3 {
  font-size: 1rem;
}

.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cost-table th,
.cost-table td {
  padding: 12px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.cost-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cost-table td {
  color: var(--text-secondary);
}

.cost-table td.highlight {
  font-weight: 700;
  font-size: 1rem;
}

.cost-table tr.row-ours {
  background: rgba(99, 102, 241, 0.06);
}

.cost-table tr.row-ours td:first-child {
  color: var(--accent);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   MODELS
   ═══════════════════════════════════════════ */
.model-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.model-card:hover {
  box-shadow: var(--shadow-md);
}

.model-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-gold));
}

.model-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.model-params {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.model-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
}

.model-stat-item {
  text-align: center;
}

.model-stat-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.model-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.btn-hf {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 50px;
  background: var(--accent-dim);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.84rem;
  text-decoration: none;
  transition: var(--transition);
}

.btn-hf:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: translateY(-1px) scale(1.02);
}

/* ═══════════════════════════════════════════
   CITATION
   ═══════════════════════════════════════════ */
.citation-block {
  position: relative;
  margin-top: 24px;
}

.citation-block pre {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.copy-btn.copied {
  color: var(--accent-green);
  border-color: var(--accent-green);
  transform: scale(1.04);
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .model-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  section {
    padding: 40px 0;
  }

  .hero {
    padding: 60px 20px 32px;
  }

  .btn-group {
    flex-direction: column;
    align-items: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .animate-in {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .stat-card,
  .method-card,
  .comparison-card,
  .model-card,
  .btn,
  .btn-hf,
  .copy-btn {
    transition: none;
  }
}