/* Equal Pals — "two pals make an equals sign". Exercise-book grid, sticker cards, chunky toy buttons.
   Fonts are self-hosted (SIL OFL, licences in assets/fonts). No scripts, no external requests. */

@font-face {
  font-family: "Grandstander";
  src: url("assets/fonts/grandstander.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/atkinson-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #f6f4fd;
  --grid: rgba(98, 104, 206, 0.09);
  --grid-strong: rgba(98, 104, 206, 0.16);
  --ink: #23263f;
  --ink-soft: #4b4f6c;
  --card: #ffffff;
  --line: #2b2e4a;
  --indigo: #4c54c4;
  --indigo-edge: #343b9c;
  --lavender: #e4e5fb;
  --mint: #bfe9d2;
  --mint-strong: #74c99f;
  --butter: #ffe08a;
  --butter-soft: #fff1c7;
  --pink: #ffd0dc;
  /* Sticker colours: fixed, the same in dark mode (not redefined below) */
  --sticker-ink: #23263f;
  --sticker-ink-soft: #3f4363;
  --sticker-card: #ffffff;
  --sticker-butter: #ffe08a;
  --sticker-butter-soft: #fff1c7;
  --sticker-butter-glass: rgba(255, 224, 138, 0.85);
  --sticker-mint: #bfe9d2;
  --sticker-mint-soft: #d6f2e3;
  --sticker-mint-strong: #74c99f;
  --sticker-pink: #ffd0dc;
  --sticker-lavender: #e4e5fb;
  --sticker-peach: #ffdcc2;
  --sticker-peach-soft: #ffe3cf;
  --sticker-sky: #d3e8ff;
  --say-hi-bg: var(--indigo);
  --blob-one-bg: var(--butter);
  --blob-two-bg: var(--pink);
  --zero-bg: var(--lavender);
  --shadow: 0 6px 0 var(--line);
  --shadow-sm: 0 4px 0 var(--line);
  --radius: 28px;
  --display: "Grandstander", "Chalkboard SE", "Comic Sans MS", ui-rounded, system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", ui-rounded, system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161933;
    --grid: rgba(173, 178, 255, 0.07);
    --grid-strong: rgba(173, 178, 255, 0.13);
    --ink: #f2f1ff;
    --ink-soft: #c9cae6;
    --card: #242849;
    --line: #0a0c1f;
    --indigo: #8f96ff;
    --indigo-edge: #5960d6;
    --lavender: #33386a;
    --mint: #2f5c4a;
    --mint-strong: #74c99f;
    --butter: #7a5f12;
    --butter-soft: #1f4a3c;
    --pink: #5a2f3e;
    --say-hi-bg: #343b9c;
    --blob-one-bg: #4c54c4;
    --blob-two-bg: #2f6f55;
    --zero-bg: #2a2f5c;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}

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

a { color: var(--indigo); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--indigo-edge); }
:focus-visible { outline: 4px solid var(--indigo); outline-offset: 4px; border-radius: 12px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

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

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

.skip-link {
  position: absolute; left: 16px; top: -80px; z-index: 10;
  padding: 10px 16px; border-radius: 14px; background: var(--card); color: var(--ink);
  border: 3px solid var(--line); font-weight: 700;
}
.skip-link:focus { top: 16px; }

/* ---------- header ---------- */
.site-header { padding: 22px 0 8px; }
.header-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--display); font-weight: 800; font-size: 1.6rem;
  color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 52px; height: 52px; flex: none; }
.brand:hover .brand-mark { animation: wiggle 0.6s ease-in-out; }

.nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-links a {
  font-weight: 700; color: var(--ink); text-decoration: none;
  padding: 10px 16px; border-radius: 999px; border: 3px solid transparent;
}
.nav-links a:hover { border-color: var(--line); background: var(--card); }
.nav-links a[aria-current="page"] { background: var(--card); border-color: var(--line); }

