@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&display=swap");

/* OTTO LAB WEBSITE STYLES
   kōwhai night: the print-editorial grammar (fraunces display, newsreader
   body, jetbrains mono microlabels, hairline rules) set on
   deep night-blue paper, with kōwhai yellow as the accent and a pounamu
   green as the soft secondary. single dark theme by design; bootstrap
   defaults are set in kowhai-night.scss. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/JetBrainsMono-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/JetBrainsMono-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/JetBrainsMono-Bold.woff2") format("woff2");
}

/* ========== TOKENS ========== */
:root {
  color-scheme: dark;

  /* paper and ink: warm off-white on deep night blue, about 15:1,
     short of pure white on black to limit halation in long prose */
  --paper: #070c1e;
  --card: #10172f;
  --ink: #e6e2d3;
  --ink-soft: #b9bdcc;
  --ink-faint: #8f95ab;

  /* kōwhai: the primary accent for links, labels, buttons */
  --kowhai: #f2c14e;
  --kowhai-bright: #f8d67f;
  --on-accent: #070c1e;

  /* legacy accent names kept for the report charts and captions:
     --green marks supported effects, --gold marks near-zero or modest
     ones, so each still looks green or gold as the captions say */
  --green: #56ae90;
  --green-deep: #1c3a2c;
  --gold: var(--kowhai);
  --blue: #8fb4d8;

  /* semantic aliases */
  --accent: var(--kowhai);
  --accent-strong: var(--kowhai-bright);
  --accent-soft: var(--green);
  --band: #1a2346;
  --band-ink: #ebe8dc;
  --band-ink-strong: #f7f4ea;

  /* hairlines as translucent ink */
  --hair: rgba(230, 226, 211, 0.2);
  --hair-soft: rgba(230, 226, 211, 0.1);
  --mono-bg: rgba(230, 226, 211, 0.07);
  --accent-tint: rgba(242, 193, 78, 0.4);

  /* type */
  --display: "Fraunces", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* spacing */
  --content-max-width: 860px;
  --prose-max-width: 44rem;

  /* radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-pill: 999px;

  /* legacy aliases still referenced by quarto components */
  --accent-primary: var(--accent);
  --accent-hover: var(--accent-strong);
  --border: var(--hair);
  --text-light: var(--ink-soft);
  --bg-light: var(--paper);
  --bg-white: var(--card);
}

/* ========== GLOBAL ========== */
body {
  font-family: var(--body);
  color: var(--ink);
  line-height: 1.65;
  font-size: 18px;
  background-color: var(--paper);
  font-weight: 400;
}

