/* ==========================================================================
   Evie's Magical Potions — order site

   Light theme by default; dark is opt-in via <html data-theme="dark">.
   Every color lives in the token blocks below, so the two themes stay in sync.
   Flavor cards carry their own gradient, injected as --c1 / --c2 by app.js.
   ========================================================================== */

/* Bottle silhouette used to mask each flavor's colors into a potion bottle. */
:root {
  color-scheme: light;

  --bottle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 60'%3E%3Cpath d='M14 1h12v5h-1.5v9.6C32 18.4 37 25.4 37 34c0 12.3-7.6 24-17 24S3 46.3 3 34c0-8.6 5-15.6 12.5-18.4V6H14z'/%3E%3C/svg%3E");

  --bg: #efe8f8;
  --text: #2a1840;
  --text-dim: #5a4870;
  --text-faint: #6b5f80;

  /* Frosted surfaces. --glass sits on the aurora, --glass-hi is the hover /
     raised step, --glass-line is the bright top-edge border that sells it. */
  --glass: rgba(255, 255, 255, 0.55);
  --glass-hi: rgba(255, 255, 255, 0.74);
  --glass-solid: rgba(255, 253, 250, 0.9);
  --glass-line: rgba(255, 255, 255, 0.9);
  --glass-ring: rgba(42, 24, 64, 0.09);
  --blur: blur(18px) saturate(170%);

  --border: rgba(42, 24, 64, 0.11);
  --border-hi: rgba(42, 24, 64, 0.2);

  /* Cauldron green for actions, hex-violet for labels, candle gold for sparkle. */
  --accent: #247a52;
  --accent-2: #1d6a5f;
  --accent-ink: #6a2f9e;
  --accent-soft: rgba(36, 122, 82, 0.14);
  --on-accent: #ffffff;
  --gold: #d9962b;
  --hero-grad: linear-gradient(100deg, #6a2f9e 10%, #247a52 90%);

  --danger: #b4233a;
  --danger-soft: rgba(180, 35, 58, 0.1);
  --ok: #247a52;
  --ok-soft: rgba(36, 122, 82, 0.14);
  --warn-bg: rgba(217, 150, 43, 0.16);
  --warn-line: rgba(217, 150, 43, 0.5);
  --warn-ink: #7d5208;

  --orb-1: rgba(140, 90, 220, 0.42);
  --orb-2: rgba(60, 190, 130, 0.28);
  --orb-3: rgba(240, 178, 80, 0.3);
  --star: rgba(106, 47, 158, 0.32);

  --scrim: rgba(42, 24, 64, 0.42);
  --shadow-sm: 0 1px 2px rgba(42, 24, 64, 0.06);
  --shadow-md: 0 10px 30px rgba(60, 32, 90, 0.13);
  --shadow-lg: 0 20px 55px rgba(60, 32, 90, 0.22);
  --shadow-accent: 0 8px 24px rgba(36, 122, 82, 0.3);

  --radius: 18px;
  --shell: 1180px;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #130c20;
  --text: #f3ecff;
  --text-dim: #bbaed2;
  --text-faint: #978aae;

  --glass: rgba(255, 255, 255, 0.06);
  --glass-hi: rgba(255, 255, 255, 0.11);
  --glass-solid: rgba(28, 19, 44, 0.92);
  --glass-line: rgba(255, 255, 255, 0.15);
  --glass-ring: rgba(0, 0, 0, 0.5);

  --border: rgba(255, 255, 255, 0.1);
  --border-hi: rgba(255, 255, 255, 0.2);

  --accent: #6be3a4;
  --accent-2: #3cc9b0;
  --accent-ink: #ffcb6b;
  --accent-soft: rgba(107, 227, 164, 0.15);
  --on-accent: #0e1d15;
  --gold: #ffcb6b;
  --hero-grad: linear-gradient(100deg, #c9a0ff 10%, #6be3a4 90%);

  --danger: #ff8a9b;
  --danger-soft: rgba(255, 138, 155, 0.12);
  --ok: #6be3a4;
  --ok-soft: rgba(107, 227, 164, 0.15);
  --warn-bg: rgba(255, 203, 107, 0.12);
  --warn-line: rgba(255, 203, 107, 0.4);
  --warn-ink: #ffcb6b;

  --orb-1: rgba(123, 60, 230, 0.5);
  --orb-2: rgba(40, 190, 130, 0.22);
  --orb-3: rgba(255, 190, 90, 0.16);
  --star: rgba(255, 236, 190, 0.6);

  --scrim: rgba(8, 4, 14, 0.72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 14px 38px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 8px 26px rgba(107, 227, 164, 0.22);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: -70px;
  left: 16px;
  z-index: 90;
  padding: 11px 18px;
  border-radius: 0 0 10px 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: top 0.18s var(--ease);
}

.skip-link:focus {
  top: 0;
}

/* ------------------------------------------------------------- background */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.orb-1 {
  top: -14vh;
  left: -8vw;
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  background: radial-gradient(circle, var(--orb-1), transparent 68%);
}

.orb-2 {
  top: 4vh;
  right: -12vw;
  width: 42vw;
  height: 42vw;
  min-width: 300px;
  min-height: 300px;
  background: radial-gradient(circle, var(--orb-2), transparent 68%);
}

.orb-3 {
  top: 58vh;
  left: 26vw;
  width: 40vw;
  height: 40vw;
  min-width: 280px;
  min-height: 280px;
  background: radial-gradient(circle, var(--orb-3), transparent 70%);
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, var(--star), transparent),
    radial-gradient(1px 1px at 34% 62%, var(--star), transparent),
    radial-gradient(1.8px 1.8px at 58% 24%, var(--star), transparent),
    radial-gradient(1px 1px at 76% 74%, var(--star), transparent),
    radial-gradient(1.4px 1.4px at 88% 36%, var(--star), transparent),
    radial-gradient(1px 1px at 46% 90%, var(--star), transparent),
    radial-gradient(1.2px 1.2px at 22% 82%, var(--star), transparent);
  background-size: 420px 420px;
}

/* ------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  height: 68px;
  padding: 0 max(20px, calc((100% - var(--shell)) / 2));
  border-bottom: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.wordmark {
  font-size: 19px;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.wordmark-hat {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--accent-ink);
  transform: rotate(-8deg);
}

:root[data-theme="dark"] .wordmark-hat {
  color: #c9a0ff;
}

.wordmark-hat .hat-band {
  fill: var(--accent);
}

.wordmark-hat .hat-spark {
  fill: var(--gold);
}

.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 14px;
  color: var(--text-dim);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 7px 0 15px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-hi);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.cart-pill:hover {
  border-color: var(--border-hi);
  background: var(--glass-solid);
}

.cart-pill svg {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
}

.cart-pill-count {
  display: grid;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  place-items: center;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.cart-pill.is-active .cart-pill-count {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

/* ------------------------------------------------------------- layout */

main {
  position: relative;
  z-index: 1;
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 17px;
  font-style: italic;
  font-weight: 500;
}

/* ------------------------------------------------------------- hero */

.hero {
  padding: 0 0 clamp(44px, 6vw, 72px);
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 26px;
  padding: 7px 16px 7px 13px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-hi);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
}

.badge-dot {
  width: 10px;
  height: 10px;
  background: var(--gold);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

/* ------------------------------------------------------------- hanging sign */

.hero .sign {
  display: block;
  width: min(480px, 100%);
  height: auto;
  margin: 0 auto clamp(26px, 4vw, 40px);
  overflow: visible;
  filter: drop-shadow(0 16px 22px rgba(42, 24, 64, 0.28));
}

.sign-iron {
  stroke: #3a2c46;
}

.sign-iron-fill {
  fill: #3a2c46;
  stroke: none;
}

.sign-board {
  stroke: #1d0e2b;
}

:root[data-theme="dark"] .sign-board {
  stroke: #7a5c94;
}

:root[data-theme="dark"] .sign-iron {
  stroke: #8c7fa3;
}

:root[data-theme="dark"] .sign-iron-fill {
  fill: #8c7fa3;
}

.sign-type text {
  font-family: "IM Fell English", "Iowan Old Style", Georgia, serif;
}

.sign-type .sign-tag,
.sign-type .sign-sub {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
}

.sign-tag {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.sign-name {
  font-size: 66px;
  font-style: italic;
}

.sign-sub {
  font-size: 44px;
}

/* One swing as the page loads, settling from its chains. */
.sign-swing {
  transform-box: view-box;
  transform-origin: 260px 10px;
  animation: sign-swing 2.6s cubic-bezier(0.3, 0.6, 0.4, 1) both;
}

@keyframes sign-swing {
  0% { transform: rotate(-5deg); }
  28% { transform: rotate(3.2deg); }
  52% { transform: rotate(-1.6deg); }
  74% { transform: rotate(0.7deg); }
  100% { transform: rotate(0deg); }
}

/* The nav name hides while the big sign is on screen, so it isn't shown twice. */
.wordmark {
  transition: opacity 0.25s var(--ease);
}

.nav.sign-in-view .wordmark {
  opacity: 0;
  pointer-events: none;
}

.hero h1 {
  margin: 0 auto;
  max-width: 13ch;
  font-size: clamp(42px, 7.8vw, 86px);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.gradient-text {
  background: var(--hero-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 54ch;
  margin: 24px auto 0;
  color: var(--text-dim);
  font-size: clamp(15px, 1.7vw, 18px);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.stats {
  display: flex;
  justify-content: center;
  gap: clamp(28px, 6vw, 70px);
  margin: clamp(48px, 7vw, 76px) 0 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--border);
}

.stats div {
  text-align: center;
}

.stats dt {
  color: var(--text-faint);
  font-size: 14px;
  font-weight: 600;
}

.stats dd {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: clamp(28px, 4.4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.14s var(--ease), box-shadow 0.2s var(--ease),
    background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: saturate(115%);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--glass-hi);
  color: var(--text-faint);
  box-shadow: inset 0 0 0 1px var(--border);
  cursor: not-allowed;
}

.btn-ghost {
  border-color: var(--glass-line);
  background: var(--glass-hi);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--border-hi);
  background: var(--glass-solid);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-hi);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--text-dim);
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  border-color: var(--border-hi);
  background: var(--glass-solid);
  color: var(--text);
}

/* ------------------------------------------------------------- marquee */

.marquee {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: 100vw;
  margin-left: 50%;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transform: translateX(-50%);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 34px;
  animation: scroll-x 68s linear infinite;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text-faint);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.marquee-item::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c1, #888), var(--c2, #555));
}

@keyframes scroll-x {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ------------------------------------------------------------- menu */

.menu {
  padding: clamp(60px, 9vw, 100px) 0 40px;
  scroll-margin-top: 80px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.section-head h2 {
  font-size: clamp(30px, 4.6vw, 46px);
}

.section-note {
  max-width: 38ch;
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

.section-note strong {
  color: var(--text);
  font-weight: 600;
}

.inline-tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--warn-line);
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 11px;
  font-weight: 600;
}

/* Scrolls with the grid on purpose: a pinned toolbar needs a backing panel,
   and that panel reads as a bar across the aurora. */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 240px;
  max-width: 330px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-hi);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.search:hover {
  background: var(--glass-solid);
}

.search svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--text-faint);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
}

