/* Swapaboo homepage (brand + content pass). Mobile-first 390px; desktop = same content centred, column
   capped ~560px. Scoped to the homepage only (index.html) — the other waitlist pages keep style.css.

   SUN (#FFC94D) RULE: sun is for MONEY (credits/coins) and the logo ONLY, with exactly two approved
   exceptions, both marked in this file: the "outgrown" highlight in the GENERIC H1 (.hh em), and
   "Skip the wait" on the ink card (.skipcard h3). Everything else uses ink / pink / green / sky / slate. */
:root{
  --ink:#33415C;        /* text + borders */
  --cream:#FFF8EE;      /* page */
  --slate:#5A6785;      /* secondary text */
  --pink:#F58FA4;
  --green:#6FBF77;
  --sky:#8FD0F2;
  --sun:#FFC94D;        /* money / logo only (+ the two exceptions above) */
  --card:#FFFFFF;
  --face:#EFE8DB;       /* neutral image placeholder */
}

/* Self-hosted fonts, latin subset only, font-display:swap. Fredoka = everything (700 headings, 500 body,
   600 labels); Caveat 700 = handwritten accents only. Only Fredoka 700 is preloaded (in the <head>). */
@font-face{font-family:'Fredoka';font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/fredoka-500.woff2) format('woff2')}
@font-face{font-family:'Fredoka';font-style:normal;font-weight:600;font-display:swap;src:url(/assets/fonts/fredoka-600.woff2) format('woff2')}
@font-face{font-family:'Fredoka';font-style:normal;font-weight:700;font-display:swap;src:url(/assets/fonts/fredoka-700.woff2) format('woff2')}
@font-face{font-family:'Caveat';font-style:normal;font-weight:700;font-display:swap;src:url(/assets/fonts/caveat-700.woff2) format('woff2')}
/* Metric-matched fallbacks (no download) so the font swap causes no layout shift. size-adjust is
   width-measured against the real faces at 100px vs Arial (see the measure harness); line boxes are held by
   explicit line-heights throughout, so width-matching is what kills the swap shift. */
@font-face{font-family:'Fredoka Fallback';src:local('Arial');size-adjust:100%}
@font-face{font-family:'Caveat Fallback';src:local('Arial');size-adjust:72%}
/* Dedicated metric-matched fallback for the big H1 (the town LCP element). Fredoka-700's own metrics
   (unitsPerEm 1000, hhea/typo ascent 974, descent -236, lineGap 0, xWidthAvg 445) mapped onto a local
   Arial box via the capsize formula, so the fallback occupies Fredoka-700's EXACT geometry (not just
   width). With the box identical, the swap is a no-op repaint and Chrome records LCP at the early fallback
   paint instead of the late swap. Final visible face is still Fredoka-700 (font-display:swap). */
@font-face{font-family:'Fredoka700 Fallback';src:local('Arial');
  size-adjust:100.91%;ascent-override:96.52%;descent-override:23.39%;line-gap-override:0%}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--cream);color:var(--ink);
  font-family:'Fredoka','Fredoka Fallback',system-ui,sans-serif;font-weight:500;line-height:1.5;
  -webkit-font-smoothing:antialiased;font-size:16px}
img{display:block;max-width:100%}
a{color:inherit}
h1,h2,h3{font-family:'Fredoka','Fredoka700 Fallback',system-ui,sans-serif;font-weight:700;line-height:1.08;margin:0}

/* Handwritten accent — Caveat ONLY here: the tagline, Sophie's name, and "Skip the wait". */
.hand{font-family:'Caveat','Caveat Fallback',cursive;font-weight:700}

.wrap{max-width:560px;margin:0 auto;padding:16px 20px 44px}

/* header */
.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}
.logo{display:inline-flex;align-items:center;text-decoration:none}
.logo img{height:30px;width:104px}
.signin{font-size:14.5px;font-weight:600;color:var(--ink);text-decoration:none;opacity:.85}
.signin:hover{opacity:1}

/* pill — white, ink border, green dot */
.pill{display:inline-flex;align-items:center;gap:8px;background:var(--card);color:var(--ink);
  border:2px solid var(--ink);font-size:13.5px;font-weight:600;padding:7px 14px;border-radius:999px;
  margin-bottom:18px;line-height:1.35}