::selection {
  background: rgba(242, 193, 78, 0.28);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

p, li {
  max-width: var(--prose-max-width);
}

pre, code, kbd, samp {
  font-family: var(--mono);
}

/* mono microlabel: the system's signature */
.kicker,
.eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ========== NAVBAR ========== */
/* slim label bar on the paper itself, hairline below */
.navbar {
  background-color: var(--paper) !important;
  border-bottom: 1px solid var(--hair);
  box-shadow: none;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.navbar-brand {
  color: var(--ink) !important;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.navbar-nav .nav-link,
.navbar-nav .dropdown-toggle {
  color: var(--ink-soft) !important;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* religionmap.org is a domain name, so it keeps its lower case */
.navbar-nav .nav-link[href^="https://religionmap.org"] {
  text-transform: none;
  letter-spacing: 0.04em;
}

.navbar-nav .nav-link:hover,
.navbar-nav .dropdown-toggle:hover,
.navbar-nav .nav-link.active {
  color: var(--accent) !important;
  background-color: transparent;
}

.navbar .quarto-navbar-tools .quarto-navigation-tool {
  color: var(--ink-soft) !important;
}

.navbar .dropdown-menu {
  background-color: var(--card);
  border: 1px solid var(--hair);
}

.navbar .dropdown-item {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* presentations: filled green label */
#nav-menu-presentations {
  background-color: var(--accent) !important;
  color: var(--on-accent) !important;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin: 0 8px;
  transition: background-color 0.2s ease;
}

#nav-menu-presentations:hover {
  background-color: var(--accent-strong) !important;
}

/* ========== MAIN CONTENT ========== */
.content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3 {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  text-wrap: balance;
}

h1 {
  font-size: 2.6rem;
  line-height: 1.08;
  margin-bottom: 1.5rem;
}

/* section headings open with a short green dash, not a full-width rule */
h2 {
  font-size: 1.9rem;
  line-height: 1.15;
  margin-top: 3.5rem;
  border: none;
  padding: 0;
}

h2::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 2px;
  background: var(--accent);
  margin-bottom: 1.1rem;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.2;
}

h4, h5, h6 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2rem;
}

strong, b {
  font-weight: 600;
  color: var(--ink);
}

.quarto-title .subtitle,
.quarto-title-block .subtitle,
.subtitle.lead {
  font-family: var(--body);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
  text-transform: none;
  letter-spacing: 0;
}

/* ========== HOME HERO ========== */
.home .quarto-title-block {
  display: none;
}

.hero {
  padding: 3rem 0 0.5rem;
  margin: 0 0 1rem;
}

.hero-affiliation {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.75rem;
}

.hero-title {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: 4.4rem;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* the italic accent word, after "Not Evidence" */
.hero-title em {
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
}

.hero-descriptor {
  margin: 0.5rem 0 0;
  font-family: var(--body);
  font-style: italic;
  font-size: 1.45rem;
  line-height: 1.3;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0;
}

.hero-lede {
  margin: 1.75rem 0 0;
  max-width: var(--prose-max-width);
  font-size: 1.22rem;
  line-height: 1.6;
  color: var(--ink);
}

.hero-text {
  margin: 1rem 0 0;
  max-width: var(--prose-max-width);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-actions p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

/* ========== HERO DAG ========== */
/* a time-indexed causal diagram beside the title. the static (base) state is
   the final frame: the single-world intervention graph. motion is layered on
   only under prefers-reduced-motion: no-preference. all colour comes from the
   tokens, so the diagram follows any palette. */
.hero-dag {
  margin: 1.75rem 0 0;
  max-width: 24rem;
}

.hero-dag .dag {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.dag-node {
  font-family: var(--body);
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  fill: var(--ink);
}

.dag-sub {
  font-style: normal;
  font-weight: 400;
  font-size: 15px;
}

.dag-u {
  fill: var(--ink-soft);
}

.dag-fixed {
  fill: var(--green);
}

.dag-bar {
  stroke: var(--ink);
  stroke-width: 1.4;
}

.dag-micro,
.dag-phase {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.dag-micro {
  fill: var(--ink-soft);
}

.dag-phase {
  fill: var(--green);
  font-weight: 600;
}

.dag-axis {
  stroke: var(--hair);
  stroke-width: 1;
}

.dag-edge path {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.4;
}

.dag-edge polygon {
  fill: var(--ink-soft);
}

.dag-edge-dashed path {
  stroke: var(--ink-faint);
  stroke-dasharray: 4 4;
}

.dag-edge-dashed polygon {
  fill: var(--ink-faint);
}

.dag-edge-int path {
  stroke: var(--green);
  stroke-width: 2;
}

.dag-edge-int polygon {
  fill: var(--green);
}

/* the box marks conditioning on w0 */
.dag-box {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.2;
}

/* final frame shows the intervention label */
.dag-phase-obs {
  opacity: 0;
}

.hero-dag-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.6rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.hero-dag-caption sub {
  font-size: 0.72em;
}

.dag-toggle {
  flex: none;
  padding: 0.1rem 0 0;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: none;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
}

.dag-toggle:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* one 30 s cycle, in temporal order: u -> w0 (1 s) and u -> y2 (2.5 s),
   w0 -> a1 (4.5 s), w0 -> y2 (6.6 s); w0 is boxed (9.6 s); treatment splits
   (12 s); the a -> y2(a) arrow draws (13.4 s) and y2 becomes y2(a) (15 s);
   hold; fade out (24-25.6 s); rest; repeat. the percentages below are that
   timeline divided by 30 s. */
@media (prefers-reduced-motion: no-preference) {
  .hero-dag {
    --dag-cycle: 30s;
  }

  .hero-dag .dag-e-la path,
  .hero-dag .dag-e-ly path,
  .hero-dag .dag-e-int path,
  .hero-dag .dag-box {
    stroke-dasharray: 1 2;
  }

  .dag-e-ul { animation: dag-ul-fade var(--dag-cycle) ease-in-out infinite both; }
  .dag-e-uy { animation: dag-uy-fade var(--dag-cycle) ease-in-out infinite both; }
  .dag-e-la path { animation: dag-la-line var(--dag-cycle) ease-in-out infinite both; }
  .dag-e-la polygon { animation: dag-la-head var(--dag-cycle) ease-in-out infinite both; }
  .dag-e-ly path { animation: dag-ly-line var(--dag-cycle) ease-in-out infinite both; }
  .dag-e-ly polygon { animation: dag-ly-head var(--dag-cycle) ease-in-out infinite both; }
  .dag-box { animation: dag-box var(--dag-cycle) ease-in-out infinite both; }
  .dag-e-int path { animation: dag-int-line var(--dag-cycle) ease-in-out infinite both; }
  .dag-e-int polygon { animation: dag-int-head var(--dag-cycle) ease-in-out infinite both; }
  .dag-split { animation: dag-split var(--dag-cycle) ease-in-out infinite both; }
  .dag-po { animation: dag-po var(--dag-cycle) ease-in-out infinite both; }
  .dag-phase-int { animation: dag-phase-int var(--dag-cycle) ease-in-out infinite both; }
  .dag-phase-obs { animation: dag-phase-obs var(--dag-cycle) ease-in-out infinite both; }

  .hero-dag.is-paused * {
    animation-play-state: paused !important;
  }
}

@keyframes dag-ul-fade {
  0%, 3.33% { opacity: 0; }
  8.00%, 80.00% { opacity: 1; }
  85.33%, 100% { opacity: 0; }
}
@keyframes dag-uy-fade {
  0%, 8.33% { opacity: 0; }
  13.33%, 80.00% { opacity: 1; }
  85.33%, 100% { opacity: 0; }
}
@keyframes dag-la-line {
  0%, 15.00% { stroke-dashoffset: 1; opacity: 1; }
  20.00%, 80.00% { stroke-dashoffset: 0; opacity: 1; }
  85.33%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes dag-la-head {
  0%, 19.67% { opacity: 0; }
  21.00%, 80.00% { opacity: 1; }
  85.33%, 100% { opacity: 0; }
}
@keyframes dag-ly-line {
  0%, 22.00% { stroke-dashoffset: 1; opacity: 1; }
  28.00%, 80.00% { stroke-dashoffset: 0; opacity: 1; }
  85.33%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes dag-ly-head {
  0%, 27.67% { opacity: 0; }
  29.00%, 80.00% { opacity: 1; }
  85.33%, 100% { opacity: 0; }
}
@keyframes dag-box {
  0%, 32.00% { stroke-dashoffset: 1; opacity: 1; }
  37.00%, 80.00% { stroke-dashoffset: 0; opacity: 1; }
  85.33%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes dag-int-line {
  0%, 44.67% { stroke-dashoffset: 1; opacity: 1; }
  49.67%, 80.00% { stroke-dashoffset: 0; opacity: 1; }
  85.33%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes dag-int-head {
  0%, 49.33% { opacity: 0; }
  50.67%, 80.00% { opacity: 1; }
  85.33%, 100% { opacity: 0; }
}
@keyframes dag-split {
  0%, 40.00% { opacity: 0; }
  44.00%, 80.00% { opacity: 1; }
  85.33%, 100% { opacity: 0; }
}
@keyframes dag-po {
  0%, 50.67% { opacity: 0; }
  54.67%, 80.00% { opacity: 1; }
  85.33%, 100% { opacity: 0; }
}
@keyframes dag-phase-int {
  0%, 40.00% { opacity: 0; }
  44.00%, 80.00% { opacity: 1; }
  85.33%, 100% { opacity: 0; }
}
@keyframes dag-phase-obs {
  0%, 36.67% { opacity: 1; }
  39.33%, 86.67% { opacity: 0; }
  90.67%, 100% { opacity: 1; }
}

/* wide screens: the diagram sits beside the title block and hangs into the
   right margin, so the title column keeps its width. below 1200px it stacks
   under the descriptor. */
@media (min-width: 1200px) {
  .home .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 21rem;
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "aff dag"
      "title dag"
      "desc dag"
      "lede dag"
      "actions actions";
    column-gap: 3rem;
    margin-right: -13rem;
  }

  .home .hero > .hero-affiliation { grid-area: aff; }
  .home .hero > .hero-title { grid-area: title; }
  .home .hero > .hero-descriptor { grid-area: desc; }
  .home .hero > .hero-lede { grid-area: lede; }
  .home .hero > .hero-actions { grid-area: actions; }

  .home .hero > .hero-dag {
    grid-area: dag;
    align-self: start;
    margin: 0;
    max-width: none;
  }
}

/* phones: the diagram follows the lede and buttons, so the opening text
   stays on the first screen */
@media (max-width: 767.98px) {
  .home .hero {
    display: flex;
    flex-direction: column;
  }

  .home .hero > .hero-dag {
    order: 1;
    margin-top: 2.25rem;
  }
}

/* ========== LINKS ========== */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-tint);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--accent-strong);
  text-decoration-color: var(--accent-strong);
}

/* ========== CODE ========== */
pre {
  background-color: var(--card);
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
}

code:not(pre code) {
  background-color: var(--mono-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.8em;
  color: var(--accent-strong);
}

/* ========== BLOCKQUOTES ========== */
blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--ink-soft);
}

/* ========== TABLES ========== */
table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th {
  background-color: transparent;
  color: var(--ink-faint);
  padding: 0.6rem 1rem 0.6rem 0;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--hair);
}

td {
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid var(--hair-soft);
  vertical-align: top;
}

td.num, .tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ========== CALLOUTS ========== */
/* note: a raised indigo panel, after the paper's dark abstract band */
.callout {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
}

/* neutralise quarto's tinted header strips inside all callouts */
.callout.callout-style-default > .callout-header {
  background: none;
  background-color: transparent !important;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  padding-left: 0;
}

.callout.callout-style-default > .callout-header .callout-icon-container {
  display: none;
}

.callout .callout-body-container,
.callout .callout-body {
  padding-left: 0;
  padding-right: 0;
}

.callout-note {
  background-color: var(--band);
  color: var(--band-ink);
}

.callout-note h1, .callout-note h2, .callout-note h3,
.callout-note h4, .callout-note h5,
.callout-note .callout-title-container {
  color: var(--band-ink-strong);
}

.callout-note h2::before {
  background: var(--gold);
}

.callout-note a {
  color: var(--accent);
  text-decoration-color: var(--accent-tint);
}

.callout-note a:hover {
  color: var(--accent-strong);
  text-decoration-color: var(--accent-strong);
}

.callout-note code:not(pre code) {
  background-color: rgba(247, 244, 234, 0.12);
  color: var(--band-ink-strong);
}

.callout-tip {
  background-color: var(--card);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.callout-warning {
  background-color: var(--card);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ========== CARDS ========== */
.card {
  background: var(--card);
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--hair);
}

.card h3 {
  margin-top: 0.25rem;
}

/* ========== STAT TILES AND KICKER CHIPS (utility) ========== */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.25rem 0;
}

.stat {
  background: var(--card);
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  flex: 1 1 11rem;
}

.stat .n {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  display: block;
}

.stat .lbl {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* chips are borderless mono kickers in this system */
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  white-space: nowrap;
}

.chip.gold { color: var(--gold); }
.chip.soft { color: var(--ink-faint); }

/* ========== PRESENTATION EMBED ========== */
.presentation-container {
  background: var(--card);
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin: 2rem 0;
}

.presentation-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hair-soft);
}

.presentation-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}

