/* Frightfully Fun Stickers - storefront styles.
   Brand values come from ds/ (exported unchanged from Claude Design). Nothing here
   redefines a token; this file only composes them. Update the design system, re-export,
   and the site follows. */
@import url('ds/colors.css');
@import url('ds/typography.css');
@import url('ds/spacing.css');
@import url('ds/radius.css');
@import url('ds/shadow.css');
@import url('ds/base.css');

/* Creepster is the wordmark face the prototype asked for but the token bundle never
   imported, so it silently fell back. Loaded explicitly here. */
@import url('https://fonts.googleapis.com/css2?family=Chonburi&family=Creepster&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=Kalam:wght@400;700&display=swap');

/* ---------- type sizes the exported scale does not have ----------
   Five sizes the storefront uses that typography.css has no step for. They are defined
   HERE and not in ds/typography.css on purpose: that file is a generated export from
   Claude Design, so anything hand-written into it is lost on the next export.
   These are named for their role, matching how the system already names --text-muted and
   --surface-card. When the design system is next rebuilt in Claude Design, fold these
   five in and delete this block. See design/DESIGN-CHANGES.md. */
:root {
  --text-xs-plus:  0.8125rem;  /* 13px - field labels, fine print */
  --text-sm-plus:  0.9375rem;  /* 15px - form controls */
  --text-2xl-plus: 2rem;       /* 32px - section headings, product page price */
  --text-3xl-plus: 2.5rem;     /* 40px - product page title */
}

body { min-height: 100vh; display: flex; flex-direction: column; }
img { max-width: 100%; }
button { font-family: var(--font-body); }
.wrap { max-width: var(--container-max); margin: 0 auto; width: 100%; padding: 0 var(--space-5); }

/* ---------- header ---------- */
.hdr {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: 14px var(--space-6);
  background: var(--color-midnight) url(assets/hero-background.png) center top / cover no-repeat;
  border-bottom: 2px solid var(--color-pumpkin);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: 'Creepster', var(--font-display); font-size: var(--text-2xl);
  color: var(--color-ghost-cream); text-decoration: none; letter-spacing: .01em;
}
.brand span { color: var(--color-pumpkin); }
.brand img { height: 32px; width: auto; }
.nav { display: flex; gap: var(--space-3); font-weight: var(--weight-bold); font-size: var(--text-lg); }
.nav a {
  color: var(--color-ghost-cream); text-decoration: none; cursor: pointer;
  padding: 6px 16px; border: 2px solid transparent; border-radius: var(--radius-pill);
  transition: border-color .12s ease, color .12s ease;
}
.nav a:hover { color: var(--color-pumpkin); border-color: var(--color-pumpkin); }
/* The page you are on keeps the ring, not just the colour. Same treatment as hover, so
   the current page reads as a selected pill rather than as slightly different text. */
.nav a.on { color: var(--color-pumpkin); border-color: var(--color-pumpkin); }
.nav a:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.cartbtn {
  position: relative; width: 46px; height: 46px; border-radius: var(--radius-pill);
  border: 2px solid transparent; background: transparent; cursor: pointer;
  color: var(--color-ghost-cream);
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.cartbtn svg { width: 28px; height: 28px; display: block; }
.cartbtn:hover { border-color: var(--color-pumpkin); color: var(--color-pumpkin); }
.cartbtn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.cartbtn .n[hidden] { display: none; }
.cartbtn .n {
  position: absolute; top: 0; right: 0; background: var(--state-danger);
  color: var(--color-ghost-cream); border-radius: 50%; min-width: 20px; height: 20px;
  font-size: var(--text-xs); font-weight: var(--weight-bold); padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--color-midnight);
}

/* ---------- hero ---------- */
.hero {
  background: var(--color-midnight) url(assets/hero-background.png) center / cover no-repeat;
  color: var(--color-ghost-cream);
  padding: 40px var(--space-6) 48px;
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-7); flex-wrap: wrap;
  overflow: hidden;                 /* stickers start above the fold while falling */
}
.hero-copy { display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--space-2); max-width: 460px; flex: 0 1 460px; }
.hero-copy img.logo { width: 320px; max-width: 100%; height: auto; }
.hero h1 { font-family: var(--font-display); text-transform: uppercase; font-size: var(--text-3xl);
  line-height: var(--leading-tight); letter-spacing: .01em; }
