/* Slow Turtle: calm, soft, readable. Brand colours from brand/make_brand.py. No external fonts or libraries. */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #234A57;
  --ink-soft: #4E6C77;
  --teal: #2C6E7F;
  --teal-dark: #1F5563;
  --green: #3F9A7B;
  --shell: #8AD6B2;
  --skin: #CDEEA6;
  --belly: #FFE9B8;
  --cheek: #FF9DAD;
  --water-1: #EEF9FC;
  --water-2: #D7F0F7;
  --sand: #FFF6E3;
  --white: #FFFFFF;
  --line: #D5E7EC;
  --radius: 22px;
  --shadow: 0 6px 24px rgba(35, 74, 87, 0.08);
  --wrap: 1080px;
  --head: "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; color-scheme: light; }
a, button { -webkit-tap-highlight-color: rgba(44, 110, 127, 0.15); }

body {
  margin: 0;
  background: var(--water-1);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-dark); }

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

h1, h2, h3 {
  font-family: var(--head);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5em;
  letter-spacing: 0.005em;
}
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--white); padding: 8px 14px; border-radius: 10px; z-index: 10;
}
.skip:focus { left: 8px; }

/* ---- header and footer ---- */
.site-head { background: var(--white); border-bottom: 1px solid var(--line); }
.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding: 14px 0;
}
.logo img { height: 46px; width: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; }
.nav a {
  display: block; padding: 8px 14px; border-radius: 999px;
  font-family: var(--head); font-weight: 600; color: var(--ink); text-decoration: none;
}
.nav a[aria-current="page"] { background: var(--water-2); color: var(--teal-dark); }
@media (hover: hover) { .nav a:hover { background: var(--water-2); color: var(--teal-dark); } }

/* Phones: logo on one line, the whole menu on the next, all four links visible at 360 px. */
@media (max-width: 520px) {
  .site-head .wrap { gap: 8px; padding: 10px 0 8px; }
  .logo img { height: 40px; }
  .nav { flex-wrap: nowrap; width: 100%; justify-content: space-between; gap: 2px;
         overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 10px 10px; font-size: 0.98rem; white-space: nowrap; }
  .nav .long { display: none; }
}

.site-foot { background: var(--white); border-top: 1px solid var(--line); margin-top: 72px; padding: 36px 0 44px; }
.site-foot .wrap { display: grid; gap: 20px; grid-template-columns: 1fr; }
.site-foot img { height: 40px; width: auto; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0 6px; margin-left: -10px; }
.site-foot nav a { display: inline-block; padding: 10px; }   /* finger-sized */
.site-foot small { color: var(--ink-soft); }
@media (min-width: 760px) { .site-foot .wrap { grid-template-columns: auto 1fr auto; align-items: center; } }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px; border: 2px solid var(--teal);
  background: var(--teal); color: var(--white);
  font: 600 1.05rem/1 var(--head); text-decoration: none; cursor: pointer;
  transition: background-color 0.2s ease;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: var(--white); }
.btn.soft { background: var(--white); color: var(--teal); }
.btn.soft:hover { background: var(--water-2); color: var(--teal-dark); }
.btn svg { width: 20px; height: 20px; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---- sections ---- */
section { padding: 56px 0 8px; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 46em; }
.eyebrow {
  display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px;
  background: var(--skin); color: var(--ink); font: 600 0.9rem/1.4 var(--head);
}
.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 26px 10px;
}
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.two { grid-template-columns: repeat(2, 1fr); } }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.prose { max-width: 46em; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.45em; }
.note { color: var(--ink-soft); font-size: 0.95rem; }

/* ---- hero ---- */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--water-2) 0%, var(--water-1) 70%);
  padding: 44px 0 64px;
}
.hero::after {   /* a soft wave at the bottom edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 36px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 36' preserveAspectRatio='none'%3E%3Cpath d='M0 24 C 200 4 400 4 600 20 C 800 36 1000 36 1200 16 L1200 36 L0 36 Z' fill='%23EEF9FC'/%3E%3C/svg%3E") no-repeat bottom / 100% 100%;
}
.hero .wrap { display: grid; gap: 28px; align-items: center; }
.hero img { width: min(520px, 100%); margin-inline: auto; }
@media (min-width: 880px) { .hero .wrap { grid-template-columns: 1.1fr 0.9fr; } }

/* ---- calm points ---- */
.points { counter-reset: point; }
.points .card { position: relative; padding-top: 58px; }
.points .card::before {
  counter-increment: point; content: counter(point);
  position: absolute; top: 18px; left: 26px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--shell); color: var(--ink); font: 600 1rem/32px var(--head); text-align: center;
}

