:root {
  --naml-ink: #23373b;
  --naml-muted: #5f6f73;
  --naml-accent: #00a896;
  --naml-red: #d1495b;
  --naml-cyan: #00a6c8;
  --naml-paper: #ffffff;
}

.reveal {
  color: var(--naml-ink);
  font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  font-size: 30px;
}

.reveal .slides {
  text-align: left;
}

.reveal .slides section {
  box-sizing: border-box;
  padding: 0.2em 0.25em 0.8em;
}

.reveal h2 {
  color: var(--naml-ink);
  font-size: 1.5em;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.72em;
  text-align: left;
  text-transform: none;
}

.reveal h2::after {
  background: var(--naml-accent);
  content: "";
  display: block;
  height: 5px;
  margin-top: 0.22em;
  width: 100%;
}

.reveal p,
.reveal li {
  line-height: 1.28;
}

.reveal ul,
.reveal ol {
  display: block;
  margin: 0.25em 0 0.4em 1.35em;
}

.reveal li {
  margin: 0.18em 0;
}

.reveal li::marker {
  color: var(--naml-accent);
}

.reveal li:has(span.fragment:not(.visible))::marker {
  color: transparent;
}

.reveal strong {
  color: #13272b;
}

.reveal blockquote {
  background: #f1f7f6;
  border-left: 7px solid var(--naml-accent);
  box-shadow: none;
  margin: 0.6em 0;
  padding: 0.35em 0.75em;
  width: auto;
}

.reveal blockquote p {
  font-style: normal;
  margin: 0.2em 0;
}

.reveal .katex-display {
  margin: 0.55em 0;
}

.reveal .slide-number {
  background: transparent;
  color: var(--naml-muted);
  font-size: 15px;
}

.reveal .progress {
  color: var(--naml-accent);
  height: 5px;
}

