/* ============================================================
   Programmable PBT talk — custom theme over reveal.js white
   ============================================================ */

:root {
  color-scheme: light;          /* keep form controls light even in OS dark mode */
  --c-generator: rgb(75, 161, 241);
  --c-mutator:   rgb(174, 62, 201);
  --c-shrinker:  rgb(241, 172, 75);
  --c-checker:   rgb(224, 49, 49);
  --c-printer:   rgb(100, 116, 139);
  --c-feedback:  rgb(76, 176, 94);
  --c-seedpool:  rgb(248, 119, 119);

  --c-ink: #0d1b2a;
  --c-paper: #ffffff;
  --c-muted: #6b7280;
  --c-rule: #e5e7eb;
  --c-accent: #1d4ed8;

  --font-serif: "Charter", "Iowan Old Style", Georgia, serif;
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Menlo", monospace;
}

.reveal {
  font-family: var(--font-sans);
  color: var(--c-ink);
}

.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--c-ink);
}

.reveal h2 {
  margin-bottom: 0.4em;
  font-size: 1.5em;
}

.reveal section[data-slug="eval-overview"] ul li {
  margin: 0.55em 0;
}

/* center: false anchors all slides to the top; re-center the few slides
   that visually want it (title + conclusion). */
.reveal .slides > section.title-slide,
.reveal .slides > section.conclusion {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.reveal h3 {
  font-size: 1.2em;
}

.reveal h4 {
  font-size: 1em;
  color: var(--c-muted);
  margin-top: 0.5em;
  margin-bottom: 0.3em;
}

.reveal p, .reveal li {
  font-size: 0.85em;
  line-height: 1.45;
}

.reveal pre {
  box-shadow: none;
  border-radius: 8px;
  margin: 0.4em 0;
}

.reveal pre code {
  font-family: var(--font-mono);
  font-size: 0.7em;
  line-height: 1.4;
  padding: 0.8em 1em;
  border-radius: 8px;
  max-height: none;
}

.reveal kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: #f3f4f6;
  border: 1px solid var(--c-rule);
  border-radius: 4px;
  padding: 0 0.4em;
}

.reveal .muted { color: var(--c-muted); }
.reveal .small { font-size: 0.7em; }

/* ---------- Title slide ---------- */
.title-slide .title-stack {
  text-align: center;
}

.paper-title {
  font-size: 2.3em;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.4em;
}

.title-accent {
  background: linear-gradient(90deg,
    var(--c-generator) 0%,
    var(--c-mutator)   25%,
    var(--c-shrinker)  50%,
    var(--c-checker)   75%,
    var(--c-feedback)  100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.authors {
  font-size: 0.85em;
  color: var(--c-ink);
  margin-bottom: 1.2em;
}

.venue {
  margin-top: 1.2em;
  color: var(--c-muted);
  font-size: 0.7em;
}

.title-loop {
  margin: 1em auto;
  width: min(720px, 80vw);
  height: 90px;
}

/* ---------- Two-column layout ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5em;
  align-items: start;
}
.two-col .col { min-width: 0; }

/* ---------- Runner loop animation ---------- */
.runner-loop-anim {
  margin: 1em auto;
  width: 100%;
  height: 280px;
}

.runner-loop-anim svg {
  width: 100%;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
}

.runner-loop-anim .node-rect {
  stroke-width: 2;
  rx: 8;
  ry: 8;
}

.runner-loop-anim .node-label {
  text-anchor: middle;
  dominant-baseline: middle;
  fill: white;
  font-weight: 600;
}

.runner-loop-anim .arrow {
  fill: none;
  stroke: var(--c-ink);
  stroke-width: 2;
  marker-end: url(#arrowhead);
  opacity: 0.55;
}

.runner-loop-anim .pulse {
  fill: var(--c-accent);
  filter: drop-shadow(0 0 6px var(--c-accent));
}

/* ---------- Runner zoo ---------- */
.runner-zoo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8em;
  margin: 1em 0;
}

.zoo-card {
  background: #fff;
  border: 1px solid var(--c-rule);
  border-radius: 10px;
  padding: 0.8em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.zoo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(13, 27, 42, 0.08);
  border-color: var(--c-accent);
}

.zoo-card.active {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px var(--c-accent) inset;
}

.zoo-card h4 {
  margin: 0 0 0.3em 0;
  font-size: 0.8em;
  color: var(--c-ink);
}

.zoo-card .zoo-tag {
  font-size: 0.6em;
  color: var(--c-muted);
}

.zoo-card svg {
  display: block;
  width: 100%;
  height: 90px;
  margin-top: 0.4em;
}

/* ---------- Embedding comparison: vertical stack ---------- */
.embed-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.embed-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 180px;
  gap: 1em;
  align-items: center;
  border: 1px solid var(--c-rule);
  border-left: 4px solid var(--c-rule);
  border-radius: 10px;
  padding: 0.45em 0.8em;
  background: #fff;
}

.embed-code { min-width: 0; }

.embed-row[data-embed="shallow"] { border-left-color: var(--c-printer); }
.embed-row[data-embed="deep"]    { border-left-color: var(--c-shrinker); }

.embed-head h3 {
  margin: 0;
  font-size: 1em;
  line-height: 1.1;
  white-space: nowrap;
}

.embed-head .tag {
  display: inline-block;
  margin-top: 0.2em;
  font-size: 0.5em;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.embed-code pre {
  margin: 0;
  background: #f6f8fa;
  border: 1px solid var(--c-rule);
  border-radius: 6px;
  overflow: hidden;
}

.embed-code pre code,
.embed-code pre code.hljs {
  font-size: 0.75em;
  padding: 0.4em 0.75em;
  line-height: 1.3;
  white-space: pre;
  display: block;
  background: transparent;   /* let pre's #f6f8fa show through */
}

.reveal .embed-pros-cons {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.7em;
}

.reveal .embed-pros-cons li {
  list-style: none;
  padding: 0.1em 0 0.1em 1.1em;
  position: relative;
  font-size: 0.95em;
  line-height: 1.3;
}

.embed-pros-cons li.pro::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--c-feedback);
  font-weight: 700;
}