.pill .dot{flex:0 0 auto;width:9px;height:9px;border-radius:50%;background:var(--green)}
.pilltext{min-width:0}

/* headline + tagline + lede */
.hh{font-size:clamp(31px,8.5vw,40px);letter-spacing:-.4px;color:var(--ink);margin:0 0 10px}
/* GENERIC H1 highlight = SUN (approved exception #1). */
.hh em{font-style:normal;color:var(--ink);
  background-image:linear-gradient(transparent 58%, var(--sun) 58%);
  -webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .05em;border-radius:2px}
/* TOWN H1 (edge layer adds .town): same ink text, but the highlighter band is SKY. */
.hh.town em{background-image:linear-gradient(transparent 58%, var(--sky) 58%)}
.tagline{font-size:22px;color:var(--slate);margin:0 0 14px;line-height:1.1}
.lede{font-size:17px;color:var(--slate);margin:0 0 14px;max-width:34ch}
.nomoney{font-size:15px;color:var(--ink);margin:0 0 20px;max-width:42ch}
.nomoney b{font-weight:600}

/* join card — white, 2.5px ink border */
.joincard{background:var(--card);border:2.5px solid var(--ink);border-radius:18px;padding:18px}
.joinform{display:flex;flex-direction:column;gap:10px}
.jlabel{font-size:13.5px;font-weight:600;color:var(--ink)}
.jinput{font-size:17px;font-family:inherit;font-weight:500;color:var(--ink);background:#fff;
  border:2px solid var(--ink);border-radius:12px;padding:13px 15px;width:100%}
.jinput::placeholder{color:#9AA2B2}
.jinput:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(143,208,242,.6)}
/* primary button — ink bg, cream text, 4px sky drop */
.jbtn{font-size:16.5px;font-weight:600;font-family:inherit;color:var(--cream);background:var(--ink);border:0;
  border-radius:12px;padding:14px 16px;width:100%;cursor:pointer;box-shadow:0 4px 0 var(--sky);
  transition:transform .08s,box-shadow .08s}
.jbtn:active{transform:translateY(3px);box-shadow:0 1px 0 var(--sky)}
.jbtn:disabled{opacity:.6;cursor:default;box-shadow:0 4px 0 var(--sky)}
.jsub{font-size:13px;color:var(--slate);margin:11px 0 0;text-align:center}
.wl-msg{font-size:13.5px;color:var(--slate);margin:8px 0 0;text-align:center;min-height:1px}
.wl-msg.err{color:#C9452F}

/* sections */
.sect{margin-top:40px}
.shd{font-size:23px;letter-spacing:-.2px;margin:0 0 16px}

/* bundles — MOBILE "Real bundles from our shelves" row of real cleaned shelf cards, square boxes (no CLS).
   Each card is a link to the catalogue (/browse); the whole card is tappable. The cleaned images are square
   on cream, so the box is 1:1 (no crop). */
.bundles{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;margin:0 -20px;padding:0 20px 4px;
  -webkit-overflow-scrolling:touch}
.bundle{flex:0 0 46%;max-width:200px;margin:0;scroll-snap-align:start;text-decoration:none;color:inherit;display:block}
.bimg{aspect-ratio:1;border-radius:14px;overflow:hidden;background:var(--face);border:2.5px solid var(--ink)}
.bimg img{width:100%;height:100%;object-fit:cover}
.bcap{display:block;font-size:13.5px;font-weight:600;color:var(--ink);margin-top:8px}
.piececount{font-size:14px;color:var(--slate);margin:14px 0 0;font-weight:600}

/* explainer video — top of How it works, below the join box. Portrait 9:16, fixed aspect = no shift.
   src is attached by home.js only as it nears the viewport; poster shows until then (never preloaded). */
.vid{display:block;width:100%;max-width:300px;margin:0 auto 22px;aspect-ratio:600/1067;border-radius:16px;
  border:2.5px solid var(--ink);background:var(--face) center/cover no-repeat;object-fit:cover}

/* how it works — four image steps */
.steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:20px}
.step{display:flex;gap:15px;align-items:center}
.stepimg{flex:0 0 auto;width:96px;height:96px;border-radius:14px;background:var(--face);border:2.5px solid var(--ink)}
.step b{display:block;font-size:16.5px;font-weight:600;margin-bottom:3px;color:var(--ink)}
.step p{font-size:14.5px;color:var(--slate);margin:0}