.presentation-embed {
  position: relative;
  width: 100%;
  height: 600px;
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.presentation-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ========== VIDEO EMBEDS ========== */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1rem 0 2.5rem;
  background-color: var(--card);
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.video-embed iframe,
.video-embed embed,
.video-embed object {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ========== SIDEBAR TOC ========== */
.sidebar nav[role="doc-toc"] {
  background-color: transparent;
  border: none;
  border-left: 1px solid var(--hair-soft);
  border-radius: 0;
  padding: 0.25rem 0 0.25rem 1rem;
}

.sidebar nav[role="doc-toc"] > h2,
.sidebar nav[role="doc-toc"] > .toc-title {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.5rem;
}

.sidebar nav[role="doc-toc"] > h2::before,
.sidebar nav[role="doc-toc"] > .toc-title::before {
  display: none;
}

.sidebar nav[role="doc-toc"] > ul {
  font-size: 0.82rem;
  font-family: var(--body);
}

.sidebar nav[role="doc-toc"] a,
.sidebar nav[role="doc-toc"] a.nav-link {
  color: var(--ink-soft) !important;
  text-decoration: none;
}

.sidebar nav[role="doc-toc"] a:hover,
.sidebar nav[role="doc-toc"] a.nav-link:hover,
.sidebar nav[role="doc-toc"] a.active,
.sidebar nav[role="doc-toc"] a.nav-link.active {
  color: var(--accent) !important;
  font-weight: 600;
}

/* ========== BUTTONS ========== */
.btn {
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}

.btn-secondary {
  background-color: transparent;
  color: var(--ink);
  border: 1px solid var(--hair);
}

.btn-secondary:hover {
  color: var(--accent);
  border-color: var(--accent);
  background-color: transparent;
}

/* ========== CARD GRID ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}

.card-grid > .card {
  margin: 0;
}

/* ========== HOME UTILITY CLASSES ========== */
.home-links {
  margin: 1rem 0 2.5rem;
  font-size: 1.05rem;
}

.home-affiliation-line {
  margin: 3.5rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair-soft);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.home-affiliation-line a {
  color: var(--ink-soft);
}

.home-affiliation-line a:hover {
  color: var(--accent);
}

.home-card,
.feature-card {
  height: 100%;
}

.home-card {
  margin: 0;
}

.home-card h3,
.feature-card h3 {
  margin-top: 0;
}

.feature-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.feature-links p {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
}

/* ========== PRESENTATION STYLES ========== */
.embed-notice {
  text-align: center;
  padding: 2rem;
  background-color: var(--card);
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-sm);
}

.presentation-link {
  margin-top: 1.5rem;
}

.presentation-link .btn {
  font-size: 0.74rem;
  padding: 0.7rem 1.8rem;
}

/* ========== LOGOS ========== */
.logos-section {
  margin-top: 3rem;
  text-align: center;
}

.logos-section img {
  max-height: 120px;
  width: auto;
  margin: 1rem;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.logos-section img:hover {
  opacity: 1;
}

/* ========== TEAM PHOTOS ========== */
.team-member {
  margin-bottom: 3rem;
}

.team-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--hair);
  transition: border-color 0.3s ease;
}

