/*
Theme Name: Irewole Quest
Theme URI: https://irewole.quest
Author: Irewole Quest
Description: A bright explorer-island theme for Irewole Quest: stories, maths, puzzles, a creative cove and a bookshop for readers aged 8 to 15.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: irewole-quest
*/

@font-face { font-family: "Fredoka"; src: url("assets/fonts/fredoka-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("assets/fonts/fredoka-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F3FAFF;
  --surface: #FFFFFF;
  --ink: #1A1D3F;
  --muted: #545A86;
  --accent: #FF5A5F;
  --accent-dark: #D93A40;
  --sun: #FFD23F;
  --line: #DCE8F5;
  --story: #F15BB5;  --story-dark: #B8237E;  --story-soft: #FDE3F2;
  --maths: #10B981;  --maths-dark: #047857;  --maths-soft: #D5F7EA;
  --puzzle: #FF9F1C; --puzzle-dark: #B45309; --puzzle-soft: #FFEBCC;
  --creative: #8B5CF6; --creative-dark: #5B32C2; --creative-soft: #ECE4FF;
  --shop: #0EA5E9;   --shop-dark: #0369A1;   --shop-soft: #D8F1FD;
  --grown: #14B8A6;  --grown-dark: #0F766E;  --grown-soft: #D4F5F1;
  --zone: var(--accent); --zone-dark: var(--accent-dark); --zone-soft: #FFE3E4;
  --ayo: #10B981; --ayo-dark: #0B8A61;
  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  --r-sm: 12px; --r-md: 22px; --r-pill: 999px;
  --wrap: 1160px;
  --shadow: 0 10px 30px rgba(26, 29, 63, .08);
}
.zone-story    { --zone: var(--story);    --zone-dark: var(--story-dark);    --zone-soft: var(--story-soft);    --ayo: var(--story);    --ayo-dark: var(--story-dark); }
.zone-maths    { --zone: var(--maths);    --zone-dark: var(--maths-dark);    --zone-soft: var(--maths-soft);    --ayo: var(--maths);    --ayo-dark: var(--maths-dark); }
.zone-puzzle   { --zone: var(--puzzle);   --zone-dark: var(--puzzle-dark);   --zone-soft: var(--puzzle-soft);   --ayo: var(--puzzle);   --ayo-dark: var(--puzzle-dark); }
.zone-creative { --zone: var(--creative); --zone-dark: var(--creative-dark); --zone-soft: var(--creative-soft); --ayo: var(--creative); --ayo-dark: var(--creative-dark); }
.zone-shop     { --zone: var(--shop);     --zone-dark: var(--shop-dark);     --zone-soft: var(--shop-soft);     --ayo: var(--shop);     --ayo-dark: var(--shop-dark); }
.zone-grown    { --zone: var(--grown);    --zone-dark: var(--grown-dark);    --zone-soft: var(--grown-soft);    --ayo: var(--grown);    --ayo-dark: var(--grown-dark); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 18px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
:where(h1, h2, h3, h4, p, ul, ol, figure, blockquote) { margin: 0; }
:where(h1, h2, h3, h4) { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }

/* Buttons and chips */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border: 0; border-radius: var(--r-pill);
  background: var(--accent); color: #FFFFFF; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.1;
  box-shadow: 0 5px 0 var(--accent-dark); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--accent-dark); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-dark); }
