/* Abacus Hero page and its privacy page. Colours are the app's own (lib/src/ui/theme.dart).
   No web fonts and no third-party requests: this page is for families. */
:root {
  --cream: #FFFBF2; --sand: #F6EFE2; --tray: #F5ECD9; --line: #E2D3BC; --lip: #D6C2A6;
  --ink: #2B1E16; --muted: #6E5A4F;
  --mango: #FF9F1C; --mango-lip: #D97706; --mango-wash: #FFF3D9;
  --teal: #14B8A6; --teal-lip: #0F766E; --teal-wash: #E6FAF7;
  --wood: #B87A44; --teak: #6F4322; --beam: #5A3518;
  --display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Sinhala", "Noto Sans Tamil", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Sinhala", "Noto Sans Tamil", sans-serif;
  --bw: clamp(46px, 12.5vw, 70px); --bh: calc(var(--bw) * 0.54); --gap: calc(var(--bh) * 0.92);
}
*, *::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: 400 1.0625rem/1.6 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-lip); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal-lip); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1080px; margin-inline: auto; padding-inline: clamp(18px, 4vw, 32px); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 9; }
.skip:focus { left: 12px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.5rem, 7vw, 4.4rem); font-weight: 900; line-height: 0.98; letter-spacing: -0.025em; text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

/* Top bar */
.top { border-bottom: 2px solid var(--line); background: var(--cream); }
.top .wrap { display: flex; gap: 6px 22px; align-items: center; padding-block: 14px; overflow-x: auto; white-space: nowrap; }
.top a { color: var(--ink); text-decoration: none; font-weight: 600; padding-block: 4px; border-bottom: 3px solid transparent; }
.top a:hover { border-bottom-color: var(--lip); }
.top a[aria-current="page"] { border-bottom-color: var(--wood); }
.top .home { color: var(--muted); }
.top .push { margin-left: auto; }