.hero-words { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  font-weight: var(--weight-bold); font-size: var(--text-xl); }
.hero-sub { font-size: var(--text-base); opacity: .9; margin: 0; }
.hero-sub b { font-weight: var(--weight-bold); }
/* The collage. An aspect-ratio box with percentage-positioned children, so the whole
   arrangement scales with the viewport rather than only working at one width. */
/* Sized from HEIGHT, not width: a width-driven box overflowed the viewport and cut the
   bottom row off. Height is capped against the viewport, width follows from the ratio.
   3 rows of stickers, so the ratio is wider than tall; a 4th row made the hero taller
   than a screen. */
.hero-scatter {
  position: relative; align-self: center;
  height: min(60vh, 560px); aspect-ratio: 92 / 79; width: auto;
  flex: 0 1 auto; min-width: 0;
}
.hs {
  position: absolute; height: auto; display: block;
  transform: rotate(var(--r));
  /* the die-cut white border needs a shadow to lift off the night sky */
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .55));
  animation: drop .42s cubic-bezier(.2, 1.5, .5, 1) var(--d) backwards;
  will-change: transform;
}
/* Each sticker falls from above, overshoots slightly and settles - quick, and
   staggered by 55ms so the pile builds up rather than appearing at once. */
@keyframes drop {
  0%   { opacity: 0; transform: translateY(-120%) rotate(calc(var(--r) - 14deg)) scale(.86); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) rotate(var(--r)) scale(1); }
}
.hs:hover {
  transform: rotate(var(--r)) scale(1.06);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .6));
  z-index: 5; transition: transform .15s ease, filter .15s ease;
}
/* .btn sets align-self:flex-start and is defined later in this file, so a bare
   .hero-cta rule loses on source order. Scoped to the parent to outrank it. */
/* Layout, plus one thing the night sky forces. Size, colour and hover all come from
   .btn, so this is the same button as Add to cart. But .btn outlines itself with a
   midnight border and a hard midnight drop shadow, and both are invisible against the
   hero backdrop - measured off a screenshot, the border pixels came back (52,12,4)
   against a (13,12,45) sky, so the button read as a plain orange pill while the same
   button on cream reads as an outlined one. The ghost-cream ring is the die-cut edge
   every sticker in the shop has, and it lets the midnight outline register. */
.hero-copy .hero-cta { margin-top: var(--space-3); align-self: center;
  box-shadow: 0 0 0 2px var(--color-ghost-cream), var(--shadow-sticker-sm); }

/* ---------- product card ---------- *//* ---------- product card ---------- */
.grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card {
  position: relative;
  display: flex; flex-direction: column; text-decoration: none;
  color: inherit; background: var(--surface-card);
  border: 2px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sticker-sm); overflow: hidden;
  transition: border-color .12s ease;
}
/* Hover cue is the artwork zooming inside the frame. The card itself does not move
   and the border does not change colour - an orange frame competed with the sticker.
   overflow:hidden on .card is what clips the zoom. */
.card:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.card .thumb { aspect-ratio: 1; background: var(--cream-200); display: block;
  width: 100%; height: auto; object-fit: cover;
  /* The resting 1.012 is not decoration, it is the fix for a hairline of card background
     showing down the right edge of the artwork. Grid columns land on fractional pixel
     widths, so an image at exactly scale(1) can paint a fraction of a pixel short of the
     card it fills. Measured in Chrome: 1.012 overhangs the card by 1.18px on each side at
     a 211px column, so the clip always cuts into artwork rather than past it. 1.004 was
     tried first and left 0.42px, which was not enough.
     Hover is 1.052, which is 4% more than the resting 1.012 - the zoom you see is 4%.
     No will-change: promoting the thumb to its own layer made the seam worse, not better. */
  transform: scale(1.012);
  transition: transform .45s cubic-bezier(.22, .61, .36, 1);
}
.card:hover .thumb { transform: scale(1.052); }
.card .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
/* stretched link: the whole card navigates, without wrapping the button in an <a> */
.card .nm { font-weight: var(--weight-bold); font-size: var(--text-sm); line-height: 1.25;
  color: inherit; text-decoration: none; }