.search input::placeholder {
  color: var(--text-faint);
}

.search:focus-within {
  border-color: var(--accent);
  background: var(--glass-solid);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chips {
  display: flex;
  gap: 9px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 19px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-hi);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease), background 0.16s var(--ease);
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip:hover {
  border-color: var(--border-hi);
  background: var(--glass-solid);
  color: var(--text);
}

.chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.chip:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.result-count {
  margin: 0 0 0 auto;
  color: var(--text-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}

.grid-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 60px 20px;
  color: var(--text-faint);
  text-align: center;
}

.grid-message.is-error {
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

/* ------------------------------------------------------------- flavor card */

.card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-line);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease),
    background 0.22s var(--ease), box-shadow 0.26s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  background: var(--glass-hi);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--glass-line);
}

.card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow-md);
}

.swatch {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 128px;
  padding: 11px 12px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--glass-hi);
  background: radial-gradient(ellipse 60% 70% at 50% 100%, color-mix(in srgb, var(--c1) 34%, transparent), transparent 75%),
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--c2) 12%, transparent));
  box-shadow: inset 0 0 0 1px var(--border);
}

/* The flavor's two colors poured into a potion bottle: cork, empty glass
   neck, then the liquid. A soft highlight streak sits on the glass. */
.bottle {
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 70px;
  height: 105px;
  background: linear-gradient(180deg,
    #a8754a 0 9%,
    color-mix(in srgb, var(--c1) 26%, #ffffff) 9% 30%,
    var(--c1) 30%,
    var(--c2) 100%);
  transform: translateX(-50%);
  -webkit-mask: var(--bottle) center / contain no-repeat;
  mask: var(--bottle) center / contain no-repeat;
  filter: drop-shadow(0 6px 10px rgba(42, 24, 64, 0.18));
  transition: transform 0.3s var(--ease);
}

.bottle::after {
  content: "";
  position: absolute;
  top: 38%;
  left: 22%;
  width: 12%;
  height: 40%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  transform: rotate(14deg);
}

.card:hover .bottle {
  transform: translateX(-50%) rotate(-4deg);
}

.swatch-index {
  position: relative;
  z-index: 1;
  color: var(--text-faint);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.swatch-tag {
  position: relative;
  z-index: 1;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 10, 24, 0.55);
  color: #ffe9b5;
  font-size: 11.5px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px 6px 4px;
}

.card h3 {
  font-size: 20px;
  font-weight: 600;
}

.card-desc {
  flex: 1;
  margin: 7px 0 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.card-price {
  margin: 9px 0 0;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Caffeine options: checkboxes styled as a list, one tickable at a time (app.js). */
.card-options,
.cart-row-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}

.cart-row-options {
  grid-column: 2 / -1;
  margin-top: 2px;
}

.opt-choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
}

.opt-choice input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--accent);
}