/* Hero */
.hero { padding-block: clamp(32px, 6vw, 72px); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.brandline { display: flex; align-items: center; gap: 12px; font: 800 1.15rem/1 var(--display); margin-bottom: 20px; }
.brandline img { width: 52px; height: 52px; border-radius: 14px; border: 2px solid var(--line); }
.hero p.lead { font-size: 1.2rem; margin-top: 20px; }
.get { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; margin-top: 28px; }
.btn { display: inline-block; font: 800 1.1rem/1 var(--display); color: var(--ink); text-decoration: none; background: var(--mango);
  padding: 17px 26px 16px; border-radius: 18px; border: 2px solid var(--mango-lip); border-bottom-width: 6px; }
.btn:hover { color: var(--ink); background: #FFAB38; }
.btn:active { transform: translateY(3px); border-bottom-width: 3px; margin-bottom: 3px; }
.facts-line { margin-top: 18px; }

/* The soroban you can play with */
.tray { background: var(--tray); border: 2px solid var(--line); border-bottom-width: 7px; border-bottom-color: var(--lip); border-radius: 30px; padding: clamp(16px, 3vw, 26px); }
.tray h2 { font-size: 1.25rem; }
.tray .how { margin-top: 6px; }
.frame { margin: 18px auto 0; width: max-content; max-width: 100%; display: flex; gap: clamp(6px, 2vw, 16px); padding: 10px clamp(12px, 3vw, 22px);
  background: #FFF8E9; border: 7px solid var(--teak); border-radius: 22px; position: relative; }
.frame::before { content: ""; position: absolute; left: 0; right: 0; top: calc(10px + var(--bh) + var(--gap)); height: 10px; background: var(--beam); }
.rod { width: calc(var(--bw) + 8px); position: relative; }
.rod::before { content: ""; position: absolute; left: 50%; top: -10px; bottom: -10px; width: 6px; margin-left: -3px; background: var(--wood); border-radius: 3px; }
.rod.unit::after { content: ""; position: absolute; left: 50%; top: calc(var(--bh) + var(--gap) + 2px); width: 6px; height: 6px; margin-left: -3px; background: #fff; border-radius: 50%; z-index: 2; }
.heaven-zone { height: calc(var(--bh) + var(--gap)); position: relative; }
.earth-zone { height: calc(var(--bh) * 4 + var(--gap)); position: relative; margin-top: 10px; }
.bead { position: absolute; left: 50%; width: var(--bw); height: var(--bh); margin-left: calc(var(--bw) / -2); padding: 0; border: 0; background: none; cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.3, 1.3, 0.5, 1); z-index: 1; -webkit-tap-highlight-color: transparent; }
.bead span { display: block; width: 100%; height: 100%; clip-path: polygon(0 50%, 16% 14%, 50% 0, 84% 14%, 100% 50%, 84% 86%, 50% 100%, 16% 86%);
  background: linear-gradient(180deg, #5EDFD1 0 44%, var(--teal) 44% 84%, var(--teal-lip) 84% 100%); }
.bead.heaven span { background: linear-gradient(180deg, #FFC766 0 44%, var(--mango) 44% 84%, var(--mango-lip) 84% 100%); }
.bead.heaven { top: 0; }
.bead.heaven.on { transform: translateY(var(--gap)); }
.bead.earth { top: calc(var(--gap) + var(--bh) * var(--k)); }
.bead.earth.on { transform: translateY(calc(var(--gap) * -1)); }
.places { display: flex; justify-content: center; gap: clamp(6px, 2vw, 16px); margin-top: 12px; }
.places div { width: calc(var(--bw) + 8px); text-align: center; background: #fff; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; padding: 6px 2px 5px; font: 800 clamp(0.72rem, 3vw, 1rem)/1.15 var(--display); white-space: nowrap; }
.places small { display: block; font: 600 0.72rem/1.2 var(--body); color: var(--muted); }
.made { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.made p { font: 800 1.15rem/1.1 var(--display); }
.made output { font-size: 2.3rem; font-weight: 900; margin-left: 6px; font-variant-numeric: tabular-nums; }
.plain-btn { font: 700 1rem/1 var(--display); color: var(--ink); background: #fff; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; padding: 10px 16px; cursor: pointer; }
.plain-btn:hover { border-color: var(--lip); }

/* Sections */
.band { padding-block: clamp(36px, 6vw, 72px); border-top: 2px solid var(--line); }
.band.sand { background: var(--sand); }
.band > .wrap > h2 + p { margin-top: 12px; }

/* Real screens on a shelf */
.shelf { list-style: none; margin: 28px 0 0; padding: 0 0 14px; display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x proximity; }
.shelf li { flex: 0 0 auto; width: min(62vw, 230px); scroll-snap-align: start; }
.shelf img { border-radius: 22px; border: 3px solid var(--ink); background: #fff; }
.shelf figure { margin: 0; }
.shelf figcaption { margin-top: 10px; font-size: 0.95rem; color: var(--muted); }

/* Ten lessons: beads threaded on a rod */
.lessons { list-style: none; margin: 30px 0 0; padding: 0; columns: 2; column-gap: 48px; counter-reset: lesson; }
.lessons li { break-inside: avoid; position: relative; padding: 0 0 22px 74px; counter-increment: lesson; }
.lessons li::before { content: ""; position: absolute; left: 24px; top: 0; bottom: 0; width: 6px; background: var(--wood); border-radius: 3px; }
.lessons li::after { content: counter(lesson); position: absolute; left: 0; top: 0; width: 54px; height: 30px; display: grid; place-items: center;
  font: 900 1rem/1 var(--display); color: #fff; clip-path: polygon(0 50%, 16% 14%, 50% 0, 84% 14%, 100% 50%, 84% 86%, 50% 100%, 16% 86%);
  background: linear-gradient(180deg, #2CC8B8 0 44%, var(--teal-lip) 44% 100%); }
.lessons li:nth-child(5n)::after { color: var(--ink); background: linear-gradient(180deg, #FFC766 0 44%, var(--mango) 44% 100%); }
.lessons p { margin-top: 2px; }
.lessons .also { margin-top: 4px; font-size: 0.95rem; color: var(--muted); }

/* For parents */
.parents { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(28px, 5vw, 64px); margin-top: 28px; align-items: start; }
.parents dl { margin: 0; }
.parents dt { font: 800 1.15rem/1.2 var(--display); margin-top: 22px; }
.parents dt:first-child { margin-top: 0; }
.parents dd { margin: 4px 0 0; max-width: 58ch; }
.gate { background: #fff; border: 2px solid var(--line); border-bottom-width: 6px; border-radius: 24px; padding: 22px; }
.gate .ask { font: 900 1.5rem/1.15 var(--display); text-align: center; background: var(--sand); border: 2px solid var(--line); border-radius: 16px; padding: 18px 14px; }
.gate p { margin-top: 12px; font-size: 0.95rem; color: var(--muted); }
.gate p.ask { margin-top: 0; font-size: 1.5rem; color: var(--ink); }
.gate img { margin: 18px auto 0; width: min(100%, 250px); border-radius: 20px; border: 3px solid var(--ink); }

/* Sinhala and Tamil */
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); margin-top: 8px; }
.langs h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.3; }
.langs ul { margin: 14px 0 0; padding-left: 1.2em; line-height: 1.85; }
.langs p { line-height: 1.85; }

/* Get it */
.getit { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.sheet { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.sheet dt { color: var(--muted); }
.sheet dd { margin: 0; font-weight: 600; }
.more { margin-top: 36px; }
.more a { margin-right: 18px; white-space: nowrap; }

footer { border-top: 2px solid var(--line); padding-block: 28px 40px; font-size: 0.95rem; color: var(--muted); }
footer p + p { margin-top: 6px; }

/* Privacy page */
.policy-head { padding-block: clamp(28px, 5vw, 56px) 8px; }
.policy-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.policy-head p { margin-top: 12px; }
.policy-nav { display: flex; gap: 18px; margin-top: 18px; font-weight: 700; }
.policy section { border-top: 2px solid var(--line); padding-block: 32px; }
.policy section h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.3; }
.policy section h3 { margin-top: 26px; line-height: 1.35; }
.policy section p { margin-top: 10px; max-width: 70ch; }
.policy [lang="si"] p, .policy [lang="ta"] p { line-height: 1.85; }
.policy .summary { margin-top: 16px; background: var(--teal-wash); border-left: 6px solid var(--teal); border-radius: 0 14px 14px 0; padding: 14px 18px; }
.policy .summary p { margin: 0; }
.policy code { font: inherit; overflow-wrap: anywhere; }

/* Screen recording */
.watch { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.watch h2 + p, .watch p + p { margin-top: 12px; }
.player { justify-self: center; width: min(100%, 300px); }
.player video { display: block; width: 100%; height: auto; aspect-ratio: 540 / 1168; border-radius: 26px; border: 3px solid var(--ink); background: var(--cream); }

/* Which version the page describes */
.version-note { margin-top: 16px; font-size: 0.95rem; background: var(--mango-wash); border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; }

@media (max-width: 860px) {
  .hero .wrap, .parents, .langs, .getit, .watch { grid-template-columns: 1fr; }
  .lessons { columns: 1; }
  .top .push { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bead { transition: none; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.also span + span { margin-left: 6px; }
