/* Brandon-Tiny — GitHub Pages */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #f0883e;
  --accent-dim: #f0883e33;
  --link: #58a6ff;
  --code-bg: #1c2128;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container { max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.hero .tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.hero .badges { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
}
.badge:hover { opacity: 0.85; }
.badge--hf { background: #ffd21e; color: #1a1a1a; }
.badge--gh { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.badge--web { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }

/* Sections */
section { padding: 3rem 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text);
}
section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-muted);
}
p { margin-bottom: 1rem; color: var(--text-muted); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
th, td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border: 1px solid var(--border);
}
th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
}
td { color: var(--text-muted); }
td:first-child { color: var(--text); font-weight: 500; }
td strong { color: var(--accent); }

/* Pipeline visual */
.pipeline {
  display: flex;
  gap: 0;
  margin: 1.5rem 0;
  font-size: 0.85rem;
}
.pipeline-phase {
  flex: 1;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  position: relative;
}
.pipeline-phase:first-child { border-radius: 8px 0 0 8px; }
.pipeline-phase:last-child { border-radius: 0 8px 8px 0; }
.pipeline-phase .phase-num {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.pipeline-phase .phase-title {
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
}
.pipeline-phase .phase-detail {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.pipeline-phase + .pipeline-phase::before {
  content: '→';
  position: absolute;
  left: -0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  z-index: 1;
}

/* Code blocks */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 1rem 0;
}
code {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.85em;
}
p code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Citation */
.citation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1rem 0;
}
.citation pre {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

/* Key stat callout */
.stat-row {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.stat {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.stat .value {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Footer */
footer {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Paper layout: sidebar + content */
.paper-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar nav (Acrobat-style) */
.paper-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1.25rem 0;
  z-index: 10;
  font-size: 0.8rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.paper-nav .nav-title {
  padding: 0 1rem 0.75rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.paper-nav a {
  display: block;
  padding: 0.4rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
}
.paper-nav a:hover {
  color: var(--text);
  background: var(--accent-dim);
  text-decoration: none;
}
.paper-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}
.paper-nav a.nav-home {
  margin-bottom: 0.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  border-left: none;
  font-weight: 500;
}
.paper-nav a.nav-home:hover { background: none; color: var(--link); }

/* Paper main area pushed right */
.paper-main {
  flex: 1;
  margin-left: 220px;
}

.paper-header {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  max-width: 820px;
  margin: 0 auto;
}
.paper-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}
.paper-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.paper-content { max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }
.paper-content section { padding: 2rem 0; }
.paper-content section h2 { font-size: 1.35rem; }
.paper-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-muted);
  margin: 1rem 0;
}
.paper-content ul, .paper-content ol {
  margin: 0.75rem 0 1rem 1.5rem;
  color: var(--text-muted);
}
.paper-content li { margin-bottom: 0.35rem; }

/* Paper footer needs margin-left too */
.paper-layout footer { margin-left: 0; }

/* Responsive: paper sidebar */
@media (max-width: 900px) {
  .paper-nav {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    padding: 0.5rem;
    gap: 0;
  }
  .paper-nav .nav-title { display: none; }
  .paper-nav a {
    border-left: none;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }
  .paper-nav a.nav-home {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0.35rem;
  }
  .paper-main { margin-left: 0; }
}

/* Responsive: general */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.75rem; }
  .hero .tagline { font-size: 1rem; }
  .pipeline { flex-direction: column; }
  .pipeline-phase { border-radius: 0 !important; }
  .pipeline-phase:first-child { border-radius: 8px 8px 0 0 !important; }
  .pipeline-phase:last-child { border-radius: 0 0 8px 8px !important; }
  .pipeline-phase + .pipeline-phase::before {
    content: '↓';
    left: 50%;
    top: -0.6rem;
    transform: translateX(-50%);
  }
  .stat-row { flex-direction: column; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.4rem 0.5rem; }
}