/* "Every piece checked" card + the two ticks */
.checked{margin-top:26px;background:var(--card);border:2.5px solid var(--ink);border-radius:18px;
  padding:18px;display:flex;gap:14px;align-items:flex-start}
.checkmark{flex:0 0 auto;width:34px;height:34px;border-radius:50%;background:var(--green);color:var(--ink);
  font-size:18px;font-weight:700;display:flex;align-items:center;justify-content:center;margin-top:1px}
.checked b{display:block;font-size:16.5px;font-weight:600;margin-bottom:3px}
.checked p{font-size:14.5px;color:var(--slate);margin:0}
.ticks{list-style:none;margin:16px 0 0;padding:0;display:flex;flex-direction:column;gap:12px}
.ticks li{display:flex;gap:12px;align-items:flex-start;font-size:15px;font-weight:500}
.tick{flex:0 0 auto;width:24px;height:24px;border-radius:50%;background:var(--green);color:var(--ink);
  font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;margin-top:1px}

/* sophie */
.sophie{margin-top:40px;background:var(--card);border:2.5px solid var(--ink);border-radius:18px;padding:20px;
  display:flex;gap:16px;align-items:flex-start}
.sophpic{width:66px;height:66px;border-radius:50%;flex:0 0 auto;object-fit:cover;background:var(--face);
  border:2px solid var(--ink)}
.sophquote{font-size:15.5px;line-height:1.55;margin:0 0 10px;color:var(--ink);font-weight:500}
.sophname{font-size:27px;color:var(--ink);margin:0;line-height:1}
.sophrole{font-size:13px;font-weight:600;color:var(--slate);margin:2px 0 0}