.team-photo:hover {
  border-color: var(--accent);
}

.team-photo-placeholder {
  width: 150px;
  height: 150px;
  background-color: var(--mono-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hair);
  color: var(--ink-faint);
  font-family: var(--display);
  font-size: 3rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  /* fill the grid column rather than shrink-to-fit, so a wide chart
     scrolls inside its panel instead of widening the page */
  .content {
    width: 100%;
    padding: 2rem 1rem;
  }

  .hero {
    padding: 1.75rem 0 0.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 2.9rem;
  }

  .hero-affiliation {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
  }

  .hero-descriptor {
    font-size: 1.2rem;
  }

  .hero-lede {
    font-size: 1.1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions p,
  .feature-links p {
    flex-direction: column;
  }

  .hero-actions .btn {
    text-align: center;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .feature-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .presentation-embed {
    height: 400px;
  }

  .team-photo,
  .team-photo-placeholder {
    width: 120px;
    height: 120px;
  }

  .team-member .columns {
    flex-direction: column;
    text-align: center;
  }

  .team-member .column {
    width: 100% !important;
  }
}

/* ========== REPORT PAGES ========== */
/* one-page editorial reports for single publications */
body.report .quarto-title-block {
  display: none;
}

/* below 992px quarto's grid holds the body column at 500px or more, which
   overflows report pages; use quarto's single-column phone grid instead.
   the auto margins on .content stop the grid stretching main, so set its
   width; wide figures then scroll inside their panel */
body.report main.content {
  width: 100%;
  min-width: 0;
}

@media (max-width: 991.98px) {
  body.report .page-columns {
    grid-template-columns: [screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end];
  }
}

img.figure-img {
  max-width: 100%;
  object-fit: contain;
}

.report-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.report-wrap p {
  max-width: none;
}

/* four stat tiles on one line; two by two on phones */
.report-wrap .stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 768px) {
  .report-wrap .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kicker-dash {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.5rem;
}

.kicker-dash::before {
  content: "";
  width: 2.25rem;
  height: 2px;
  background: var(--accent);
  flex: none;
}

.report-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 1rem 0 0.75rem;
  max-width: 24ch;
  text-wrap: balance;
}

.report-title em {
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
}

.report-subtitle {
  font-family: var(--body);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.35;
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
  max-width: 34rem;
}

.byline {
  margin: 1.75rem 0 0;
  font-size: 1rem;
}

.byline .names {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
}

.byline .venue {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-left: 0.75rem;
}

.report-lede {
  font-size: 1.3rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 2rem 0 0;
  max-width: 42rem;
}

.report-lede .hl {
  color: var(--green);
  font-weight: 500;
}

.report-lede .hl-gold {
  color: var(--gold);
  font-weight: 500;
}

.report-section {
  margin-top: 4.5rem;
}

.claim::before {
  display: none;
}

.claim {
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 1rem 0 1.25rem;
  max-width: 26ch;
  text-wrap: balance;
}

.report-section > p {
  max-width: 44rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 2.25rem 0 0;
}

.duo .panel {
  background: var(--card);
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-sm);
  padding: 1.6rem 1.75rem;
}

