/* Shared style for the /helium HTML exports of the P5 papers. */
:root {
  --cftblue: #1A4A8A;
  --cftbluemid: #2E6DB4;
  --cftbluebg: #E8EFF8;
  --cftteal: #1B6B6B;
  --cfttealbg: #E2F0F0;
  --cftgreen: #1E7A4A;
  --cftgreenbg: #E5F2EB;
  --cftorange: #B85800;
  --cftorangebg: #FBEFE2;
  --cftred: #8A2020;
  --cftgrey: #444444;
  --text: #1d1d22;
  --muted: #6c6c74;
  --rule: #d8d8e0;
}

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body {
  font-family: "Latin Modern Roman", "Charter", Georgia, "Iowan Old Style",
               "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: #fafafb;
  margin: 0;
  padding: 0;
}

.helium-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.4rem 1.6rem 5rem;
}

.helium-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250,250,251,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 1.2rem;
  font-size: 0.92rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.helium-topbar a {
  color: var(--cftblue);
  text-decoration: none;
  font-weight: 600;
}
.helium-topbar a:hover { text-decoration: underline; }
.helium-topbar .sep { color: var(--muted); }
.helium-topbar .crumb-current { color: var(--cftteal); font-weight: 600; }

h1 {
  font-family: "Inter", "Helvetica Neue", system-ui, sans-serif;
  color: var(--cftblue);
  font-size: 1.85rem;
  line-height: 1.2;
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
  border-bottom: 2px solid var(--cftblue);
  padding-bottom: 0.45rem;
}
h2 {
  font-family: "Inter", "Helvetica Neue", system-ui, sans-serif;
  color: var(--cftblue);
  font-size: 1.4rem;
  margin-top: 2.4rem;
  margin-bottom: 0.4rem;
}
h3 {
  font-family: "Inter", "Helvetica Neue", system-ui, sans-serif;
  color: var(--cftteal);
  font-size: 1.15rem;
  margin-top: 1.8rem;
  margin-bottom: 0.3rem;
}
h4 {
  font-family: "Inter", "Helvetica Neue", system-ui, sans-serif;
  color: var(--cftteal);
  font-size: 1.0rem;
  margin-top: 1.4rem;
  margin-bottom: 0.2rem;
}

p { margin: 0.6rem 0 0.7rem; }
a { color: var(--cftbluemid); }
a:visited { color: var(--cftblue); }

blockquote {
  border-left: 3px solid var(--cftteal);
  padding: 0.2rem 1rem;
  background: var(--cfttealbg);
  margin: 1rem 0;
  color: var(--cftgrey);
}

code, .code {
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #eef0f4;
  padding: 0.1em 0.32em;
  border-radius: 3px;
}
pre code { background: transparent; padding: 0; }
pre {
  background: #f1f2f6;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.7rem 0.9rem;
  overflow-x: auto;
  font-size: 0.86em;
  line-height: 1.4;
}

figure {
  margin: 1.4rem auto;
  text-align: center;
}
figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: white;
  padding: 0.4rem;
}
figcaption, .caption {
  font-size: 0.88rem;
  color: var(--cftgrey);
  margin-top: 0.5rem;
  text-align: left;
  padding: 0 0.6rem;
}

table {
  border-collapse: collapse;
  margin: 1rem auto;
  font-size: 0.94rem;
}
th, td {
  padding: 0.35rem 0.85rem;
  border-bottom: 1px solid var(--rule);
}
thead th {
  border-bottom: 2px solid var(--text);
  text-align: left;
}

.abstract {
  background: var(--cftbluebg);
  border-left: 4px solid var(--cftblue);
  padding: 0.9rem 1.2rem;
  margin: 1.4rem 0 1.8rem;
  font-size: 0.97rem;
}
.abstract::before {
  content: "Abstract";
  display: block;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  color: var(--cftblue);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

/* tcolorbox emulation: pandoc renders custom envs as divs with the class. */
div.resultbox, div.checkbox, div.notebox, div.summarybox,
div.statusbox, div.animbox {
  border-left: 4px solid var(--cftblue);
  background: var(--cftbluebg);
  padding: 0.7rem 1.0rem;
  margin: 1.1rem 0;
  border-radius: 3px;
}
div.checkbox { border-left-color: var(--cftgreen); background: var(--cftgreenbg); }
div.notebox  { border-left-color: var(--cftorange); background: var(--cftorangebg); }
div.statusbox { border-left-color: var(--cftgreen); background: var(--cftgreenbg); }

/* MathJax sizing tweaks */
mjx-container { font-size: 1.04em !important; }
mjx-container[display="true"] { margin: 0.9rem 0 !important; }

/* TOC at top of pandoc output */
nav#TOC {
  background: #f3f4f8;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.7rem 1.2rem;
  margin: 1.4rem 0 2rem;
  font-size: 0.92rem;
}
nav#TOC > ul { padding-left: 1.2rem; margin: 0.3rem 0; }
nav#TOC ul ul { padding-left: 1.1rem; }
nav#TOC a { color: var(--cftblue); text-decoration: none; }
nav#TOC a:hover { text-decoration: underline; }

/* Title block */
header#title-block-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
header#title-block-header h1.title {
  border-bottom: none;
  padding-bottom: 0;
  color: var(--cftblue);
  margin-top: 0.4rem;
}
header#title-block-header p.author,
header#title-block-header p.date {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.2rem 0;
}

/* Footnotes */
section.footnotes {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
  color: var(--cftgrey);
}

/* Landing page card grid */
.helium-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin: 2rem 0 3rem;
}
.helium-card {
  display: block;
  background: white;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--cftblue);
  border-radius: 4px;
  padding: 1.1rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.helium-card:hover {
  box-shadow: 0 6px 18px rgba(26,74,138,0.13);
  transform: translateY(-2px);
}
.helium-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--cftblue);
}
.helium-card .tagline {
  font-size: 0.92rem;
  color: var(--cftgrey);
  margin-bottom: 0.4rem;
}
.helium-card .meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
}
.helium-card.refined { border-left-color: var(--cftteal); }
.helium-card.refined h2 { color: var(--cftteal); }
.helium-card.marzlin { border-left-color: var(--cftgreen); }
.helium-card.marzlin h2 { color: var(--cftgreen); }

/* ── Animations grid ──────────────────────────────────────────── */
.helium-anims {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0 2rem;
}
.helium-anims .anim-card {
  margin: 0;
  background: #fff;
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  padding: 0.6rem 0.6rem 0.4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.helium-anims .anim-card.wide { grid-column: 1 / -1; }
.helium-anims video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #000;
}
.helium-anims figcaption {
  font-size: 0.88rem;
  color: var(--gray, #444);
  margin-top: 0.5rem;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .helium-anims { grid-template-columns: 1fr; }
}
