/* ABC.Academy — design system
   Paper: cool tablet-paper white. Ink: navy. Ruling: handwriting-paper blue + margin red.
   Letter blocks carry the colour; the interface chrome stays quiet. */

:root {
  --paper: #F6F9FF;
  --paper-2: #EAF1FC;
  --white: #FFFFFF;
  --ink: #1B2340;
  --ink-2: #4A5578;
  --ink-3: #7D88A8;
  --rule: #8FB2EA;
  --rule-soft: #C9DAF5;
  --red: #E5484D;
  --red-dark: #C2353A;
  --sun: #FFC93C;
  --leaf: #22A86B;
  --sky: #2F7FF0;
  --grape: #7C5CE6;
  --display: "Andika", "Lexend", system-ui, sans-serif;
  --body: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-block: 14px;
  --r-panel: 8px;
  --r-pill: 999px;
  --wrap: 1180px;
  --block-depth: 0 6px 0 rgba(27, 35, 64, .22);
  --lift: 0 14px 30px -18px rgba(27, 35, 64, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.65 var(--body);
  text-rendering: optimizeLegibility;
}
img, svg, video, iframe { max-width: 100%; display: block; }
a { color: var(--sky); text-underline-offset: .18em; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--sun); color: var(--ink); }

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
.lede { font-size: 1.18rem; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 999; border-radius: 6px; }
.skip:focus { left: 8px; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Owner contact bar (every page) ---------- */
.owner-bar { background: var(--ink); color: #fff; font-size: .86rem; }
.owner-bar a { display: block; color: #fff; text-decoration: none; text-align: center; padding: .5rem 1rem; }
.owner-bar a:hover { background: #26315a; color: var(--sun); }
.owner-bar strong { color: var(--sun); font-weight: 600; }

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 2px solid var(--rule-soft); position: sticky; top: 0; z-index: 50; }
.header-row { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.logo-blocks { display: inline-flex; gap: 3px; }
.logo-blocks span { width: 26px; height: 28px; border-radius: 6px; display: grid; place-items: center; font: 700 1rem/1 var(--display); color: #fff; box-shadow: 0 3px 0 rgba(27,35,64,.25); }
.logo-blocks span:nth-child(1) { background: var(--red); }
.logo-blocks span:nth-child(2) { background: var(--sky); transform: translateY(-3px); }
.logo-blocks span:nth-child(3) { background: var(--leaf); }
.logo-word { font: 700 1.3rem/1 var(--display); }
.logo-word small { font-size: .95rem; color: var(--ink-2); font-weight: 400; }

.nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.nav > ul { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; align-items: center; }
.nav a, .nav .dd-btn { display: block; padding: .5rem .7rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav .dd-btn:hover, .nav a[aria-current="page"] { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--red); border-radius: 8px 8px 0 0; }
.dd { position: relative; }
.dd-btn::after { content: ""; display: inline-block; margin-left: .35rem; border: 5px solid transparent; border-top-color: currentColor; transform: translateY(3px); }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; background: var(--white); border: 2px solid var(--rule-soft); border-radius: 12px; padding: .4rem; list-style: none; margin: 0; box-shadow: var(--lift); display: none; }
.dd.open .dd-menu { display: block; }
.dd-menu a { padding: .55rem .7rem; }
.dd-menu a span { display: block; font-size: .8rem; color: var(--ink-3); }
.nav-cta { margin-left: .5rem; }
.menu-toggle { display: none; margin-left: auto; background: var(--paper-2); border: 0; border-radius: 10px; padding: .55rem .75rem; cursor: pointer; font-weight: 600; }

@media (max-width: 1080px) {
  .menu-toggle { display: inline-flex; }
  .nav { position: fixed; inset: 0 0 0 auto; width: min(360px, 88vw); background: var(--white); flex-direction: column; align-items: stretch; padding: 5rem 1rem 2rem; box-shadow: -20px 0 40px -20px rgba(27,35,64,.4); overflow-y: auto; z-index: 60; display: none; }
  .nav.open { display: flex; animation: slidein .22s ease; }
  .nav > ul { flex-direction: column; align-items: stretch; }
  .dd-menu { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 0 .8rem; min-width: 0; }
  .dd-btn { display: none !important; }
  .nav-cta { margin: 1rem 0 0; }
  .nav-close { display: block !important; position: absolute; top: 1rem; right: 1rem; }
  body.menu-open { overflow: hidden; }
}
.nav-close { display: none; background: var(--paper-2); border: 0; border-radius: 10px; padding: .5rem .8rem; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .78rem 1.35rem; border-radius: var(--r-pill); border: 2px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; transition: transform .12s ease, background .15s ease; }
.btn:active { transform: translateY(2px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-dark); }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; box-shadow: 0 4px 0 #0d1330; }
.btn-ink:hover { background: #2b3766; color: #fff; }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--rule-soft); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-sun { background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 #d9a51e; }
.btn-sm { padding: .5rem .95rem; font-size: .9rem; }
.btn-lg { padding: 1rem 1.7rem; font-size: 1.08rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* ---------- Letter blocks (the signature element) ---------- */
.block { --c: var(--sky); display: inline-grid; place-items: center; background: var(--c); color: #fff; border-radius: var(--r-block); box-shadow: var(--block-depth); font: 700 2rem/1 var(--display); width: 64px; height: 68px; border: 0; cursor: pointer; transition: transform .12s ease; position: relative; }
.block:hover { transform: translateY(-3px) rotate(-2deg); }
.block:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(27,35,64,.22); }
.block.c-red { --c: var(--red); } .block.c-sun { --c: var(--sun); color: var(--ink); } .block.c-leaf { --c: var(--leaf); }
.block.c-sky { --c: var(--sky); } .block.c-grape { --c: var(--grape); } .block.c-ink { --c: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 5vw, 4rem); background: var(--white); border-bottom: 2px solid var(--rule-soft); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero h1 { line-height: 1.32; }
.hero-line { display: block; padding: 0 .1em; background:
   linear-gradient(var(--rule), var(--rule)) 0 21% / 100% 2px no-repeat,
   repeating-linear-gradient(90deg, var(--rule) 0 12px, transparent 12px 22px) 0 50% / 100% 2px no-repeat,
   linear-gradient(var(--red), var(--red)) 0 81% / 100% 2px no-repeat; }
.hero .lede { margin-bottom: 1.6rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1.5rem; padding: 0; list-style: none; font-size: .92rem; color: var(--ink-2); }
.hero-trust li::before { content: "✓"; color: var(--leaf); font-weight: 700; margin-right: .4rem; }

.board { background: var(--paper); border: 2px solid var(--rule-soft); border-radius: 18px; padding: 1.4rem; position: relative; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.board-head h2 { font-size: 1.25rem; margin: 0; }
.alpha-wall { display: grid; grid-template-columns: repeat(7, 1fr); gap: .55rem; }
.alpha-wall .block { width: 100%; height: auto; aspect-ratio: 1 / 1.06; font-size: clamp(1.2rem, 2.4vw, 1.75rem); }
.board-foot { margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .92rem; color: var(--ink-2); }
.said { font: 700 1.4rem/1.2 var(--display); color: var(--ink); min-height: 1.7rem; }
.drop-in .block { animation: drop .5s cubic-bezier(.3,1.4,.6,1) both; }
@keyframes drop { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .alpha-wall { grid-template-columns: repeat(6, 1fr); gap: .4rem; } }

/* ---------- Sections ---------- */
.section { padding: clamp(2.8rem, 6vw, 4.8rem) 0; }
.section.alt { background: var(--paper-2); }
.section.ink { background: var(--ink); color: #fff; }
.section.ink .lede, .section.ink .muted { color: #C8D0EA; }
.section-head { max-width: 720px; margin-bottom: 2rem; }
.section-head.row { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1.25rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }

.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 2.5rem; align-items: start; }
.split.split-narrow { grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; }
@media (max-width: 960px) { .split, .split.split-narrow { grid-template-columns: minmax(0, 1fr); } }

/* Tool shelf: tools sit like books on a shelf, each with its own block */
.shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.shelf a { display: grid; grid-template-columns: 58px 1fr; gap: .9rem; align-items: start; padding: 1.3rem 1.1rem 1.4rem 0; text-decoration: none; color: var(--ink); border-bottom: 2px solid var(--rule-soft); }
.shelf a:hover h3 { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 3px; }
.shelf .block { width: 58px; height: 60px; font-size: 1.5rem; pointer-events: none; }
.shelf h3 { font-size: 1.15rem; margin: .1rem 0 .25rem; }
.shelf p { margin: 0; font-size: .92rem; color: var(--ink-2); }
@media (max-width: 960px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .shelf { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--white); border: 2px solid var(--rule-soft); border-radius: var(--r-panel); padding: 1.35rem; }
.card h3 { margin-top: 0; }
.card.link { text-decoration: none; color: var(--ink); display: block; transition: border-color .15s; }
.card.link:hover { border-color: var(--ink); }
.card .meta { font-size: .85rem; color: var(--ink-3); margin-bottom: .4rem; }
.panel { background: var(--white); border-radius: 18px; border: 2px solid var(--rule-soft); padding: clamp(1.25rem, 3vw, 2rem); }
.panel.ruled-top { border-top: 6px solid var(--red); }
.chip { display: inline-block; padding: .2rem .65rem; border-radius: var(--r-pill); background: var(--paper-2); font-size: .8rem; color: var(--ink-2); }
.chip.on { background: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chips button.chip { border: 0; cursor: pointer; font-size: .88rem; padding: .4rem .85rem; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { border-left: 4px solid var(--rule); padding-left: .9rem; }
.stat b { display: block; font: 700 1.6rem/1.1 var(--display); }
.stat span { font-size: .88rem; color: var(--ink-2); }
@media (max-width: 760px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

.daily { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.daily .card { border-top: 6px solid var(--sun); }
.daily .card:nth-child(2) { border-top-color: var(--leaf); }
.daily .card:nth-child(3) { border-top-color: var(--grape); }
.daily .big { font: 700 2.6rem/1.1 var(--display); margin: .2rem 0 .4rem; }
@media (max-width: 860px) { .daily { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Lead capture ---------- */
.lead-band { background: var(--ink); color: #fff; border-radius: 22px; padding: clamp(1.5rem, 4vw, 2.8rem); display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; }
.lead-band h2 { color: #fff; }
.lead-band p { color: #C8D0EA; }
.lead-band ul { margin: 0 0 1rem; padding-left: 1.2rem; color: #E1E6F5; }
@media (max-width: 860px) { .lead-band { grid-template-columns: minmax(0, 1fr); } }

.form-card { background: var(--white); color: var(--ink); border-radius: 16px; padding: clamp(1.2rem, 3vw, 1.8rem); border: 2px solid var(--rule-soft); }
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label, .legend { font-weight: 600; font-size: .93rem; }
.field .hint { font-size: .8rem; color: var(--ink-3); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: .72rem .85rem; border: 2px solid var(--rule-soft); border-radius: 10px; background: var(--white); }
input:focus, select:focus, textarea:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px rgba(47,127,240,.18); }
textarea { min-height: 120px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .row2 { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; margin-bottom: .8rem; }
.check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--red); flex-shrink: 0; }
.hp { position: absolute !important; left: -5000px !important; }
.form-note { font-size: .8rem; color: var(--ink-3); margin-top: .6rem; }
.form-done { display: none; text-align: center; padding: 1.5rem .5rem; }
.form-done .block { margin: 0 auto 1rem; }
form.sent > *:not(.form-done) { display: none !important; }
form.sent .form-done { display: block; }

.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opt span { display: block; padding: .8rem .9rem; border: 2px solid var(--rule-soft); border-radius: 12px; background: var(--white); font-size: .93rem; cursor: pointer; height: 100%; }
.opt span b { display: block; font-size: 1.4rem; margin-bottom: .15rem; }
.opt input:checked + span { border-color: var(--ink); background: var(--paper-2); box-shadow: inset 0 -4px 0 var(--red); }
.opt input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }

.stepper { display: flex; gap: .4rem; margin-bottom: 1.2rem; }
.stepper i { flex: 1; height: 8px; border-radius: 99px; background: var(--rule-soft); }
.stepper i.on { background: var(--red); }
.step { display: none; }
.step.active { display: block; animation: fade .2s ease; }
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.step-nav { display: flex; justify-content: space-between; gap: .8rem; margin-top: 1rem; }
.step-count { font-size: .85rem; color: var(--ink-3); margin-bottom: .2rem; }

.trust-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .55rem; }
.trust-list li { display: flex; gap: .6rem; align-items: flex-start; }
.trust-list li::before { content: ""; width: 18px; height: 18px; border-radius: 5px; background: var(--leaf); flex-shrink: 0; margin-top: .25rem; box-shadow: 0 2px 0 rgba(0,0,0,.2); }

/* ---------- Donation ---------- */
.tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.tier { border: 2px solid var(--rule-soft); background: var(--white); border-radius: 14px; padding: 1rem; cursor: pointer; text-align: left; }
.tier b { font: 700 1.6rem/1 var(--display); display: block; }
.tier span { font-size: .85rem; color: var(--ink-2); }
.tier[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 -5px 0 var(--sun); }
.alloc { display: grid; gap: .6rem; }
.alloc-row { display: grid; grid-template-columns: 170px 1fr 48px; gap: .8rem; align-items: center; font-size: .92rem; }
.alloc-bar { height: 14px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.alloc-bar i { display: block; height: 100%; border-radius: 99px; }
.toggle { display: inline-flex; background: var(--paper-2); border-radius: 99px; padding: 4px; }
.toggle button { border: 0; background: none; padding: .45rem 1rem; border-radius: 99px; cursor: pointer; font-weight: 600; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C8D0EA; padding: 3.5rem 0 1.5rem; margin-top: 0; font-size: .93rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--sun); text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 2rem; }
.foot-grid h4 { color: #fff; font-size: 1rem; margin-bottom: .8rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.foot-news { display: flex; gap: .5rem; margin-top: .8rem; }
.foot-news input { background: #26315a; border-color: #3a4677; color: #fff; }
.foot-news input::placeholder { color: #9aa6cc; }
.foot-legal { border-top: 1px solid #333f6c; margin-top: 2.5rem; padding-top: 1.2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .82rem; }
@media (max-width: 960px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Page header ---------- */
.page-head { background: var(--white); border-bottom: 2px solid var(--rule-soft); padding: clamp(2rem, 5vw, 3.4rem) 0 clamp(1.6rem, 4vw, 2.6rem); }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: .8rem; }
.crumbs a { color: var(--ink-2); }

/* ---------- Prose (guides, legal) ---------- */
.prose { font-size: 1.06rem; line-height: 1.75; }
.prose h2 { font-size: 1.7rem; margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose blockquote { margin: 1.5rem 0; padding: 1rem 1.2rem; border-left: 5px solid var(--sun); background: var(--white); border-radius: 0 10px 10px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .95rem; background: var(--white); }
.prose th, .prose td { border: 1px solid var(--rule-soft); padding: .6rem .7rem; text-align: left; vertical-align: top; }
.prose th { background: var(--paper-2); }
.toc { background: var(--white); border: 2px solid var(--rule-soft); border-radius: 12px; padding: 1rem 1.2rem; margin: 1.5rem 0; font-size: .95rem; }
.toc ol { margin: .4rem 0 0; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start; }
.article-aside { position: sticky; top: 90px; display: grid; gap: 1rem; }
@media (max-width: 980px) { .article-layout { grid-template-columns: minmax(0, 1fr); } .article-aside { position: static; } }
.inline-cta { background: var(--paper-2); border-radius: 14px; padding: 1.3rem; margin: 2rem 0; border: 2px dashed var(--rule); }
.inline-cta h3 { margin-top: 0; }

/* ---------- Tool UIs ---------- */
.tool { background: var(--white); border: 2px solid var(--rule-soft); border-radius: 20px; padding: clamp(1rem, 3vw, 1.8rem); }
.tool-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.letter-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: .45rem; }
.letter-grid .block { width: 100%; height: auto; aspect-ratio: 1 / 1.05; font-size: clamp(1rem, 2vw, 1.5rem); }
.letter-grid .block[aria-pressed="true"] { outline: 4px solid var(--ink); outline-offset: 2px; }
@media (max-width: 760px) { .letter-grid { grid-template-columns: repeat(7, 1fr); } }
.letter-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
@media (max-width: 860px) { .letter-stage { grid-template-columns: minmax(0, 1fr); } }
.letter-card { background: var(--paper); border-radius: 16px; padding: 1.4rem; text-align: center; }
.letter-big { font: 700 clamp(5rem, 14vw, 9rem)/1 var(--display); color: var(--ink); display: flex; justify-content: center; gap: 1.5rem; }
.letter-big span:last-child { color: var(--red); }
.word-list { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1rem; }
.word-chip { background: var(--white); border: 2px solid var(--rule-soft); border-radius: 12px; padding: .5rem .8rem; cursor: pointer; font-size: 1.05rem; }
.word-chip em { font-style: normal; font-size: 1.5rem; display: block; }
.word-chip:hover { border-color: var(--ink); }
.trace-wrap { position: relative; background: var(--white); border: 2px solid var(--rule-soft); border-radius: 16px; overflow: hidden; touch-action: none; }
.trace-wrap canvas { width: 100%; height: 320px; display: block; cursor: crosshair; }
.trace-tools { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; justify-content: center; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--rule-soft); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }

.builder { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .8rem; margin: 1.2rem 0; }
.builder select { width: auto; font: 700 1.8rem/1 var(--display); padding: .4rem .7rem; }
.builder .eq { font: 700 2rem/1 var(--display); color: var(--ink-3); }
.result-word { font: 700 clamp(2.5rem, 7vw, 4rem)/1 var(--display); text-align: center; }
.result-word .emo { display: block; font-size: 3rem; margin-bottom: .3rem; }
.result-note { text-align: center; color: var(--ink-2); min-height: 1.6rem; }

.flash { background: var(--paper); border-radius: 18px; padding: 2.5rem 1rem; text-align: center; font: 700 clamp(3rem, 10vw, 5.5rem)/1.1 var(--display); border: 2px dashed var(--rule); margin: 1rem 0; }
.quiz-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin-top: 1rem; }
.quiz-opts button { font: 700 1.6rem/1.2 var(--display); padding: 1rem; border-radius: 14px; border: 2px solid var(--rule-soft); background: var(--white); cursor: pointer; }
.quiz-opts button.right { background: #dff5ea; border-color: var(--leaf); }
.quiz-opts button.wrong { background: #fde4e5; border-color: var(--red); }
.progress-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.progress-dots i { width: 10px; height: 10px; border-radius: 3px; background: var(--rule-soft); }
.progress-dots i.ok { background: var(--leaf); }

.hundred { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.hundred button { aspect-ratio: 1; border: 1px solid var(--rule-soft); background: var(--white); border-radius: 6px; font: 600 clamp(.7rem, 1.6vw, 1rem)/1 var(--body); cursor: pointer; padding: 0; }
.hundred button.hl { background: var(--sun); border-color: #d9a51e; }
.tenframe { display: grid; grid-template-columns: repeat(5, 56px); gap: 6px; justify-content: center; margin: 1rem 0; }
.tenframe button { width: 56px; height: 56px; border: 2px solid var(--ink); background: var(--white); border-radius: 8px; cursor: pointer; font-size: 1.8rem; line-height: 1; }
.count-area { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; font-size: 2.4rem; min-height: 120px; align-content: center; padding: 1rem; background: var(--paper); border-radius: 16px; }
.mathq { font: 700 clamp(2.4rem, 7vw, 3.6rem)/1.2 var(--display); text-align: center; margin: 1rem 0; }

/* Games */
.game-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.game-picker button { text-align: left; background: var(--white); border: 2px solid var(--rule-soft); border-radius: 14px; padding: 1rem; cursor: pointer; }
.game-picker button b { display: block; font: 700 1.1rem/1.2 var(--display); margin-top: .5rem; }
.game-picker button span { font-size: .85rem; color: var(--ink-2); }
.game-picker button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 -5px 0 var(--red); }
.game-picker .emo { font-size: 2rem; }
.stage { background: var(--paper); border: 2px solid var(--rule-soft); border-radius: 20px; min-height: 420px; padding: 1.2rem; position: relative; overflow: hidden; }
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stars { font-weight: 700; }
.prompt-line { font: 700 1.5rem/1.3 var(--display); text-align: center; margin: .5rem 0 1rem; }
.bubble-field { position: relative; height: 330px; }
.bubble { position: absolute; width: 72px; height: 72px; border-radius: 50%; border: 0; font: 700 1.8rem/1 var(--display); color: #fff; cursor: pointer; box-shadow: inset -6px -8px 0 rgba(0,0,0,.12); }
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; max-width: 520px; margin: 0 auto; }
.mem-card { aspect-ratio: 1; border-radius: 14px; border: 0; font: 700 2rem/1 var(--display); cursor: pointer; background: var(--ink); color: var(--ink); box-shadow: var(--block-depth); }
.mem-card.up, .mem-card.done { background: var(--white); color: var(--ink); border: 2px solid var(--rule-soft); }
.mem-card.done { opacity: .5; }
.pic-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; max-width: 560px; margin: 0 auto; }
.pic-choices button { font-size: 3rem; padding: 1rem; border-radius: 16px; border: 2px solid var(--rule-soft); background: var(--white); cursor: pointer; }
.pic-choices button small { display: block; font-size: .9rem; }
.big-emoji { font-size: 4.5rem; text-align: center; line-height: 1.2; }
.slots { display: flex; justify-content: center; gap: .5rem; margin: 1rem 0; }
.slots span { width: 60px; height: 66px; border-bottom: 4px solid var(--ink); display: grid; place-items: center; font: 700 2rem/1 var(--display); }
.tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.tiles .block { width: 58px; height: 62px; font-size: 1.7rem; }
.celebrate { position: absolute; inset: 0; display: none; place-items: center; background: rgba(246,249,255,.92); text-align: center; z-index: 5; }
.celebrate.show { display: grid; }

/* Worksheets */
.ws-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 980px) { .ws-layout { grid-template-columns: minmax(0, 1fr); } }
.ws-controls { position: sticky; top: 90px; }
.sheet { background: #fff; width: 100%; max-width: 816px; aspect-ratio: 8.5 / 11; margin: 0 auto; padding: 5.5% 6%; box-shadow: var(--lift); border: 1px solid var(--rule-soft); color: #111; overflow: hidden; font-family: var(--display); }
.sheet-head { display: flex; justify-content: space-between; align-items: end; border-bottom: 2px solid #111; padding-bottom: .4rem; margin-bottom: 1rem; font-family: var(--body); font-size: .85rem; }
.sheet h2 { font-size: 1.5rem; margin: 0 0 .3rem; text-align: center; }
.sheet .ins { text-align: center; font-family: var(--body); font-size: .85rem; margin-bottom: .8rem; }
.trace-row { position: relative; height: 62px; margin-bottom: 14px; display: flex; align-items: center; gap: 0; font-size: 48px; line-height: 1; white-space: nowrap; overflow: hidden;
  background:
   linear-gradient(#5b8de0, #5b8de0) 0 10% / 100% 1.5px no-repeat,
   repeating-linear-gradient(90deg, #8fb2ea 0 8px, transparent 8px 14px) 0 50% / 100% 1.5px no-repeat,
   linear-gradient(#e5484d, #e5484d) 0 88% / 100% 2px no-repeat; }
.trace-row .ghost { color: transparent; -webkit-text-stroke: 1.3px #9aa3b8; letter-spacing: .32em; padding-left: .2em; }
.trace-row .solid { color: #111; letter-spacing: .32em; padding-left: .2em; }
.ws-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 2rem; font-family: var(--body); }
.ws-prob { font: 600 1.35rem/1.3 var(--body); display: flex; gap: .5rem; align-items: baseline; }
.ws-prob .n { font-size: .8rem; color: #666; width: 1.6rem; }
.ws-key { margin-top: 1rem; border-top: 1px dashed #999; padding-top: .5rem; font: .75rem/1.4 var(--body); color: #555; }
.ws-cvc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.ws-cvc div { border: 1.5px solid #ccc; border-radius: 10px; padding: .6rem; display: flex; gap: .8rem; align-items: center; font-family: var(--body); }
.ws-cvc em { font-style: normal; font-size: 2.6rem; }
.ws-cvc span { flex: 1; border-bottom: 2px solid #333; height: 2.2rem; }
.cert { border: 10px double var(--sky); height: 100%; display: grid; place-items: center; text-align: center; padding: 2rem; }
.cert h2 { font-size: 2.4rem; }
.cert .name { font-size: 2.6rem; border-bottom: 2px solid #111; padding: 0 2rem; margin: .8rem 0; }

/* Stories */
.story-text { font: 400 clamp(1.3rem, 2.6vw, 1.7rem)/1.8 var(--display); }
.story-text span.w { border-radius: 4px; padding: 0 2px; cursor: pointer; }
.story-text span.w.on { background: var(--sun); }
.story-illus { font-size: 3.5rem; letter-spacing: .3rem; text-align: center; margin-bottom: 1rem; }

/* Videos */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.vcard { background: var(--white); border: 2px solid var(--rule-soft); border-radius: 14px; overflow: hidden; }
.lite { position: relative; aspect-ratio: 16/9; background: #000 center/cover no-repeat; cursor: pointer; border: 0; width: 100%; padding: 0; display: block; }
.lite::after { content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; transform: translate(-50%, -50%); border-radius: 12px; background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/26px no-repeat; }
.lite iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vcard .vbody { padding: .8rem 1rem 1rem; }
.vcard h3 { font: 600 .98rem/1.35 var(--body); margin: 0 0 .3rem; }
.vcard .meta { font-size: .8rem; color: var(--ink-3); }

.news-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.news-list li { padding: .9rem 0; border-bottom: 1px solid var(--rule-soft); }
.news-list a { font-weight: 600; color: var(--ink); text-decoration: none; }
.news-list a:hover { text-decoration: underline; }
.news-list .meta { font-size: .8rem; color: var(--ink-3); }

/* Quiz / readiness */
.q-card { background: var(--white); border: 2px solid var(--rule-soft); border-radius: 16px; padding: 1.4rem; }
.scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .8rem; }
.scale label { position: relative; }
.scale input { position: absolute; opacity: 0; }
.scale span { display: block; text-align: center; padding: .7rem .4rem; border: 2px solid var(--rule-soft); border-radius: 10px; cursor: pointer; font-size: .9rem; }
.scale input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.scale input:focus-visible + span { outline: 3px solid var(--sun); }
.meter { height: 16px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--leaf); border-radius: 99px; transition: width .6s ease; }

/* FAQ */
.faq details { border-bottom: 2px solid var(--rule-soft); padding: 1rem 0; }
.faq summary { font-weight: 600; cursor: pointer; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; font: 700 1.4rem/1 var(--display); color: var(--red); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: .7rem 0 0; color: var(--ink-2); }

/* Toast, modal, sticky CTA, cookie */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: .8rem 1.2rem; border-radius: 12px; z-index: 300; transition: transform .25s ease; max-width: 92vw; }
.toast.show { transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; background: rgba(27,35,64,.55); display: none; place-items: center; z-index: 200; padding: 1rem; }
.modal.show { display: grid; }
.modal-box { background: var(--white); border-radius: 20px; padding: clamp(1.3rem, 4vw, 2.2rem); max-width: 520px; width: 100%; position: relative; border-top: 8px solid var(--red); max-height: 92vh; overflow-y: auto; }
.modal-x { position: absolute; top: .7rem; right: .7rem; border: 0; background: var(--paper-2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; background: var(--white); border-top: 2px solid var(--rule-soft); padding: .6rem 1rem; display: none; gap: .6rem; align-items: center; justify-content: space-between; z-index: 90; font-size: .9rem; }
@media (max-width: 760px) { .sticky-cta.show { display: flex; } body.has-sticky { padding-bottom: 64px; } }
.cookie { position: fixed; left: 1rem; bottom: 1rem; max-width: 420px; background: var(--white); border: 2px solid var(--rule-soft); border-radius: 14px; padding: 1rem 1.1rem; z-index: 150; box-shadow: var(--lift); font-size: .88rem; display: none; }
.cookie.show { display: block; }
.cookie .btn-row { margin-top: .6rem; }

.search-box { display: flex; gap: .5rem; }
.result-item { padding: 1rem 0; border-bottom: 1px solid var(--rule-soft); }
.result-item a { font-weight: 600; font-size: 1.1rem; }
.notice { background: #FFF6D9; border: 2px solid #F3D47A; border-radius: 12px; padding: .9rem 1.1rem; font-size: .92rem; }

/* Contest */
.theme-card { background: var(--white); border-radius: 18px; border: 2px solid var(--rule-soft); padding: 1.5rem; display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; }
.countdown { display: flex; gap: .6rem; }
.countdown div { background: var(--ink); color: #fff; border-radius: 10px; padding: .5rem .7rem; text-align: center; min-width: 64px; }
.countdown b { display: block; font: 700 1.5rem/1 var(--display); }
.countdown span { font-size: .72rem; color: #C8D0EA; }
.timeline { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 1rem; }
.timeline li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: .8rem; align-items: start; }
.timeline li::before { content: counter(step); width: 44px; height: 46px; border-radius: 12px; background: var(--sky); color: #fff; display: grid; place-items: center; font: 700 1.3rem/1 var(--display); box-shadow: var(--block-depth); }
.timeline li:nth-child(2)::before { background: var(--leaf); }
.timeline li:nth-child(3)::before { background: var(--sun); color: var(--ink); }
.timeline li:nth-child(4)::before { background: var(--grape); }
.timeline li:nth-child(5)::before { background: var(--red); }

.job { background: var(--white); border: 2px solid var(--rule-soft); border-radius: 14px; padding: 1.2rem 1.3rem; display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.job h3 { margin: 0 0 .2rem; font-size: 1.15rem; }
@media (max-width: 600px) { .job { grid-template-columns: minmax(0, 1fr); } }

.pkg { background: var(--white); border: 2px solid var(--rule-soft); border-radius: 16px; padding: 1.4rem; display: flex; flex-direction: column; }
.pkg.feature { border-color: var(--ink); box-shadow: inset 0 6px 0 var(--red); }
.pkg ul { padding-left: 1.1rem; margin: .4rem 0 1rem; flex: 1; }
.pkg .price { font: 700 1.6rem/1.1 var(--display); margin: .3rem 0; }

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

/* ---------- Print: worksheets and articles ---------- */
@media print {
  @page { size: letter; margin: 0; }
  body { background: #fff; }
  .owner-bar, .site-header, .site-footer, .no-print, .ws-controls, .page-head, .cookie, .sticky-cta, .modal, .toast, ins.adsbygoogle, .google-auto-placed { display: none !important; }
  .ws-layout { display: block; }
  .sheet { box-shadow: none; border: 0; max-width: none; width: 8.5in; height: 11in; aspect-ratio: auto; padding: .55in .6in; page-break-after: always; }
  .section { padding: 0; }
}
