/* Awesome Reasoning Models Theory — site styles
   Self-contained. No external font/CDN dependencies beyond system Inter fallback.
*/

:root {
  --bg-deep: #07090f;
  --bg: #0b1220;
  --bg-card: #111827;
  --bg-card-hover: #1e293b;
  --border: #1e293b;
  --border-strong: #334155;
  --fg: #f8fafc;
  --fg-muted: #cbd5e1;
  --fg-dim: #94a3b8;
  --fg-faint: #64748b;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-warm: #fb923c;
  --accent-green: #34d399;
  --accent-pink: #f472b6;
  --maxw: 1140px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-deep);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'ss01' on, 'cv11' on;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(ellipse at top right, rgba(56, 189, 248, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(129, 140, 248, 0.08) 0%, transparent 50%),
    var(--bg-deep);
  background-attachment: fixed;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms ease;
}
a:hover { color: var(--accent-2); }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 0.4em;
}
h1 { font-size: 3rem; letter-spacing: -0.03em; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--fg-muted); }

code, pre {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.9em;
}

/* === Top navigation === */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(7, 9, 15, 0.7);
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
}
.topnav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.9rem;
}
.topnav-brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.topnav-brand:hover { color: var(--fg); }
.topnav-brand .dot {
  display: inline-block; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 12px var(--accent);
}
.topnav-links { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.topnav-links a { color: var(--fg-dim); font-weight: 500; }
.topnav-links a:hover { color: var(--fg); }
.topnav-cta {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--fg) !important;
}
.topnav-cta:hover { background: var(--bg-card-hover); }

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

section { padding: 80px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

/* === Hero === */
.hero {
  padding: 100px 0 60px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin-bottom: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #bae6fd 60%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-tagline {
  font-size: 1.2rem;
  color: var(--fg-muted);
  max-width: 680px;
  margin-bottom: 32px;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 56px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  font-size: 0.95rem; font-weight: 600;
  border-radius: 8px;
  transition: all 160ms ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #0b1220;
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.2);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(56, 189, 248, 0.32);
  color: #0b1220;
}
.btn-secondary {
  background: rgba(30, 41, 59, 0.6);
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--fg); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.hero-stat .num {
  font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.hero-stat .label {
  font-size: 0.85rem;
  color: var(--fg-dim);
  margin-top: 6px;
}

/* === Chapter grid === */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 22px 20px;
  transition: all 200ms ease;
  position: relative;
  overflow: hidden;
}
.chapter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
}
.chapter-card.cat-foundation::before { background: var(--accent); }
.chapter-card.cat-inference::before { background: var(--accent-green); }
.chapter-card.cat-training::before { background: var(--accent-warm); }
.chapter-card.cat-failure::before { background: var(--accent-pink); }
.chapter-card.cat-synthesis::before { background: var(--accent-2); }

.chapter-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.chapter-card .ch-num {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
  margin-bottom: 8px;
}
.chapter-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--fg);
}
.chapter-card p {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin: 0;
}
.chapter-card a { color: inherit; }

/* === Side-by-side comparison === */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.compare-card h3 {
  font-size: 1rem;
  color: var(--fg-faint);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.compare-card.this h3 { color: var(--accent); }
.compare-card ul { padding: 0; margin: 0; list-style: none; }
.compare-card li {
  padding: 6px 0 6px 22px;
  font-size: 0.92rem;
  color: var(--fg-muted);
  position: relative;
}
.compare-card li::before {
  content: '○';
  position: absolute; left: 0;
  color: var(--fg-faint);
}
.compare-card.this li::before { content: '●'; color: var(--accent); }

/* === Timeline mini === */
.timeline-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-top: 32px;
  overflow: hidden;
}
.timeline-track {
  position: relative;
  margin: 24px 0 8px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}
.timeline-dots {
  display: flex;
  justify-content: space-between;
  position: absolute;
  width: 100%;
  top: -8px;
}
.timeline-dot {
  width: 20px; height: 20px;
  background: var(--bg-card);
  border: 3px solid var(--accent);
  border-radius: 50%;
  transition: all 160ms ease;
}
.timeline-dot.model { border-color: var(--accent-2); }
.timeline-dot.bench { border-color: var(--accent-warm); }
.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 0.75rem;
  color: var(--fg-dim);
  text-align: center;
}
.timeline-labels span { width: 80px; }

