/* Camp Sparkles. Tokens first; nothing below uses a literal color, size or duration. */
:root {
  color-scheme: light dark;
  /* brand, from the logo: Sparkles purple, star yellow, outline ink, cream paper */
  --purple: oklch(47% 0.22 288);
  --purple-deep: oklch(40% 0.2 288);
  --purple-tint: oklch(94.5% 0.035 288);
  --star: oklch(84% 0.165 80);
  --star-deep: oklch(72% 0.16 70);
  --star-tint: oklch(96% 0.05 90);
  --outline: oklch(24% 0.07 300);
  /* neutrals, warm paper tinted toward the purple */
  --canvas: oklch(98.2% 0.014 80);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(96.4% 0.016 80);
  --surface-3: oklch(93% 0.018 80);
  --line: oklch(89% 0.018 80);
  --ink: oklch(24% 0.07 300);
  --ink-2: oklch(40% 0.05 300);
  --ink-3: oklch(53% 0.035 300);
  --accent: var(--purple);
  --accent-fill: var(--purple);
  --on-accent: oklch(100% 0 0);
  --violet-tint: var(--purple-tint);
  --positive: oklch(50% 0.13 150);
  --attention: oklch(55% 0.14 70);
  --negative: oklch(52% 0.18 25);
  --focus: oklch(60% 0.2 288 / 0.45);

  --font-display: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --t-large: clamp(2.125rem, 1.6rem + 2.4vw, 2.75rem);
  --t-title1: clamp(1.75rem, 1.5rem + 1vw, 2rem);
  --t-title2: 1.375rem;
  --t-title3: 1.25rem;
  --t-headline: 1.0625rem;
  --t-body: 1.0625rem;
  --t-foot: 0.8125rem;
  --t-cap: 0.75rem;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 48px; --s10: 64px;
  --r1: 6px; --r2: 10px; --r3: 14px; --r4: 22px; --r5: 30px; --rfull: 999px;
  /* the sticker: the logo's outline, used on buttons only */
  --sticker-line: 2px solid var(--outline);
  --sticker-drop: 0 3px 0 var(--outline);
  --sticker-drop-pressed: 0 1px 0 var(--outline);
  --shadow-raised: 0 1px 2px oklch(24% 0.07 300 / 0.06), 0 10px 28px oklch(24% 0.07 300 / 0.1);
  --d-press: 50ms; --d-state: 140ms; --d-move: 240ms; --d-arrive: 420ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --tap: 44px;
  --measure: 66ch;
}
@media (prefers-color-scheme: dark) {
  :root {
    --purple: oklch(74% 0.15 290);
    --purple-deep: oklch(56% 0.21 288);
    --purple-tint: oklch(30% 0.08 290);
    --star-tint: oklch(32% 0.06 85);
    --outline: oklch(12% 0.04 300);
    --canvas: oklch(17% 0.045 295);
    --surface: oklch(21.5% 0.05 295);
    --surface-2: oklch(25% 0.052 295);
    --surface-3: oklch(30% 0.054 295);
    --line: oklch(33% 0.05 295);
    --ink: oklch(96.5% 0.015 80);
    --ink-2: oklch(83% 0.02 80);
    --ink-3: oklch(69% 0.02 80);
    --accent-fill: var(--purple-deep);
    --positive: oklch(76% 0.13 150);
    --attention: oklch(82% 0.14 85);
    --negative: oklch(72% 0.16 25);
    --shadow-raised: 0 1px 2px oklch(0% 0 0 / 0.3), 0 10px 28px oklch(0% 0 0 / 0.4);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--canvas); color: var(--ink); font: var(--t-body)/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
@media (min-width: 1024px) { body { font-size: 1rem; } }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-size: var(--t-large); line-height: 1.08; }
h2 { font-size: var(--t-title1); line-height: 1.15; }
h3 { font-size: var(--t-title3); line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: var(--t-foot); }
.eyebrow { font-size: var(--t-cap); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.wrap { width: min(100% - 2 * var(--s4), 1080px); margin-inline: auto; }
.narrow { width: min(100% - 2 * var(--s4), 640px); margin-inline: auto; }
.stack > * + * { margin-top: var(--s4); }
.stack-s > * + * { margin-top: var(--s2); }
.stack-l > * + * { margin-top: var(--s7); }
.row { display: flex; align-items: center; gap: var(--s3); }
.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r1); }