.card .nm::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.buy { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .pr { font-family: var(--font-hand); font-size: var(--text-lg); color: var(--brand-primary-hover); }
.add {
  position: relative; z-index: 2;          /* above the stretched link */
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--color-midnight); background: var(--color-pumpkin);
  color: var(--color-midnight); font-size: var(--text-lg); font-weight: var(--weight-bold);
  line-height: 1; cursor: pointer; display: flex; align-items: center;
  justify-content: center; padding: 0;
  transition: transform .12s ease, background .12s ease;
}
.add:hover { background: var(--pumpkin-600); transform: scale(1.12); }
.add:active { transform: scale(.94); }
.add.added { background: var(--accent-slime); }

/* Review lens: only with ?review=1. Never part of the shopping experience. */
.rv { display: none; }
body.review .rv { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* 10px is deliberately NOT a brand token. The review lens is internal tooling that no
   customer sees, so it has no business adding a step to the type scale. */
.rv span { font-size: 10px; padding: 1px 6px; border-radius: var(--radius-pill);
  background: color-mix(in oklch, var(--color-midnight) 12%, transparent); }
.rv .unnamed { background: var(--state-warning); color: var(--color-midnight); font-weight: 700; }
.rv .ip { background: var(--state-danger); color: var(--color-ghost-cream); }
.rv .cf { background: var(--color-haunted-purple); color: var(--color-ghost-cream); }
body.review .card.flagged { border-color: var(--state-danger); }

/* ---------- shop ---------- */
.shop { display: flex; gap: var(--space-6); align-items: flex-start; padding: var(--space-6) 0; }
.side { flex: 0 0 220px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 96px; }
.side h3 { font-family: var(--font-body); font-size: var(--text-sm); text-transform: uppercase;
  letter-spacing: var(--tracking-wide); color: var(--text-muted); margin-bottom: var(--space-2); }
.side a { padding: 9px 12px; border-radius: var(--radius-md); font-size: var(--text-sm);
  font-weight: var(--weight-medium); color: var(--text-primary); text-decoration: none; cursor: pointer;
  display: flex; justify-content: space-between; gap: 8px; }
.side a:hover { background: var(--cream-200); color: var(--text-primary); }
.side a.on { background: var(--color-pumpkin); color: var(--color-ghost-cream); font-weight: var(--weight-bold); }
.side a .c { opacity: .65; font-size: var(--text-xs); }
.shop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-5); }
.shop-main h1 { font-size: var(--text-3xl); margin-bottom: 4px; }
.shop-main .blurb { color: var(--text-secondary); margin: 0; max-width: 640px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: var(--space-3); padding-bottom: var(--space-5); flex-wrap: wrap; }
.pager button, .pager a {
  min-width: 36px; height: 36px; padding: 0 8px; border: 2px solid var(--border-default);
  border-radius: var(--radius-md); background: var(--surface-page); color: var(--text-primary);
  font-weight: var(--weight-bold); font-size: var(--text-sm); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.pager a.on { background: var(--color-pumpkin); color: var(--color-ghost-cream); border-color: var(--color-pumpkin); }
.pager .gap { border: none; background: none; color: var(--text-muted); cursor: default; }

/* ---------- product detail ---------- */
.pdp { display: flex; gap: var(--space-7); margin-top: var(--space-4); flex-wrap: wrap;
       padding-bottom: var(--space-7); }
.pdp .shot { width: 420px; max-width: 100%; height: auto; aspect-ratio: 1; border-radius: 20px;
  border: 2px solid var(--border-strong); box-shadow: var(--shadow-sticker-md);
  object-fit: cover; background: var(--cream-200); }
.pdp .info { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: var(--space-4); }
.pdp h1 { font-size: var(--text-3xl-plus); }
.pdp .price { font-family: var(--font-hand); font-size: var(--text-2xl-plus); color: var(--brand-primary-hover); }
.pdp p { color: var(--text-secondary); line-height: var(--leading-relaxed); margin: 0; }
.back { font-size: var(--text-sm); color: var(--text-muted); text-decoration: none; }
.field { display: flex; flex-direction: column; gap: 4px; max-width: 200px; }
.field label { font-size: var(--text-xs-plus); color: var(--text-secondary); }
select, .qty {
  border: 2px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--surface-page); color: var(--text-primary);
  font-family: var(--font-body); font-size: var(--text-sm-plus);
}
select { padding: 9px 10px; }
.qtyrow { display: flex; align-items: center; gap: 12px; }
.qty { display: inline-flex; align-items: center; }
.qty button { width: 36px; height: 36px; border: none; background: none; cursor: pointer; font-size: var(--text-base); }
.qty span { width: 32px; text-align: center; }
.btn {
  border: 2px solid var(--color-midnight); border-radius: var(--radius-md);
  background: var(--color-pumpkin); color: var(--color-midnight);
  font-weight: var(--weight-bold); font-size: var(--text-base); padding: 12px 22px; cursor: pointer;
  box-shadow: var(--shadow-sticker-sm); align-self: flex-start;
}
/* Colour only on hover - no translate. The 1px shift made the button feel like it
   moved out from under the pointer. */
