/* === Custom Properties === */
:root {
  --bg: #ffffff;
  --bg-surface: #f0eeeb;
  --border: #ddd9d3;
  --text: #2c2825;
  --text-muted: #555049;
  --accent: #c4625a;
  --accent-hover: #a84d46;
  --code: #496e4b;
  --link: #4a7a8c;
  --link-hover: #365d6b;
  --font-heading: 'Literata', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  --max-width: 1080px;
  --max-width-wide: 1180px;
}

/* === Fonts === */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hiA.woff2) format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuGKYAZ9hiA.woff2) format('woff2');
}
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/literata/v37/or3PQ6P12-iJxAIgLa78DkrbXsDgk0oVDaBPYLanFMHB.woff2) format('woff2');
}
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/literata/v37/or3PQ6P12-iJxAIgLa78DkrbXsDgk0oVDaBPYLa2FMHB.woff2) format('woff2');
}
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/literata/v37/or3NQ6P12-iJxAIgLYT1PLs1Zd0nfUwAbeGVKoRYzNiCp1OUedn8.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/ibmplexmono/v19/-F63fjptAgt5VM-kVkqdyU8n5igg1l9kn-s.woff2) format('woff2');
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, blockquote, pre, figure { margin: 0; }

/* === Base === */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: 21px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--link-hover); }

img { max-width: 100%; height: auto; display: block; }

/* === Skip Link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus { top: 0.5rem; }

/* === Typography === */
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.25; font-weight: 700; }
h1 { font-size: 3rem; }
h2 { font-size: 2.2rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.4rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 0.5rem; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.88em;
}
code {
  background: #edecea;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}
pre {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  overflow-x: auto;
  line-height: 1.55;
}
pre code {
  background: none;
  padding: 0;
  font-size: 0.92rem;
}

/* === Layout === */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }
.container-wide { max-width: var(--max-width-wide); margin: 0 auto; padding: 0 2rem; }

section { padding: 5.5rem 0; }
section.alt { background: var(--bg-surface); }

/* === Navigation === */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.nav-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo { height: 36px; }
.nav-links { display: flex; gap: 1.5rem; list-style: none; padding: 0; align-items: center; }
.nav-links a {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links li + li::before {
  content: "|";
  color: #dcdcdc;
  font-weight: 300;
  margin-left: -0.75rem;
  margin-right: 0.75rem;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 7rem 0 5.5rem;
}
.hero-logo {
  width: 500px;
  margin: 0 auto 2.5rem;
}
.hero-tagline {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto 2.5rem;
  line-height: 1.55;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.hero-stat {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--code);
}
.hero-stat-sep {
  color: var(--border);
  user-select: none;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* === Property Grid === */
.prop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-top: 2.5rem;
}
.prop-item {
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.5rem;
  background: #fff;
  border-radius: 0 8px 8px 0;
}
.prop-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}
.prop-item p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Quote Cards === */
.quote-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1.75rem 2rem;
  margin-bottom: 1.75rem;
}
section.alt .quote-card { background: #fff; }
section:not(.alt) .quote-card { background: #fff; }
.quote-card h3 {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--accent);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.quote-card blockquote {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--text);
  line-height: 1.65;
  font-size: 1.1rem;
}
.quote-card blockquote em { font-style: normal; }
.quote-card .quote-attr {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 1rem;
}
.quote-context {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: normal;
  line-height: 1.55;
}

/* === Architecture Diagram === */
.arch-diagram {
  font-size: 0.95rem;
  line-height: 1.6;
}
.arch-diagram .c-node { color: #2a5a2e; font-weight: 600; }
.arch-diagram .c-agent { color: var(--accent); font-weight: 600; }
.arch-diagram .c-muted { color: var(--text-muted); }

.arch-text { margin-top: 2.5rem; }
.arch-text p { margin-bottom: 1.25rem; color: var(--text-muted); font-size: 1.05rem; line-height: 1.6; }
.arch-text strong { color: var(--text); }

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  margin: 1.5rem 0;
}
thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}
tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}
tbody tr:last-child td { border-bottom: none; }
.row-highlight { background: rgba(196, 98, 90, 0.1); }
.row-highlight td { font-weight: 600; }

/* === Stat Blocks === */
.stat-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}
.stat-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  flex: 1;
  min-width: 140px;
}
section:not(.alt) .stat-block { background: #fff; }
.stat-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--code);
  display: block;
}
.stat-label {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: block;
}

/* === Results Sub-sections === */
.results-sub { margin-bottom: 3rem; }
.results-sub h3 { color: var(--text); }
.results-note {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.55;
}

/* === Paper Section === */
.paper-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}
.paper-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}
.paper-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.15s;
}
.paper-badge:hover { border-color: var(--text-muted); color: var(--text); }

/* === Getting Started === */
.getting-started-pre {
  margin: 1.5rem 0;
}
.getting-started-note {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  line-height: 1.55;
}

/* === Footer === */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 4.5rem 0 3.5rem;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.footer-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.15s;
  display: block;
}
.footer-card:hover { border-color: var(--text-muted); }
.footer-card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.footer-card-url {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text-muted);
}
.footer-meta {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}
.footer-meta a { color: var(--text-muted); }
.footer-meta a:hover { color: var(--text); }
.footer-etymology {
  max-width: 720px;
  margin: 1.75rem auto 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: center;
  font-family: var(--font-heading);
  font-style: italic;
  opacity: 0.7;
}

/* === Section Intro === */
.section-intro {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.65;
}

/* === Ideas === */
.idea-block {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border, #e5e5e5);
}
.idea-block:last-child { border-bottom: none; }
.idea-block h3 {
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}
.idea-block p { margin-bottom: 1rem; line-height: 1.7; }
.idea-refs {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  border-left: 2px solid var(--border, #e5e5e5);
  padding-left: 1rem;
}
.idea-refs li {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

/* === Responsive === */
@media (max-width: 768px) {
  body { font-size: 19px; }
  section { padding: 3.5rem 0; }
  .hero { padding: 4.5rem 0 3.5rem; }
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }
  .hero-tagline { font-size: 2rem; }
  .hero-subtitle { font-size: 1.1rem; }
  .hero-logo { width: 360px; }

  .prop-grid { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr; }

  .hamburger { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.25rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.1rem; }
  .nav-links li + li::before { content: none; }

  .stat-row { gap: 0.75rem; }
  .stat-block { min-width: 100px; padding: 1rem; }
  .stat-value { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  body { font-size: 18px; }
  .hero-stats { gap: 1rem; }
  .hero-stat-sep { display: none; }
  .hero-stats { flex-direction: column; align-items: center; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; text-align: center; }
  table { font-size: 0.92rem; }
  thead th, tbody td { padding: 0.5rem 0.6rem; }
  pre code { font-size: 0.85rem; }
  .arch-diagram { font-size: 0.82rem; }
}
