/* Sparklins site layer. Design System v2.0 "Storybook Day & Night".
   Engine tokens are themed here; page-specific styles live in each page. */
:root {
  --paper: #FFF2DF;
  --paper-raised: #FFFBF2;
  --paper-sunk: #F7E5C6;
  --line: #E5CFAA;
  --line-strong: #957852;
  --ink: #352A46;
  --ink-muted: #665872;
  --star: #FCCC30;
  --on-star: #352A46;
  --honey: #DE851F;
  --plum: #352A46;
  --on-plum: #FFF2DF;
  --night: #1E1729;
  --night-raised: #2B2139;
  --night-ink-muted: #C9BCD4;
  --meadow: #276B45;
  --meadow-soft: #DDEFD8;
  --tangerine: #A3481A;
  --tangerine-fill: #E67C4D;
  --tangerine-soft: #FDE0CF;
  --coral: #FCAA8A;

  --sc-canvas: var(--paper);
  --sc-surface: var(--paper-raised);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--ink-muted);
  --sc-accent: var(--star);
  --sc-accent-ink: var(--on-star);
  --sc-font-display: "Fredoka", "Baloo 2", ui-rounded, system-ui, sans-serif;
  --sc-font-text: "Nunito", ui-rounded, system-ui, sans-serif;
  --sc-shadow-color: 32 45% 30%;
  --sc-e1: 0 1px 2px hsl(var(--sc-shadow-color) / 0.10), 0 2px 6px -1px hsl(var(--sc-shadow-color) / 0.10);
  --sc-e2: 0 2px 4px hsl(var(--sc-shadow-color) / 0.10), 0 10px 22px -6px hsl(var(--sc-shadow-color) / 0.18);
  --sc-e3: 0 4px 8px hsl(var(--sc-shadow-color) / 0.10), 0 22px 44px -10px hsl(var(--sc-shadow-color) / 0.24);
  --sc-edge: inset 0 1px 0 rgba(255,255,255,0.7);
  --sticker: 0 4px 0 rgba(53,42,70,0.16);
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 40px; --r-pill: 999px;
  --focus: #352A46;
  --hdr-h: 72px;
  --sc-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --sc-ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--hdr-h) + 12px); -webkit-text-size-adjust: 100%; }
img, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
body { margin: 0; font-family: var(--sc-font-text); font-size: clamp(1rem, 0.96rem + 0.22vw, 1.125rem); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; }

body { background: var(--paper); color: var(--ink); font-weight: 500; }
::selection { background: var(--star); color: var(--on-star); }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--star); color: var(--on-star); padding: 10px 16px; border-radius: var(--r-pill); font-weight: 800; }
.skip:focus { left: 12px; }