/* brand mark: the sparkle */
.mark { display: inline-flex; align-items: center; gap: var(--s2); font-family: var(--font-display); font-weight: 700; font-size: var(--t-title3); letter-spacing: -0.01em; color: var(--purple); text-decoration: none; }
.mark svg { width: 34px; height: auto; flex: none; }
svg .mk-star { fill: var(--star); }
svg .mk-arc { fill: var(--purple); }

/* buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s5); border-radius: var(--rfull);
  font: 600 var(--t-headline)/1 var(--font-body); text-decoration: none; white-space: nowrap;
  background: var(--accent-fill); color: var(--on-accent);
  border: var(--sticker-line); box-shadow: var(--sticker-drop);
  transition: transform var(--d-press) var(--ease-out), box-shadow var(--d-press) var(--ease-out), background var(--d-state) var(--ease-out), opacity var(--d-state);
}
.btn:active { transform: translateY(2px); box-shadow: var(--sticker-drop-pressed); }
.btn.secondary { background: var(--surface); color: var(--ink); }
.btn.plain, .btn.danger { border: 0; box-shadow: none; }
.btn.plain:active, .btn.danger:active { transform: scale(0.97); }
.btn.plain { background: transparent; color: var(--accent); padding: 0 var(--s3); }
.btn.danger { background: transparent; color: var(--negative); }
.btn.big { min-height: 54px; padding: 0 var(--s7); font-size: var(--t-title3); }
.btn.full { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* inset grouped list */
.group { background: var(--surface); border-radius: var(--r3); overflow: hidden; }
.group-head { font-size: var(--t-foot); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; margin: var(--s6) var(--s4) var(--s2); }
.group-foot { font-size: var(--t-foot); color: var(--ink-3); margin: var(--s2) var(--s4) 0; }
.cell { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: var(--s3) var(--s4); position: relative; text-decoration: none; color: inherit; background: none; border: 0; width: 100%; text-align: left; font: inherit; }
.cell + .cell::before { content: ''; position: absolute; top: 0; left: var(--s4); right: 0; border-top: 1px solid var(--line); }
button.cell, a.cell { cursor: pointer; transition: background var(--d-state); }
button.cell:active, a.cell:active { background: var(--surface-2); }
.cell .title { font-weight: 500; }
.cell .sub { font-size: var(--t-foot); color: var(--ink-3); }
.cell .value { color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.chev::after { content: ''; width: 8px; height: 8px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(-45deg); margin-left: var(--s1); flex: none; }

/* fields: native controls, styled lightly */
label.field { display: block; padding: var(--s3) var(--s4); position: relative; }
label.field + label.field::before, label.field + .cell::before, .cell + label.field::before { content: ''; position: absolute; top: 0; left: var(--s4); right: 0; border-top: 1px solid var(--line); }
.field > span { display: block; font-size: var(--t-foot); color: var(--ink-2); margin-bottom: var(--s1); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: max(16px, 1em); padding: var(--s1) 0; min-height: 32px; outline: none;
}
.field textarea { resize: vertical; min-height: 72px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field:focus-within > span { color: var(--accent); }
.field.invalid > span { color: var(--negative); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-fill); width: 22px; height: 22px; flex: none; margin: 0; }
.check { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); cursor: pointer; position: relative; }
.check + .check::before { content: ''; position: absolute; top: 0; left: var(--s4); right: 0; border-top: 1px solid var(--line); }
.check .grow > :first-child { font-weight: 500; }
.check .price { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r2); padding: 2px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--ink); font: 500 var(--t-foot)/1 var(--font-body); padding: 0 var(--s3); min-height: 32px; border-radius: calc(var(--r2) - 2px); cursor: pointer; white-space: nowrap; transition: background var(--d-state), box-shadow var(--d-state); }
.cell .seg { display: flex; width: 100%; }
.cell .seg button { flex: 1; padding: 0 var(--s2); }
.icon-btn { appearance: none; border: 0; background: none; color: var(--ink-3); width: var(--tap); height: var(--tap); margin: calc(-1 * var(--s2)) calc(-1 * var(--s3)) calc(-1 * var(--s2)) 0; display: grid; place-items: center; border-radius: var(--rfull); cursor: pointer; flex: none; transition: color var(--d-state), background var(--d-state); }
.icon-btn:hover { color: var(--negative); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.seg button[aria-pressed=true] { background: var(--surface); box-shadow: 0 1px 3px oklch(0% 0 0 / 0.12); }

.chip { display: inline-flex; align-items: center; gap: var(--s1); font-size: var(--t-cap); font-weight: 600; padding: 2px var(--s2); border-radius: var(--rfull); background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.chip.good { background: color-mix(in oklch, var(--positive) 16%, transparent); color: var(--positive); }
.chip.warn { background: color-mix(in oklch, var(--attention) 18%, transparent); color: var(--attention); }
.chip.bad { background: color-mix(in oklch, var(--negative) 14%, transparent); color: var(--negative); }
.chip.accent { background: var(--violet-tint); color: var(--accent); }

/* toast with undo */
.toast { position: fixed; left: 50%; bottom: calc(var(--s6) + env(safe-area-inset-bottom)); transform: translate(-50%, 24px); opacity: 0; background: var(--ink); color: var(--canvas); border-radius: var(--rfull); padding: var(--s3) var(--s5); display: flex; gap: var(--s4); align-items: center; z-index: 50; transition: transform var(--d-move) var(--ease-out), opacity var(--d-move); max-width: calc(100% - 2 * var(--s4)); }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast button { background: none; border: 0; color: var(--star); font: 600 var(--t-body) var(--font-body); cursor: pointer; padding: 0; min-height: 32px; }

/* sheet */
dialog.sheet { border: 0; padding: 0; background: var(--canvas); color: var(--ink); width: min(100%, 640px); max-width: 100%; max-height: 92vh; border-radius: var(--r4) var(--r4) 0 0; margin: auto auto 0; }
@media (min-width: 744px) { dialog.sheet { border-radius: var(--r4); margin: auto; max-height: 86vh; } }
dialog.sheet::backdrop { background: oklch(10% 0.02 290 / 0.4); }
dialog.sheet[open] { animation: sheet-in var(--d-arrive) var(--ease-out); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { position: sticky; top: 0; background: var(--canvas); display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); z-index: 1; border-bottom: 1px solid var(--line); }
.sheet-body { padding: var(--s4) var(--s4) var(--s8); }

.empty { text-align: center; padding: var(--s9) var(--s4); color: var(--ink-2); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; margin: var(--s8) auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { background: color-mix(in oklch, var(--negative) 10%, var(--surface)); color: var(--negative); border-radius: var(--r2); padding: var(--s3) var(--s4); font-size: var(--t-foot); }
.note-box { background: var(--violet-tint); border-radius: var(--r3); padding: var(--s4); }

.fade-in { animation: fade-in var(--d-move) var(--ease-out) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ---------- shared site chrome ---------- */
.site-top { position: sticky; top: 0; z-index: 20; background: color-mix(in oklch, var(--canvas) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid color-mix(in oklch, var(--line) 60%, transparent); }
.site-top .wrap { display: flex; align-items: center; gap: var(--s3); min-height: 60px; }
.site-top .mark { margin-right: auto; }
.site-nav { display: none; gap: var(--s1); }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; padding: var(--s2) var(--s3); border-radius: var(--rfull); transition: background var(--d-state), color var(--d-state); }
.site-nav a:hover { background: var(--surface-3); color: var(--ink); }
.site-nav a[aria-current=page] { color: var(--accent); }
.menu-btn { padding: 0 var(--s2); }
@media (min-width: 1024px) { .site-nav { display: flex; } .menu-btn { display: none; } }
@media (max-width: 420px) { .site-cta { display: none; } }
.site-foot { padding: var(--s9) 0 calc(var(--s9) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin-top: var(--s9); }
.site-foot .wrap { display: grid; gap: var(--s7); }
.foot-cols { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.foot-cols h3 { font: 600 var(--t-foot) var(--font-body); color: var(--ink-3); }
.foot-cols a { color: var(--ink); text-decoration: none; }
.foot-cols a:hover { color: var(--accent); }
@media (min-width: 744px) { .site-foot .wrap { grid-template-columns: 1fr 2fr; } .site-foot .wrap > .faint { grid-column: 1 / -1; } }
/* phone: a sticky primary action once the hero's button scrolls away */
.dock { position: fixed; left: var(--s4); right: var(--s4); bottom: calc(var(--s4) + env(safe-area-inset-bottom)); z-index: 15; transform: translateY(140%); transition: transform var(--d-move) var(--ease-out); }
.dock.on { transform: none; }
@media (min-width: 744px) { .dock { display: none; } }