.embed-pros-cons li.con::before {
  content: "✗";
  position: absolute;
  left: 0;
  color: var(--c-checker);
  font-weight: 700;
}

/* ---------- DBAS diagram ---------- */
.dbas-diagram {
  width: 100%;
  height: 360px;
  margin: 0.6em 0;
}

.dbas-diagram svg {
  width: 100%;
  height: 100%;
}

/* ---------- Per-runner detail slides ---------- */
.runner-subtitle {
  font-family: var(--font-mono);
  font-size: 0.5em;
  color: var(--c-muted);
  font-weight: 400;
  margin-left: 0.4em;
  letter-spacing: 0;
}

.runner-tagline {
  text-align: center;
  color: var(--c-muted);
  margin: 0.3em 0 1em 0;
}

.runner-tagline code {
  background: #f3f4f6;
  padding: 0.05em 0.35em;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.runner-detail {
  display: grid;
  grid-template-columns: 1fr minmax(0, 1.1fr);
  gap: 1.2em;
  align-items: center;
  margin-top: 0.4em;
}

.runner-detail-anim {
  width: 100%;
  height: 240px;
}

.runner-detail-anim svg {
  width: 100%;
  height: 100%;
}

.runner-detail pre {
  margin: 0;
  background: #f6f8fa;
  border: 1px solid var(--c-rule);
  border-radius: 8px;
  overflow: hidden;
}

.runner-detail pre code,
.runner-detail pre code.hljs {
  font-size: 0.55em;
  padding: 0.7em 0.95em;
  line-height: 1.45;
  display: block;
  white-space: pre;
  overflow-x: auto;
  background: transparent;
}

/* ---------- Implementation cards ---------- */
.impl-card {
  border: 1px solid var(--c-rule);
  border-radius: 10px;
  padding: 1em;
  text-align: left;
}

.impl-points {
  margin: 0.4em 0 0.6em 0;
  padding-left: 1.1em;
}

.impl-points li {
  margin: 0.15em 0;
}

.impl-card[data-impl="rocq"] {
  border-top: 4px solid var(--c-generator);
}

.impl-card[data-impl="racket"] {
  border-top: 4px solid var(--c-mutator);
}

.impl-sub {
  font-size: 0.6em;
  color: var(--c-muted);
  font-weight: 400;
}

/* ---------- Evaluation placeholders ---------- */
.eval-placeholder {
  border: 2px dashed var(--c-rule);
  border-radius: 12px;
  padding: 2.2em 1em;
  text-align: center;
  color: var(--c-muted);
  background: #fafafa;
}

.eval-grid {
  display: grid;
  gap: 0.6em;
  margin-top: 0.4em;
}

.eval-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.eval-grid-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
}