.opt-choice strong {
  color: var(--text);
  font-weight: 600;
}

.opt-choice em {
  color: var(--text-faint);
  font-style: normal;
}

.opt-legend {
  /* Floating the legend keeps it inside the fieldset's box. */
  float: left;
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
  padding: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

.opt-legend span:not(.sr-only) {
  color: var(--text-faint);
  font-weight: 500;
}

/* In the order but no caffeine level picked yet. */
.card-options.needs-choice,
.cart-row-options.needs-choice {
  margin-left: -8px;
  margin-right: -8px;
  padding: 8px;
  border-radius: 10px;
  background: var(--warn-bg);
  box-shadow: inset 0 0 0 1px var(--warn-line);
}

.needs-choice .opt-legend span:not(.sr-only) {
  color: var(--warn-ink);
  font-weight: 700;
}

.opt-choice:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.sour-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.sour-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

.sour-toggle.is-off {
  color: var(--text-faint);
  cursor: not-allowed;
}

.foot-spacer {
  flex: 1;
}

.add-btn {
  height: 36px;
  padding: 0 18px;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  background: var(--glass-hi);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.add-btn:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
}

.add-btn:disabled {
  color: var(--text-faint);
  cursor: not-allowed;
  opacity: 0.6;
}

.stepper {
  display: flex;
  align-items: center;
  height: 36px;
  overflow: hidden;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  background: var(--glass-hi);
}

.stepper button {
  display: grid;
  width: 34px;
  height: 100%;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  transition: background 0.14s var(--ease);
}

.stepper button:hover:not(:disabled) {
  background: var(--accent-soft);
}

.stepper button:disabled {
  color: var(--text-faint);
  cursor: not-allowed;
}

.stepper-value {
  min-width: 26px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- how */

.how {
  padding: clamp(60px, 9vw, 110px) 0 clamp(50px, 7vw, 90px);
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.how h2 {
  margin-bottom: 44px;
  font-size: clamp(28px, 4.2vw, 42px);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 26px 24px 28px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.step-num {
  display: block;
  margin-bottom: 16px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.steps h3 {
  font-size: 19px;
}

.steps p {
  margin: 9px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* ------------------------------------------------------------- footer */

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 130px;
  border-top: 1px solid var(--border);
}

.footer-brand {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
}

.site-footer p {
  margin: 6px 0 0;
  color: var(--text-faint);
  font-size: 13px;
}

/* ------------------------------------------------------------- order dock */

.order-dock {
  position: fixed;
  z-index: 35;
  right: 16px;
  bottom: 18px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(430px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 10px 10px 20px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-solid);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  animation: dock-in 0.3s var(--ease) both;
}

.order-dock-info strong {
  display: block;
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 600;
}

.order-dock-info span {
  color: var(--text-faint);
  font-size: 12.5px;
}

.order-dock .btn {
  height: 42px;
  padding: 0 20px;
  font-size: 14px;
}

@keyframes dock-in {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ------------------------------------------------------------- drawer */

.scrim {
  position: fixed;
  z-index: 50;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade 0.2s var(--ease) both;
}

.drawer {
  position: fixed;
  z-index: 55;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(460px, 100%);
  flex-direction: column;
  border-left: 1px solid var(--glass-line);
  background: var(--glass-solid);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  animation: drawer-in 0.3s var(--ease) both;
}

@keyframes drawer-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-head .section-kicker {
  margin-bottom: 6px;
}

.drawer-head h2 {
  font-size: 24px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  overscroll-behavior: contain;
}

.drawer-empty {
  margin: 36px 0;
  color: var(--text-faint);
  font-size: 14.5px;
  text-align: center;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.cart-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 13px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--glass);
}

.cart-swatch {
  width: 38px;
  height: 46px;
  background: linear-gradient(180deg, #a8754a 0 9%, color-mix(in srgb, var(--c1) 26%, #ffffff) 9% 30%, var(--c1) 30%, var(--c2) 100%);
  -webkit-mask: var(--bottle) center / contain no-repeat;
  mask: var(--bottle) center / contain no-repeat;
}

.cart-row-name {
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
}

.cart-row-price {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.cart-row .stepper {
  height: 32px;
}

.cart-row .stepper button {
  width: 30px;
}

.cart-row-sour {
  grid-column: 2 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
}

.cart-row-sour input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

/* ------------------------------------------------------------- form */

.form-heading {
  margin: 0 0 18px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 18px;
}

.field {
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
}

.req {
  color: var(--accent-ink);
}

.opt {
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  outline: 0;
  background: var(--glass-hi);
  font-size: 14.5px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: var(--glass-solid);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

:root[data-theme="dark"] .field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75);
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

.field-hint {
  margin: 7px 0 0;
  color: var(--text-faint);
  font-size: 12.5px;
}

.field-error {
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 500;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------------- drawer foot */

.drawer-foot {
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border);
  background: var(--glass);
}

.drawer-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.drawer-total span {
  color: var(--text-faint);
  font-size: 13px;
}

.drawer-total strong {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.form-status {
  margin: 0 0 11px;
  font-size: 13px;
  font-weight: 500;
}

.form-status:empty {
  display: none;
}

.form-status.is-error {
  color: var(--danger);
}

.form-status.is-busy {
  color: var(--text-dim);
}

/* ------------------------------------------------------------- success */

.success {
  padding: 34px 0;
  text-align: center;
}

.success-mark {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  box-shadow: 0 0 0 1px var(--ok-soft), 0 0 36px var(--ok-soft);
}

.success-mark svg {
  width: 28px;
  height: 28px;
}

.success h3 {
  font-size: 26px;
}

.success > p {
  margin: 10px 0 24px;
  color: var(--text-dim);
  font-size: 14.5px;
}

.success-summary {
  margin-bottom: 26px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--glass);
  text-align: left;
}

.success-summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.success-summary li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.success-summary li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.success-summary em {
  color: var(--text-faint);
  font-style: normal;
}

.success-summary strong {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  .section-head {
    align-items: flex-start;
  }

  .result-count {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  main,
  .site-footer {
    width: calc(100% - 32px);
  }

  .nav {
    padding: 0 16px;
  }

  .hero {
    padding-top: 0;
    text-align: left;
  }

  .hero h1 {
    margin-left: 0;
    max-width: none;
  }

  .lede {
    margin-left: 0;
  }

  .hero-actions {
    justify-content: stretch;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .stats {
    justify-content: space-between;
    gap: 14px;
  }

  .stats div {
    text-align: left;
  }

  .cart-pill-text {
    display: none;
  }

  .cart-pill {
    padding: 0 6px 0 12px;
  }

  .search {
    max-width: none;
  }

  .chips {
    flex: 1 1 auto;
  }

  .chip {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0 12px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  }

  .drawer {
    width: 100%;
    border-left: 0;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer {
    padding-bottom: 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .marquee-track {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