.btn { transition: background .12s ease; }
.btn:hover { background: var(--pumpkin-600); }
/* base.css carries a{color;text-decoration:underline} and a:hover{color}. On an <a> that
   is styled as a button, a:hover (0,1,1) OUTRANKS .btn (0,1,0), so "Shop stickers" and
   "Shop all designs" were shifting their label to purple on hover while the real <button>
   "Add to cart" kept its midnight label. Same class, three different-looking hovers.
   Pinning every state at (0,2,0) makes an <a class="btn"> and a <button class="btn">
   behave identically. */
.btn, .btn:link, .btn:visited, .btn:hover, .btn:focus, .btn:active {
  color: var(--color-midnight); text-decoration: none;
}
.btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.note { font-size: var(--text-xs-plus); color: var(--text-muted); }

/* ---------- cart drawer ---------- */
.scrim { position: fixed; inset: 0; background: transparent; pointer-events: none;
  transition: background .2s; z-index: 30; }
.scrim.open { background: color-mix(in oklch, var(--color-midnight) 50%, transparent); pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 380px; max-width: 92vw; z-index: 31;
  background: var(--surface-page); border-left: 2px solid var(--border-strong);
  transform: translateX(100%); transition: transform .2s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer header { display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5); border-bottom: 2px solid var(--border-default); }
.drawer h2 { font-size: var(--text-xl); }
.drawer .x { border: none; background: none; font-size: var(--text-xl); cursor: pointer; line-height: 1; }
.lines { flex: 1; overflow: auto; padding: var(--space-4) var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-4); }
.line { display: flex; gap: 12px; align-items: flex-start; }
.line img { width: 62px; height: 62px; border-radius: var(--radius-md);
  border: 2px solid var(--border-strong); object-fit: cover; }
.line .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.line .t .nm { font-weight: var(--weight-bold); font-size: var(--text-sm); }
.line .rm { border: none; background: none; color: var(--text-muted); cursor: pointer;
  font-size: var(--text-xs); text-decoration: underline; padding: 0; text-align: left; }
.drawer footer { border-top: 2px solid var(--border-default); padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3); }
.total { display: flex; justify-content: space-between; font-weight: var(--weight-bold); font-size: var(--text-lg); }
.empty { color: var(--text-muted); text-align: center; padding: var(--space-7) 0; }

/* ---------- footer ---------- */
.ftr { background: var(--color-midnight); color: var(--color-ghost-cream);
  padding: var(--space-7) var(--space-6); margin-top: auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-5); }
.ftr .b { font-family: 'Creepster', var(--font-display); font-size: var(--text-xl); }
.ftr small { opacity: .75; }

/* ---------- animation ---------- */
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; } }
.hero-tile, .hero-words span { animation: pop .5s backwards; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* animation:none would otherwise leave the stickers at their 0% keyframe */
  .hs { opacity: 1; transform: rotate(var(--r)); }
  /* transition:none would still snap the thumb to its zoomed size on hover */
  .card:hover .thumb { transform: scale(1.012); }
}

@media (max-width: 900px) {
  .hero { gap: var(--space-5); }
  .hero-copy { flex: 1 1 100%; max-width: 520px; }
  .hero-scatter { flex: 1 1 100%; height: auto; width: min(100%, 560px); }
}
@media (max-width: 820px) {
  .shop { flex-direction: column; }
  .side { position: static; flex: 1 1 auto; width: 100%;
          flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .side h3 { width: 100%; }
  .hdr { padding: 12px var(--space-4); flex-wrap: wrap; }
  .pdp { gap: var(--space-5); }
}
