/* LLM Routing talk — shared "slide deck" theme */

:root {
  --navy: #2f5496;
  --navy-dark: #1f3864;
  --accent: #ed7d31;
  --accent2: #4472c4;
  --ink: #262626;
  --muted: #595959;
  --rule: #d9d9d9;
  --paper: #ffffff;
  --canvas: #eef1f5;
  --code-bg: #f4f4f4;
  --radius: 6px;
  --slide-max: 1500px;
  --topbar-h: 3.6rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Calibri, "Helvetica Neue", Arial, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.slide {
  max-width: var(--slide-max);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  padding: calc(var(--topbar-h) + 2rem) clamp(1.25rem, 5vw, 5rem) 3.5rem;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}

/* ---------- Header ---------- */

.slide-header {
  border-bottom: 4px solid var(--accent);
  padding-bottom: 0.9rem;
  margin-bottom: 2rem;
}

.eyebrow {
  display: block;
  font-size: clamp(1rem, 1vw + 0.6rem, 1.3rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.slide-header h1 {
  margin: 0;
  color: var(--navy-dark);
  font-size: clamp(2.3rem, 3.6vw, 3.6rem);
  font-weight: 700;
}

/* ---------- Title slide ---------- */

.title-slide {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: calc(var(--topbar-h) + 2rem) clamp(1.25rem, 6vw, 5rem) 3.5rem;
}

.title-slide .top-rule,
.title-slide .bottom-rule {
  border: none;
  border-top: 4px solid var(--accent);
  width: 140px;
  margin: 0 auto 2rem;
}

.title-slide .bottom-rule {
  margin: 2rem auto 0;
}

.title-slide h1 {
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  color: var(--navy-dark);
  margin: 0 0 1rem;
  font-weight: 700;
}

.title-slide .subtitle {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  color: var(--muted);
}

.title-slide .author {
  font-weight: 600;
  color: var(--navy);
}

/* ---------- Body content ---------- */

.content {
  font-size: clamp(1.4rem, 1.4vw + 0.9rem, 1.9rem);
}

.content h2 {
  color: var(--navy);
  font-size: 1.35em;
  margin: 1.2em 0 0.6em;
}

.content h2:first-child {
  margin-top: 0;
}

.content p {
  margin: 0 0 1rem;
}

.content ul,
.content ol {
  margin: 0 0 1.1rem;
  padding-left: 1.4rem;
}

.content li {
  margin-bottom: 0.55rem;
}

.content li > ul,
.content li > ol {
  margin-top: 0.55rem;
}

.content ul ul {
  list-style-type: circle;
}

.content ul ul ul {
  list-style-type: square;
}

.content a {
  color: var(--accent2);
  text-decoration: none;
  border-bottom: 1px solid rgba(68, 114, 196, 0.4);
}

.content a:hover {
  border-bottom-color: var(--accent2);
}

.content strong {
  color: var(--navy-dark);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--navy);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

blockquote {
  margin: 1.2rem 0;
  padding: 0.9rem 1.2rem;
  background: #f7f8fb;
  border-left: 4px solid var(--accent2);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--navy-dark);
  font-style: italic;
}

blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.8em;
  color: var(--muted);
}

figure {
  margin: 1.5rem 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.5rem;
}

figcaption {
  margin-top: 0.6rem;
  font-size: 0.8em;
  color: var(--muted);
}

/* Hand-built concept diagrams (as opposed to pasted paper figures) */
.content li > figure.diagram {
  margin: 1rem 0 0.6rem;
  text-align: left;
}

figure.diagram svg {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid #d7dde1;
  border-radius: var(--radius);
  background: #f4f8f8;
  padding: 0.75rem 0;
}

figure.diagram figcaption {
  text-align: left;
}

/* Diagram palette is deliberately distinct from the page's navy/orange
   theme (teal + purple + red) so diagrams read as a separate visual
   layer from the surrounding prose. */
.dg-box {
  fill: #fff;
  stroke: #2b6f77;
  stroke-width: 2;
}

.dg-box-chosen {
  fill: #2b6f77;
  stroke: #2b6f77;
  stroke-width: 2;
}

.dg-box-alt {
  fill: #fff;
  stroke: #b0b8bc;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.dg-box-escalate {
  fill: #fff;
  stroke: #c0392b;
  stroke-width: 2;
}

.dg-diamond {
  fill: #fff;
  stroke: #6b5b95;
  stroke-width: 2;
}

.dg-diamond-escalate {
  fill: #fff;
  stroke: #c0392b;
  stroke-width: 2;
}

.dg-diamond-chosen {
  fill: #6b5b95;
  stroke: #6b5b95;
  stroke-width: 2;
}

/* Shape vocabulary: diamond = router/decision, circle = a model/LLM,
   rounded rectangle = everything else that flows through the system. */
.dg-circle {
  fill: #fff;
  stroke: #2b6f77;
  stroke-width: 2;
}

.dg-circle-chosen {
  fill: #2b6f77;
  stroke: #2b6f77;
  stroke-width: 2;
}

.dg-circle-alt {
  fill: #fff;
  stroke: #b0b8bc;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.dg-container {
  fill: rgba(43, 111, 119, 0.05);
  stroke: #b0b8bc;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.dg-label {
  font-family: "Segoe UI", Calibri, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  fill: #262626;
  text-anchor: middle;
  dominant-baseline: middle;
}

.dg-label-chosen {
  font-family: "Segoe UI", Calibri, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  fill: #fff;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
}

.dg-label-alt {
  font-family: "Segoe UI", Calibri, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  fill: #93999d;
  text-anchor: middle;
  dominant-baseline: middle;
}

.dg-caption {
  font-family: "Segoe UI", Calibri, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  fill: #595959;
  text-anchor: middle;
}

.dg-caption-left {
  font-family: "Segoe UI", Calibri, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  fill: #595959;
  text-anchor: start;
}

.dg-arrow {
  stroke: #2b6f77;
  stroke-width: 2;
  fill: none;
}

.dg-arrow-alt {
  stroke: #b0b8bc;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  fill: none;
}

.dg-arrow-escalate {
  stroke: #c0392b;
  stroke-width: 2;
  fill: none;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.2rem 0 1.6rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 0.85em;
  min-width: 560px;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background: #f7f8fb;
}

tr.deprecated {
  font-style: italic;
}

tr.deprecated td {
  color: var(--muted);
}

.table-footnote {
  font-size: 0.85em;
  color: var(--muted);
  margin: 0.6rem 0 1.6rem;
}

.timeline-callout {
  font-size: 0.85em;
  color: var(--muted);
  margin-top: -0.4rem;
}

.reading-item {
  margin-bottom: 1.3rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--rule);
}