/* ---------- buttons & chips ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 12px 26px;
  font-family: var(--display); font-weight: 800; font-size: 1.2rem; text-decoration: none;
  color: #1f3a2d; background: var(--mint-strong);
  border: 3px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.button:hover { color: #1f3a2d; transform: translateY(2px); box-shadow: var(--shadow-sm); }
.button:active { transform: translateY(6px); box-shadow: 0 0 0 var(--line); }
.button svg { width: 22px; height: 22px; }

.badge-soon {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 22px 10px 14px;
  border: 3px solid var(--line); border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow-sm);
  font-weight: 700; color: var(--ink);
}
.badge-soon svg { width: 30px; height: 30px; }
.badge-soon small { display: block; font-weight: 400; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.2; }

.sticker {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  border: 3px solid var(--line); box-shadow: var(--shadow-sm);
  font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: var(--sticker-ink);
  white-space: nowrap;
}
.sticker svg { width: 22px; height: 22px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 48px; align-items: center;
  padding: 40px 0 72px;
}
.hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }

.eyebrow {
  display: inline-block; font-family: var(--display); font-weight: 800;
  font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--indigo);
}

.hero h1 { font-size: clamp(2.8rem, 6.4vw, 5.4rem); font-weight: 800; }
.hero h1 .eq {
  display: inline-block; color: var(--indigo);
  transform: rotate(-6deg); padding: 0 0.06em;
}
.hero h1 .underline {
  background: linear-gradient(transparent 62%, var(--butter) 62%, var(--butter) 92%, transparent 92%);
  padding: 0 0.08em; border-radius: 6px;
}
.promise { font-size: clamp(1.15rem, 1.8vw, 1.35rem); color: var(--ink-soft); max-width: 34ch; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 6px; }

.hero-art { position: relative; padding: 36px 24px 48px; }
.ipad {
  position: relative; z-index: 2;
  padding: 16px; border-radius: 40px;
  background: #24273f; border: 3px solid var(--line);
  box-shadow: 0 10px 0 var(--line), 0 30px 60px rgba(35, 38, 80, 0.25);
  transform: rotate(3deg);
}
.ipad img { border-radius: 24px; }
.hero-art .blob {
  position: absolute; z-index: 1; border-radius: 50%;
  border: 3px solid var(--line);
}
.hero-art .blob.b1 { width: 210px; height: 210px; background: var(--blob-one-bg); top: -10px; right: -18px; }
.hero-art .blob.b2 { width: 150px; height: 150px; background: var(--blob-two-bg); bottom: 4px; left: -10px; }
.hero-art .s1 { --r: -8deg; background: var(--sticker-butter); top: 8px; left: 10px; transform: rotate(var(--r)); }
.hero-art .s2 { --r: 5deg; background: var(--sticker-mint); bottom: 14px; right: 8%; transform: rotate(var(--r)); }
.hero-art .s3 { --r: 9deg; background: var(--sticker-pink); top: 44%; right: -12px; transform: rotate(var(--r)); }

.doodle {
  position: absolute; z-index: 0; pointer-events: none;
  font-family: var(--display); font-weight: 800; color: var(--indigo); opacity: 0.18;
  animation: float 7s ease-in-out infinite;
}
.doodle.d1 { font-size: 5rem; top: 0; left: 44%; }
.doodle.d2 { font-size: 3.6rem; bottom: 6%; left: 2%; animation-delay: -2s; }
.doodle.d3 { font-size: 4.2rem; top: 18%; left: -2%; animation-delay: -4s; }
.doodle.d4 { font-size: 3.2rem; bottom: 0; left: 40%; animation-delay: -1s; }

/* ---------- equation strip ---------- */
.equation {
  margin: 0 0 88px;
  padding: 28px; border-radius: var(--radius);
  background: var(--card); border: 3px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-wrap: wrap; gap: 14px 12px; align-items: center; justify-content: center;
}
.term {
  padding: 10px 18px; border-radius: 16px; border: 3px solid var(--line);
  font-family: var(--display); font-weight: 800; font-size: clamp(1.05rem, 2vw, 1.4rem); color: var(--sticker-ink);
}
.term.t1 { background: var(--sticker-lavender); transform: rotate(-2deg); }
.term.t2 { background: var(--sticker-peach); transform: rotate(2deg); }
.term.t3 { background: var(--sticker-sky); transform: rotate(-1deg); }
.term.result { background: var(--sticker-mint-strong); transform: rotate(-2deg); box-shadow: var(--shadow-sm); }
.op { font-family: var(--display); font-weight: 800; font-size: 2rem; color: var(--indigo); line-height: 1; }
.op.eq { font-size: 2.4rem; }

