@font-face { font-family: "Andika"; src: url("../fonts/andika-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/andika-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("../fonts/kalam-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("../fonts/kalam-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --page: #eef3ee;
  --ink: #1d2721;
  --quiet: #33413a;
  --line: #c9d6cb;
  --paper: #fffdf7;
  --floor: #efd3bf;
  --june: #2d6a4f;
  --ana: #c4563a;
  --faith: #a8700c;
  --okafor: #77478a;
  --leo: #33669e;
  --gutter: clamp(16px, 4.5vw, 48px);
  --measure: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 19px/1.55 "Andika", system-ui, sans-serif;
}
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--june); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon {
  width: 1.4em; height: 1.4em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}
.icon .accent-june { stroke: var(--june); }
.icon .accent-faith { stroke: var(--faith); }

.top {
  display: flex; flex-wrap: wrap; gap: 0.35em 0.9em;
  width: min(var(--measure), 100% - 2 * var(--gutter));
  margin-inline: auto; padding-top: 18px;
  font-size: 0.95rem; color: var(--quiet);
}
.top a { color: var(--ink); font-weight: 700; text-decoration: none; }
.top a:hover { text-decoration: underline; }

/* ---- Opening: a frame that fits the screen ---- */
.opening {
  height: calc(100svh - 48px);
  width: min(var(--measure), 100% - 2 * var(--gutter));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  overflow: hidden;
}
.opening-art { height: 100%; min-height: 0; display: flex; align-items: center; }
.opening-art svg { width: 100%; height: min(78%, 560px); border-radius: 18px; background: var(--floor); }
h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5.2vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.lede { margin: 0.8em 0 0; font-size: clamp(1.1rem, 1.7vw, 1.35rem); max-width: 30em; }
.read {
  display: inline-flex; align-items: center; gap: 0.55em;
  margin-top: 1.4em; padding: 0.55em 1em 0.55em 0.75em;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 6px; cursor: pointer;
}
.read .icon { width: 1.6em; height: 1.6em; }
.read:hover { background: #ffffff; }
.read[aria-pressed="true"] { background: var(--june); border-color: var(--june); color: #ffffff; }

@media (max-width: 760px) {
  .opening { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); align-items: start; padding-top: 20px; gap: 16px; }
  .opening-art svg { height: 100%; }
  .read { margin-top: 1em; }
}

/* A short screen (a phone held sideways): the words alone, still fitting. */
@media (max-height: 520px) and (min-width: 561px) {
  .opening { grid-template-columns: 1fr; align-content: center; }
  .opening-art { display: none; }
  h1, html[data-read="simply"] h1 { font-size: 2rem; }
  .lede { margin-top: 0.5em; }
  .read { margin-top: 0.8em; }
  .opening .er { margin-top: 0.4em; }
  .opening .er li { grid-template-columns: 34px 1fr; gap: 10px; font-size: 1.1rem; }
  .opening .er li + li { margin-top: 4px; }
  .opening .er .icon { width: 34px; height: 34px; }
}

/* ---- Easy Read lines: a picture to the left of each line ---- */
.er { list-style: none; margin: 0.8em 0 0; padding: 0; }
.er li {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center;
  font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.45;
}
.er li + li { margin-top: 14px; }
.er .icon { width: 56px; height: 56px; color: var(--ink); }
html[data-read="simply"] h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
@media (max-width: 760px) {
  .er li { grid-template-columns: 44px 1fr; gap: 12px; }
  .er .icon { width: 44px; height: 44px; }
  .er li + li { margin-top: 10px; }
}

/* ---- Scenes ---- */
.scene { position: relative; }
.scene[data-scene="circle"] { height: round(down, 354svh, 1px); }
.scene[data-scene="week"] { height: round(down, 386svh, 1px); }
.stage {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  background: var(--floor);
}
.stage svg.table { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.band {
  position: absolute; left: 0; right: 0; top: 0; z-index: 1;
  padding: 16px var(--gutter) 14px;
  background: rgba(252, 249, 241, 0.97);
  border-bottom: 1px solid #d8c9ab;
}
.caption {
  display: flex; align-items: baseline; gap: 0.7em;
  max-width: 62ch; min-height: 2.7em; margin: 0 auto;
  font-size: clamp(1.1rem, 1.9vw, 1.65rem); line-height: 1.3;
  will-change: opacity, transform;
}
.caption .who { font-weight: 700; flex: none; }
html[data-read="simply"] .caption { align-items: center; font-size: clamp(1.25rem, 2.2vw, 1.8rem); }
html[data-read="simply"] .caption .icon { width: 2.2em; height: 2.2em; }
@media (max-width: 760px) {
  .caption { flex-direction: column; gap: 0.15em; min-height: 3.9em; }
  html[data-read="simply"] .caption { flex-direction: row; min-height: 3.2em; }
}
.labels text { font-family: "Andika", system-ui, sans-serif; }
.strip text { font-family: "Andika", system-ui, sans-serif; }
.endcard text { font-family: "Andika", system-ui, sans-serif; }

.week {
  position: absolute; left: 50%; bottom: 14px; z-index: 1;
  width: min(760px, 100% - 2 * var(--gutter)); transform: translateX(-50%);
  height: 54px; opacity: 0;
  background: rgba(252, 249, 241, 0.97); border: 1px solid #d8c9ab; border-radius: 8px;
}
.week .days { display: grid; grid-template-columns: repeat(7, 1fr); height: 100%; }
.week .days span {
  padding: 5px 0 0 10px; display: flex; align-items: flex-start;
  font-weight: 700; font-size: 0.95rem; color: var(--quiet);
  border-left: 1px solid #e6dcc6;
}
.week .days span:first-child { border-left: 0; }
.week .dots span {
  position: absolute; top: 72%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--dot); opacity: 0;
}
.week .marker { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }
@media (max-width: 560px) {
  .week { height: 48px; bottom: 10px; }
  .week .days span { padding: 4px 0 0 6px; font-size: 0.8rem; }
  .week .dots span { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
}

.stills { display: none; }

/* ---- Interlude ---- */
.interlude {
  width: min(44rem, 100% - 2 * var(--gutter));
  margin: clamp(56px, 10vw, 110px) auto;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
}
.interlude p { margin: 0; }

/* ---- The diary ---- */
.diary {
  width: min(52rem, 100% - 2 * var(--gutter));
  margin: clamp(64px, 10vw, 120px) auto 0;
}
h2 { margin: 0 0 0.4em; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; }
.note { margin: 0 0 1.2em; max-width: 40em; }
.entries {
  list-style: none; margin: 0; padding: clamp(16px, 3vw, 32px) clamp(18px, 4vw, 44px);
  background:
    repeating-linear-gradient(to bottom, transparent 0 41px, #e4dcc8 41px 42px),
    var(--paper);
  border-left: 10px solid #6a4a36;
  border-radius: 4px;
  box-shadow: 0 1px 0 #d6cbb2;
}
.entry {
  --hand: color-mix(in srgb, var(--who, #1d2721) 62%, #000000);
  display: grid; grid-template-columns: 7.5em 1fr; column-gap: 1em;
  padding: 0.35em 0; color: var(--ink);
}
.entries.simply .entry { grid-template-columns: 8.5em 1fr; font-size: 1.15rem; }
.entry .when { font-weight: 700; color: var(--quiet); }
.entry .hand {
  grid-column: 2; font-family: "Kalam", cursive; font-size: 1.3rem; line-height: 1.35;
  color: var(--hand);
}
.entry .by { grid-column: 2; font-size: 0.9rem; font-weight: 700; color: var(--hand); }
.entry .answer {
  grid-column: 2; margin-top: 0.3em; padding-left: 1em;
  border-left: 3px solid var(--june);
  font-family: "Kalam", cursive; font-size: 1.3rem; line-height: 1.35;
  color: color-mix(in srgb, var(--june) 75%, #000000);
}
.entry .answer .by { display: block; font-family: "Andika", system-ui, sans-serif; color: inherit; }
@media (max-width: 560px) {
  .entry, .entries.simply .entry { grid-template-columns: 1fr; }
  .entry .hand, .entry .by, .entry .answer { grid-column: 1; }
}

/* ---- Close ---- */
.close {
  width: min(52rem, 100% - 2 * var(--gutter));
  margin: clamp(64px, 10vw, 120px) auto 0;
  padding-bottom: 64px;
}
.film { margin: 2em 0 0; }
.film video { width: 100%; height: auto; display: block; background: var(--floor); border-radius: 8px; aspect-ratio: 16 / 9; }
.film figcaption { margin-top: 0.6em; color: var(--quiet); font-size: 1rem; }
.back { margin: 2.4em 0 0; font-weight: 700; }

/* ---- Reduced motion: stills, no pinning ---- */
.calm .scene { height: auto; }
.calm .stage { display: none; }
.calm .stills {
  display: grid; gap: 28px;
  width: min(var(--measure), 100% - 2 * var(--gutter));
  margin: 40px auto 0;
}
.calm .stills figure { margin: 0; }
.calm .stills svg { width: 100%; height: auto; display: block; border-radius: 12px; background: var(--floor); }
.calm .stills figcaption {
  display: flex; align-items: center; gap: 0.6em; margin-top: 0.6em;
  font-size: 1.15rem;
}
.calm .stills figcaption .icon { width: 2em; height: 2em; }

/* ---- Capture mode (films): the stage alone ---- */
.capture body { background: var(--floor); }
.capture .top, .capture .opening, .capture .interlude, .capture .diary, .capture .close,
.capture #week-wrap { display: none; }
.capture .scene-wrap .week {
  position: absolute; left: 50%; bottom: 14px; z-index: 1;
  width: min(760px, 100% - 2 * var(--gutter)); transform: translateX(-50%);
  height: 54px; opacity: 0;
  background: rgba(252, 249, 241, 0.97); border: 1px solid #d8c9ab; border-radius: 8px;
}
.week .days { display: grid; grid-template-columns: repeat(7, 1fr); height: 100%; }
.week .days span {
  padding: 5px 0 0 10px; display: flex; align-items: flex-start;
  font-weight: 700; font-size: 0.95rem; color: var(--quiet);
  border-left: 1px solid #e6dcc6;
}
.week .days span:first-child { border-left: 0; }
.week .dots span {
  position: absolute; top: 72%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--dot); opacity: 0;
}
.week .marker { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }
@media (max-width: 560px) {
  .week { height: 48px; bottom: 10px; }
  .week .days span { padding: 4px 0 0 6px; font-size: 0.8rem; }
  .week .dots span { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
}

.stills { display: none; }
.capture .scene { height: 100vh; }
.capture .stage { position: fixed; inset: 0; height: 100vh; }
.capture .band { padding: 22px 48px 18px; }
.capture .caption { font-size: 28px; max-width: none; }
.capture .week { width: 70%; }