.reveal section[data-state="title-slide"] {
  color: white;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.reveal section[data-state="title-slide"] h2 {
  color: white;
  font-size: 2.15em;
  line-height: 1.08;
  margin-bottom: 0.38em;
  max-width: 860px;
}

.reveal section[data-state="title-slide"] h2::after {
  width: 180px;
}

.reveal .subtitle {
  color: #d8e7e5;
  font-size: 1.18em;
  margin: 0.15em 0 2.2em;
}

.reveal .byline {
  color: #ffffff;
  font-size: 0.85em;
}

.reveal .byline + .byline {
  margin-top: 0;
}

.reveal .r-hstack {
  align-items: flex-start;
  gap: 2.2em;
  justify-content: center;
}

.reveal .image-card {
  color: var(--naml-muted);
  font-size: 0.85em;
  text-align: center;
}

.reveal .image-card img {
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(28, 54, 58, 0.16);
  display: block;
  margin: 0 auto 0.3em;
}

.reveal img.main-image {
  border: 0;
  box-shadow: none;
  display: block;
  margin: 0.3em auto 0;
  max-height: 520px;
  object-fit: contain;
}

.reveal .figure-credit {
  color: var(--naml-muted);
  font-size: 0.55em;
  margin: 0.15em auto 0;
  text-align: center;
}

.reveal .why-p-adics-layout {
  align-items: flex-start;
  display: grid;
  gap: 1.2em;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.reveal .why-p-adics-copy {
  min-width: 0;
}

.reveal .why-p-adics-copy > p {
  margin-top: 0;
}

.reveal .tree-of-life-figure {
  margin-top: 0.1em;
  text-align: center;
}

.reveal img.tree-of-life-image {
  border: 0;
  box-shadow: 0 8px 22px rgba(28, 54, 58, 0.14);
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
  width: 320px;
}

.reveal .tree-of-life-figure .figure-credit {
  line-height: 1.2;
  max-width: 320px;
}

.reveal .tree-of-life-figure .figure-credit a {
  color: inherit;
}

.reveal img.gradient-flow-animation {
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(28, 54, 58, 0.14);
  max-height: 570px;
}

.reveal .gradient-animation-label {
  flex: 1 1 0;
  margin: 0 0 0.1em;
  max-width: 420px;
  text-align: center;
}

.reveal .r-hstack p:has(> img.gradient-flow-animation) {
  flex: 1 1 0;
  height: auto;
  margin: 0;
  max-width: 420px;
}

.reveal .r-hstack img.gradient-flow-animation {
  max-width: 100%;
}

.reveal .chess-search-copy {
  align-items: stretch;
  flex: 1 1 0;
  min-width: 0;
  text-align: left;
}

.reveal .chess-search-copy p {
  margin: 0.25em 0;
}

.reveal .chess-search-copy .katex-display {
  font-size: 0.78em;
}

.reveal .chess-search-figure {
  margin: 0.1em auto 0.35em;
  text-align: center;
}

.reveal img.chess-tree-image {
  border: 0;
  box-shadow: none;
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
}

.reveal img.portrait-image {
  border: 0;
  box-shadow: none;
  display: block;
  margin: -0.45em auto 0;
  object-fit: contain;
}

.reveal .tree-diagram {
  display: block;
  height: auto;
  margin: -0.35em auto 0;
  max-height: 560px;
  width: 80%;
}

.reveal .tree-diagram .edges line {
  stroke: var(--naml-ink);
  stroke-linecap: round;
  stroke-width: 4;
}

.reveal .tree-diagram .edges.thin line {
  stroke-width: 2.5;
}

.reveal .tree-diagram .edges.thick line {
  stroke-width: 3;
}

.reveal .tree-diagram .nodes circle {
  fill: var(--naml-ink);
}

.reveal .tree-diagram text {
  fill: var(--naml-ink);
  font-family: "Source Sans Pro", sans-serif;
  font-size: 28px;
}

.reveal .tree-diagram .accent {
  fill: #316bdf;
  font-size: 22px;
}

.reveal .tree-diagram .red circle,
.reveal .tree-diagram .red polygon {
  fill: var(--naml-red);
}

.reveal .tree-diagram .red line {
  stroke: var(--naml-red);
}

.reveal .tree-diagram .cyan circle {
  fill: var(--naml-cyan);
}

.reveal .tree-diagram .cyan line {
  stroke: var(--naml-cyan);
}

.reveal .descent-tree .arrow line {
  marker-end: url(#arrowhead);
}

.reveal .root-path .arrow line {
  marker-end: url(#arrowhead-root);
}

.reveal .tree-diagram .edge-label {
  font-size: 23px;
}

.reveal .tree-diagram .red-text {
  fill: var(--naml-red);
}

.reveal .wordnet-tree,
.reveal .labelled-tree {
  max-height: 420px;
  width: 70%;
}

.reveal .polydisc-tree {
  max-height: 390px;
  width: 76%;
}

.reveal .definition-heading {
  color: var(--naml-red);
  font-size: 0.9em;
  font-weight: 700;
  margin: -0.15em 0 0.12em;
}

.reveal .definition-heading p {
  margin: 0;
}

.reveal .compact-definition-heading {
  margin-bottom: -0.25em;
}

.reveal .extension-note {
  color: var(--naml-red);
  font-size: 0.64em;
  margin: -0.35em auto 0;
  max-width: 850px;
  text-align: center;
}

.reveal .extension-note p,
.reveal .polydisc-space-definition p {
  margin: 0.08em 0;
}

.reveal .polydisc-space-definition {
  font-size: 0.78em;
  margin-top: 0.2em;
}

.reveal .polydisc-space-definition .katex-display {
  font-size: 0.9em;
  margin: 0.2em 0;
}

.reveal .nested-discs-figure {
  flex: 0 0 28%;
  margin-top: 0.1em;
}

.reveal .nested-discs-figure svg {
  display: block;
  height: 118px;
  margin: 0 auto;
  width: 268px;
}

.reveal .nested-discs-figure circle {
  fill: none;
  stroke: var(--naml-ink);
  stroke-width: 3;
}

.reveal .polydisc-recall {
  flex: 1 1 0;
  font-size: 0.67em;
  min-width: 0;
}

.reveal .polydisc-recall-row {
  align-items: center;
  gap: 1em;
}

.reveal .polydisc-recall p {
  margin: 0.08em 0;
}

.reveal .polydisc-recall ol {
  margin: 0.1em 0 0 1.3em;
}

.reveal .polydisc-recall li {
  margin: 0.06em 0;
}

.reveal .oxford-polydisc-tree {
  margin-top: -0.55em;
  max-height: 585px;
  width: 100%;
}

.reveal .oxford-polydisc-tree .edges line {
  stroke-width: 2.5;
}

.reveal .oxford-polydisc-tree .continuation {
  stroke-dasharray: 7 8;
}

.reveal .oxford-polydisc-tree text {
  font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
}

.reveal .oxford-polydisc-tree .level-labels text,
.reveal .oxford-polydisc-tree .branch-labels text {
  fill: var(--naml-ink);
  font-size: 23px;
  font-style: italic;
  paint-order: stroke;
  stroke: var(--naml-paper);
  stroke-width: 10px;
  stroke-linejoin: round;
}

.reveal .oxford-polydisc-tree .interpolated-disc circle {
  fill: var(--naml-ink);
}

.reveal .oxford-polydisc-tree .interpolated-disc text {
  fill: var(--naml-ink);
  font-size: 18px;
  paint-order: stroke;
  stroke: var(--naml-paper);
  stroke-width: 8px;
}

/* Keep the notation legible where branches meet their labels. The edges are
   earlier in the SVG source; this opaque halo makes that foreground order explicit. */
.reveal .disc-notation-tree .branch-labels text {
  paint-order: stroke fill;
  stroke: var(--naml-paper);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 14px;
}

.reveal .disc-notation-tree .interpolated-disc text {
  paint-order: stroke fill;
  stroke-width: 11px;
}

.reveal .metric-polydisc-tree {
  max-height: 555px;
}

.reveal .metric-polydisc-tree .absolute-labels text {
  fill: #273dbd;
  font-size: 19px;
  paint-order: stroke;
  stroke: var(--naml-paper);
  stroke-width: 8px;
}

.reveal .metric-polydisc-tree .valuative-labels text {
  fill: var(--naml-red);
  font-size: 19px;
  paint-order: stroke;
  stroke: var(--naml-paper);
  stroke-width: 8px;
}

.reveal .field-extension-lead {
  font-size: 0.72em;
  margin: -0.45em auto 0.35em;
  max-width: 900px;
  text-align: center;
}

.reveal .field-extension-lead p {
  margin: 0;
}

.reveal .field-extension-assets {
  display: none !important;
}

.reveal .field-extension-panels {
  align-items: flex-start;
  display: flex;
  gap: 1.2em;
  justify-content: center;
  margin: 0 auto;
  width: 96%;
}

.reveal .field-extension-panel {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.reveal .field-extension-panel + .field-extension-panel {
  border-left: 2px dashed #b7c3c5;
  padding-left: 1.2em;
}

.reveal .field-extension-heading {
  color: #273dbd;
  font-size: 0.9em;
  font-weight: 700;
}

.reveal .residue-field-extension .field-extension-heading {
  color: var(--naml-red);
}

.reveal .field-extension-equation {
  margin: 0.08em 0;
}

.reveal img.field-extension-figure {
  border: 0;
  box-shadow: none;
  display: block;
  height: 260px;
  margin: -0.05em auto 0.05em;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.reveal .field-extension-conclusion {
  font-size: 0.7em;
  line-height: 1.2;
  margin: -0.1em auto 0;
  max-width: 410px;
}

.reveal .facts-heading {
  margin-top: 0.35em;
}

.reveal .absolute-polynomial-body {
  align-items: flex-start;
  display: grid;
  gap: 0.65em;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  margin-top: 0.08em;
}

.reveal .absolute-polynomial-facts {
  font-size: 0.77em;
  min-width: 0;
}

.reveal .absolute-polynomial-facts ol {
  margin: 0.08em 0 0 1.25em;
}

.reveal .absolute-polynomial-facts li {
  margin: 0.12em 0;
}

.reveal .absolute-polynomial-example {
  margin: -0.2em 0 0;
  min-width: 0;
  text-align: center;
}

.reveal .absolute-polynomial-example figcaption {
  color: var(--naml-muted);
  font-size: 0.66em;
  margin-bottom: -0.2em;
}

.reveal .absolute-polynomial-tree {
  display: block;
  height: auto;
  margin: 0 auto;
  overflow: visible;
  width: 100%;
}

.reveal .absolute-polynomial-tree .branch line {
  stroke-linecap: round;
  stroke-width: 5;
}

.reveal .absolute-polynomial-tree .branch-at-one line {
  stroke: var(--naml-accent);
}

.reveal .absolute-polynomial-tree .branch-at-minus-one line {
  stroke: var(--naml-red);
}

.reveal .absolute-polynomial-tree .join-node,
.reveal .absolute-polynomial-tree .leaf-node {
  fill: var(--naml-ink);
}

.reveal .absolute-polynomial-tree text {
  fill: var(--naml-ink);
  font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
}

.reveal .absolute-polynomial-tree .join-label,
.reveal .absolute-polynomial-tree .leaf-label {
  font-size: 23px;
  font-weight: 600;
}

.reveal .absolute-polynomial-tree .radius-label {
  fill: var(--naml-muted);
  font-size: 19px;
  paint-order: stroke;
  stroke: var(--naml-paper);
  stroke-linejoin: round;
  stroke-width: 9px;
}

.reveal .absolute-polynomial-formulas {
  display: grid;
  gap: 0.35em;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: -0.05em;
}

.reveal .branch-formula {
  background: #f3f8f7;
  border-radius: 6px;
  box-sizing: border-box;
  min-height: 100px;
  padding: 0.28em 0.18em;
}

.reveal .branch-formula.branch-at-one {
  border-top: 4px solid var(--naml-accent);
}

.reveal .branch-formula.branch-at-minus-one {
  border-top: 4px solid var(--naml-red);
}

.reveal .branch-formula .katex-display {
  font-size: 0.55em;
  margin: 0;
}

.reveal section[data-state="nonarch-geometry-slide"] h2 {
  margin-bottom: 0.45em;
}

.reveal section[data-state="nonarch-geometry-slide"] > p {
  margin: 0.2em 0;
}

.reveal section[data-state="nonarch-geometry-slide"] > ul {
  font-size: 0.92em;
  margin-bottom: 0.3em;
  margin-top: 0.12em;
}

.reveal section[data-state="nonarch-geometry-slide"] > ul li {
  margin: 0.12em 0;
}

.reveal .optimisation-regime {
  flex: 1 1 0;
  font-size: 0.8em;
  margin-top: -0.35em;
  max-width: 430px;
  min-width: 0;
  text-align: center;
}

.reveal .optimisation-library {
  color: var(--naml-muted);
  font-size: 0.62em;
  margin: -0.9em 0 0.15em;
  text-align: right;
}

.reveal .optimisation-library p {
  margin: 0;
}

.reveal .continuous-regime {
  border-right: 2px dashed var(--naml-ink);
  padding-right: 1.1em;
}

.reveal .regime-tree {
  display: block;
  height: 145px;
  margin: 0 auto -0.25em;
  max-width: 360px;
  width: 80%;
}

.reveal .regime-tree line,
.reveal .regime-tree path {
  fill: none;
  stroke: var(--naml-ink);
  stroke-linecap: round;
  stroke-width: 2.2;
}

.reveal .regime-tree circle {
  fill: var(--naml-ink);
}

.reveal .regime-tree text {
  fill: var(--naml-ink);
  font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  font-size: 22px;
}

.reveal .optimisation-regime p {
  margin: 0.12em 0;
}

.reveal .regime-method {
  color: var(--naml-muted);
  font-size: 0.66em;
  margin-top: 0.3em;
}

.reveal .optimisation-gif-row {
  align-items: center;
  border-top: 2px dashed var(--naml-ink);
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 0.3em;
  padding-top: 0.35em;
  width: 96%;
}

.reveal .optimisation-gif-row img.optimisation-gif {
  background: #f7faf9;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 5px 16px rgba(28, 54, 58, 0.12);
  display: block;
  height: 142px;
  margin: 0;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.reveal section[data-state="tree-search-slide"] h2 {
  margin-bottom: 0.35em;
}

.reveal section[data-state="tree-search-slide"] > p,
.reveal section[data-state="tree-search-slide"] > ul {
  font-size: 0.72em;
  margin-bottom: 0.14em;
  margin-top: 0.14em;
}

.reveal section[data-state="tree-search-slide"] > ul {
  margin-left: 1.35em;
}

.reveal .tree-search-demo {
  margin: -0.2em auto -0.25em;
  max-height: 270px;
  width: 100%;
}

.reveal .tree-search-demo .edges line {
  stroke: var(--naml-ink);
  stroke-width: 3;
}

.reveal .tree-search-demo .nodes circle.root-node {
  fill: var(--naml-accent);
  stroke: var(--naml-accent);
}

.reveal .tree-search-demo .nodes circle.search-node {
  fill: var(--naml-paper);
  stroke: var(--naml-ink);
  stroke-width: 3;
}

.reveal .tree-search-demo .node-label {
  fill: var(--naml-ink);
  font-size: 20px;
  font-weight: 500;
  paint-order: stroke;
  stroke: var(--naml-paper);
  stroke-linejoin: round;
  stroke-width: 8px;
  text-anchor: middle;
}

.reveal .tree-search-demo .level-labels text {
  fill: var(--naml-muted);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reveal .tree-search-demo .selection-ring {
  fill: none;
  stroke: var(--naml-cyan);
  stroke-width: 5;
}

.reveal .tree-search-demo .selection-note {
  fill: var(--naml-cyan);
  font-size: 18px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--naml-paper);
  stroke-linejoin: round;
  stroke-width: 7px;
}

.reveal .tree-search-demo .final-note {
  font-size: 17px;
}

.reveal .result-tree {
  margin-top: -0.7em;
  max-height: 245px;
  width: 54%;
}

.reveal .root-path {
  max-height: 260px;
  width: 52%;
}

.reveal .descent-tree {
  max-height: 520px;
  width: 58%;
}

.reveal .mcts-steps {
  font-size: 0.78em;
  margin-bottom: 0;
  margin-top: -0.2em;
}

.reveal .mcts-steps li {
  line-height: 1.17;
  margin: 0.08em 0;
}

.reveal .mcts-steps li p {
  margin: 0;
}

.reveal .mcts-tree {
  margin-top: -0.45em;
  max-height: 335px;
  width: 84%;
}

.reveal .mcts-tree .base-edges line {
  stroke: #aab6b8;
  stroke-linecap: round;
  stroke-width: 3;
}

.reveal .mcts-tree .base-nodes circle {
  fill: var(--naml-paper);
  stroke: #8f9fa2;
  stroke-width: 3;
}

.reveal .mcts-tree .base-nodes circle.root-node {
  fill: var(--naml-accent);
  stroke: var(--naml-accent);
}

.reveal .mcts-tree .node-score {
  fill: var(--naml-ink);
  font-size: 16px;
  text-anchor: middle;
}

.reveal .mcts-tree .base-nodes .root-score,
.reveal .mcts-tree .selection-nodes .node-score {
  fill: var(--naml-paper);
}

.reveal .mcts-tree .node-name {
  fill: var(--naml-muted);
  font-size: 18px;
  text-anchor: middle;
}

.reveal .mcts-tree .selection-edges line {
  stroke: var(--naml-cyan);
  stroke-linecap: round;
  stroke-width: 7;
}

.reveal .mcts-tree .selection-nodes circle {
  fill: var(--naml-cyan);
}

.reveal .mcts-tree .stage-label {
  font-size: 20px;
  font-weight: 600;
}

.reveal .mcts-tree .selection-label {
  fill: var(--naml-cyan);
}

.reveal .mcts-tree .evaluation-ring {
  fill: none;
  stroke: var(--naml-red);
  stroke-width: 5;
}

.reveal .mcts-tree .evaluation-label,
.reveal .mcts-tree .evaluation-value {
  fill: var(--naml-red);
}

.reveal .mcts-tree .evaluation-value {
  font-size: 19px;
}

.reveal .mcts-tree .expansion-edges line {
  stroke: var(--naml-accent);
  stroke-linecap: round;
  stroke-width: 4;
}

.reveal .mcts-tree .expansion-nodes circle {
  fill: var(--naml-paper);
  stroke: var(--naml-accent);
  stroke-width: 4;
}

.reveal .mcts-tree .update-stage line {
  marker-end: url(#mcts-arrowhead);
  stroke: var(--naml-red);
  stroke-dasharray: 8 6;
  stroke-linecap: round;
  stroke-width: 5;
}

.reveal .mcts-tree .update-label {
  fill: var(--naml-red);
}

@media (max-width: 900px) {
  .reveal {
    font-size: 26px;
  }
}