.btn svg { width: 20px; height: 20px; }
.btn--zone { background: var(--zone-dark); box-shadow: 0 5px 0 color-mix(in srgb, var(--zone-dark) 70%, #000); }
.btn--zone:hover { box-shadow: 0 7px 0 color-mix(in srgb, var(--zone-dark) 70%, #000); }
.btn--ghost { background: var(--surface); color: var(--ink); box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); }
.btn--ghost:hover { box-shadow: 0 7px 0 var(--line); }
.btn--small { padding: 10px 18px; font-size: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-pill); border: 2px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: 15px; cursor: pointer; color: var(--ink);
}
.chip[aria-pressed="true"], .chip.is-active { background: var(--zone-soft); border-color: var(--zone); color: var(--zone-dark); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); }
.admin-bar .site-header { top: 32px; }
.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand__badge { width: 52px; height: 52px; border-radius: 16px; background: var(--sun); display: grid; place-items: center; overflow: hidden; box-shadow: 0 4px 0 #E0B21E; }
.brand__badge svg { width: 62px; height: auto; margin: 4px -14px 0 0; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.brand__name span { color: var(--accent); }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0; }
.site-nav a { display: block; padding: 8px 14px; border-radius: var(--r-pill); text-decoration: none; font-weight: 700; font-size: 16px; }
.site-nav a:hover { background: var(--surface); }
.site-nav a[aria-current="page"] { background: var(--nav-c, var(--zone-soft)); color: var(--ink); }
.site-nav .nav-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--nav-c); margin-right: 6px; }
.header-cta { flex-shrink: 0; }
.nav-toggle { display: none; margin-left: auto; width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 22px; height: 3px; border-radius: 3px; background: var(--ink); margin: auto; position: relative; content: ""; }
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .site-nav, .header-cta { display: none; }
  .site-header.is-open .site-nav { display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 2px solid var(--line); padding: 12px 16px 20px; }
  .site-header.is-open .site-nav ul { flex-direction: column; }
  .site-header.is-open .site-nav a { font-size: 20px; padding: 12px 16px; }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* Home hero */
.hero { position: relative; overflow: hidden; padding: 56px 0 24px; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; }
.hero__kicker { display: inline-flex; align-items: center; gap: 8px; background: var(--sun); color: var(--ink); font-weight: 700; padding: 6px 16px; border-radius: var(--r-pill); font-size: 15px; transform: rotate(-2deg); margin-bottom: 18px; }
.hero h1 { font-size: clamp(42px, 6vw, 76px); font-weight: 700; line-height: 1.02; }
.hero h1 .rainbow { display: inline-block; }
.hero h1 .rainbow span:nth-child(5n+1) { color: var(--story); }
.hero h1 .rainbow span:nth-child(5n+2) { color: var(--puzzle); }
.hero h1 .rainbow span:nth-child(5n+3) { color: var(--maths); }
.hero h1 .rainbow span:nth-child(5n+4) { color: var(--shop); }
.hero h1 .rainbow span:nth-child(5n+5) { color: var(--creative); }
.hero__lead { font-size: 21px; color: var(--muted); max-width: 34ch; margin: 18px 0 28px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__art { position: relative; }
.hero__blob { position: absolute; inset: 6% 0 0 8%; background: var(--sun); border-radius: 46% 54% 42% 58% / 56% 44% 56% 44%; transform: rotate(-6deg); }
.hero__blob::after { content: ""; position: absolute; width: 46%; aspect-ratio: 1; right: -6%; top: -8%; border-radius: 50%; background: var(--story); opacity: .9; }
.hero__art .ayo { position: relative; width: 112%; max-width: none; margin-left: -6%; filter: drop-shadow(0 14px 0 rgba(26,29,63,.08)); }
.hero__bubble { position: absolute; left: -4%; top: 2%; background: var(--surface); border: 3px solid var(--ink); border-radius: 22px; padding: 10px 16px; font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.2; max-width: 220px; transform: rotate(-4deg); z-index: 2; }
.hero__bubble::after { content: ""; position: absolute; right: 30px; bottom: -14px; width: 22px; height: 22px; background: var(--surface); border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg); }
@media (max-width: 860px) {
  .hero { padding-top: 32px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 420px; margin: 0 auto; }
  .hero__bubble { left: 0; }
}

