/* Milo & Moon — every colour here comes out of cover_layout.py and
   build_pdf.py, so the site and the printed books cannot drift apart. */
:root{
  --ink:#2A3440;              /* BODY_INK: the type on every printed cover */
  --accent:#14646E;           /* the badge teal, identical on all 11 covers */
  --badge-ink:#FFF6E4;        /* INK: the cream type inside the badge */
  --paper:#FFFDF9;            /* warm, not clinical white */
  --rule:#EDE6DA;
  --soft:#5F6874;
  --field:#FBF1DF;
  /* The crayon palette, straight from build_pdf.PALETTE. */
  --c1:#E5322D; --c2:#F5871F; --c3:#FFD400; --c4:#43B049;
  --c5:#0F9BD7; --c6:#7A4FBF; --c7:#EC5F9B; --c8:#00B39F;
  --round:"Baloo 2","Fredoka One",Fredoka,"Chalkboard SE",Seravek,
          "Avenir Next",-apple-system,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--round);
  font-size:19px;line-height:1.55;-webkit-font-smoothing:antialiased}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.skip{position:absolute;left:-9999px}
.skip:focus{left:8px;top:8px;background:var(--accent);color:#fff;padding:8px 14px;
  border-radius:6px;z-index:20}
a{color:var(--accent)}
img{max-width:100%;height:auto}

/* ── header ─────────────────────────────────────────── */
header.site{display:flex;flex-wrap:wrap;gap:14px 28px;align-items:center;
  justify-content:space-between;padding:16px clamp(16px,4vw,52px);
  background:var(--paper);border-bottom:3px solid var(--rule)}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;
  color:var(--accent);font-weight:800;font-size:clamp(22px,2.6vw,30px);
  letter-spacing:-.01em}
.brand img{width:clamp(52px,6vw,72px);height:auto}
header nav{display:flex;align-items:center;gap:22px;font-size:16px}
header nav a{text-decoration:none;font-weight:700}
header nav a:hover{color:var(--c1)}
/* The edition picker. It stays a native <select> on purpose — on a phone that
   opens the OS wheel, which is a better control than anything rebuilt in
   div-and-JavaScript, and it needs no script at all. Only the chrome is
   restyled: appearance:none removes the system look, and the chevron is an
   inline SVG data URI so it costs no request. */
.lang{position:relative;display:inline-flex;align-items:center}
.lang select{appearance:none;-webkit-appearance:none;font:inherit;
  font-family:var(--round);font-size:15px;font-weight:700;
  padding:9px 40px 9px 18px;border:2.5px solid var(--accent);border-radius:999px;
  background-color:var(--paper);color:var(--accent);cursor:pointer;
  box-shadow:0 3px 0 var(--accent);transition:transform .12s,box-shadow .12s;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2314646E' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 15px center;
  background-size:12px 8px}
