/* Tiny Tot Tree theme: the look of the books. ALL design choices live in the tokens below (:root); components use only tokens,
   so this file ports to a Shopify theme as settings (colours, fonts, radii) plus a few component rules.
   Colours sampled from the book covers (dev/marketing/brand/BRAND-SPEC.md). "Bright" colours are for stripes, borders and icons;
   the deeper colour of each section holds text (contrast 4.5:1 or better). Marketing's final theme (T-025) replaces the token values only.
   Fonts: no web fonts are loaded (the page allows only its own files); rounded system fonts give the same friendly feel. */
:root {
  /* colour */
  --cream: #FFF6E5; --paper: #FFFFFF; --white: #FFFFFF; --ink: #502A13; --ink-soft: #7A5A44; --line: #EBD9BC;
  --sun: #F8D828; --apple: #D92B1A; --apple-edge: #8F1A0E; --leaf: #58A820; --sky: #00B0F8; --royal: #0058B0; --royal-edge: #003B7A; --grape: #8236C0; --bubble: #C8246E;
  --hero-end: #FFE9A8; --ig-edge: #5A2384; --wa: #17804A; --wa-edge: #0E5A32; --sun-edge: #B59C00; --ok-bg: #E4F3D6; --ok-ink: #245A08; --no-bg: #FBE0DC;
  /* type */
  --head: ui-rounded, "SF Pro Rounded", "Fredoka", "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: ui-rounded, "Nunito", "Avenir Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* shape */
  --radius: 22px; --radius-sm: 14px; --gap: 16px; --gutter: 16px; --shadow: 0 6px 0 rgba(80, 42, 19, .12); --tap: 44px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 17px/1.5 var(--body); overflow-x: hidden; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.12; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 7vw, 3.4rem); } h2 { font-size: clamp(1.5rem, 4.5vw, 2.2rem); } h3 { font-size: 1.15rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.block { padding: 28px 0; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 50; }
.muted { color: var(--ink-soft); } .small { font-size: .9rem; }
:focus-visible { outline: 3px solid var(--royal); outline-offset: 2px; }

/* top bar */
.bar { background: var(--paper); border-bottom: 4px solid var(--sun); position: sticky; top: 0; z-index: 10; }
.bar .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding-top: 6px; padding-bottom: 6px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.25rem var(--head); white-space: nowrap; }
.brand .logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--cream); }
.bar nav { order: 3; width: 100%; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.bar nav::-webkit-scrollbar { display: none; }
.bar nav a { white-space: nowrap; text-decoration: none; font-weight: 800; padding: 0 12px; border-radius: 99px; min-height: var(--tap); display: inline-flex; align-items: center; }
.bar nav a:hover { background: var(--cream); } .bar nav a[aria-current="page"] { background: var(--sun); }
.bar .wa-top { margin-left: auto; }
.ig-top { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border-radius: 50%; background: var(--grape); color: var(--white); margin-left: auto; }
.ig-top + .wa-top { margin-left: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px; border-radius: 99px; border: 0; font: 800 1.1rem var(--head);
  text-decoration: none; cursor: pointer; color: var(--white); background: var(--apple); box-shadow: 0 5px 0 var(--apple-edge); transition: transform .12s; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--apple-edge); }
.btn.royal { background: var(--royal); box-shadow: 0 5px 0 var(--royal-edge); }
.btn.wa { background: var(--wa); box-shadow: 0 5px 0 var(--wa-edge); }
.btn.ghost { background: var(--paper); color: var(--ink); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--line); }
.btn.small { min-height: var(--tap); padding: 0 16px; font-size: 1rem; }

/* hero */
.hero { background: linear-gradient(180deg, var(--cream) 0%, var(--hero-end) 100%); border-bottom: 6px dotted var(--sun); overflow: hidden; }
.hero .wrap { display: grid; gap: 8px; align-items: end; padding-top: 24px; padding-bottom: 0; }
.hero .lead { font-size: 1.15rem; max-width: 34ch; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 22px; }
.hero .boy { justify-self: center; width: min(70vw, 320px); }
.hero .boy img, .hero .boy svg { width: 100%; height: auto; }
.bubble { position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: 20px; padding: 10px 14px; font-weight: 800; max-width: 24ch; margin: 0 0 16px; }
.bubble::after { content: ""; position: absolute; left: 28px; bottom: -14px; width: 22px; height: 22px; background: var(--paper); border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg); }
.doodle { color: var(--bubble); }

