/* Spellbinding Books — the kids' bookshop (since 2026-11-19).
   Warm paper, a sky-blue ink, sunshine yellow, coral and leaf green.
   Rounded display type (Fredoka), clean sans body (Inter).
   Bright enough for a child to love, calm enough for the grown-up who is
   actually buying: colour does the cheering, the words stay plain.
   Every text colour here passes WCAG AA (4.5:1) on the surface it sits on. */

:root {
  --ink: #1d2740;
  --ink-soft: #46516a;
  --paper: #fffaf2;
  --card: #ffffff;
  --blue: #1e5aa0;
  --blue-deep: #17477f;
  --sky: #e2effc;
  --sun: #ffd35c;
  --sun-soft: #fff2c9;
  --sun-deep: #e5a800;
  --coral: #f07b5a;
  --coral-soft: #fde4dc;
  --leaf: #2e7a4f;
  --mint: #ddf2e6;
  --lilac: #ece6fb;
  --night: #1d2740;
  --line: rgba(29, 39, 64, 0.14);
  --line-strong: rgba(29, 39, 64, 0.24);
  --danger: #b3261e;
  --radius: 18px;
  --radius-small: 10px;
  --measure: 38rem;
  --display: "Fredoka", "Baloo 2", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
}

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

a { color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--blue-deep); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--card); padding: 0.6rem 1rem; border-radius: var(--radius-small); border: 2px solid var(--ink); }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.875rem; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: 0; line-height: 1.15; text-wrap: balance; }

/* ---------- header ---------- */
header.site { background: var(--card); border-bottom: 1px solid var(--line); position: relative; }
/* A row of four colours under the header: the shop's whole palette at once. */
header.site::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px; background: linear-gradient(90deg, var(--blue) 0 25%, var(--sun) 25% 50%, var(--coral) 50% 75%, var(--leaf) 75% 100%); }
header.site .wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between; padding-block: 1rem; }
.brand { font-family: var(--display); font-size: 1.6rem; font-weight: 600; margin: 0; line-height: 1.1; }
.brand a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 0.55rem; }
.brand img { width: 2.4rem; height: 2.4rem; flex: none; }
.brand strong { display: block; font-weight: 600; }
.brand span { display: block; font-family: var(--sans); font-size: 0.75rem; font-weight: 600; color: var(--blue); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 0.2rem; }
nav.site ul { display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; font-weight: 500; }
nav.site a { display: inline-block; color: var(--ink); text-decoration: none; padding: 0.4rem 0.8rem; border-radius: 999px; }
nav.site a:hover { background: var(--sky); color: var(--ink); }
nav.site a.active { background: var(--sun); color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding-block: 3.5rem 3rem; background:
    radial-gradient(circle at 92% 18%, rgba(255, 211, 92, 0.45) 0 7rem, transparent 7.1rem),
    radial-gradient(circle at 4% 96%, rgba(240, 123, 90, 0.16) 0 9rem, transparent 9.1rem),
    var(--sky); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 2rem; align-items: center; }