/* ---------- section heads ---------- */
.section { margin: 0 0 96px; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 36px; max-width: 760px; }
.section-head h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 800; }
.section-head p { color: var(--ink-soft); font-size: 1.2rem; }

/* ---------- kids & parents ---------- */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.panel {
  position: relative; padding: 36px 32px 34px; border-radius: var(--radius);
  border: 3px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 18px;
}
.panel.kids { background: var(--butter-soft); transform: rotate(-1deg); }
.panel.parents { background: var(--card); transform: rotate(0.8deg); }
.panel-tag {
  align-self: flex-start; padding: 6px 14px; border-radius: 999px;
  border: 3px solid var(--line); font-family: var(--display); font-weight: 800; font-size: 0.95rem;
  color: var(--sticker-ink);
}
.kids .panel-tag { background: var(--sticker-butter); }
.parents .panel-tag { background: var(--sticker-lavender); }
.panel h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ticks li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.ticks .ic {
  width: 40px; height: 40px; border-radius: 12px; border: 3px solid var(--line);
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.15rem;
  color: var(--sticker-ink);
}
.ticks strong { display: block; font-family: var(--display); font-weight: 800; font-size: 1.15rem; line-height: 1.3; }
.ticks span.txt { color: var(--ink-soft); }
.ic.c1 { background: var(--sticker-peach); }
.ic.c2 { background: var(--sticker-pink); }
.ic.c3 { background: var(--sticker-mint); }
.ic.c4 { background: var(--sticker-sky); }
.ic.c5 { background: var(--sticker-lavender); }
.ic.c6 { background: var(--sticker-butter); }

/* ---------- tiles (like the app's Home pills) ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.tile {
  padding: 22px 20px 24px; border-radius: 24px; border: 3px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px; color: var(--sticker-ink);
  transition: transform 0.18s ease;
}
.tile:hover { transform: translateY(-4px) rotate(-1deg); }
.tile .sym {
  width: 50px; height: 50px; border-radius: 50%; background: var(--sticker-card); border: 3px solid var(--line);
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.35rem;
}
.tile h3 { font-size: 1.3rem; font-weight: 800; }
.tile p { font-size: 1rem; line-height: 1.5; color: var(--sticker-ink-soft); }
.tile.lav { background: var(--sticker-lavender); }
.tile.but { background: var(--sticker-butter-soft); }
.tile.sky { background: var(--sticker-sky); }
.tile.pnk { background: var(--sticker-pink); }
.tile.mnt { background: var(--sticker-mint-soft); }
.tile.pch { background: var(--sticker-peach-soft); }

/* ---------- screens ---------- */
.screens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: start; }
.polaroid {
  margin: 0; padding: 14px 14px 18px; border-radius: 22px;
  background: var(--card); border: 3px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.polaroid:nth-child(1) { transform: rotate(-2.5deg); }
.polaroid:nth-child(2) { transform: rotate(1.5deg) translateY(18px); }
.polaroid:nth-child(3) { transform: rotate(-1deg); }
.polaroid:hover { transform: rotate(0) scale(1.02); }
.polaroid img { border-radius: 12px; border: 2px solid var(--line); }
.polaroid figcaption { padding: 14px 4px 0; font-size: 1rem; color: var(--ink-soft); }
.polaroid figcaption strong { display: block; font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: var(--ink); }

/* ---------- privacy band ---------- */
.zero {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 40px; align-items: center;
  padding: 44px; border-radius: var(--radius);
  background: var(--zero-bg); border: 3px solid var(--line); box-shadow: var(--shadow);
}
.zero .zero-num {
  font-family: var(--display); font-weight: 800; font-size: clamp(7rem, 16vw, 12rem); line-height: 0.85;
  color: var(--indigo); transform: rotate(-6deg);
  text-shadow: 6px 6px 0 var(--mint-strong);
}
.zero h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 800; margin-bottom: 14px; }
.zero p { color: var(--ink-soft); max-width: 60ch; }
.zero p + p { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card);
  font-weight: 700; font-size: 0.95rem; color: var(--ink);
}

