/* chocolatedunk.com
   Cream paper, cocoa ink, one caramel accent. Fraunces (self-hosted, SIL OFL: /assets/fonts/OFL.txt)
   for display type only, the system sans for everything else. No JavaScript anywhere: the CSP is
   script-src 'none'. The pages come from ChocolateDunk/tools/website/build-pages.py. */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces.woff2?v=2026-09-25") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6efe4;
  --paper-deep: #efe5d6;
  --ink: #2a1a11;
  --muted: #6b5343;
  --accent: #9a4a14;
  --line: rgba(42, 26, 17, 0.14);
  --line-strong: rgba(42, 26, 17, 0.28);

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --max: 75rem;                                  /* 1200 px of content */
  --pad: clamp(1.25rem, 4.5vw, 3rem);            /* 20 px on phones, 48 px from ~1070 px */
  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Short pages (404) keep the footer at the bottom of the window. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}
body > main { flex: 1 0 auto; }

img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
h1, h2, h3, p, ul, ol, dl, dd, figure, address { margin: 0; }
ul, ol { padding: 0; list-style: none; }
address { font-style: normal; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }

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

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  left: var(--pad);
  top: -3rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.9375rem;
}
.skip:focus { top: 0.75rem; color: var(--paper); }

/* ---------- Type ---------- */

h1, h2, .display {
  font-family: var(--display);
  font-weight: 400;
  font-optical-sizing: auto;
}

h2 {
  font-size: clamp(2.125rem, 1.5rem + 2.3vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
}

.lead {
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.45;
  color: var(--muted);
  max-width: 30em;
  text-wrap: pretty;
}

.more {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.more::after { content: "\00a0\2192"; }
.more:hover { color: var(--accent); }

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 4.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand img { width: 2rem; height: 2rem; border-radius: 22.5%; }

.nav { display: flex; gap: clamp(1.25rem, 3vw, 2.25rem); }
.nav a {
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.5rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Call to action: "Coming soon" now, the App Store badge once 1.0 is live ---------- */

.cta { display: grid; justify-items: start; gap: 0.125rem; line-height: 1.3; }
.cta strong { font-weight: 600; font-size: 1rem; }
.cta span { color: var(--muted); font-size: 0.9375rem; }
.cta--live { gap: 0.625rem; }
.cta__badge { display: block; border-radius: 0.5rem; }
.cta__badge img { width: 9rem; height: auto; }

/* ---------- Home: hero ---------- */

.hero { padding-top: clamp(1.25rem, 3.2vw, 2.5rem); }

.hero__mast { display: grid; gap: 1.25rem; }

.hero h1 {
  font-size: clamp(3.75rem, 1.9rem + 7.6vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.hero__aside { display: grid; gap: 1.75rem; }

.hero__plate { margin-top: clamp(2rem, 4.5vw, 3rem); }
.hero__plate img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--paper-deep);
}

@media (min-width: 1100px) {
  .hero__mast {
    grid-template-columns: 1fr minmax(0, 21.5rem);
    align-items: end;
    column-gap: 4rem;
  }
  .hero__aside { padding-bottom: 0.625rem; }
  .hero .lead { font-size: 1.25rem; }
  /* One line beside the aside at every width: the content width minus the aside and the gap,
     over the wordmark's width in em. */
  .hero h1 { font-size: min(7.5rem, calc((min(100vw, 81rem) - 31.5rem) / 6.4)); }
}

/* ---------- Sections ---------- */

.section { padding-top: clamp(5rem, 11vw, 9rem); }

.section__head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.section__head p { color: var(--muted); max-width: 32em; }

@media (min-width: 900px) {
  .section__head--row {
    grid-template-columns: 1fr auto;
    align-items: end;
    column-gap: 3rem;
  }
  .section__head--row p { grid-column: 1; }
  .section__head--row .more { grid-column: 2; grid-row: 1 / span 2; align-self: end; padding-bottom: 0.2rem; }
}

/* Two columns from 900 px: a sticky heading on the left, the content on the right. */
@media (min-width: 900px) {
  .split {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: 3rem;
    align-items: start;
  }
  .split__head { position: sticky; top: 2rem; }
  .split .section__head { margin-bottom: 0; }
}

/* ---------- Home: the worlds strip (CSS-only scroll snap) ---------- */

.strip {
  --edge: max(var(--pad), calc((100% - var(--max)) / 2));   /* lines the first card up with .wrap */
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  padding-block: 0.375rem 1.25rem;   /* room for the focus ring inside the scroller */
  margin-top: -0.375rem;
}

.strip__list {
  display: flex;
  gap: clamp(0.875rem, 1.6vw, 1.5rem);
  width: max-content;
  padding-inline: var(--edge);
}

.strip__item {
  flex: none;
  width: clamp(14.5rem, 62vw, 18.25rem);
  scroll-snap-align: start;
}
@media (min-width: 700px) {
  .strip__item { width: clamp(12rem, 28vw, 18.25rem); }   /* a fourth card always peeks in */
}

.strip__item a, .world a { display: block; text-decoration: none; color: var(--ink); }
.strip__item a:focus-visible { outline-offset: 4px; border-radius: 6px; }
.strip__item img, .world img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--paper-deep);
}

.label {
  display: flex;
  gap: 0.625rem;
  align-items: baseline;
  padding-top: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 500;
}
.label__num {
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.strip__item a:hover .label__name { color: var(--accent); }

/* ---------- Home: facts ---------- */

.facts {
  display: grid;
  border-top: 1px solid var(--line);
}
.facts li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.375rem;
  border-bottom: 1px solid var(--line);
}
.facts__value {
  font-family: var(--display);
  font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.facts__note { color: var(--muted); font-size: 0.9375rem; text-align: right; }

@media (min-width: 900px) {
  .facts {
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--line);
  }
  .facts li {
    display: grid;
    gap: 0.5rem;
    align-content: start;
    padding: 2rem 2rem 2.25rem 0;
    border-bottom: 0;
  }
  .facts li + li { padding-left: 2rem; border-left: 1px solid var(--line); }
  .facts__note { text-align: left; }
}

/* ---------- Questions (home and support) ---------- */

.qa { border-top: 1px solid var(--line); }
.qa:last-child { border-bottom: 1px solid var(--line); }

.qa summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding-block: 1.25rem;
  cursor: pointer;
  list-style: none;
  font-size: 1.0625rem;
  font-weight: 500;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
  color: var(--muted);
  transition: transform 0.3s var(--ease);
}
.qa[open] summary::after { transform: rotate(45deg); }
.qa summary:hover { color: var(--accent); }