.hero-art { width: 100%; height: auto; max-width: 26rem; justify-self: center; }
.kicker { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.95rem; color: var(--blue-deep); font-weight: 600; margin: 0 0 0.9rem; }
.kicker::before { content: ""; width: 0.8rem; height: 0.8rem; margin-top: 0.4em; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 3px #fff; flex: none; }
.hero h1 { font-size: clamp(2.2rem, 5.6vw, 3.5rem); margin: 0 0 1rem; max-width: 32rem; }
.hero p { max-width: var(--measure); margin: 0 0 1rem; font-size: 1.125rem; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero { padding-block: 1.75rem 2.5rem; background: radial-gradient(circle at 100% 0%, rgba(255, 211, 92, 0.45) 0 5rem, transparent 5.1rem), var(--sky); }
  .hero-art { max-width: 11rem; order: -1; justify-self: start; }
}

/* ---------- sections ---------- */
section { padding-block: 2.75rem; }
section > .wrap > h1, section > .wrap > h2 { font-size: 1.9rem; margin: 0 0 0.45rem; }
section > .wrap > h1 { font-size: clamp(2rem, 5vw, 2.7rem); }
section > .wrap > .lede, .page .lede { max-width: var(--measure); color: var(--ink-soft); margin: 0 0 1.5rem; }
.more { margin: 1.1rem 0 0; font-size: 0.9375rem; font-weight: 600; }
/* Shelf headings on the shop page (one per category). */
.cat { display: flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-size: 1.35rem; font-weight: 600; color: var(--ink); margin: 2.25rem 0 0.9rem; }
.cat::before { content: ""; width: 0.9rem; height: 0.9rem; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 3px var(--sun-soft); flex: none; }
h2.cat:nth-of-type(4n+2)::before { background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
h2.cat:nth-of-type(4n+3)::before { background: var(--leaf); box-shadow: 0 0 0 3px var(--mint); }
h2.cat:nth-of-type(4n+4)::before { background: var(--blue); box-shadow: 0 0 0 3px var(--sky); }

.band { background: var(--card); border-block: 1px solid var(--line); }
.band.sun { background: var(--sun-soft); border-color: rgba(229, 168, 0, 0.35); }
.band.night { background: var(--night); color: var(--paper); border-color: var(--night); }
.band.night h2 { color: var(--sun); }
.band.night a:not(.btn) { color: var(--sun); }
.lede.light { color: rgba(255, 250, 242, 0.86); }
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 2.5rem; }
.two-up h2 { font-size: 1.75rem; margin: 0 0 0.5rem; }
/* The paired blocks on the home page sit on their own soft panels. */
.panel { border-radius: var(--radius); padding: 1.5rem 1.6rem 1.6rem; }
.panel.mint { background: var(--mint); }
.panel.lilac { background: var(--lilac); }
.panel .lede { color: var(--ink-soft); }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.1rem; list-style: none; margin: 0; padding: 0; }
.card { position: relative; overflow: hidden; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.35rem 1.25rem 1.2rem; display: flex; flex-direction: column; gap: 0.45rem; box-shadow: 0 3px 0 var(--line); }
/* A coloured band across the top of each card, taking turns. */
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--blue); }
.card:nth-child(4n+2)::before { background: var(--sun); }
.card:nth-child(4n+3)::before { background: var(--coral); }
.card:nth-child(4n+4)::before { background: var(--leaf); }
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
  .card:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); }
}
.card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-small); border: 1px solid var(--line); }
.card h3 { font-size: 1.2rem; margin: 0; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--blue); }
/* The whole card is the link's target area, so small hands and big thumbs
   do not have to hit the title exactly. */
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card h3 a:focus-visible { outline: none; }
.card:focus-within { outline: 3px solid var(--blue-deep); outline-offset: 3px; }
.card p { margin: 0; font-size: 0.9375rem; color: var(--ink-soft); }
.card .price { margin-top: auto; padding-top: 0.5rem; color: var(--blue-deep); font-weight: 600; font-size: 0.9375rem; font-family: var(--sans); }
.tag { display: inline-block; font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: var(--blue-deep); background: var(--sky); border-radius: 999px; padding: 0.2rem 0.65rem; }
.card .tag { align-self: flex-start; }

/* ---------- inner pages ---------- */
/* .wrap sets its own padding, so the page sections need their top and bottom
   space set here or they start flush against the header. */
.wrap.page { padding-top: 2.25rem; padding-bottom: 2.5rem; }