/* Map */
.map-section { padding: 32px 0 56px; }
.map {
  position: relative; border-radius: 32px; overflow: hidden; border: 4px solid var(--surface);
  box-shadow: 0 0 0 2px var(--line), var(--shadow); aspect-ratio: 1200 / 720; background: #7DD3FC;
}
.map > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map__title { position: absolute; left: 20px; top: 18px; background: var(--surface); padding: 10px 18px; border-radius: 18px; box-shadow: var(--shadow); z-index: 3; }
.map__title strong { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1.1; }
.map__title small { color: var(--muted); font-weight: 700; font-size: 14px; }
.map-pin {
  position: absolute; z-index: 2; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px;
  background: var(--surface); border-radius: var(--r-pill); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 17px; white-space: nowrap;
  box-shadow: 0 5px 0 var(--zone-dark), 0 10px 20px rgba(26,29,63,.15); border: 3px solid var(--zone);
  transition: transform .15s ease;
}
.map-pin:hover { transform: translate(-50%, -56%) scale(1.05); }
.map-pin__icon { width: 34px; height: 34px; border-radius: 50%; background: var(--zone); color: #FFFFFF; display: grid; place-items: center; }
.map-pin__icon svg { width: 18px; height: 18px; }
.map__ayo { position: absolute; width: 13%; left: 41%; top: 22%; z-index: 2; --ayo: #10B981; }
@media (max-width: 760px) {
  .map { border-radius: 22px; }
  .map__title { left: 10px; top: 10px; padding: 6px 12px; border-radius: 12px; }
  .map__title strong { font-size: 16px; }
  .map__title small { display: none; }
  .map-pin { font-size: 0; gap: 0; padding: 3px; border-width: 2px; }
  .map-pin__icon { width: 30px; height: 30px; }
  .map__ayo { display: none; }
}

/* Section headings */
.section { padding: 56px 0; }
.section-head { margin-bottom: 28px; max-width: 640px; }
.section-head h2 { font-size: clamp(32px, 4vw, 48px); }
.section-head p { color: var(--muted); margin-top: 10px; font-size: 19px; }
.eyebrow { font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--zone-dark); margin-bottom: 6px; }

/* Zone bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.zone-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px;
  padding: 26px; border-radius: var(--r-md); text-decoration: none;
  background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
  min-height: 210px;
}
.zone-card:hover { transform: translateY(-4px) rotate(-.4deg); border-color: var(--zone); }
.zone-card h3 { font-size: 30px; }
.zone-card p { color: var(--muted); max-width: 32ch; }
.zone-card__icon { width: 58px; height: 58px; border-radius: 18px; background: var(--zone); color: #FFFFFF; display: grid; place-items: center; box-shadow: 0 4px 0 var(--zone-dark); margin-bottom: 8px; }
.zone-card__icon svg { width: 30px; height: 30px; }
.zone-card__go { margin-top: auto; font-weight: 700; color: var(--zone-dark); display: inline-flex; align-items: center; gap: 6px; }
.zone-card__go svg { width: 18px; height: 18px; }
.zone-card::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--zone-soft); z-index: 0; }
.zone-card > * { position: relative; z-index: 1; }
.zone-card--big { grid-column: span 3; grid-row: span 2; background: var(--zone); border-color: var(--zone); color: #FFFFFF; }
.zone-card--big p, .zone-card--big .zone-card__go { color: #FFFFFF; }
.zone-card--big .zone-card__icon { background: #FFFFFF; color: var(--zone-dark); box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.zone-card--big::after { background: rgba(255,255,255,.18); width: 260px; height: 260px; }
.zone-card--big h3 { font-size: 40px; }
.zone-card--wide { grid-column: span 3; }
.zone-card--third { grid-column: span 2; }
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .zone-card--big, .zone-card--wide, .zone-card--third { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 560px) { .bento { grid-template-columns: 1fr; } .zone-card--big, .zone-card--wide, .zone-card--third { grid-column: auto; } }

/* Levels band */
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
.level-panel { padding: 36px; display: flex; gap: 22px; align-items: flex-start; }
.level-panel--tb { background: var(--sun); }
.level-panel--pf { background: var(--ink); color: #FFFFFF; }
.level-panel--pf p { color: #D9DCF5; }
.level-panel__num { font-family: var(--font-display); font-weight: 700; font-size: 64px; line-height: 1; }
.level-panel h3 { font-size: 30px; margin-bottom: 6px; }
@media (max-width: 760px) { .levels { grid-template-columns: 1fr; } .level-panel { padding: 26px; } }

/* Featured stories strip */
.story-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

/* Zone page header */
.zone-hero { padding: 28px 0 8px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--zone-dark); text-decoration: none; margin-bottom: 18px; }
.back-link svg { width: 18px; height: 18px; transform: rotate(180deg); }
.zone-banner {
  position: relative; display: grid; grid-template-columns: 1fr 200px; align-items: center; gap: 20px;
  background: var(--zone); color: #FFFFFF; border-radius: 30px; padding: 36px 40px; overflow: visible;
  box-shadow: 0 8px 0 var(--zone-dark);
}
.zone-banner h1 { font-size: clamp(38px, 5vw, 60px); font-weight: 700; }
.zone-banner p { font-size: 20px; margin-top: 8px; max-width: 40ch; }
.zone-banner .eyebrow { color: #FFFFFF; opacity: .9; }
.zone-banner .ayo { width: 250px; max-width: none; margin: -60px -40px -40px 0; --ayo: #FFFFFF; --ayo-dark: var(--zone-dark); filter: drop-shadow(0 8px 0 rgba(0,0,0,.12)); }
.zone-banner::before { content: ""; position: absolute; right: 120px; top: -18px; width: 54px; height: 54px; background: var(--sun); border-radius: 50%; }
@media (max-width: 700px) {
  .zone-banner { grid-template-columns: 1fr; padding: 28px 24px 150px; }
  .zone-banner .ayo { position: absolute; right: 0; bottom: -20px; width: 190px; margin: 0; }
  .zone-banner::before { right: 24px; top: -14px; width: 36px; height: 36px; }
}

/* Level switch */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 28px 0 22px; }
.toolbar__label { font-weight: 700; color: var(--muted); font-size: 15px; }
.level-switch { display: inline-flex; padding: 5px; border-radius: var(--r-pill); background: var(--surface); border: 2px solid var(--line); }
.level-switch button { border: 0; background: transparent; padding: 10px 18px; border-radius: var(--r-pill); font-weight: 700; cursor: pointer; font-size: 16px; }
.level-switch button small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.level-switch button[aria-pressed="true"] { background: var(--zone); color: #FFFFFF; }
.level-switch button[aria-pressed="true"] small { color: #FFFFFF; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
html[data-level="trailblazer"] [data-only="pathfinder"],
html[data-level="pathfinder"] [data-only="trailblazer"] { display: none !important; }

/* Story cards */
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding-bottom: 64px; }
@media (max-width: 960px) { .story-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .story-grid { grid-template-columns: 1fr; } }
.story-card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-md); border: 2px solid var(--line); overflow: hidden; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease; }
.story-card:hover { transform: translateY(-4px); }
.story-card__cover { position: relative; height: 130px; background: var(--g, var(--story)); overflow: hidden; }
.story-card__cover::before, .story-card__cover::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.25); }
.story-card__cover::before { width: 160px; height: 160px; right: -30px; top: -50px; }
.story-card__cover::after { width: 70px; height: 70px; left: 24px; bottom: -24px; background: rgba(255,255,255,.35); }
.story-card__cover svg { position: absolute; left: 22px; top: 22px; width: 46px; height: 46px; color: #FFFFFF; }
.story-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.story-card__genre { font-weight: 700; font-size: 14px; color: var(--g-dark, var(--story-dark)); }
.story-card h3 { font-size: 26px; }
.story-card p { color: var(--muted); font-size: 17px; }
.story-card__meta { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 700; padding-top: 8px; }
.tag { padding: 4px 12px; border-radius: var(--r-pill); background: var(--bg); border: 2px solid var(--line); }
.tag--draft { background: var(--sun); border-color: var(--sun); }
.g-adventure { --g: #F15BB5; --g-dark: #B8237E; }
.g-animal { --g: #10B981; --g-dark: #047857; }
.g-mystery { --g: #1A1D3F; --g-dark: #1A1D3F; }
.g-friendship { --g: #FF9F1C; --g-dark: #B45309; }
.g-inspiring { --g: #0EA5E9; --g-dark: #0369A1; }
.g-funny { --g: #8B5CF6; --g-dark: #5B32C2; }
.empty-note { padding: 32px; text-align: center; background: var(--surface); border: 2px dashed var(--line); border-radius: var(--r-md); color: var(--muted); grid-column: 1 / -1; }

/* Story reader */
.reader { padding: 24px 0 72px; }
.reader__head { max-width: 760px; margin: 0 auto 30px; }
.reader__cover { height: 180px; border-radius: 28px; background: var(--g); position: relative; overflow: hidden; margin-bottom: 26px; }
.reader__cover::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.22); right: -40px; top: -80px; }
.reader__cover svg { position: absolute; left: 30px; bottom: 26px; width: 64px; height: 64px; color: #FFFFFF; }
.reader__head h1 { font-size: clamp(38px, 5vw, 58px); font-weight: 700; }
.reader__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; font-weight: 700; font-size: 15px; }
.reader__tools { margin-left: auto; display: inline-flex; gap: 6px; }
.reader__tools button { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }
.reader__text { max-width: 680px; margin: 0 auto; font-size: var(--read-size, 20px); line-height: 1.75; }
.reader__text p + p { margin-top: 1.1em; }
.reader__text h2, .reader__text h3 { margin: 1.6em 0 .5em; font-size: 1.4em; }
.reader__text > p:first-child::first-letter { font-family: var(--font-display); font-weight: 700; float: left; font-size: 3.4em; line-height: .9; margin: .06em .12em 0 0; color: var(--g-dark); }
.think-box { max-width: 680px; margin: 40px auto 0; background: var(--sun); border-radius: var(--r-md); padding: 28px 30px; }
.think-box h2 { font-size: 28px; margin-bottom: 10px; }
.think-box ol { padding-left: 22px; }
.think-box li + li { margin-top: 6px; }
.reader__next { max-width: 680px; margin: 34px auto 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }

/* Activity cards: quiz, maths, creative */
.panel { background: var(--surface); border: 2px solid var(--line); border-radius: 26px; padding: 30px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 22px; }
.panel h2 { font-size: 32px; }
.panel__intro { color: var(--muted); margin-top: 6px; }
.activity-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; padding-bottom: 64px; align-items: start; }
@media (max-width: 900px) { .activity-layout { grid-template-columns: 1fr; } }
.side-card { background: var(--zone-soft); border-radius: 26px; padding: 26px; }
.side-card h3 { font-size: 24px; margin-bottom: 8px; }
.side-card + .side-card { margin-top: 18px; }
.side-card ul { padding-left: 20px; }

.quiz__progress { height: 12px; border-radius: 99px; background: var(--zone-soft); overflow: hidden; margin: 14px 0 20px; }
.quiz__progress span { display: block; height: 100%; width: 0; background: var(--zone); border-radius: 99px; transition: width .3s ease; }
.quiz__count { font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--zone-dark); }
.quiz__q { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 3vw, 32px); line-height: 1.2; margin-bottom: 20px; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .answers { grid-template-columns: 1fr; } }
.answer { text-align: left; padding: 16px 18px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); font-weight: 700; font-size: 18px; cursor: pointer; box-shadow: 0 4px 0 var(--line); transition: transform .1s ease; }
.answer:hover:not([disabled]) { border-color: var(--zone); transform: translateY(-2px); }
.answer.is-right { background: var(--maths-soft); border-color: var(--maths); box-shadow: 0 4px 0 var(--maths); }
.answer.is-wrong { background: #FFE3E4; border-color: var(--accent); box-shadow: 0 4px 0 var(--accent); }
.answer[disabled] { cursor: default; }
.feedback { margin-top: 18px; padding: 16px 18px; border-radius: 16px; background: var(--zone-soft); font-weight: 700; display: none; }
.feedback.is-on { display: block; }
.feedback span { display: block; font-weight: 400; margin-top: 4px; }
.quiz__foot { display: flex; justify-content: flex-end; margin-top: 18px; gap: 12px; }
.result { text-align: center; padding: 10px 0; }
.result__stars { display: flex; justify-content: center; gap: 8px; margin: 12px 0; }
.result__stars svg { width: 44px; height: 44px; color: var(--line); }
.result__stars svg.on { color: var(--sun); }
.result h3 { font-size: 34px; }

.sprint__screen { display: grid; place-items: center; text-align: center; gap: 16px; padding: 16px 0; }
.sprint__sum { font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 7vw, 80px); line-height: 1; color: var(--zone-dark); }
.sprint__form { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sprint__form input { width: 180px; font-size: 30px; font-family: var(--font-display); text-align: center; padding: 10px; border-radius: var(--r-sm); border: 3px solid var(--line); color: var(--ink); background: var(--surface); }
.sprint__form input:focus { border-color: var(--zone); outline: none; }
.sprint__stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stat { background: var(--zone-soft); border-radius: 16px; padding: 10px 18px; font-weight: 700; }
.stat b { font-family: var(--font-display); font-size: 26px; display: block; line-height: 1; color: var(--zone-dark); }
.mode-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.prompt-card { border-radius: 22px; padding: 28px; background: var(--zone); color: #FFFFFF; position: relative; overflow: hidden; }
.prompt-card::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.15); right: -50px; top: -60px; }
.prompt-card__text { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 3vw, 32px); line-height: 1.2; position: relative; }
.notebook label { display: block; font-weight: 700; margin: 22px 0 8px; }
.notebook textarea { width: 100%; min-height: 220px; padding: 18px; border-radius: var(--r-sm); border: 2px solid var(--line); font: inherit; line-height: 1.7; background: repeating-linear-gradient(var(--surface), var(--surface) 29px, var(--zone-soft) 30px); color: var(--ink); resize: vertical; }
.notebook small { color: var(--muted); display: block; margin-top: 6px; }
.character { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0; }
.character div { background: var(--zone-soft); border-radius: 16px; padding: 14px 16px; }
.character small { display: block; font-weight: 700; color: var(--zone-dark); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.character strong { font-family: var(--font-display); font-weight: 600; font-size: 21px; line-height: 1.2; }
@media (max-width: 560px) { .character { grid-template-columns: 1fr; } }

/* Bookshop */
.shop-note { display: flex; gap: 16px; align-items: center; background: var(--sun); border-radius: 20px; padding: 16px 22px; font-weight: 700; margin-bottom: 26px; }
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-bottom: 64px; }
@media (max-width: 1000px) { .book-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .book-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .book-grid { grid-template-columns: 1fr; } }
.book { display: flex; flex-direction: column; gap: 10px; }
.book__cover {
  aspect-ratio: 3 / 4; border-radius: 8px 18px 18px 8px; background: var(--b, var(--shop)); color: #FFFFFF; position: relative; overflow: hidden;
  padding: 22px 20px 20px 30px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: inset 10px 0 0 rgba(0,0,0,.12), 0 10px 0 rgba(26,29,63,.08); transition: transform .15s ease;
}
.book:hover .book__cover { transform: rotate(-2deg) translateY(-4px); }
.book__cover::after { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.18); right: -20%; bottom: -10%; }
.book__cover strong { font-family: var(--font-display); font-size: 26px; line-height: 1.1; position: relative; z-index: 1; }
.book__cover em { font-style: normal; font-weight: 700; font-size: 14px; opacity: .9; position: relative; z-index: 1; }
.book__cover svg { width: 40px; height: 40px; position: relative; z-index: 1; }
.book h3 { font-size: 22px; }
.book p { color: var(--muted); font-size: 16px; }
.book__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.book__price { font-family: var(--font-display); font-weight: 700; font-size: 24px; }