.qa__a {
  padding-bottom: 1.5rem;
  color: var(--muted);
  max-width: 38em;
}
.qa__a p + p, .qa__a p + ul, .qa__a ul + p { margin-top: 0.75rem; }
.qa__a ul { list-style: disc; padding-left: 1.25rem; }
.qa__a li + li { margin-top: 0.25rem; }
.qa__a a { color: var(--ink); }
.qa__a a:hover { color: var(--accent); }

/* In-app paths on the support page: Settings › Purchases */
.path { color: var(--ink); font-weight: 500; }

/* ---------- Home: closing call to action ---------- */

.coda {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1.5rem;
  padding-block: clamp(6rem, 13vw, 10rem) clamp(4.5rem, 9vw, 7rem);
}
.coda__icon { width: 5.5rem; height: 5.5rem; border-radius: 22.5%; }
.coda__line {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.coda .cta { justify-items: center; }

/* ---------- Footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.foot__row { display: grid; gap: 1.25rem; }
.foot__credit { color: var(--ink); }
.foot__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.foot__links a { text-decoration: none; }
.foot__links a:hover { color: var(--ink); }
.foot__legal { font-size: 0.8125rem; max-width: 52em; }

@media (min-width: 900px) {
  .foot__row { grid-template-columns: 1fr auto; align-items: baseline; }
  .foot__legal { grid-column: 1 / -1; }
}

/* ---------- Inner pages ---------- */

.page__head { padding-top: clamp(2rem, 6vw, 4.5rem); }

.crumbs {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line-strong); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.page h1 {
  font-size: clamp(2.75rem, 1.6rem + 4.6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.026em;
}
.page h2 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem); line-height: 1.08; letter-spacing: -0.018em; }
/* Sits where the breadcrumbs sit on other pages (404). */
.eyebrow { font-size: 0.875rem; color: var(--muted); margin-bottom: 1.5rem; }
.page .lead { margin-top: 1.25rem; }
.meta { margin-top: 1rem; font-size: 0.9375rem; color: var(--muted); max-width: 40em; }

.page__body { padding-top: clamp(3.5rem, 7vw, 5.5rem); }
.page__end { padding-bottom: clamp(5rem, 10vw, 8rem); }

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

/* The app icon beside the call to action, at the foot of an inner page. */
.closing {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(5rem, 10vw, 8rem);
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}
.closing__icon { width: 3.5rem; height: 3.5rem; border-radius: 22.5%; }