/* invite card — solid ink, cream "Join free" button with a pink drop */
.darkcard{margin-top:40px;background:var(--ink);color:var(--cream);border-radius:18px;padding:24px 22px;text-align:center}
.darkcard h3{font-size:22px;color:var(--cream);margin:0 0 8px}
.darkcard p{font-size:15px;color:#D6DBE6;margin:0 auto 18px;max-width:40ch}
.darkbtn{font-size:16px;font-weight:600;font-family:inherit;color:var(--ink);background:var(--cream);border:0;
  border-radius:12px;padding:13px 26px;cursor:pointer;box-shadow:0 4px 0 var(--pink);
  transition:transform .08s,box-shadow .08s}
.darkbtn:active{transform:translateY(3px);box-shadow:0 1px 0 var(--pink)}

/* footer */
.foot{margin-top:44px;padding-top:22px;border-top:2px solid var(--ink);text-align:center}
.foot nav{display:flex;flex-wrap:wrap;gap:16px;justify-content:center;font-size:14px;font-weight:600}
.foot nav a{text-decoration:none;color:var(--ink);opacity:.85}
.foot nav a:hover{opacity:1}
.legal{font-size:11.5px;color:var(--slate);opacity:.9;line-height:1.5;margin:14px 0 0}

/* ── After-email state (home.js swaps #main's contents) ───────────────────────────── */
.done{text-align:center;padding-top:10px}
.donetick{width:56px;height:56px;border-radius:50%;background:var(--green);color:var(--ink);
  font-size:28px;font-weight:700;display:flex;align-items:center;justify-content:center;margin:0 auto 16px}
.done h2{font-size:26px;letter-spacing:-.3px;margin:0 0 8px}
.done .sub{font-size:16px;color:var(--slate);margin:0 auto 24px;max-width:40ch}
.skipcard{background:var(--ink);color:var(--cream);border-radius:18px;padding:22px;text-align:left;margin:0 0 22px}
/* "Skip the wait" = Caveat + SUN (approved exception #2). */
.skipcard h3{font-family:'Caveat','Caveat Fallback',cursive;font-size:30px;color:var(--sun);margin:0 0 6px;line-height:1}
.skipcard p{font-size:14.5px;color:#D6DBE6;margin:0 0 15px}
.skipactions{display:flex;flex-direction:column;gap:10px}
.wa-btn,.copy-btn{font-size:15px;font-weight:600;font-family:inherit;border-radius:11px;padding:13px 16px;
  cursor:pointer;border:0;text-align:center;text-decoration:none;display:block}
.wa-btn{background:var(--green);color:var(--ink);box-shadow:0 4px 0 rgba(0,0,0,.18);transition:transform .08s,box-shadow .08s}
.wa-btn:active{transform:translateY(3px);box-shadow:0 1px 0 rgba(0,0,0,.18)}
.copy-btn{background:var(--cream);color:var(--ink)}
.sizesask{text-align:left;background:var(--card);border:2.5px solid var(--ink);border-radius:18px;padding:18px}
.sizesask h3{font-size:16.5px;margin:0 0 3px;font-weight:600}
.sizesask .hint{font-size:13px;color:var(--slate);margin:0 0 13px}
/* Optional first-name capture on the after-email screen (home.js). Matches the sizes card. 16px input font
   so iOS doesn't zoom on focus. */
.nameask{text-align:left;background:var(--card);border:2.5px solid var(--ink);border-radius:18px;padding:18px;margin:0 0 22px}
.nameask label{display:block;font-size:16.5px;font-weight:600;margin:0 0 10px}
.namerow{display:flex;gap:9px}
.nameinput{display:block;width:100%;box-sizing:border-box;font-size:16px;font-family:inherit;color:var(--ink);background:#fff;
  border:2px solid var(--ink);border-radius:11px;padding:11px 14px}
.nameinput:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.namesave{flex:0 0 auto;font-size:15px;font-weight:600;font-family:inherit;color:var(--ink);
  background:var(--sun);border:2px solid var(--ink);border-radius:11px;padding:11px 18px;cursor:pointer}
.namesave:active{transform:translateY(1px)}
.namesaved{display:block;font-size:13px;color:var(--slate);margin:9px 0 0;min-height:1em}
.chips{display:flex;flex-wrap:wrap;gap:9px}
.chip{font-size:14px;font-weight:600;font-family:inherit;color:var(--ink);background:#fff;
  border:2px solid var(--ink);border-radius:999px;padding:8px 15px;cursor:pointer}
/* selected: baby bands fill PINK, toddler-and-up fill SKY; ink text + border throughout. */
.chip.on.baby{background:var(--pink)}
.chip.on.up{background:var(--sky)}
.chip:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
/* Three-step after-email flow (home.js renderStep1/2/3). Reuses .done/.donetick/.sub/.nameask/.sizesask/
   .chip/.skipcard/.wa-btn/.copy-btn/.jbtn; the rules below are the only new bits. */
.postjoin .jbtn{margin-top:18px}
.startlisting{display:block;text-align:center;text-decoration:none}
.postjoin .skipcard{margin:20px 0 0;text-align:center}
.postjoin .skipcard p{margin:0 0 13px}
.stepskip{display:block;margin:16px auto 0;background:none;border:0;font:inherit;font-size:14.5px;
  font-weight:600;color:var(--slate);text-decoration:underline;cursor:pointer}
.namesaved.err{color:#C9452F}
.otherwise{font-size:14px;color:var(--slate);margin:16px auto 0;max-width:42ch}

/* ── Desktop-layout scaffolding (new elements only) ────────────────────────────────────────────────
   HARD RULE: the phone layout is byte-for-byte unchanged. These defaults only HIDE the new desktop-only
   elements and leave the .hero/.herotext/.hiw/.reassure-m/.duo wrappers transparent (plain blocks) on
   mobile; ALL desktop layout lives in the min-width:900px block, and the hero illustration is a background
   set only there, so phones never download it. */
.topnav{display:flex;align-items:center;gap:22px}
.navlink{display:none}
/* The hero column (heading + 2x2 grid / pile fallback) is DESKTOP-ONLY: phones never render it, so nothing
   it references downloads under 900px. All of its layout lives in the min-width:900px block. */
.herocol{display:none}
.reassure-d{display:none}

@media(min-width:620px){
  .hh{font-size:42px}
  .bundle{flex-basis:32%}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .jbtn,.darkbtn,.wa-btn{transition:none}
}

/* ── DESKTOP (>=900px) ─────────────────────────────────────────────────────────────────────────────
   Everything below is desktop-only; nothing here applies under 900px, so the phone layout + payload are
   untouched. "board 4" layout: 1160px container, two-column hero, 4-up bundles, two-column How-it-works,
   three reassurance cards, Sophie + invite side by side. */
@media(min-width:900px){
  .wrap{max-width:1160px;padding:24px 40px 60px}

  /* header: nav links + outlined Sign-in pill */
  .top{margin-bottom:34px}
  .navlink{display:inline-block;font-size:15px;font-weight:600;color:var(--ink);text-decoration:none;opacity:.85}
  .navlink:hover{opacity:1}
  .signin{border:2px solid var(--ink);border-radius:999px;padding:8px 18px;opacity:1}

  /* hero: two columns (text left, illustration right) */
  .hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,460px);gap:48px;align-items:center;margin-bottom:8px}
  .herotext{min-width:0}
  .hero .pill{margin-bottom:16px}
  .hh{font-size:clamp(44px,5vw,56px);line-height:1.02;margin:0 0 12px}
  .tagline{font-size:26px;margin:0 0 16px}
  .lede{font-size:18px;max-width:46ch}
  .nomoney{max-width:48ch}
  /* email input + button side by side, wrap if tight; date line left-aligned */
  .joinform{flex-direction:row;flex-wrap:wrap;align-items:center}
  .jlabel{flex:1 0 100%}
  .jinput{flex:1 1 240px}
  .jbtn{flex:0 0 auto;width:auto;white-space:nowrap}
  .jsub{text-align:left}
  /* hero visual — DESKTOP-ONLY. A small heading over a 2x2 grid of real cleaned shelf photos, replacing the
     pile. The grid lives in a fixed square (aspect-ratio:1) so showing it (or the pile fallback) causes zero
     layout shift; the hero row height is set by the taller text column, so nothing moves. Images are lazy /
     low priority -> the H1 stays the LCP. */
  .herocol{display:block;min-width:0}
  .herohd{font-size:15px;font-weight:600;color:var(--slate);margin:0 0 12px;text-align:center}
  .herovis{position:relative;width:100%;aspect-ratio:1}
  .herogrid{position:absolute;inset:0;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:14px}
  .herogrid[hidden]{display:none}
  .hcard{display:flex;flex-direction:column;min-height:0;text-decoration:none;color:inherit}
  .hcard .bimg{flex:1 1 auto;min-height:0;border-radius:16px}
  .hcard .bcap{margin-top:7px;font-size:13.5px;line-height:1.2}
  /* pile fallback — shown by home.js ONLY if an image fails to load: a 360px square centred in the box. */
  .heroimg{display:block;position:absolute;inset:0;margin:auto;width:100%;max-width:360px;max-height:360px;
    aspect-ratio:1;border:2.5px solid var(--ink);border-radius:20px;
    background:var(--card) url(/assets/pile.webp) center/cover no-repeat}
  .heroimg[hidden]{display:none}

  /* the mobile "Real bundles from our shelves" ROW is hidden on desktop (the hero grid carries the photos). */
  #bundles-sect{display:none}

  /* how it works: video left (square box), the four steps as a 2x2 grid right */
  .hiw{display:grid;grid-template-columns:340px minmax(0,1fr);gap:40px;align-items:center}
  /* portrait 9:16 box (~340 wide) matching the video's own aspect -> object-fit:contain fills it with no
     bars and never crops the explainer's captions (the captions ARE the message). */
  .vid{width:100%;max-width:340px;height:auto;margin:0;aspect-ratio:600/1067;object-fit:contain}
  .steps{display:grid;grid-template-columns:1fr 1fr;gap:24px 28px}
  .step{align-items:flex-start}
  .stepimg{width:112px;height:112px}

  /* reassurance: three cards in a row (the mobile card + two ticks are hidden) */
  .reassure-m{display:none}
  .reassure-d{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
  .rcard{background:var(--card);border:2.5px solid var(--ink);border-radius:18px;padding:22px}
  .rcard .checkmark{margin:0 0 12px}
  .rcard b{display:block;font-size:17px;font-weight:600;margin-bottom:5px;color:var(--ink)}
  .rcard p{font-size:14.5px;color:var(--slate);margin:0}

  /* sophie + "Want in sooner?" side by side */
  .duo{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:stretch;margin-top:40px}
  .duo .sophie,.duo .darkcard{margin-top:0}
  .darkcard{display:flex;flex-direction:column;justify-content:center}
}
