/* Word Wobble website. Palette and type from BRAND.md → Look. */
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --cream: #FFF8EC;
  --floor: #F3E4CA;
  --ink: #1E1B2E;
  --ink-soft: #4A4560;
  --lime: #A6E22E;
  --lime-dark: #86C21A;
  --uk: #2D6CDF;
  --us: #E5484D;
  --yellow: #FFD23F;
  --correct: #16A34A;
  --wrong: #DC2626;
  --white: #FFFFFF;
  --line: 3px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --radius: 20px;
  --display: "Fredoka", "Baloo 2", ui-rounded, system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.6 var(--text);
  background-image: radial-gradient(rgba(30, 27, 46, 0.06) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--uk); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.center img { margin: 0 auto 1rem; }
.section { padding: 40px 0; }
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--yellow); padding: 8px 12px; border: var(--line); border-radius: 12px; }

/* buttons and chips */
.btn {
  display: inline-flex; align-items: center; gap: 0.4em;
  font: 600 1.05rem/1 var(--display);
  padding: 14px 22px; border: var(--line); border-radius: 999px;
  box-shadow: var(--pop); color: var(--ink); text-decoration: none; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-sm { padding: 9px 16px; font-size: 0.95rem; box-shadow: 3px 3px 0 var(--ink); }
.btn-lime { background: var(--lime); }
.btn-red { background: var(--us); color: var(--white); }
.btn-ink { background: var(--ink); color: var(--white); box-shadow: 4px 4px 0 var(--lime-dark); }
.chip, .tag {
  display: inline-block; font: 600 0.85rem/1 var(--display);
  padding: 6px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow);
}
.tag { background: var(--white); margin-left: 0.5em; vertical-align: middle; }
.hl { background: linear-gradient(transparent 58%, var(--yellow) 58%); }