.reading-item:last-child {
  border-bottom: none;
}

.reading-item .taxonomy {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8em;
  color: var(--navy);
}

.reading-item .taxonomy::before {
  content: "\2192  ";
  color: var(--accent);
  font-weight: 700;
}

.timeline dt {
  color: var(--navy);
  font-weight: 700;
  font-size: 1.1em;
  margin-top: 1.1rem;
}

.timeline dt:first-child {
  margin-top: 0;
}

.timeline dd {
  margin: 0.25rem 0 0;
}

/* ---------- Top toolbar ---------- */

.topbar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: var(--slide-max);
  margin: 0 auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.topbar .nav-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--navy-dark);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex: none;
}

.icon-btn:hover {
  background: #f2f4f8;
  border-color: var(--navy);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.nav-btn:hover {
  background: var(--navy-dark);
}

.nav-btn:active {
  transform: scale(0.97);
}

.nav-btn.disabled {
  background: #fff;
  color: var(--rule);
  border-color: var(--rule);
  pointer-events: none;
}

.nav-counter {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 3.5rem;
  text-align: center;
}

@media (max-width: 560px) {
  .topbar {
    gap: 0.35rem;
    padding: 0 0.6rem;
  }
  .nav-btn {
    padding: 0.5rem 0.7rem;
  }
  .nav-btn span.label {
    display: none;
  }
}

/* ---------- Table of contents overlay ---------- */

.toc-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(31, 56, 100, 0.45);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(1rem, 6vh, 5rem) 1rem;
}

.toc-overlay[hidden] {
  display: none;
}

.toc-panel {
  background: var(--paper);
  border-radius: var(--radius);
  width: min(480px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--rule);
}

.toc-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--navy-dark);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0.6rem;
  overflow-y: auto;
}

.toc-list li {
  margin: 0;
}

.toc-list a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.65rem 0.7rem;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.98rem;
}

.toc-list a:hover {
  background: #f2f4f8;
}

.toc-list a .toc-num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 1.6rem;
}

.toc-list a[aria-current="page"] {
  background: #eaf0fb;
  color: var(--navy-dark);
  font-weight: 700;
}

.toc-list a[aria-current="page"] .toc-num {
  color: var(--accent);
}