.duo .chip {
  white-space: normal;
}

.duo .panel h3 {
  margin: 0.4rem 0 0.6rem;
  font-size: 1.35rem;
}

.duo .panel p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

.numbered {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3.5rem;
  margin: 2.25rem 0 0;
}

.numbered .item .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  margin-right: 0.6rem;
}

.numbered .item h3 {
  display: inline;
  font-size: 1.15rem;
  margin: 0;
}

.numbered .item p {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.trial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem 2.5rem;
  margin: 2rem 0 0;
}

.trial-grid .cell {
  min-width: 0;
}

.trial-grid .chip {
  white-space: normal;
}

.trial-grid .cell p {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.trial-grid .arm {
  margin-top: 0.9rem;
}

.trial-grid .arm .chip {
  display: block;
  margin-bottom: 0.15rem;
}

.trial-grid .arm p {
  margin: 0.15rem 0 0;
}

@media (max-width: 900px) {
  .trial-grid {
    grid-template-columns: 1fr;
  }
}

.figure-panel {
  /* inside charts, the modest-evidence marks take a muted violet-grey so
     that the brightest colour does not fall on the least robust estimates */
  --gold: #766c89;
  background: var(--card);
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-sm);
  padding: 1.75rem 1.75rem 1.25rem;
  margin: 2.25rem 0 0;
  overflow-x: auto;
}