/* === Feature blocks === */
.feature {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items: center;
  margin-top: 24px;
}
.feature-flip { grid-template-columns: 1fr 1.2fr; }
.feature-flip .feature-img { order: -1; }
@media (max-width: 880px) {
  .feature, .feature-flip { grid-template-columns: 1fr; gap: 32px; }
}
.feature h2 { margin-bottom: 18px; }
.feature p { font-size: 1rem; }
.feature-img {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
}
.feature-img img, .feature-img svg { max-width: 100%; display: block; height: auto; }

/* === Quote === */
.quote {
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--fg);
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 48px 0;
  border-left: 3px solid var(--accent);
  padding-left: 28px;
  max-width: 820px;
  margin-top: 24px;
}
.quote-source {
  display: block;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--fg-dim);
  font-weight: 400;
}

/* === Table-of-contents-style list === */
.tocish {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.tocish a {
  display: block;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  transition: all 160ms ease;
}
.tocish a:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateX(2px);
}
.tocish .item-label {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--fg-faint);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tocish .item-title {
  font-size: 1rem; font-weight: 600; color: var(--fg);
}
.tocish .item-desc {
  font-size: 0.85rem; color: var(--fg-muted);
  margin-top: 4px;
}

/* === Footer === */
footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 0;
}
footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  font-size: 0.88rem;
  color: var(--fg-dim);
}
@media (max-width: 720px) {
  footer .container { grid-template-columns: 1fr 1fr; }
}
footer h4 {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
  margin-bottom: 14px;
  text-transform: uppercase;
}
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: 8px; }
footer a { color: var(--fg-dim); }
footer a:hover { color: var(--fg); }
.footer-meta {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--fg-faint);
}

/* === Mini chip / tag === */
.chip {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* === Tables in markdown-rendered pages === */
.markdown-body table {
  border-collapse: collapse;
  margin: 16px 0;
  width: 100%;
}
.markdown-body th, .markdown-body td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.markdown-body th { background: var(--bg-card); color: var(--fg); font-weight: 600; }

/* === Timeline page === */
.timeline-page {
  padding: 60px 24px;
  max-width: 1280px;
  margin: 0 auto;
}
.timeline-page .timeline-canvas {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  margin-top: 32px;
  position: relative;
  overflow-x: auto;
}
.tl-row {
  display: flex;
  gap: 40px;
  align-items: stretch;
  padding-bottom: 24px;
  min-width: 1100px;
}
.tl-card {
  flex: 1;
  min-width: 200px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: all 200ms ease;
  cursor: pointer;
  position: relative;
}
.tl-card::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -24px;
  transform: translateX(-50%);
  width: 14px; height: 14px;
  background: var(--accent);
  border: 3px solid var(--bg-card);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--accent);
}
.tl-card.model::after { background: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2); }
.tl-card.benchmark::after { background: var(--accent-warm); box-shadow: 0 0 0 1px var(--accent-warm); }
.tl-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.tl-card .date {
  font-size: 0.75rem; letter-spacing: 0.1em;
  color: var(--fg-faint);
  font-weight: 600;
  margin-bottom: 6px;
}
.tl-card h4 {
  font-size: 0.95rem;
  margin: 0 0 6px;
  color: var(--fg);
}
.tl-card p {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin: 0;
}
.tl-line {
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-warm) 100%);
  margin: -3px 0 56px;
  min-width: 1100px;
  border-radius: 1px;
  opacity: 0.5;
}
.tl-legend { display: flex; gap: 24px; margin: 16px 0 24px; font-size: 0.85rem; color: var(--fg-dim); }
.tl-legend .dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 6px; vertical-align: middle;
}

/* responsive helpers */
@media (max-width: 720px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.5rem; }
  section { padding: 56px 0; }
  .topnav-links { display: none; }
  .topnav-cta { display: inline-flex; }
}
