/* Plink: a color-blocked world per flavor. Single visual identity, set deliberately (no light/dark switch). */
:root {
  --bg: #ffe14d;
  --ink: #1f3a12;
  --soft: #fff3a8;
  --pop: #3e8e2f;
  --paper: #ffffff;
  --paper-ink: #16140f;
  --night: #0c2a4a;
  --shop: #141414;
  --display: "Bagel Fat One", "Arial Black", Impact, sans-serif;
  --sans: "Onest", "Helvetica Neue", Arial, sans-serif;
  --label: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { background: var(--bg); transition: background-color 0.9s var(--ease); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  transition: background-color 0.9s var(--ease), color 0.6s var(--ease);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--bg); }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.kicker {
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gutter) 14px;
  color: var(--ink);
  transition: color 0.6s var(--ease);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav.on-dark { color: #ffffff; }
.nav.on-dark .cart b { background: #ffffff; color: #141414; }
.logo { font-family: var(--display); font-size: 1.9rem; line-height: 1; text-decoration: none; color: inherit; letter-spacing: 0.01em; }
.links { display: flex; gap: 22px; margin-left: 28px; }
.links a { text-decoration: none; font-weight: 700; font-size: 0.95rem; position: relative; }
.links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.links a:hover::after { transform: scaleX(1); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 999px;
  transition: transform 0.25s var(--spring), background 0.3s;
}
.pill:hover { transform: translateY(-2px); }
.sound { margin-left: auto; }
.sound svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sound .spk { fill: currentColor; }
.sound[aria-pressed="false"] .wave { opacity: 0.2; }
.cart b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 0.78rem; transition: background 0.6s, color 0.6s; }
.cart.bump b { animation: bump 0.5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.5); } }

/* ------------------------------------------------------------------ canvas + mega type */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; touch-action: pan-y; }
.mega {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 0;
  margin: 0;
  font-family: var(--display);
  font-size: 29vw;
  line-height: 1;
  white-space: nowrap;
  color: var(--soft);
  transform: translate3d(-50%, -54%, 0);
  transition: color 0.9s var(--ease);
  pointer-events: none;
  user-select: none;
}

/* ------------------------------------------------------------------ stage */
.stage { position: relative; height: 540vh; }
.stage-sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  pointer-events: none;
}
.can-mount { pointer-events: none; }
.stage-mount { position: absolute; left: 50%; top: 52%; height: 64vh; aspect-ratio: 0.54; transform: translate(-50%, -50%); }

.copy { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.45s var(--ease), visibility 0s linear 0.45s; }
.copy.is-active { opacity: 1; visibility: visible; transition: opacity 0.55s var(--ease) 0.1s, visibility 0s; }
.copy a, .copy button { pointer-events: auto; }

.hero-left { position: absolute; left: var(--gutter); bottom: 9vh; max-width: 29rem; display: grid; gap: 16px; }
.hero-left h1 { font-family: var(--display); font-size: clamp(3rem, 6.4vw, 6.2rem); line-height: 0.9; }
.lede { font-size: 1.15rem; font-weight: 500; max-width: 26rem; }
.hero-right { position: absolute; right: var(--gutter); bottom: 9vh; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.hint { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9rem; margin-top: 6px; }
.hint-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); animation: ping 1.8s var(--ease) infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 12px transparent; } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 14px 24px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  color: var(--bg);
  background: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  transition: transform 0.3s var(--spring), background 0.6s, color 0.6s, border-color 0.6s;
}
.btn:hover { transform: translateY(-3px) rotate(-1.5deg); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 10px 18px; font-size: 0.9rem; }