.lang select:hover{background-color:#F3FAFA}
.lang select:active{transform:translateY(3px);box-shadow:none}
.lang select:focus-visible{outline:3px solid var(--c3);outline-offset:3px}

main{max-width:1120px;margin:0 auto;padding:clamp(26px,4vw,56px) clamp(16px,4vw,52px) 70px}

/* ── hero ───────────────────────────────────────────── */
.hero{display:grid;gap:clamp(26px,4vw,54px);align-items:center;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.eyebrow{font-size:13px;font-weight:800;letter-spacing:.18em;text-transform:uppercase;
  color:var(--c1);margin:0 0 12px}
h1{font-size:clamp(34px,5.4vw,58px);line-height:1.04;margin:0 0 .4em;
  font-weight:800;letter-spacing:-.02em;text-wrap:balance}
h1 em{font-style:normal;color:var(--accent);
  text-decoration:underline;text-decoration-color:var(--c3);
  text-decoration-thickness:.16em;text-underline-offset:.06em}
.lede{font-size:19.5px;color:var(--soft);max-width:52ch;margin:0}
.lede.big{font-size:22px;max-width:46ch}
.cta{display:inline-block;margin-top:26px;background:var(--accent);color:#fff;
  text-decoration:none;font-weight:800;font-size:18px;padding:14px 30px;
  border-radius:999px;box-shadow:0 5px 0 #0d4a52;transition:transform .12s}
.cta:hover{transform:translateY(2px);box-shadow:0 3px 0 #0d4a52}
.cta:active{transform:translateY(5px);box-shadow:none}

/* Covers fanned out like books dropped on a table. */
.fan{display:flex;justify-content:center;align-items:flex-end}
/* ⚠️ Overlap is tuned so the TITLE on each cover stays readable. At -5.5%
   the next cover ate the word ANIMALS, which defeats the point of showing
   covers at all — the title IS the product. */
.fanned{display:block;width:40%;margin-inline:-3.4%;border-radius:8px;
  background:var(--field);padding:8px;transform:rotate(var(--tilt));
  box-shadow:0 12px 30px rgba(42,52,64,.2);transition:transform .18s}
.fanned:first-child{margin-left:0}
.fanned:last-child{margin-right:0}
.fanned:hover{transform:rotate(0deg) translateY(-10px) scale(1.05);z-index:3;
  position:relative}
.fanned img{display:block;border-radius:4px}

/* ── three facts ────────────────────────────────────── */
.pitch{display:grid;gap:18px;margin-top:clamp(40px,6vw,76px);
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}
.bit{text-align:center;padding:26px 20px;border-radius:18px;background:var(--field)}
.bit:nth-child(2){background:#C7EEEB}
.bit:nth-child(3){background:#F9DCEC}
.num{display:block;font-size:clamp(44px,6vw,62px);font-weight:800;line-height:1;
  color:var(--accent)}
.bit p{margin:10px 0 0;font-size:16.5px;color:var(--ink);font-weight:600}

/* ── badge heading, the device off every cover ──────── */
.badge{display:inline-block;background:var(--accent);color:var(--badge-ink);
  font-weight:800;font-size:clamp(24px,3.6vw,40px);letter-spacing:-.01em;
  padding:.42em 1.15em;border-radius:999px;margin:0 0 18px;
  box-shadow:0 0 0 7px var(--paper),0 0 0 11px var(--accent)}
.pagehead{margin:8px 0 clamp(30px,5vw,52px)}

/* ── book grid ──────────────────────────────────────── */
.books{display:grid;gap:clamp(20px,3vw,34px);
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.book{display:block;text-decoration:none;color:var(--ink);border-radius:20px;
  background:var(--field);padding:22px 20px 24px;text-align:center;
  transform:rotate(var(--tilt));transition:transform .18s,box-shadow .18s;
  box-shadow:0 8px 0 rgba(42,52,64,.12)}
.book:hover{transform:rotate(0deg) translateY(-6px);
  box-shadow:0 16px 34px rgba(42,52,64,.22)}
.shelf{display:block;margin-bottom:16px}
.shelf img{display:block;width:100%;border-radius:6px;
  box-shadow:0 8px 20px rgba(42,52,64,.22)}
.meta{display:block}
.bt{display:block;font-size:26px;font-weight:800;line-height:1.1}
.bd{display:block;font-size:16px;color:var(--soft);margin:6px 0 12px}
.market{display:inline-block;font-size:12.5px;font-weight:800;letter-spacing:.03em;
  color:#fff;background:var(--accent);border-radius:999px;padding:5px 14px}
.market.soon{background:var(--c2);color:#3a2400}

/* ── one title ──────────────────────────────────────── */
.title{display:grid;gap:clamp(26px,4vw,52px);align-items:start;
  grid-template-columns:minmax(0,4fr) minmax(0,5fr)}
.art{background:var(--field);border-radius:20px;padding:clamp(18px,3vw,34px)}
.art img{display:block;border-radius:6px;box-shadow:0 14px 34px rgba(42,52,64,.24)}
.sub{font-size:17px;color:var(--soft);margin:0 0 18px}
.bullets{padding-left:0;margin:22px 0 0;list-style:none}
.bullets li{position:relative;padding-left:34px;margin-bottom:11px;font-weight:600}
.bullets li::before{content:"";position:absolute;left:0;top:.42em;width:18px;
  height:18px;border-radius:50%;background:var(--c3)}
.bullets li:nth-child(2)::before{background:var(--c4)}
.bullets li:nth-child(3)::before{background:var(--c5)}
.buy{margin-top:26px;font-weight:700}
.buy.soon{color:var(--soft)}
.isbn{font-size:14px;color:var(--soft);margin:4px 0 0}

/* ── the colour-in holding page ─────────────────────── */
.soon{margin-top:30px;padding:clamp(22px,4vw,38px);background:var(--field);
  border-radius:20px;max-width:60ch}
.soon p{margin:0 0 14px}
.soon p:last-child{margin:0}

/* ── the crayon row, the series' signature device ───── */
.crayons{height:clamp(56px,7vw,92px);margin-top:clamp(40px,6vw,70px);
  background:url("/brand/crayons.png") repeat-x bottom center;
  background-size:auto 100%}

footer.site{border-top:3px solid var(--rule);padding:32px clamp(16px,4vw,52px) 60px;
  color:var(--soft);font-size:16px;text-align:center}
footer.site img{width:64px;margin-bottom:8px}
footer.site p{margin:0 auto 8px;max-width:56ch}
.fine{font-size:13.5px;margin-top:14px !important}

@media (max-width:820px){
  .hero,.title{grid-template-columns:1fr}
  /* ⛔ COVERS FIRST on a phone. Most visitors arrive by scanning the QR code
     printed in the book, so they land here on mobile — and in the desktop
     source order the covers sat below the headline, the lede and the button,
     roughly 1200px down. A book brand whose first mobile screen is a wall of
     text has buried the only thing that sells it. */
  .hero{display:flex;flex-direction:column}
  .hero .fan{order:-1;margin:0 0 26px}
  .fanned{width:44%;margin-inline:-2.6%}
  .lede{font-size:18px}
  h1{font-size:clamp(30px,8vw,42px)}
}
@media (max-width:560px){
  /* The nav wrapped mid-phrase — "Colouring / Story Books" over two lines and
     "Colour / in" over two more, three ragged rows of header before any
     content. Smaller, and never broken inside a label. */
  header.site{padding:12px 16px;gap:10px 16px}
  /* ⚠️ `space-between` with a 147px <select> overflowed the viewport by 29px —
     the edition control was clipped off the right edge. Let the row WRAP
     instead: the links stay left, the select keeps to the right, and on a
     narrow phone it drops to its own line rather than off the screen. */
  header nav{gap:10px 14px;font-size:14.5px;width:100%;flex-wrap:wrap;
    justify-content:flex-start}
  header nav a{white-space:nowrap}
  .lang{margin-left:auto}
  .lang select{font-size:14px;padding:6px 10px;max-width:100%}
  .brand{font-size:22px;gap:9px}
  .brand img{width:46px}
  .cta{width:100%;text-align:center}
}