/* header and footer */
.top { position: sticky; top: 0; z-index: 5; background: rgba(255, 248, 236, 0.92); backdrop-filter: blur(8px); border-bottom: var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 1.35rem var(--display); }
.brand img { border-radius: 50%; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font: 600 1.05rem var(--display); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--lime-dark); text-decoration-thickness: 4px; }
.foot { margin-top: 48px; border-top: var(--line); background: var(--floor); padding: 32px 0; }
.foot-in { display: grid; gap: 16px; }
.foot-in p { margin: 8px 0 0; color: var(--ink-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { color: var(--ink); font: 600 1rem var(--display); }
.foot .legal { font-size: 0.85rem; }

/* home */
.hero { padding: 32px 0 8px; }
.hero-in { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 24px; }
.kicker { font: 600 1rem var(--display); color: var(--lime-dark); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4em; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-top: 24px; }
.step { background: var(--white); border: var(--line); border-radius: var(--radius); box-shadow: var(--pop); padding: 20px; }
.step h2 { font-size: 1.3rem; margin: 10px 0 6px; }
.step p { margin: 0; color: var(--ink-soft); }
.num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: var(--line); background: var(--lime); font: 700 1.2rem var(--display); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head a { font: 600 1.05rem var(--display); }
.cast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cast-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 18px 20px; border: var(--line); border-radius: var(--radius); box-shadow: var(--pop); background: var(--white); color: var(--ink-soft); text-decoration: none; transition: transform 0.12s; }
.cast-card:hover { transform: translateY(-4px) rotate(-1deg); }
.cast-card img { height: 200px; width: auto; object-fit: contain; }
.cast-name { font: 700 1.5rem var(--display); color: var(--ink); }
.cast-wob { background: #F1FBDD; }
.cast-mia { background: #FDE8E9; }
.cast-ollie { background: #E4EDFC; }
.promise { display: flex; gap: 28px; align-items: center; background: var(--yellow); border: var(--line); border-radius: var(--radius); box-shadow: var(--pop); padding: 28px; }
.promise img { flex: none; width: 160px; }
.promise p { color: var(--ink); }

/* lesson cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.lesson-card { display: flex; flex-direction: column; background: var(--white); border: var(--line); border-radius: var(--radius); box-shadow: var(--pop); overflow: hidden; color: var(--ink); text-decoration: none; transition: transform 0.12s, box-shadow 0.12s; }
.lesson-card:hover { transform: translate(-2px, -3px); box-shadow: 6px 7px 0 var(--ink); }
.lesson-card[hidden] { display: none; }
.lc-img { position: relative; display: block; aspect-ratio: 9 / 12; overflow: hidden; border-bottom: var(--line); background: var(--floor); }
.lc-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.lc-play { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: var(--line); background: var(--us); color: var(--white); font-size: 1.1rem; }
.lc-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 18px; align-items: flex-start; }
.lc-title { font: 700 1.3rem/1.2 var(--display); }
.lc-meta { font-size: 0.9rem; color: var(--ink-soft); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 24px; }
.filter { font: 600 0.95rem var(--display); padding: 8px 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); color: var(--ink); cursor: pointer; }
.filter.is-on { background: var(--ink); color: var(--white); }

/* lesson page */
.crumbs { font-size: 0.95rem; color: var(--ink-soft); padding-top: 20px; }
.crumbs a { color: var(--ink-soft); }
.lesson-head { padding: 16px 0 8px; max-width: 760px; }
.lesson-head h1 { margin-top: 12px; }
.lesson-grid { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 28px; align-items: start; margin-top: 16px; }
.video-col { position: sticky; top: 88px; }
.short { width: 100%; aspect-ratio: 9 / 16; border: var(--line); border-radius: var(--radius); box-shadow: var(--pop); background: var(--ink); }
.video-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.learn-col { display: grid; gap: 20px; }
.box { background: var(--white); border: var(--line); border-radius: var(--radius); box-shadow: var(--pop); padding: 22px 24px; margin-bottom: 20px; }
.learn-col .box { margin-bottom: 0; }
.box > :last-child { margin-bottom: 0; }
.rule { padding: 14px 0; border-top: 2px dashed var(--floor); }
.rule:first-of-type { border-top: 0; padding-top: 4px; }
.rule h3 { margin-bottom: 4px; }
.rule p { margin: 0 0 6px; color: var(--ink-soft); }
.term { font-size: 1.5rem; background: linear-gradient(transparent 60%, var(--lime) 60%); }
.examples { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.examples li { padding: 8px 12px; border-radius: 12px; background: #F0FDF4; }
.examples li.bad { background: #FEF2F2; text-decoration: line-through; text-decoration-color: rgba(220, 38, 38, 0.6); }
.mistake { background: #FFF4D6; }
.tips ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.quiz { margin-top: 28px; background: #F1FBDD; }
.q { padding: 14px 0; border-top: 2px dashed rgba(30, 27, 46, 0.15); }
.q:first-of-type { border-top: 0; }
.q-text { font: 600 1.2rem var(--display); display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.q-num { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--white); font-size: 0.95rem; }
.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opt { font: 600 1.05rem var(--display); padding: 10px 18px; border: var(--line); border-radius: 14px; background: var(--white); color: var(--ink); cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.opt:hover:not(:disabled) { background: var(--yellow); }
.opt:disabled { cursor: default; }
.opt.is-right { background: var(--correct); color: var(--white); }
.opt.is-wrong { background: var(--wrong); color: var(--white); text-decoration: line-through; }
.why { display: none; margin: 10px 0 0; }
.q.is-done .why, .no-js .why { display: block; }
.score { font: 700 1.3rem var(--display); margin: 8px 0 0; }
.sources { font-size: 0.95rem; color: var(--ink-soft); }
.sources h2 { font-size: 1.1rem; }
.sources ul { margin: 0; padding-left: 1.2em; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.pager a { font: 600 1.05rem var(--display); padding: 12px 18px; border: var(--line); border-radius: 999px; background: var(--white); color: var(--ink); text-decoration: none; box-shadow: 3px 3px 0 var(--ink); }

/* about */
.people { display: grid; gap: 20px; }
.person { display: flex; align-items: center; gap: 24px; border: var(--line); border-radius: var(--radius); box-shadow: var(--pop); padding: 20px 24px; scroll-margin-top: 90px; }
.person img { flex: none; width: 170px; height: 220px; object-fit: contain; }
.person-lime { background: #F1FBDD; }
.person-red { background: #FDE8E9; }
.person-blue { background: #E4EDFC; }
.prose h2 { margin-top: 1.4em; font-size: 1.4rem; }

/* phones and tablets */
@media (max-width: 860px) {
  .hero-in, .lesson-grid { grid-template-columns: 1fr; }
  .hero-img { order: -1; max-width: 520px; margin: 0 auto; }
  .steps, .cast { grid-template-columns: 1fr; }
  .video-col { position: static; max-width: 380px; margin: 0 auto; width: 100%; }
  .promise { flex-direction: column; text-align: center; }
  .cast-card { flex-direction: row; text-align: left; }
  .cast-card img { height: 130px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { gap: 12px; }
  .nav a:not(.btn) { font-size: 0.95rem; }
  .brand span { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .lc-title { font-size: 1.05rem; }
  .lc-body { padding: 10px 12px 14px; }
  .lc-body .chip { font-size: 0.72rem; padding: 4px 8px; }
  .lc-play { width: 38px; height: 38px; }
  .box { padding: 18px; }
  .person { flex-direction: column; text-align: center; }
  .foot .brand span { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* printing a lesson as a worksheet */
@media print {
  body { background: none; font-size: 12pt; }
  .top, .foot, .video-col, .crumbs, .pager, .filters, .skip { display: none !important; }
  .lesson-grid { display: block; }
  .box { box-shadow: none; break-inside: avoid; }
  .opt { box-shadow: none; }
  .why { display: none !important; }
  .q-text::after { content: ""; }
}

/* click-to-play YouTube embed (lesson pages with a "youtube" ID) */
.yt { position: relative; overflow: hidden; padding: 0; }
.yt-play { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; }
.yt-play img { width: 100%; height: 100%; object-fit: cover; }
.yt-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; border: var(--line); background: var(--us); color: var(--white); font-size: 2rem; box-shadow: var(--pop); transition: transform 0.12s; }
.yt-play:hover .yt-btn, .yt-play:focus-visible .yt-btn { transform: translate(-50%, -50%) scale(1.08); }
.yt-play:focus-visible { outline: 4px solid var(--yellow); outline-offset: -4px; }
.yt iframe { width: 100%; height: 100%; border: 0; display: block; }