/* flavor copy: letters rise in when active */
.flavor-left { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-46%); max-width: 36vw; display: grid; gap: 14px; }
.count { font-weight: 800; letter-spacing: 0.12em; font-size: 0.85rem; }
.flavor-name {
  font-family: var(--display);
  font-size: clamp(3.4rem, 8.6vw, 9.2rem);
  line-height: 0.86;
  hyphens: manual;
  overflow-wrap: normal;
  padding-bottom: 0.06em; /* room for descenders (Swedish headings are longer) */
}
.tagline { font-size: 1.25rem; font-weight: 600; max-width: 20rem; }
.flavor-right { position: absolute; right: var(--gutter); bottom: 10vh; width: min(22rem, 30vw); display: grid; gap: 10px; }
.flavor-right h3 { font-weight: 800; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; }
.flavor-right p { font-size: 1.05rem; font-weight: 500; }
.chips { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 12px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 700; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.flavor-copy .flavor-name,
.flavor-copy .tagline,
.flavor-copy .count,
.flavor-copy .flavor-right { transform: translateY(26px); opacity: 0; transition: transform 0.7s var(--spring), opacity 0.4s var(--ease); }
.flavor-copy.is-active .flavor-name,
.flavor-copy.is-active .tagline,
.flavor-copy.is-active .count,
.flavor-copy.is-active .flavor-right { transform: none; opacity: 1; }
.flavor-copy.is-active .flavor-name { transition-delay: 0.08s; }
.flavor-copy.is-active .tagline { transition-delay: 0.16s; }
.flavor-copy.is-active .flavor-right { transition-delay: 0.22s; }

.flavor-dots { position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); display: grid; gap: 12px; pointer-events: auto; }
.flavor-dots button {
  position: relative;
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: transparent;
  transition: transform 0.3s var(--spring), background 0.3s;
}
.flavor-dots button[aria-current="true"] { background: var(--ink); transform: scale(1.25); }
.flavor-dots span {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity 0.2s, transform 0.3s var(--ease);
  pointer-events: none;
}
.flavor-dots button:hover span,
.flavor-dots button:focus-visible span { opacity: 1; transform: translate(0, -50%); }