h1, h2, h3, .display { font-family: var(--sc-font-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.04; text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
.eyebrow { font-family: var(--sc-font-text); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--meadow); margin: 0 0 10px; }
.muted { color: var(--ink-muted); }
.wrap { width: min(100% - 2 * clamp(16px, 5vw, 64px), 76rem); margin-inline: auto; }

/* ---------- buttons ---------- */
.btn { --b: var(--star); --t: var(--on-star); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: var(--r-pill); border: 0; background: var(--b); color: var(--t); font-family: var(--sc-font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.1; text-decoration: none; cursor: pointer; box-shadow: var(--sticker); transition: transform 140ms var(--sc-ease-out), box-shadow 140ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out); white-space: nowrap; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(53,42,70,0.16); }
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: translateY(-1px); } }
.btn--plum { --b: var(--plum); --t: var(--on-plum); }
.btn--ghost { --b: transparent; --t: var(--ink); box-shadow: inset 0 0 0 2px var(--line-strong); }
.btn--sm { min-height: 44px; padding: 8px 18px; font-size: 0.95rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.textlink { font-weight: 800; color: var(--ink); }

/* ---------- chips & badges ---------- */
.age { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 7px; border-radius: var(--r-pill); background: var(--star); color: var(--on-star); font-family: var(--sc-font-display); font-weight: 700; font-size: 0.88rem; line-height: 1.3; box-shadow: var(--sticker); white-space: nowrap; }
.age svg { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 12px; border-radius: var(--r-pill); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; background: var(--meadow-soft); color: var(--meadow); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--new { background: var(--tangerine-soft); color: var(--tangerine); }
.pick { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 8px 16px; border-radius: var(--r-pill); border: 2px solid var(--line-strong); background: var(--paper-raised); color: var(--ink); font-weight: 800; font-size: 0.95rem; cursor: pointer; transition: background-color 140ms var(--sc-ease-out), border-color 140ms var(--sc-ease-out), transform 120ms var(--sc-ease-out); }
.pick[aria-pressed="true"], .pick[aria-checked="true"] { background: var(--star); border-color: var(--ink); color: var(--on-star); box-shadow: var(--sticker); }
.pick:active { transform: scale(0.97); }

/* ---------- header ---------- */
.hdr { position: fixed; inset: 0 0 auto 0; z-index: 90; height: var(--hdr-h); display: flex; align-items: center; gap: 16px; padding: 0 clamp(14px, 3vw, 32px); background: color-mix(in oklab, var(--hdr-bg, var(--paper)) 92%, transparent); color: var(--hdr-ink, var(--ink)); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid color-mix(in oklab, var(--hdr-ink, var(--ink)) 10%, transparent); }
.hdr__logo { display: flex; align-items: center; flex: none; }
.hdr__logo img { height: 46px; width: auto; }
.hdr__logo .logo-night { display: none; }
.is-night .hdr__logo .logo-day { display: none; }
.is-night .hdr__logo .logo-night { display: block; }
.hdr__nav { display: flex; gap: 4px; margin-left: 12px; }
.hdr__nav a { padding: 10px 14px; border-radius: var(--r-pill); font-weight: 800; font-size: 0.95rem; text-decoration: none; color: inherit; }
.hdr__nav a[aria-current="page"] { background: color-mix(in oklab, var(--hdr-ink, var(--ink)) 8%, transparent); }
@media (hover: hover) and (pointer: fine) { .hdr__nav a:hover { background: color-mix(in oklab, var(--hdr-ink, var(--ink)) 8%, transparent); } }
.hdr__end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bagbtn { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: var(--r-pill); border: 2px solid color-mix(in oklab, var(--hdr-ink, var(--ink)) 35%, transparent); background: transparent; color: inherit; font-weight: 800; cursor: pointer; }
.bagbtn svg { width: 20px; height: 20px; }
.bagbtn__n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--star); color: var(--on-star); font-size: 0.8rem; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.menubtn { display: none; }
@media (max-width: 860px) {
  .hdr__nav { display: none; position: absolute; top: var(--hdr-h); left: 0; right: 0; flex-direction: column; padding: 12px; background: var(--hdr-bg, var(--paper)); border-bottom: 1px solid var(--line); }
  .hdr__nav.is-open { display: flex; }
  .hdr__nav a { padding: 14px 16px; font-size: 1.05rem; }
  .menubtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid color-mix(in oklab, var(--hdr-ink, var(--ink)) 35%, transparent); background: transparent; color: inherit; cursor: pointer; }
  .hdr .hdr__cta { display: none; }
  .hdr__logo img { height: 40px; }
  .bagbtn__label { display: none; }
}