/* ---- video: click to play ---- */
.player {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--ink); box-shadow: var(--shadow);
}
.player img, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.player .play {
  position: absolute; right: 4%; bottom: 6%;   /* over the sand, so the thumbnail's words stay visible */
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 28px 16px 22px; border-radius: 999px; border: 0;
  background: rgba(255, 255, 255, 0.95); color: var(--teal-dark);
  font: 600 1.15rem/1 var(--head); text-decoration: none; cursor: pointer; box-shadow: var(--shadow);
}
.player .play:hover { background: var(--white); color: var(--teal); }
.player .play svg { width: 26px; height: 26px; }
@media (max-width: 520px) {
  .player .play { padding: 11px 18px 11px 14px; font-size: 1rem; gap: 8px; }
  .player .play svg { width: 22px; height: 22px; }
  .player { border-radius: 16px; }
}
.player-note { margin-top: 10px; }

/* ---- episode ---- */
.chapters { display: grid; gap: 4px 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 0; list-style: none; }
.chapters a {
  display: flex; gap: 8px; align-items: baseline; padding: 10px 10px; border-radius: 12px; min-height: 44px;
  text-decoration: none; color: var(--ink); background: rgba(255, 255, 255, 0.55);
}
@media (hover: hover) { .chapters a:hover { background: var(--water-2); } }
.learn { display: grid; gap: 14px; grid-template-columns: 1fr; padding: 0; list-style: none; }
@media (min-width: 640px) { .learn { grid-template-columns: repeat(2, 1fr); } }
.learn li { background: var(--white); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); }
.learn strong { font-family: var(--head); font-weight: 600; display: block; margin-bottom: 2px; }
.chapters time { font-variant-numeric: tabular-nums; color: var(--teal); font-weight: 600; min-width: 3.2em; }
details.transcript { margin-top: 18px; }
details.transcript summary { cursor: pointer; font-family: var(--head); font-weight: 600; color: var(--teal); }
details.transcript ol { list-style: none; padding: 0; columns: 2 260px; column-gap: 28px; }
details.transcript li { break-inside: avoid; margin-bottom: 4px; }
details.transcript time { color: var(--ink-soft); font-variant-numeric: tabular-nums; margin-right: 8px; }

/* ---- coloring ---- */
.tiles { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tiles.six { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .tiles.six { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .tiles.six { grid-template-columns: repeat(6, 1fr); } }
.tile {
  display: block; background: var(--white); border-radius: 18px; box-shadow: var(--shadow);
  padding: 10px 10px 12px; text-decoration: none; color: var(--ink); text-align: center;
  transition: transform 0.2s ease;
}
@media (hover: hover) { .tile:hover { transform: translateY(-2px); color: var(--teal-dark); } }
.tile img { border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; }
.tile span { font: 600 1.05rem/1.3 var(--head); }
.sheet { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.sheet img { border-radius: 12px; }
.fact {
  background: var(--belly); border-radius: var(--radius); padding: 18px 22px; margin: 22px 0;
  font-size: 1.15rem;
}
.fact strong { font-family: var(--head); font-weight: 600; }

/* ---- breadcrumbs ---- */
.crumbs { font-size: 0.95rem; margin-top: 22px; margin-bottom: 6px; color: var(--ink-soft); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--ink-soft); }

/* ---- small spacing helpers (no inline styles: the security policy forbids them) ---- */
.top { padding-top: 12px; }
.mt { margin-top: 18px; }
.mt-l { margin-top: 26px; }
.mb { margin-bottom: 22px; }
.tile.left { text-align: left; }
.pager { display: flex; flex-wrap: wrap; gap: 0 12px; margin: 8px 0 0 -10px; }
.pager a { display: inline-block; padding: 10px; }
.card ul { padding-left: 1.2em; }
.card li { margin-bottom: 0.4em; }
.tile .note { margin: 6px 0 0; }

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

/* Small phones: a little less padding, so text gets the room. */
@media (max-width: 400px) {
  .card { padding: 20px 18px 6px; }
  .points .card::before { left: 18px; }
  section { padding-top: 44px; }
  .btn { padding: 12px 20px; }
}

/* ---- printing a coloring page: only the page itself ---- */
@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .sheet, .sheet * { visibility: visible; }
  .sheet { position: fixed; inset: 0; padding: 0; box-shadow: none; border-radius: 0; }
  .sheet img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
}