/* ------------------------------------------------------------------ inside */
.inside { background: var(--paper); color: var(--paper-ink); padding: 16vh var(--gutter) 14vh; }
.inside ::selection { background: var(--paper-ink); color: var(--paper); }
.inside-grid { display: grid; grid-template-columns: 1.15fr 0.75fr 1fr; gap: 3vw; align-items: center; max-width: 1380px; margin: 0 auto; }
.ingredients, .facts-wrap { position: relative; z-index: 2; }
.ingredients { display: grid; gap: 22px; }
.ingredients h2, .lineup h2, .shop h2, .fizz h2 { font-family: var(--display); font-size: clamp(2.5rem, 5vw, 4.8rem); line-height: 0.92; }
.ingr-list { list-style: none; margin: 0; padding: 0; counter-reset: ing; display: grid; gap: 14px; }
.ingr-list li { counter-increment: ing; display: grid; grid-template-columns: 2.2rem 1fr; column-gap: 12px; row-gap: 2px; }
.ingr-list li::before {
  content: counter(ing);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--paper-ink);
  color: var(--paper);
  font-weight: 800;
  font-size: 0.95rem;
}
.ingr-list b { font-weight: 800; font-size: 1.08rem; }
.ingr-list span { color: #4b4a45; font-size: 0.98rem; }
.not-in { font-weight: 700; padding-top: 14px; border-top: 2px solid var(--paper-ink); }
.inside-mount { height: min(68vh, 620px); aspect-ratio: 0.54; justify-self: center; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--paper-ink);
  background: transparent;
  font-weight: 700;
  font-size: 0.88rem;
  transition: background 0.25s, color 0.25s, transform 0.25s var(--spring);
}
.tabs button:hover { transform: translateY(-2px); }
.tabs button[aria-selected="true"] { background: var(--c); color: #111; box-shadow: inset 0 0 0 2px var(--paper-ink); }

.facts { font-family: var(--label); color: #000; background: #fff; border: 2px solid #000; padding: 6px 9px 8px; max-width: 350px; line-height: 1.2; }
.nf-title { font-weight: 900; font-size: 2.55rem; letter-spacing: -0.015em; line-height: 1; margin: 0 0 2px; }
.nf-servings { font-size: 1.05rem; padding-bottom: 2px; border-top: 1px solid #000; padding-top: 3px; }
.nf-size { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 900; }
.nf-bar.thick { height: 11px; background: #000; margin: 3px 0 2px; }
.nf-bar.med { height: 5px; background: #000; margin: 2px 0; }
.nf-small { font-size: 0.8rem; }
.nf-cal { display: flex; justify-content: space-between; align-items: baseline; font-size: 2.1rem; font-weight: 900; line-height: 1; }
.nf-cal b:first-child { font-size: 1.65rem; }
.nf-dv { text-align: right; font-size: 0.8rem; padding: 2px 0; }
.nf-row { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid #000; padding: 3px 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.nf-row.indent { padding-left: 14px; }
.nf-row.indent2 { padding-left: 28px; }
.nf-foot { font-size: 0.68rem; padding-top: 4px; }
.nf-ingr { font-size: 0.72rem; padding-top: 6px; margin-top: 6px; border-top: 1px solid #000; }

/* ------------------------------------------------------------------ fizz */
.fizz { position: relative; z-index: 3; background: var(--night); color: #fff; min-height: 110vh; overflow: hidden; display: flex; align-items: center; touch-action: pan-y; }
#fizz-canvas { position: absolute; inset: 0; display: block; }
.fizz::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 42, 74, 0.85) 0%, rgba(12, 42, 74, 0.55) 38%, rgba(12, 42, 74, 0) 62%); pointer-events: none; }
.fizz-inner { z-index: 1; }
.fizz-inner { position: relative; max-width: 660px; padding: 14vh var(--gutter); display: grid; gap: 22px; pointer-events: none; }
.fizz ::selection { background: #fff; color: var(--night); }
.fizz-lede { font-size: 1.15rem; color: #d6e6f5; max-width: 34rem; }
.scale { margin: 10px 0 0; display: grid; gap: 8px; padding: 18px 18px 14px; border-radius: 16px; background: rgba(6, 22, 40, 0.72); border: 1.5px solid rgba(255, 255, 255, 0.22); }
.scale-track { display: grid; gap: 10px; }
.band { position: relative; height: 34px; }
.band::before {
  content: "";
  position: absolute;
  top: 22px;
  height: 8px;
  left: calc(var(--a) / 5 * 100%);
  width: max(8px, calc((var(--b) - var(--a)) / 5 * 100%));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}
.band.plink::before { background: #ffe14d; width: 10px; height: 16px; top: 18px; margin-left: -5px; border-radius: 4px; }
.band span { position: absolute; top: 0; left: 0; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.band.plink span { color: #ffe14d; }
.scale-axis { display: flex; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, 0.4); padding-top: 4px; font-size: 0.75rem; font-variant-numeric: tabular-nums; color: #b8cde2; }
.scale figcaption { font-size: 0.78rem; color: #b8cde2; }
.popped { font-weight: 700; color: #d6e6f5; }
.popped b { color: #ffe14d; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ lineup */
.lineup { background: var(--paper); color: var(--paper-ink); padding: 14vh var(--gutter) 12vh; }
.lineup-head { max-width: 1380px; margin: 0 auto 5vh; display: grid; gap: 12px; position: relative; z-index: 2; }
.shelf { list-style: none; margin: 0 auto; padding: 0; max-width: 1380px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px); }
.slot { position: relative; display: grid; justify-items: center; gap: 8px; padding: 3vh 12px 26px; border-radius: 28px; background: color-mix(in srgb, var(--c) 32%, white); transition: background 0.4s var(--ease); }
.slot:hover { background: color-mix(in srgb, var(--c) 55%, white); }
.slot-mount { height: min(44vh, 400px); aspect-ratio: 0.54; margin-bottom: 8px; }
.slot h3, .slot p, .slot .btn { position: relative; z-index: 2; }
.slot h3 { font-family: var(--display); font-size: clamp(1.3rem, 1.9vw, 1.8rem); line-height: 1; text-align: center; }
.slot p { font-size: 0.9rem; color: #3f3d38; font-variant-numeric: tabular-nums; }
.slot .btn { --ink: #16140f; --bg: #ffffff; margin-top: 6px; }

/* ------------------------------------------------------------------ shop */
.shop { position: relative; z-index: 3; background: var(--shop); color: #fff; padding: 14vh var(--gutter); }
.shop ::selection { background: #fff; color: #111; }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; align-items: center; max-width: 1280px; margin: 0 auto; }
.shop-copy { display: grid; gap: 18px; }
.shop-copy > p { color: #cfcfcf; max-width: 30rem; }
.pack-rows { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.pack-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #333; }
.pack-row:first-child { border-top: 1px solid #333; }
.chip { width: 24px; height: 24px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2); }
.pack-name { font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 12px; }
.step { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; background: transparent; color: #fff; font-size: 1.25rem; font-weight: 700; line-height: 1; transition: background 0.2s, color 0.2s, transform 0.2s var(--spring); }
.step:hover:not(:disabled) { background: #fff; color: #111; transform: scale(1.08); }
.step:disabled { opacity: 0.3; cursor: not-allowed; }
.qty { min-width: 1.6em; text-align: center; font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.pack-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.shop .btn { --ink: #ffe14d; --bg: #141414; }
.btn.big { padding: 16px 28px; font-size: 1.05rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.ghost-light { background: transparent; color: #fff; border-color: #fff; }
.pack { display: grid; gap: 16px; justify-items: center; }
.tray {
  width: min(100%, 470px);
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(160deg, #d3ae75, #b58d57);
  box-shadow: inset 0 0 0 3px rgba(90, 60, 25, 0.35), 0 40px 70px rgba(0, 0, 0, 0.5);
  transform: perspective(900px) rotateX(18deg);
}
.pack-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pack-grid .can-top {
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 0;
  background: radial-gradient(circle at 42% 38%, #fbfcfd 0%, #d4d8dd 34%, #9aa0a8 60%, var(--c) 61%, var(--c) 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18), 0 6px 10px rgba(60, 40, 10, 0.35);
  animation: drop 0.45s var(--spring);
}
.pack-grid .can-top.empty { background: rgba(80, 55, 22, 0.35); box-shadow: inset 0 4px 10px rgba(60, 40, 10, 0.45); animation: none; }
@keyframes drop { from { transform: translateY(-16px) scale(0.8); opacity: 0; } }
.pack-total { font-size: 0.95rem; color: #cfcfcf; }
.pack-total b { color: #fff; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ footer */
.foot { position: relative; z-index: 3; background: #ffe14d; color: #1f3a12; padding: 8vh var(--gutter) 5vh; overflow: hidden; }
.foot-mega { font-family: var(--display); font-size: 27vw; line-height: 0.8; letter-spacing: -0.01em; margin-left: -0.04em; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; margin-top: 4vh; font-weight: 600; }
.foot-row p:first-child { max-width: 36rem; }
.foot-small { font-size: 0.85rem; opacity: 0.8; }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  max-width: min(92vw, 520px);
  padding: 14px 20px;
  border-radius: 16px;
  background: #141414;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, 160%);
  visibility: hidden;
  transition: transform 0.5s var(--spring), visibility 0s linear 0.5s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform 0.5s var(--spring), visibility 0s; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .inside-grid { grid-template-columns: 1fr 1fr; }
  .inside-mount { grid-row: span 2; order: 2; height: 60vh; }
  .ingredients { order: 1; }
  .facts-wrap { order: 3; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .links { display: none; }
  .logo { font-size: 1.6rem; }
  .pill { padding: 7px 11px; font-size: 0.82rem; }
  .sound span { display: none; }
  .mega { font-size: 38vw; }
  .stage-mount { top: 53%; height: 40vh; }
  .hero-left { top: 13vh; bottom: auto; right: var(--gutter); gap: 10px; }
  .hero-left h1 { font-size: 13vw; }
  .hero-left .lede { display: none; }
  .hero-right { left: var(--gutter); right: var(--gutter); bottom: max(3vh, 16px); flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; }
  .hero-right .btn { padding: 12px 18px; font-size: 0.92rem; }
  .hint { width: 100%; justify-content: center; font-size: 0.82rem; }
  .flavor-left { top: 12vh; transform: none; max-width: calc(100% - 2 * var(--gutter) - 30px); gap: 6px; }
  .flavor-name { font-size: 15vw; }
  .tagline { font-size: 1rem; }
  .flavor-right { left: var(--gutter); right: var(--gutter); width: auto; bottom: max(3vh, 16px); gap: 6px; }
  .flavor-right p { font-size: 0.95rem; }
  .flavor-dots { display: none; }
  .inside-grid { grid-template-columns: 1fr; gap: 32px; }
  .inside-mount { grid-row: auto; height: 52vh; }
  .shop-grid { grid-template-columns: 1fr; }
  .tray { transform: none; }
  .shelf { gap: 10px; }
  .slot { border-radius: 20px; padding: 2vh 8px 16px; }
  .slot-mount { height: 30vh; }
  .slot .btn { padding: 8px 12px; font-size: 0.8rem; }
  .slot p { font-size: 0.78rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