.eval-fig {
  margin: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eval-fig img {
  width: 100%;
  height: auto;
  max-height: 230px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

.eval-grid-6 .eval-fig img {
  max-height: 150px;
}

.eval-fig figcaption {
  font-size: 0.6em;
  color: var(--c-muted);
  margin-top: 0.1em;
  letter-spacing: 0.02em;
}

/* ---------- Conclusion ---------- */
.conclusion h2 {
  font-size: 2em;
}

.conclusion-body {
  margin: 1.4em auto;
  max-width: 900px;
  min-height: 220px;
  padding: 1em 1.2em;
  border: 1px dashed var(--c-rule);
  border-radius: 12px;
  background: #fafafa;
  font-size: 1.05em;
  line-height: 1.55;
  text-align: left;
}

.conclusion-body:focus { background: #fff; border-style: solid; }

.conclusion-placeholder {
  color: var(--c-muted);
  font-style: italic;
  margin: 0;
  text-align: center;
  padding-top: 0.5em;
}

.thanks {
  margin-top: 1.4em;
  font-size: 1.4em;
  font-weight: 700;
  text-align: center;
}

/* ============================================================
   Annotation mode (tooling — not part of the talk visuals)
   ============================================================ */

#anno-toolbar {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9000;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 8px;
}

#anno-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--c-rule);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--c-ink);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(13, 27, 42, 0.08);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

#anno-toolbar button:hover { border-color: var(--c-accent); }

#anno-toolbar button.active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

#anno-toolbar .anno-icon { font-size: 13px; }
#anno-toolbar .anno-label { letter-spacing: 0.02em; }

#anno-toolbar .anno-count {
  background: rgba(13, 27, 42, 0.08);
  color: var(--c-ink);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  min-width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#anno-toolbar button.active .anno-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

#anno-toolbar .anno-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: help;
}

/* Annotation targets (only shown in annotation mode).
   Note: do NOT override position on <section> — reveal.js sets it absolute
   to position/stack slides, and overriding it makes slides drop into
   normal flow and shift down. */
body.annotation-mode [data-anno] {
  outline: 1px dashed rgba(29, 78, 216, 0.35);
  outline-offset: 2px;
  cursor: crosshair;
  transition: outline-color 100ms ease, outline-width 100ms ease;
}

body.annotation-mode [data-anno]:not(section) {
  position: relative;
}

body.annotation-mode [data-anno]:hover {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

body.annotation-mode [data-anno].has-note {
  outline-color: var(--c-feedback);
}

body.annotation-mode [data-anno].has-note:hover {
  outline: 2px solid var(--c-feedback);
}

/* keep child outlines from getting double-stacked under parent's */
body.annotation-mode [data-anno] [data-anno] {
  outline-offset: 1px;
}

.anno-badge {
  position: absolute;
  top: -10px;
  right: -2px;
  background: var(--c-ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(13, 27, 42, 0.25);
}

[data-anno].has-note > .anno-badge {
  background: var(--c-feedback);
}

/* Note panel */
#anno-panel {
  position: fixed;
  width: 380px;
  background: #fff;
  border: 1px solid var(--c-rule);
  border-radius: 10px;
  box-shadow: 0 14px 44px rgba(13, 27, 42, 0.22);
  z-index: 9100;
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.anno-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--c-rule);
  background: #f8fafc;
}

.anno-panel-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-ink);
  font-weight: 600;
}

.anno-panel-key .anno-slug { color: var(--c-accent); }
.anno-panel-key .anno-sep  { color: var(--c-muted); margin: 0 1px; }
.anno-panel-key .anno-name { color: var(--c-ink); }

.anno-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--c-muted);
  padding: 0 4px;
  line-height: 1;
}

.anno-panel-close:hover { color: var(--c-ink); }

.anno-panel-text {
  width: 100%;
  min-height: 140px;
  padding: 10px 12px;
  border: none;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  background: #fff;
  color: var(--c-ink);
}

.anno-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--c-rule);
  background: #fafbfc;
}

.anno-panel-actions button {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--c-rule);
  background: #fff;
  color: var(--c-ink);
  font-weight: 500;
  font-family: var(--font-sans);
}

.anno-panel-actions .anno-panel-save {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

.anno-panel-actions .anno-panel-save:hover { filter: brightness(1.05); }

.anno-panel-actions .anno-panel-delete {
  color: var(--c-checker);
  border-color: transparent;
  margin-right: auto;
}

.anno-panel-actions .anno-panel-delete:hover {
  background: rgba(224, 49, 49, 0.08);
}

/* Inline content edit (double-click in annotation mode) */
body.annotation-mode [data-anno].anno-editing {
  outline: 2px solid var(--c-accent) !important;
  outline-offset: 3px;
  background: rgba(29, 78, 216, 0.04);
  cursor: text;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.08);
}

body.annotation-mode [data-anno].anno-editing:focus {
  outline-color: var(--c-feedback) !important;
}