/* ---------- bag drawer ---------- */
.bag { position: fixed; inset: 0; z-index: 150; display: none; }
.bag.is-open { display: block; }
.bag__scrim { position: absolute; inset: 0; background: rgba(30,23,41,0.45); opacity: 0; transition: opacity 220ms var(--sc-ease-out); }
.bag.is-shown .bag__scrim { opacity: 1; }
.bag__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--paper-raised); color: var(--ink); display: flex; flex-direction: column; box-shadow: var(--sc-e3); transform: translateX(100%); transition: transform 300ms var(--sc-ease-drawer); }
.bag.is-shown .bag__panel { transform: none; }
.bag__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.bag__head h2 { font-size: 1.4rem; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent; color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; }
.bag__ship { margin: 0; padding: 10px 20px; background: var(--meadow-soft); color: var(--meadow); font-weight: 800; font-size: 0.9rem; }
.bag__items { flex: 1; overflow: auto; padding: 8px 20px; }
.bag__empty { text-align: center; padding: 40px 10px; }
.bag__empty img { width: 120px; margin: 0 auto 12px; }
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line img { width: 72px; height: 92px; object-fit: cover; border-radius: var(--r-sm); background: var(--paper-sunk); }
.line h3 { font-size: 1rem; line-height: 1.2; }
.line__price { font-weight: 800; }
.qty { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent; color: var(--ink); font-weight: 800; cursor: pointer; }
.qty span { min-width: 24px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.bag__foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.bag__total { display: flex; justify-content: space-between; font-family: var(--sc-font-display); font-size: 1.25rem; font-weight: 600; }
.bag__fine { margin: 0; font-size: 0.82rem; color: var(--ink-muted); }
.bag__member { margin: 0 0 8px; font-size: 0.86rem; font-weight: 800; color: var(--meadow); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 160; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--plum); color: var(--on-plum); padding: 12px 18px; border-radius: var(--r-pill); font-weight: 800; box-shadow: var(--sc-e2); transition: opacity 200ms var(--sc-ease-out), transform 200ms var(--sc-ease-out); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer ---------- */
.foot { background: var(--night); color: var(--on-plum); padding: 56px 0 28px; }
.foot a { color: var(--on-plum); }
.foot__grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
@media (max-width: 1000px) { .foot__grid { grid-template-columns: repeat(3, 1fr); } .foot__brand { grid-column: 1 / -1; } }
.foot__grid h3 { font-size: 1.05rem; margin-bottom: 10px; color: var(--star); }
.foot__grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot__grid a { text-decoration: none; font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .foot__grid a:hover { text-decoration: underline; } }
.foot__small { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255,242,223,0.18); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 0.85rem; color: var(--night-ink-muted); }
.foot p { color: var(--night-ink-muted); }
@media (max-width: 760px) { .foot__grid { grid-template-columns: 1fr 1fr; } .foot__brand { grid-column: 1 / -1; } }