/* section tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow); min-height: 150px; transition: transform .15s; }
.tile:hover { transform: translateY(-4px) rotate(-1deg); }
.tile .ic { font-size: 2.4rem; line-height: 1; } .tile b { font: 800 1.2rem/1.1 var(--head); } .tile span { font-size: .95rem; } .tile small { margin-top: auto; font-weight: 800; }

/* book cards */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.card { background: var(--paper); border-radius: var(--radius-sm); border: 3px solid var(--line); padding: 10px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); min-width: 0; }
.card:hover { border-color: var(--sun); }
.card .cv { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--sun); display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font: 800 1rem var(--head); }
.card .cv img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card h3 { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
.price { font-weight: 800; color: var(--royal); }
.chip { display: inline-block; font-weight: 800; font-size: .8rem; padding: 3px 10px; border-radius: 99px; background: var(--cream); border: 2px solid var(--line); }
.ribbon { position: absolute; top: 8px; left: 8px; z-index: 1; background: var(--bubble); color: var(--white); font-weight: 800; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; }
.ribbon.out { left: auto; right: 8px; background: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.filters input, .filters select { font: inherit; padding: 0 14px; min-height: var(--tap); border: 2px solid var(--line); border-radius: 99px; background: var(--paper); color: var(--ink); flex: 1 1 160px; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.chips button { font: 800 .95rem var(--body); min-height: var(--tap); padding: 0 16px; border-radius: 99px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* section header */
.sechead { padding: 26px 0 22px; border-bottom: 6px dotted rgba(255, 255, 255, .55); }
.sechead .ic { font-size: 3rem; } .sechead p { max-width: 52ch; font-size: 1.1rem; margin: 0 0 8px; }
.sechead a.sheet { color: inherit; font-weight: 800; }

/* hero says, learning panel, ticks */
.says { display: flex; gap: 14px; align-items: center; background: var(--paper); border: 3px dashed var(--sky); border-radius: var(--radius); padding: 14px; }
.says .face { flex: 0 0 76px; height: 76px; border-radius: 50%; overflow: hidden; border: 3px solid var(--sun); background: var(--cream); }
.says .face img, .says .face svg { width: 100%; height: 100%; object-fit: cover; }
.learn { background: var(--royal); color: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.learn .btn { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 var(--sun-edge); }
.ticks { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks li::before { content: "\2713"; flex: 0 0 28px; height: 28px; line-height: 28px; text-align: center; border-radius: 50%; background: var(--leaf); color: var(--white); font-weight: 800; }
.igstrip { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--paper); border: 3px solid var(--grape); border-radius: var(--radius); padding: 14px; margin-top: 18px; }
.igstrip p { margin: 0; flex: 1 1 220px; } .igicon { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border-radius: 50%; background: var(--grape); color: var(--white); }
.btn.ig { background: var(--grape); box-shadow: 0 5px 0 var(--ig-edge); }
.sheetstrip { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--paper); border: 3px solid var(--line); border-radius: var(--radius); padding: 14px; }
.sheetstrip p { margin: 0; flex: 1 1 220px; }

/* book page */
.crumbs { font-weight: 800; font-size: .95rem; padding: 14px 0 0; } .crumbs a { text-decoration: none; color: var(--royal); }
.book { display: grid; gap: 20px; padding-top: 12px; } .book > * { min-width: 0; }
.gallery { display: grid; gap: 10px; }
.gallery .main { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--paper); border: 3px solid var(--line); display: flex; align-items: center; justify-content: center; font: 800 1.3rem var(--head); text-align: center; padding: 14px; }
.gallery .main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--paper); }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.thumbs button { padding: 0; aspect-ratio: 3 / 4; border-radius: 10px; border: 3px solid var(--line); background: var(--paper); overflow: hidden; cursor: pointer; min-height: var(--tap); }
.thumbs button[aria-pressed="true"] { border-color: var(--royal); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.info h1 { font-size: clamp(1.7rem, 6vw, 2.6rem); overflow-wrap: anywhere; }
.info .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.info .price { font: 800 1.9rem var(--head); }
.pill { display: inline-block; padding: 3px 12px; border-radius: 99px; background: var(--ok-bg); color: var(--ok-ink); font-weight: 800; font-size: .85rem; } .pill.no { background: var(--no-bg); color: var(--apple-edge); }
.note { font-size: .92rem; color: var(--ink-soft); }
.buy { position: sticky; bottom: 0; z-index: 4; background: var(--paper); border-top: 4px solid var(--sun); padding: 10px var(--gutter); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.buy .price { font: 800 1.4rem var(--head); }
.dl { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }

/* words page */
.prose { max-width: 62ch; } .prose h3 { margin-top: 1.2em; } .prose p { margin: 0 0 .9em; }

/* help chat (a placeholder: a chatbot for families and Seeders comes later) */
.helpbox { border: 3px dashed var(--line); border-radius: var(--radius); padding: 14px; background: rgba(255, 255, 255, .06); color: var(--white); margin-top: 16px; }
.helpbox b { font-family: var(--head); } .helpbox .tight { margin: .3em 0 0; }

footer { background: var(--ink); color: var(--white); padding: 26px 0; margin-top: 30px; }
footer a { color: var(--sun); } footer .cols { display: grid; gap: 14px; }
footer .links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.empty { text-align: center; padding: 30px 0; }
.gap-top { margin-top: 18px; } .boy-small { width: 140px; margin: 0 auto 10px; }

@media (min-width: 720px) {
  .bar nav { order: 0; width: auto; margin-left: auto; overflow: visible; } .bar .wa-top { margin-left: 0; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero .wrap { grid-template-columns: 1.1fr .9fr; gap: 24px; }
  .book { grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
  .buy { position: static; border: 0; padding: 0; background: none; justify-content: flex-start; }
  footer .cols { grid-template-columns: 2fr 1fr; }
}
/* Instagram wall (T-027): the site's own copies; cards, reels, controls */
.igrow { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: none; }
.igrow::-webkit-scrollbar { display: none; }
.igrow .igcard { flex: 0 0 68vw; max-width: 260px; scroll-snap-align: start; }
.igwall { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.igcard { background: var(--paper); border: 3px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.igcard.playing { border-color: var(--grape); }
.igmedia { position: relative; aspect-ratio: 4 / 5; background: var(--cream); overflow: hidden; }
.igmedia img, .igmedia video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.igmedia .igopen { position: absolute; inset: 0; display: block; }
.igvideo { z-index: 1; } .igposter.igfallback { z-index: 0; }
.igcard.playing .igposter { visibility: hidden; }
.igplay { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--grape); color: var(--white); font-size: 1.3rem; cursor: pointer; box-shadow: 0 4px 0 var(--ig-edge); }
.igcard.playing .igplay { opacity: 0; width: 100%; height: 100%; border-radius: 0; background: transparent; box-shadow: none; }
.igcard.playing .igplay:focus-visible { opacity: 1; outline: 3px solid var(--sun); }
.igsound { position: absolute; z-index: 3; right: 8px; bottom: 8px; min-width: var(--tap); min-height: var(--tap); border-radius: 50%; border: 0; background: var(--ink); color: var(--white); font-size: 1.1rem; cursor: pointer; opacity: .9; }
.igbadge { position: absolute; z-index: 3; top: 8px; right: 8px; background: var(--ink); color: var(--white); font-weight: 800; font-size: .72rem; padding: 3px 10px; border-radius: 99px; }
.igmedia .ribbon { z-index: 3; }
.igbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.igcap { margin: 0; font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.igmeta { margin: 0; }
.igview { margin-top: auto; font-weight: 800; color: var(--grape); min-height: var(--tap); display: inline-flex; align-items: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 720px) { .igwall { grid-template-columns: repeat(4, minmax(0, 1fr)); } .igrow .igcard { flex-basis: 240px; } }
@media (prefers-reduced-motion: reduce) { .igcard { transition: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