/* Support: the contact block */
.contact { display: grid; gap: 1rem; justify-items: start; }
.contact p { color: var(--muted); max-width: 32em; }
.contact .mail {
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.contact .mail:hover { color: var(--accent); }

/* ---------- Worlds page ---------- */

.worlds {
  --gap: clamp(1rem, 2vw, 1.5rem);
  display: grid;
  gap: clamp(2.5rem, 5vw, 3.5rem) var(--gap);
  container-type: inline-size;
}
@media (min-width: 560px) { .worlds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .worlds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Milk River leads across two columns (11 worlds then fill every row). Its landscape plate is
   exactly as tall as a 4:5 card beside it: 5/4 of one column. */
@media (min-width: 560px) {
  .world--lead { grid-column: span 2; }
  .world--lead img { aspect-ratio: 33 / 20; }
  @supports (width: 1cqw) {
    .world--lead img { aspect-ratio: auto; height: calc(1.25 * (100cqw - var(--gap)) / 2); }
  }
}
@media (min-width: 900px) {
  @supports (width: 1cqw) {
    .world--lead img { height: calc(1.25 * (100cqw - 2 * var(--gap)) / 3); }
  }
}

.world { scroll-margin-top: 1.5rem; }
.world h2 {
  display: flex;
  gap: 0.625rem;
  align-items: baseline;
  margin-top: 1rem;
  font-size: 1.625rem;
  line-height: 1.15;
  letter-spacing: -0.012em;
}
.world h2 .label__num { font-family: var(--text); font-size: 0.9375rem; }
.world p { margin-top: 0.5rem; color: var(--muted); font-size: 0.9375rem; max-width: 30em; }
.world .world__unlock { margin-top: 0.375rem; color: var(--ink); }

/* ---------- Press page ---------- */

.press + .press { padding-top: clamp(4rem, 8vw, 6rem); }
.press h2 { margin-bottom: 1.5rem; }
.press p { max-width: 38em; }
.press p + p, .press p + ul, .press ul + p, .press p + .thumbs, .press p + .quote { margin-top: 1rem; }

.sheet { border-top: 1px solid var(--line); }
.sheet div {
  display: grid;
  gap: 0.25rem;
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--line);
}
.sheet dt { color: var(--muted); font-size: 0.9375rem; }
@media (min-width: 560px) {
  .sheet div { grid-template-columns: 10rem 1fr; gap: 1.5rem; }
}

.quote {
  padding-left: 1.25rem;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
}
.quote p, .quote ul { max-width: 36em; }
.quote p + p, .quote p + ul, .quote ul + p { margin-top: 0.875rem; }
.quote ul { list-style: disc; padding-left: 1.25rem; }
.quote li + li { margin-top: 0.25rem; }

.press__icon { display: flex; align-items: center; gap: 1.5rem; }
.press__icon img { width: 5.5rem; height: 5.5rem; border-radius: 22.5%; }

.thumbs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
}
@media (min-width: 560px) { .thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.thumbs a { display: block; text-decoration: none; color: var(--ink); }
.thumbs img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); background: var(--paper-deep); }
.thumbs .label { padding-top: 0.625rem; font-size: 0.875rem; }
.thumbs .label span { color: var(--muted); font-weight: 400; }
.thumbs a:hover .label__name { color: var(--accent); }

/* ---------- Privacy policy ---------- */

.toc__title { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; }
.toc ol { display: grid; gap: 0.375rem; font-size: 0.9375rem; color: var(--muted); }
.toc a { text-decoration: none; }
.toc a:hover { color: var(--ink); }
@media (max-width: 899px) {
  .toc { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
}

.prose { max-width: 42rem; }
.prose h2 {
  font-size: clamp(1.625rem, 1.35rem + 1vw, 2.125rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 3rem 0 1rem;
  scroll-margin-top: 1.5rem;
}
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul, .prose address, .prose .table-wrap { margin-top: 1rem; }
.prose ul { list-style: disc; padding-left: 1.25rem; }
.prose li + li { margin-top: 0.5rem; }
.prose strong { font-weight: 600; }

.table-wrap { overflow-x: auto; }
.table-wrap table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.table-wrap th, .table-wrap td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.table-wrap th { font-weight: 600; border-bottom-color: var(--line-strong); }
.table-wrap td:first-child { color: var(--ink); }
.table-wrap td { color: var(--muted); }

/* ---------- Motion (CSS only, and only if the reader is fine with it) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero__aside { animation: rise 0.8s var(--ease) both; }
  .hero__aside { animation-delay: 0.08s; }
  .hero__plate { animation: settle 0.8s var(--ease) both; }  /* scale only: never hides the LCP image */
}

@keyframes rise {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: none; }
}
@keyframes settle {
  from { transform: scale(0.985); }
  to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