/* ---------- product card ---------- */
.pcard { display: flex; flex-direction: column; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sc-e2); }
.pcard__media { position: relative; display: block; aspect-ratio: 4 / 5; background: var(--paper-sunk); overflow: hidden; }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--sc-ease-out); }
@media (hover: hover) and (pointer: fine) { .pcard:hover .pcard__media img { transform: scale(1.03); } }
.pcard__media .age { position: absolute; top: 12px; left: 12px; }
.pcard__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.pcard__body h3 { font-size: 1.3rem; }
.pcard__body h3 a { text-decoration: none; }
.pcard__body p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; line-height: 1.5; }
.pcard__foot { margin-top: auto; padding-top: 10px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.price { font-family: var(--sc-font-display); font-weight: 700; font-size: 1.35rem; line-height: 1; }
.price small { display: block; margin-top: 4px; font-family: var(--sc-font-text); font-weight: 700; font-size: 0.7rem; color: var(--ink-muted); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
[hidden] { display: none !important; }

/* ---------- v2.4 header: search + sticker book ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hdrbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border-radius: var(--r-pill); border: 2px solid color-mix(in oklab, var(--hdr-ink, var(--ink)) 22%, transparent); background: var(--paper-raised); color: inherit; font: inherit; font-weight: 800; font-size: 0.95rem; cursor: pointer; transition: border-color 140ms var(--sc-ease-out); }
.hdrbtn--stk { padding-left: 8px; }
.hdrbtn--stk img { width: 28px; height: 28px; }
.hdrbtn--stk b { min-width: 24px; height: 24px; padding: 0 6px; border-radius: var(--r-pill); background: var(--star); color: var(--on-star); display: inline-grid; place-items: center; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .hdrbtn:hover { border-color: var(--hdr-ink, var(--ink)); } }
.is-night .hdrbtn { background: var(--night-raised); }
@media (max-width: 1240px) { .hdrbtn--search span { display: none; } .hdrbtn--search { width: 44px; padding: 0; justify-content: center; } }
@media (max-width: 1080px) { .hdrbtn--stk span { display: none; } }
@media (max-width: 420px) { .hdr__end { gap: 6px; } .hdrbtn--stk { padding: 4px 8px 4px 4px; gap: 4px; } .bagbtn { padding: 8px 10px; } .hdr { gap: 8px; } }
@media (max-width: 360px) { .hdr__logo img { height: 34px; } }
.stkpill { display: none !important; }

/* ---------- v2.4 site search ---------- */
.srch { position: fixed; inset: 0; z-index: 150; display: grid; align-items: start; justify-items: center; padding: clamp(12px, 8vh, 96px) 12px 12px; }
.srch[hidden] { display: none; }
.srch__scrim { position: absolute; inset: 0; background: rgba(30,23,41,0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.srch__panel { position: relative; width: min(100%, 680px); max-height: min(80vh, 720px); display: flex; flex-direction: column; background: var(--paper-raised); border-radius: var(--r-lg); box-shadow: var(--sc-e3); overflow: hidden; animation: srch-in 220ms var(--sc-ease-out); }
@keyframes srch-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.srch__bar { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: 1.5px solid var(--line); color: var(--ink); }
.srch__bar input { flex: 1; min-width: 0; min-height: 48px; border: 0; background: transparent; font: inherit; font-size: 1.1rem; font-weight: 700; color: var(--ink); outline: none; }
.srch__bar input::placeholder { color: var(--ink-muted); font-weight: 600; }
.srch__results { overflow: auto; padding: 8px; }
.srch__group { margin: 10px 10px 4px; font-weight: 800; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.srch__hit { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--r-md); text-decoration: none; color: var(--ink); }
.srch__hit img { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; background: var(--paper-sunk); }
.srch__hit strong { display: block; font-family: var(--sc-font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
.srch__hit span { display: block; font-size: 0.88rem; color: var(--ink-muted); font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.srch__hit:hover, .srch__hit:focus-visible, .srch__hit.is-active { background: var(--paper-sunk); }
.srch__empty { margin: 18px 12px; color: var(--ink); font-weight: 600; }
.srch__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 10px 12px; }
html.srch-open { overflow: hidden; }

/* ---------- v2.5 footer: six columns + tagline ---------- */
.foot__grid--6 { grid-template-columns: 1.5fr repeat(5, 1fr); gap: 24px; }
@media (max-width: 1100px) { .foot__grid--6 { grid-template-columns: repeat(3, 1fr); } .foot__grid--6 .foot__brand { grid-column: 1 / -1; } }
@media (max-width: 760px) { .foot__grid--6 { grid-template-columns: 1fr 1fr; } }
.foot__tag { font-family: var(--sc-font-display); font-weight: 600; font-size: 1.25rem; color: var(--star); margin: 10px 0 4px; }
.chiplinks { display: flex; flex-wrap: wrap; gap: 8px; }
.chiplink { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: var(--r-pill); border: 2px solid var(--line-strong); background: var(--paper-raised); color: var(--ink); font-weight: 800; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .chiplink:hover { background: var(--star); border-color: var(--ink); } }

/* v3.0 account button */
.hdrbtn--acct { text-decoration: none; padding-left: 8px; }
.hdrbtn--acct svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.hdrbtn__av { width: 28px; height: 28px; border-radius: 50%; background: var(--plum); color: var(--on-plum); display: inline-grid; place-items: center; font-size: 0.85rem; }
@media (max-width: 1160px) { .hdrbtn--acct span { display: none; } .hdrbtn--acct { width: 44px; padding: 0; justify-content: center; } }
@media (max-width: 420px) { .hdrbtn--acct { width: 40px; min-height: 40px; } }

/* v3.1 header fit */
@media (min-width: 861px) and (max-width: 1240px) { .hdr__nav a { padding: 10px 9px; font-size: 0.9rem; } .hdr__nav { margin-left: 4px; gap: 0; } .hdrbtn--search span, .hdrbtn--stk span { display: none; } }
@media (min-width: 861px) and (max-width: 1000px) { .hdrbtn--acct span, .bagbtn__label { display: none; } }