/* ---------- footer ---------- */
.site-footer { margin-top: 40px; padding: 0 0 48px; }
.say-hi {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
  padding: 36px 40px; border-radius: var(--radius);
  background: var(--say-hi-bg); border: 3px solid var(--line); box-shadow: var(--shadow);
  color: #ffffff;
}
.say-hi h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; color: #ffffff; }
.say-hi p { color: #e8e9ff; margin-top: 6px; }
.footer-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: center;
  margin-top: 28px; color: var(--ink-soft); font-size: 1rem;
}
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { font-weight: 700; color: var(--ink); }

/* ---------- legal pages ---------- */
.legal {
  margin: 24px auto 0; padding: 48px clamp(22px, 5vw, 64px) 56px;
  width: min(860px, 100% - 32px);
  background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  position: relative;
}
.legal::before {
  content: ""; position: absolute; top: -18px; left: 50%; width: 120px; height: 34px;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--sticker-butter-glass); border: 2px solid var(--line); border-radius: 6px;
}
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; }
.legal .effective { margin: 10px 0 8px; color: var(--ink-soft); }
.legal .summary {
  margin: 22px 0 8px; padding: 18px 22px; border-radius: 18px;
  background: var(--butter-soft); border: 2px dashed var(--line);
}
.legal section { margin-top: 34px; }
.legal h2 {
  font-size: 1.55rem; font-weight: 800; margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
}
.legal h2::before {
  content: "="; flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.3rem; line-height: 1;
  background: var(--mint); border: 2px solid var(--line); color: var(--ink);
}
.legal p { color: var(--ink); }
.legal p + p { margin-top: 12px; }
.legal-footer { width: min(860px, 100% - 32px); margin-inline: auto; }

/* ---------- motion ---------- */
@keyframes rise { from { transform: translateY(28px); } to { transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-14px) rotate(6deg); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes pop { 0% { transform: scale(0.7) rotate(var(--r, 0deg)); } 70% { transform: scale(1.08) rotate(var(--r, 0deg)); } 100% { transform: scale(1) rotate(var(--r, 0deg)); } }

.hero-copy > * { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero-copy > *:nth-child(2) { animation-delay: 0.08s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.24s; }
.ipad { animation: tilt-in 0.9s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes tilt-in { from { transform: rotate(7deg) translateY(30px); } to { transform: rotate(3deg); } }
.hero-art .sticker { animation: pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero-art .s1 { animation-delay: 0.6s; }
.hero-art .s2 { animation-delay: 0.75s; }
.hero-art .s3 { animation-delay: 0.9s; }

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

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .hero-art { max-width: 640px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duo { grid-template-columns: minmax(0, 1fr); }
  .screens { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin-inline: auto; }
  .polaroid:nth-child(2) { transform: rotate(1.5deg); }
}
@media (max-width: 640px) {
  body { font-size: 1.05rem; }
  .brand { font-size: 1.35rem; }
  .brand-mark { width: 44px; height: 44px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .zero { grid-template-columns: minmax(0, 1fr); padding: 30px 24px; gap: 18px; }
  .say-hi { grid-template-columns: minmax(0, 1fr); padding: 28px 24px; }
  .panel { padding: 28px 22px; }
  .equation { padding: 20px 14px; }
  .hero-art { padding: 28px 8px 40px; }
  .hero-art .blob.b1 { width: 140px; height: 140px; }
  .hero-art .blob.b2 { width: 100px; height: 100px; }
  .hero-art .s3 { display: none; }
  .doodle { display: none; }
  .sticker { font-size: 0.95rem; padding: 6px 12px; }
}