.figure-panel svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 620px;
}

.fig-caption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 44rem;
  margin: 1rem 0 0;
}

.report-note {
  background: var(--band);
  color: var(--band-ink);
  border-radius: var(--radius-sm);
  padding: 1.6rem 1.85rem;
  margin: 4.5rem 0 1rem;
}

.report-note .kicker {
  color: var(--gold);
}

.report-note p {
  margin: 0.6rem 0 0;
  font-size: 0.98rem;
}

.report-note a {
  color: var(--accent);
  text-decoration-color: var(--accent-tint);
}

.report-note a:hover {
  color: var(--accent-strong);
  text-decoration-color: var(--accent-strong);
}

.report-note code:not(pre code) {
  background-color: rgba(247, 244, 234, 0.12);
  color: var(--band-ink-strong);
}

@media (max-width: 768px) {
  .duo,
  .numbered {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-wrap {
    padding: 1.5rem 1rem 2.5rem;
  }

  .report-subtitle {
    font-size: 1.2rem;
  }

  .report-lede {
    font-size: 1.12rem;
  }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========== DARK THEME DETAILS ========== */
/* code blocks sit on card, not the highlight theme's own background */
div.sourceCode,
pre.sourceCode {
  background-color: var(--card);
  border-color: var(--hair-soft);
}

/* photos with white studio backgrounds glare on dark paper */
.team-photo,
.quarto-figure img[src*="images/team/"] {
  filter: brightness(0.94);
}

/* logos are drawn for white paper: give them a light plate */
img[src*="images/logos/"],
.logos-section img {
  background-color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  opacity: 1;
}

/* inline-styled buttons in presentations.qmd carry old blue and slate
   fills; bring them into the palette without editing page content */
a.btn.btn-primary[style] {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  border: 1px solid var(--accent) !important;
  border-radius: var(--radius-pill) !important;
}

a.btn.btn-primary[style]:hover {
  background: var(--accent-strong) !important;
  border-color: var(--accent-strong) !important;
}

a.btn.btn-primary[style*="#4c4f69"] {
  background: transparent !important;
  color: var(--ink) !important;
  border: 1px solid var(--hair) !important;
}

a.btn.btn-primary[style*="#4c4f69"]:hover {
  background: transparent !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* external-link icon drawn as a mask so it takes the link's own colour:
   kōwhai in prose, ink on filled kōwhai buttons, brighter on hover */
a.external::after {
  background-image: none !important;
  background-color: currentColor;
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z"/><path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z"/><path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z"/></svg>') center / contain no-repeat;
  opacity: 0.75;
}

a.external:hover::after {
  opacity: 1;
}

/* quarto derives a yellowish muted grey from the body colour for
   captions and asides; use the palette's soft ink instead */
.panel-caption,
.figure-caption,
.subfigure-caption,
.table-caption,
figcaption,
caption,
.header-section-number,
.column-margin figcaption,
.margin-caption,
div.aside,
aside,
.column-margin,
.blockquote {
  color: var(--ink-soft);
}

/* search overlay: darken the page behind the panel instead of washing
   it with translucent ink */
.aa-DetachedOverlay {
  background-color: rgba(6, 6, 16, 0.72);
}

.aa-DetachedOverlay .aa-Panel,
#quarto-search-results .aa-Panel {
  background-color: var(--card);
  border: 1px solid var(--hair);
}

/* osm tiles are drawn for daylight: invert them into a night map so the
   location widget does not glow on the page */
.leaflet-container {
  background-color: var(--card);
}

.leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9) saturate(0.6);
}

.leaflet-control-attribution,
.leaflet-bar a {
  background-color: var(--card) !important;
  color: var(--ink-soft) !important;
  border-color: var(--hair) !important;
}

.leaflet-container a.external::after {
  display: none;
}

/* quarto sets callout border colours with higher specificity */
div.callout-tip.callout {
  border-left-color: var(--accent-soft);
}

div.callout-warning.callout {
  border-left-color: var(--gold);
}
