/* ============================================================
   3DGS Antialiasing Survey — stylesheet
   Aesthetic: academic, calm, content-first, with interactive
   demos that pop. Inspired by Distill.pub + thesis monographs.
   ============================================================ */

:root {
  --bg:        #fbf9f4;
  --bg-soft:   #f3efe5;
  --bg-card:   #ffffff;
  --ink:       #1f2024;
  --ink-soft:  #4a4d57;
  --ink-faint: #8a8d97;
  --line:      #e5e0d3;
  --accent:    #b6552e;   /* burnt orange */
  --accent-soft:#ecd5c8;
  --accent2:   #2a6f6b;   /* teal */
  --accent3:   #c08a2c;   /* mustard for "frontier" tags */
  --code-bg:   #1d1f24;
  --code-ink:  #e4e2db;
  --math-bg:   #f6f1e3;
  --shadow:    0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.04);
  --radius:    8px;
  --maxw:      820px;
  --font-body: "Charter","Iowan Old Style","Source Serif Pro","Noto Serif SC",ui-serif,Georgia,serif;
  --font-ui:   "Inter","Helvetica Neue","Noto Sans SC",ui-sans-serif,system-ui,sans-serif;
  --font-mono: "JetBrains Mono","Fira Code",ui-monospace,Menlo,monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ----- Layout ------------------------------------------------ */
.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 22px 40px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  font-family: var(--font-ui);
  font-size: 14px;
}
.sidebar h1 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.sidebar .subtitle {
  color: var(--ink-faint);
  font-size: 12px;
  margin-bottom: 18px;
  line-height: 1.4;
}
.toc { list-style: none; padding: 0; margin: 14px 0 0; }
.toc > li { margin: 0; }
.toc a {
  display: block;
  padding: 5px 8px;
  border-radius: 4px;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.35;
}
.toc a:hover { background: var(--accent-soft); color: var(--ink); }
.toc a.active { color: var(--accent); font-weight: 600; }
.toc .group {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--ink-faint);
  padding: 14px 8px 4px;
  font-weight: 600;
}
.toc .nested { padding-left: 12px; font-size: 13px; }

main {
  padding: 56px 60px 120px;
  max-width: 100%;
}
.col {
  max-width: var(--maxw);
  margin: 0 auto;
}

/* ----- Typographic primitives -------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-ui); letter-spacing: -.012em; }
h1 { font-size: 44px; line-height: 1.05; margin: 0 0 8px; font-weight: 800; }
h2 {
  font-size: 28px;
  line-height: 1.2;
  margin: 64px 0 12px;
  font-weight: 700;
  border-top: 1px solid var(--line);
  padding-top: 36px;
}
h2 .num {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
  margin-right: 12px;
  font-size: 18px;
  vertical-align: 4px;
}
h3 { font-size: 22px; margin: 38px 0 8px; font-weight: 700; }
h4 { font-size: 16px; margin: 22px 0 6px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
p { margin: 0 0 14px; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
a:hover { border-bottom-color: var(--accent); }
strong { color: var(--ink); font-weight: 700; }
em { font-style: italic; color: var(--ink-soft); }
hr { border: 0; height: 1px; background: var(--line); margin: 36px 0; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 4px 0; }

/* ----- Hero -------------------------------------------------- */
.hero {
  margin: 0 0 48px;
  padding: 18px 0 24px;
}
.hero .kicker {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
}
.hero .lede {
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 720px;
  margin: 18px 0 10px;
}
.hero .meta {
  font-family: var(--font-ui);
  color: var(--ink-faint);
  font-size: 13px;
  margin-top: 18px;
}

/* ----- Paper cards ------------------------------------------ */
.paper {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 22px 0 28px;
  box-shadow: var(--shadow);
}
.paper-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  font-family: var(--font-ui);
}
.paper-head .alias {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.paper-head .full {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 400;
}
.paper-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.paper-meta .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 6px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .02em;
}
.paper-meta .tag.teal  { background: #d6e8e6; color: var(--accent2); }
.paper-meta .tag.mustard { background: #f3e2bf; color: #8a6512; }
.paper-meta a {
  color: var(--ink-soft);
  border-bottom: none;
  margin-right: 12px;
}
.paper-meta a:hover { color: var(--accent); }
.paper .pain {
  font-style: italic;
  color: var(--ink-soft);
  margin: 4px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--accent-soft);
}
.paper .idea {
  margin: 12px 0;
}
.paper .idea-label {
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  font-weight: 700;
}
.paper .diff {
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 10px;
}
.paper .diff::before {
  content: "vs prior →";
  font-weight: 700;
  color: var(--accent2);
  margin-right: 8px;
}

/* ----- Callouts --------------------------------------------- */
.callout {
  background: var(--math-bg);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 22px 0;
  border-left: 4px solid var(--accent3);
  font-family: var(--font-body);
}
.callout-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent3);
  margin-bottom: 8px;
}
.callout.intuition { border-left-color: var(--accent2); }
.callout.intuition .callout-title { color: var(--accent2); }
.callout.warn { border-left-color: var(--accent); background: #fbeee6; }
.callout.warn .callout-title { color: var(--accent); }

/* ----- Code ------------------------------------------------- */
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 18px 22px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 18px 0;
}
code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent);
}
pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }

/* Prism tomorrow palette gets remapped to fit the warm theme.
   We don't need many — keep tokens subdued. */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6e6a86; font-style: italic; }
.token.punctuation { color: #cfcabf; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #ebbcba; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #c4a7e7; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #eb6f92; }
.token.atrule, .token.attr-value, .token.keyword { color: #f6c177; }
.token.function, .token.class-name { color: #91d1c2; }
.token.regex, .token.important, .token.variable { color: #f5b840; }

/* ----- Tables ----------------------------------------------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-family: var(--font-ui);
  font-size: 14px;
}
.tbl th, .tbl td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl th {
  background: var(--bg-soft);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tbl tr:hover td { background: #fffaf2; }
.tbl td a { color: var(--ink-soft); border-bottom: 1px dotted var(--line); }
.tbl td a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.tbl-wrap { overflow-x: auto; margin: 18px 0; border-radius: var(--radius); }
.tbl-wrap .tbl { margin: 0; }

/* ----- Demos ------------------------------------------------ */
.demo {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 26px 0;
  box-shadow: var(--shadow);
}
.demo-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 12px;
}
.demo-stage {
  position: relative;
  width: 100%;
  background: #f8f6ef;
  border-radius: 6px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.demo canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 13px;
  margin-top: 14px;
}
.demo-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  min-width: 130px;
}
.demo-controls input[type=range] { width: 160px; accent-color: var(--accent); }
.demo-controls .toggle {
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: none; font-size: 13px; letter-spacing: 0; font-weight: 400;
  color: var(--ink);
  min-width: auto;
  flex-direction: row;
}
.demo-controls .toggle input { accent-color: var(--accent); }
.readout {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent2);
  background: var(--bg-soft);
  padding: 4px 8px;
  border-radius: 3px;
  display: inline-block;
}
.demo-caption {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 12px;
  line-height: 1.5;
}
.demo-msg {
  font-family: var(--font-ui);
  font-size: 13px;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent3);
  border-radius: 4px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.demo-msg.ok    { border-left-color: var(--accent2); background: #eaf3f1; color: var(--accent2); }
.demo-msg.warn  { border-left-color: var(--accent); background: #fbeee6; color: var(--accent); }
.demo-msg strong, .demo-msg code { color: inherit; }
.demo-msg code { background: rgba(0,0,0,0.04); }

/* ----- Math (KaTeX overrides) ------------------------------- */
.katex { font-size: 1.04em; }
.katex-display {
  background: var(--math-bg);
  padding: 12px 18px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 16px 0;
}

/* ----- Pipeline ASCII diagram ------------------------------ */
.pipeline {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 22px 26px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  margin: 22px 0;
  overflow-x: auto;
  white-space: pre;
  box-shadow: var(--shadow);
}

/* ----- Two-column comparison ------------------------------ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}
.two-col .panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.two-col .panel h4 {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
}
.two-col .panel p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 4px 0;
}
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* ----- Artifact-triplet card grid -------------------------- */
.triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0;
}
.triple .card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.triple .card .icon { font-size: 24px; line-height: 1; margin-bottom: 6px; }
.triple .card h4 {
  margin: 4px 0 6px;
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent);
}
.triple .card p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 4px 0;
}
.triple .card .why {
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-faint);
}
@media (max-width: 700px) { .triple { grid-template-columns: 1fr; } }

/* ----- Timeline -------------------------------------------- */
.timeline {
  position: relative;
  margin: 20px 0;
  padding-left: 28px;
  font-family: var(--font-ui);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 4px; bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent3), var(--accent2));
}
.tl-item {
  position: relative;
  margin: 10px 0;
  padding: 4px 0 4px 0;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -22px; top: 10px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}
.tl-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: .04em;
}
.tl-title {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  margin: 1px 0 2px;
}
.tl-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ----- Reference list -------------------------------------- */
#references-list {
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--ink-soft);
  padding-left: 28px;
  line-height: 1.55;
}
#references-list li { margin: 6px 0; }
#references-list a { color: var(--accent2); border-bottom: 1px dotted var(--line); }
#references-list a:hover { border-bottom-color: var(--accent2); }

/* ----- Footer ------------------------------------------------ */
footer {
  margin-top: 80px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-faint);
}
footer p { margin: 4px 0; }
footer a { color: var(--ink-soft); border-bottom: 1px dotted var(--line); }

/* ----- Responsive ------------------------------------------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto; border-right: none;
    border-bottom: 1px solid var(--line); padding: 18px 22px;
  }
  main { padding: 32px 22px 80px; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  h1 { font-size: 32px; }
  h2 { font-size: 22px; margin-top: 44px; }
  .paper { padding: 16px 18px; }
  .demo { padding: 14px; }
  .demo-controls input[type=range] { width: 100%; }
}

/* Smooth scrolling anchors with a tiny indicator */
section { scroll-margin-top: 30px; }