/* Grown-ups */
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; padding-bottom: 64px; }
.guide-grid .panel h2 { font-size: 28px; margin-bottom: 8px; }
.guide-grid .panel--wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; background: var(--zone-soft); border-color: var(--zone-soft); }
@media (max-width: 760px) { .guide-grid, .guide-grid .panel--wide { grid-template-columns: 1fr; } }

/* Generic page */
.page-content { max-width: 760px; margin: 0 auto; padding: 40px 0 80px; }
.page-content h1 { font-size: 52px; margin-bottom: 20px; }
.page-content p + p { margin-top: 1em; }

/* Footer */
.site-footer { background: var(--ink); color: #FFFFFF; padding: 56px 0 30px; margin-top: 40px; position: relative; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -28px; height: 30px; background: radial-gradient(circle at 30px 30px, var(--ink) 30px, transparent 31px) repeat-x; background-size: 60px 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h2 { font-size: 22px; margin-bottom: 12px; color: var(--sun); }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li + li { margin-top: 6px; }
.site-footer a { color: #FFFFFF; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer p { color: #D9DCF5; max-width: 36ch; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-brand .ayo { width: 90px; }
.footer-brand span { font-family: var(--font-display); font-weight: 700; font-size: 28px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 36px; padding-top: 20px; font-size: 15px; color: #B8BDE6; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* Motion */
.ayo .ayo-pupil { transform-box: fill-box; transform-origin: center; animation: ayo-look 6s ease-in-out infinite; }
@keyframes ayo-look { 0%, 40%, 100% { transform: translate(0, 0); } 50%, 70% { transform: translate(-3px, 2px); } }
.hero__art .ayo { animation: ayo-bob 4s ease-in-out infinite; }
@keyframes ayo-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Refinements */
.hero__kicker svg { width: 18px; height: 18px; flex-shrink: 0; }
.level-panel__num { white-space: nowrap; font-size: 52px; }
.zone-card--big .ayo { position: absolute; right: -30px; bottom: -10px; width: 62%; max-width: 340px; z-index: 1; --ayo: #FFFFFF; --ayo-dark: var(--zone-dark); }
.zone-card--big p { max-width: 26ch; }
@media (max-width: 900px) { .zone-card--big { min-height: 380px; } .zone-card--big .ayo { width: 48%; } }
[hidden] { display: none !important; }

/* Story pictures */
.story-card__cover.has-image::before, .story-card__cover.has-image::after, .reader__cover.has-image::before { display: none; }
.story-card__cover.has-image img, .reader__cover.has-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; display: block; }
.reader__cover.has-image { height: auto; aspect-ratio: 5 / 2; }

/* Parents' section */
.parent-jump { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 8px; }
.parent-jump a { padding: 8px 16px; border-radius: var(--r-pill); background: var(--surface); border: 2px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; }
.parent-jump a:hover { border-color: var(--zone); color: var(--zone-dark); }
.parent-section { padding: 40px 0 0; scroll-margin-top: 90px; }
.parent-section > h2 { font-size: 36px; margin-bottom: 6px; }
.parent-section > .panel__intro { margin-bottom: 22px; max-width: 760px; }
.parent-section .guide-grid { padding-bottom: 0; margin-top: 18px; }
.parent-section .panel h3 { font-size: 24px; margin-bottom: 8px; }
.parent-section ul { padding-left: 20px; }
.parent-section li + li { margin-top: 6px; }
.parent-zones { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.parent-zone { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 22px; background: var(--zone-soft); color: var(--ink); text-decoration: none; border: 2px solid transparent; transition: transform .2s, border-color .2s; }
.parent-zone:hover { transform: translateY(-3px); border-color: var(--zone); }
.parent-zone strong { font-family: var(--font-display); font-size: 20px; }
.parent-zone > span:last-child { font-size: 15px; color: var(--muted); }
.parent-zone__icon { width: 44px; height: 44px; border-radius: 14px; background: var(--zone); color: #FFFFFF; display: grid; place-items: center; }
.parent-zone__icon svg { width: 24px; height: 24px; }
.level-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.level-card { border-top: 10px solid var(--sun); }
.level-card--path { border-top-color: var(--accent); }
.level-card h3 { font-size: 30px !important; }
.safety-list { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.safety-item { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 2px solid var(--line); border-radius: 22px; padding: 20px; }
.safety-item > svg { flex: none; width: 36px; height: 36px; color: var(--zone-dark); }
.safety-item h3 { font-size: 20px !important; margin-bottom: 4px; }
.panel--contact { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--zone-soft); border-color: var(--zone-soft); margin-bottom: 64px; }
.panel--contact > svg, .panel--contact .mascot { width: 140px; height: auto; flex: none; }
@media (max-width: 1000px) { .parent-zones { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .parent-zones { grid-template-columns: 1fr 1fr; } .level-compare, .safety-list { grid-template-columns: 1fr; } .panel--contact > svg, .panel--contact .mascot { width: 90px; } .parent-section > h2 { font-size: 30px; } }
.guide-grid > .panel + .panel, .level-compare > .panel + .panel { margin-top: 0; }
.g-ireblaze { --g: #8B5CF6; --g-dark: #5B21B6; }

/* IreBlaze transformation stage */
.ib-stage { margin: 8px 0 32px; background: linear-gradient(180deg, #1E1B4B 0%, #3B1F7A 60%, #0F766E 100%); border-radius: var(--r-md); padding: 20px 16px 18px; color: #fff; overflow: hidden; }
.ib-stage__scene { position: relative; width: min(300px, 80%); aspect-ratio: 220 / 238; margin: 0 auto; }
.ib-stage__form { position: absolute; inset: 0; }
.ib-stage__form svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ib-stage__glow { position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle, rgba(196,181,253,.55), rgba(139,92,246,0) 70%); }
.ib-stage__ring { position: absolute; inset: 0; opacity: 0; }
.ib-stage__ring span { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 12px var(--sun); }
.ib-stage__ring span:nth-child(1) { transform: rotate(0deg) translateX(120px); }
.ib-stage__ring span:nth-child(2) { transform: rotate(60deg) translateX(120px); background: #F15BB5; box-shadow: 0 0 12px #F15BB5; }
.ib-stage__ring span:nth-child(3) { transform: rotate(120deg) translateX(120px); background: #FF9F1C; }
.ib-stage__ring span:nth-child(4) { transform: rotate(180deg) translateX(120px); background: #10B981; box-shadow: 0 0 12px #10B981; }
.ib-stage__ring span:nth-child(5) { transform: rotate(240deg) translateX(120px); background: #0EA5E9; box-shadow: 0 0 12px #0EA5E9; }
.ib-stage__ring span:nth-child(6) { transform: rotate(300deg) translateX(120px); background: #C4B5FD; }
.ib-stage__flash { position: absolute; inset: -10%; border-radius: 50%; background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0) 65%); opacity: 0; }
.ib-stage__caption { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.ib-stage__names { position: relative; display: inline-grid; font-family: var(--font-display); font-size: 26px; min-width: 7em; text-align: center; }
.ib-stage__names b { grid-area: 1 / 1; }
.ib-n2 { color: var(--sun); opacity: 0; }
.ib-stage__btn { background: var(--sun); color: var(--ink); }

/* 7s loop: boy bounces, sparkles spin in, flash, hero appears and glows, then back */
.ib-stage__human { animation: ib-human 7s ease-in-out infinite; transform-origin: 50% 90%; }
.ib-stage__hero { animation: ib-hero 7s ease-in-out infinite; transform-origin: 50% 90%; }
.ib-stage__ring { animation: ib-ring 7s linear infinite; }
.ib-stage__flash { animation: ib-flash 7s ease-out infinite; }
.ib-stage__glow { animation: ib-glow 7s ease-in-out infinite; }
.ib-n1 { animation: ib-n1 7s step-end infinite; }
.ib-n2 { animation: ib-n2 7s step-end infinite; }
.ib-stage .ireblaze path[fill="#FF5A5F"][opacity] { transform-box: fill-box; transform-origin: 50% 100%; animation: ib-flame .5s ease-in-out infinite alternate; }
@keyframes ib-human { 0%, 30% { opacity: 1; transform: translateY(0) scale(1); } 8%, 22% { transform: translateY(-6px) scale(1); } 15% { transform: translateY(0) scale(1, .97); } 36% { opacity: 1; transform: scale(1.08) rotate(-4deg); } 42%, 88% { opacity: 0; transform: scale(1.25); } 95%, 100% { opacity: 1; transform: scale(1); } }
@keyframes ib-hero { 0%, 40% { opacity: 0; transform: scale(.6); } 47% { opacity: 1; transform: scale(1.1); } 52% { transform: scale(1); } 60%, 74% { transform: translateY(-8px); } 67%, 82% { opacity: 1; transform: translateY(0); } 90%, 100% { opacity: 0; transform: scale(.7); } }
[data-ib-stage] * { animation-delay: var(--ib-delay, 0s) !important; }
.ib-reset * { animation: none !important; }
@keyframes ib-ring { 0%, 28% { opacity: 0; transform: rotate(0) scale(1.3); } 32% { opacity: 1; } 44% { opacity: 1; transform: rotate(540deg) scale(.3); } 48%, 100% { opacity: 0; transform: rotate(540deg) scale(.3); } }
@keyframes ib-flash { 0%, 40% { opacity: 0; transform: scale(.4); } 44% { opacity: 1; transform: scale(1); } 54%, 100% { opacity: 0; transform: scale(1.3); } }
@keyframes ib-glow { 0%, 40% { opacity: .4; } 50%, 85% { opacity: 1; transform: scale(1.15); } 95%, 100% { opacity: .4; transform: scale(1); } }
@keyframes ib-n1 { 0% { opacity: 1; } 43% { opacity: 0; } 90% { opacity: 1; } }
@keyframes ib-n2 { 0% { opacity: 0; } 43% { opacity: 1; } 90% { opacity: 0; } }
@keyframes ib-flame { from { transform: scaleY(1); } to { transform: scaleY(1.25) skewX(-6deg); } }
@media (prefers-reduced-motion: reduce) {
  .ib-stage__scene { width: min(520px, 100%); aspect-ratio: 440 / 238; }
  .ib-stage__human { right: 50%; }
  .ib-stage__hero { left: 50%; }
  .ib-stage__ring, .ib-stage__flash, .ib-n2, .ib-stage__btn { display: none; }
  .ib-n1::after { content: " becomes IreBlaze"; color: var(--sun); }
}