/* ---------- item page ---------- */
.item .crumb { font-size: 0.875rem; color: var(--ink-soft); margin: 0 0 0.5rem; }
.item-image { width: 100%; max-width: 26rem; border-radius: var(--radius); border: 1px solid var(--line); margin: 0.5rem 0 1rem; }
.item .price { font-family: var(--sans); font-size: 1.35rem; font-weight: 600; color: var(--blue-deep); margin: 0.25rem 0; }
.item .schedule { display: inline-block; color: var(--ink); background: var(--sun-soft); border-radius: var(--radius-small); padding: 0.5rem 0.85rem; margin: 0.25rem 0 1rem; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.actions { margin-top: 1.5rem; }

/* ---------- buttons / forms ---------- */
.btn { display: inline-block; background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 0.8rem 1.45rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; box-shadow: 0 3px 0 var(--blue-deep); }
.btn:hover { background: var(--blue-deep); color: #fff; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--blue-deep); }
.btn.sun { background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--sun-deep); }
.btn.sun:hover { background: #ffc832; color: var(--ink); }
.btn.ghost { background: var(--card); color: var(--blue-deep); border: 2px solid var(--blue); box-shadow: none; padding: calc(0.8rem - 2px) calc(1.45rem - 2px); }
.btn.ghost:hover { background: var(--sky); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.small { padding: 0.45rem 0.95rem; font-size: 0.9rem; }
input[type="email"], input[type="text"] { font: inherit; padding: 0.7rem 0.9rem; border: 2px solid var(--line-strong); border-radius: var(--radius-small); background: var(--card); color: var(--ink); min-width: 0; width: 100%; }
input[type="email"]:focus-visible, input[type="text"]:focus-visible { border-color: var(--blue); }
label { display: block; margin-bottom: 0.4rem; }
.error { color: var(--danger); font-size: 0.9375rem; }

/* ---------- cart ---------- */
.cart-lines { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.75rem; max-width: 40rem; }
.cart-lines li { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.cart-lines li > div:first-child { display: flex; flex-direction: column; gap: 0.15rem; }
.cart-lines .muted { font-size: 0.875rem; }
.qty { display: inline-flex; align-items: center; gap: 0.5rem; }
.qty button { width: 2.25rem; height: 2.25rem; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.qty button:hover { background: var(--sky); }
.line-total { font-weight: 600; min-width: 4.5rem; text-align: right; }
.total { font-size: 1.125rem; margin: 0.5rem 0 1.5rem; }
.checkout { max-width: 28rem; display: grid; gap: 0.6rem; }
@media (max-width: 480px) { .cart-lines li { grid-template-columns: 1fr; } .line-total { text-align: left; } }

/* ---------- success ---------- */
.order-lines { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.75rem; max-width: 40rem; }
.order-lines li { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; display: grid; gap: 0.4rem; }

/* ---------- notice / footer ---------- */
.notice { border: 2px solid var(--line); border-left: 6px solid var(--sun); background: var(--card); border-radius: var(--radius-small); padding: 1rem 1.2rem; max-width: var(--measure); font-size: 0.9375rem; color: var(--ink-soft); }
.pending { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 1rem 1.2rem; font-size: 0.9375rem; color: var(--ink-soft); max-width: var(--measure); background: var(--card); }

footer.site { background: var(--night); color: rgba(255, 250, 242, 0.86); margin-top: 2.5rem; padding-block: 2.75rem 3rem; font-size: 0.875rem; position: relative; }
footer.site::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--blue) 0 25%, var(--sun) 25% 50%, var(--coral) 50% 75%, var(--leaf) 75% 100%); }
footer.site p { max-width: var(--measure); margin: 0 0 0.6rem; }
footer.site strong { color: #fff; }
footer.site .muted { color: rgba(255, 250, 242, 0.72); }
footer.site a { color: var(--sun); }
footer.site :focus-visible { outline-color: var(--sun); }
.subscribe { max-width: 30rem; margin-bottom: 1.9rem; color: #fff; }
.subscribe .row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.subscribe .row input { flex: 1 1 14rem; border-color: transparent; }
.subscribe .row input:focus-visible { border-color: var(--sun); }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 0.5rem); background: var(--night); color: var(--sun); border: 2px solid var(--sun); padding: 0.6rem 1.1rem; border-radius: 999px; font-size: 0.9375rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* Honeypot field in the footer signup: off-screen rather than display:none,
   since some bots skip hidden fields but not positioned ones. */
.subscribe .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
