/* Glazer Cocktails — "The Molecular Alchemist" (DESIGN.md). Clarified cocktails as repeatable chemistry:
   one accent hue rides --ph, from butterfly-pea blue (spirit-forward) to hibiscus pink (citrus-forward). */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&family=Unbounded:wght@300;400&display=swap");

/* --ph is registered so the accent interpolates when a drink changes it (motion.js). */
@property --ph {
  syntax: "<number>";
  inherits: true;
  initial-value: 0.35;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --abyss: #070a10;
  --vessel: #0e1420;
  --clarified: #e8f1f6;
  --distillate: #8fa3b5;
  --pea: #3f5bff;          /* fills; white text on it is 5.1:1 */
  --pea-hover: #3550f0;
  --pea-text: #7c8cff;     /* pH 0 as text, 6.7:1 on abyss */
  --hibiscus: #ff5fae;     /* pH 1 as text, 7.1:1 on abyss */
  --nitrogen: #7df2e6;     /* focus rings and headline readouts */

  --ph: 0.35;
  --accent: color-mix(in oklch, var(--hibiscus) calc(var(--ph) * 100%), var(--pea-text));
  transition: --ph 600ms var(--ease-in-out);

  --primary: var(--abyss);
  --accent-hover: color-mix(in oklch, var(--accent), white 18%);
  --accent-glow: color-mix(in oklch, var(--accent) 16%, transparent);
  --card-bg: var(--vessel);
  --text-dark: var(--clarified);
  --text-grey: var(--distillate);
  --border-color: rgba(232, 241, 246, 0.1);
  --danger: #ff7a7a;
  --danger-bg: rgba(255, 122, 122, 0.12);
  --success: #4ce0a3;
  --success-bg: rgba(76, 224, 163, 0.12);

  --card-radius: 22px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* Offset, tinted depth; never a zero-offset glow. */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, 0.75), 0 2px 6px rgba(0, 0, 0, 0.35);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Geist", system-ui, sans-serif;
  --font-data: "Geist Mono", ui-monospace, monospace;

  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--abyss);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--nitrogen);
  scrollbar-color: rgba(143, 163, 181, 0.35) var(--abyss);
}

/* Atmosphere: light folding through clarified ice, tinted by the current pH. Fixed, behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: -10% -20% auto;
  height: 110vh;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(100deg, transparent 0 90px, color-mix(in oklch, var(--accent) 7%, transparent) 140px, transparent 210px),
    radial-gradient(55% 45% at 75% 10%, color-mix(in oklch, var(--accent) 18%, transparent), transparent 70%);
  filter: blur(22px);
  animation: atmosphere-drift 26s var(--ease-in-out) infinite alternate;
}

@keyframes atmosphere-drift {
  to { transform: translateX(7%); }
}

img,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--nitrogen);
  outline-offset: 3px;
}

::selection {
  background: color-mix(in oklch, var(--accent) 40%, transparent);
  color: var(--clarified);
}

/* Utility display values (e.g. .tactile-btn's inline-flex) must not override [hidden]. */
[hidden] {
  display: none !important;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 5.5vw, 4.75rem); letter-spacing: -0.035em; line-height: 1.04; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h4, h5, h6 { font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9375rem; }

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

small,
.text-muted {
  color: var(--text-grey);
}


/* ---------- Layout utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- .glass-panel ---------- */
/* Never use on a container whose child must escape its edge (e.g. dropdowns): overflow is hidden to contain the glow. */
.glass-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: rgba(14, 20, 32, 0.55);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border-radius: var(--card-radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-lg);
}

/* 1px gradient edge via mask: light at the top-left, the pH hue at the bottom-right. */
.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(232, 241, 246, 0.28), rgba(232, 241, 246, 0.05) 40%, color-mix(in oklch, var(--accent) 65%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.glass-panel--sm {
  border-radius: var(--radius-md);
}

/* ---------- .tactile-btn ---------- */
.tactile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8em 1.25em;
  border: 1px solid rgba(232, 241, 246, 0.18);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dark);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms var(--ease-out),
    border-color 200ms ease,
    background-color 200ms ease,
    color 200ms ease;
}

/* Clickable cards: press feedback only; tilt and image scale come from .item-card and motion.js. */
.tactile-card {
  scale: 1;
  transition: scale 160ms var(--ease-out), border-color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .tactile-btn:hover {
    border-color: var(--accent);
    color: var(--text-dark);
  }

  .tactile-card:hover {
    border-color: color-mix(in oklch, var(--accent) 45%, transparent);
    color: var(--text-dark);
  }
}

.tactile-btn:active {
  transform: scale(0.97);
  transition-duration: 120ms;
}

.tactile-card:active {
  scale: 0.97;
  transition-duration: 120ms;
}

.tactile-btn:disabled,
.tactile-btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.tactile-btn--primary {
  background: var(--pea);
  border-color: var(--pea);
  color: #fff;
}

.tactile-btn--primary:hover {
  background: var(--pea-hover);
  border-color: var(--pea-hover);
  color: #fff;
}

.tactile-btn--danger {
  background: var(--danger-bg);
  border-color: rgba(255, 122, 122, 0.4);
  color: var(--danger);
}

.tactile-btn--danger:hover {
  border-color: var(--danger);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(255, 122, 122, 0.3);
  color: var(--danger);
}

/* Nav/footer links: no chrome until hover. */
.tactile-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-grey);
  font-weight: 500;
}

.tactile-btn--ghost:hover {
  background: rgba(232, 241, 246, 0.05);
  border-color: transparent;
}

.tactile-btn--ghost[aria-current="page"] {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  color: var(--text-dark);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.tactile-btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

/* ---------- .tactile-field ---------- */
.tactile-field {
  width: 100%;
  padding: 0.75em 0.95em;
  background: rgba(232, 241, 246, 0.04);
  border: 1px solid rgba(232, 241, 246, 0.16);
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.tactile-field::placeholder {
  color: var(--text-grey);
}

.tactile-field:focus,
.tactile-field:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

select.tactile-field option {
  background: var(--card-bg);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 0.6em 1em;
  background: var(--nitrogen);
  color: var(--abyss);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
  color: var(--abyss);
}

/* ---------- Site header (partials/nav.html) ---------- */
/* Own frost, not .glass-panel: the dropdown must overflow the bar. */
[data-include$="nav.html"] {
  min-height: 73px; /* reserve header height so the page doesn't jump when the partial lands */
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 10, 16, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-color);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  min-height: 72px;
}

.site-nav__brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-dark);
  white-space: nowrap;
}

.site-nav__brand:hover {
  color: var(--text-dark);
}

.site-nav__brand span {
  color: var(--text-grey);
  font-weight: 300;
}

.site-nav__menu,
.site-nav__submenu,
.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav__menu .tactile-btn {
  padding: 0.5em 0.9em;
  font-size: 0.9375rem;
}

.site-nav__toggle {
  display: none;
}

/* Hamburger morphs to × when open. */
.site-nav__bars,
.site-nav__bars::before,
.site-nav__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition:
    transform 0.2s var(--ease-out),
    background-color 0.2s ease;
}

.site-nav__bars {
  position: relative;
}

.site-nav__bars::before,
.site-nav__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.site-nav__bars::before { top: -6px; }
.site-nav__bars::after { top: 6px; }

.site-nav__toggle[aria-expanded="true"] .site-nav__bars { background-color: transparent; }
.site-nav__toggle[aria-expanded="true"] .site-nav__bars::before { transform: translateY(6px) rotate(45deg); }
.site-nav__toggle[aria-expanded="true"] .site-nav__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Collection dropdown: opens on hover (mouse) or aria-expanded (click, keyboard, touch). */
.site-nav__dropdown {
  position: relative;
}

.site-nav__dropdown > button svg {
  transition: transform 0.2s var(--ease-out);
}

.site-nav__dropdown:has([aria-current="page"]) > button {
  border-radius: 0;
  color: var(--text-dark);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.site-nav__submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  gap: 2px;
  min-width: 220px;
  padding: 6px;
  background: rgba(14, 20, 32, 0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.2s ease,
    transform 0.2s var(--ease-out),
    visibility 0.2s;
}

/* Bridges the 8px gap so hover doesn't drop between button and menu. */
.site-nav__submenu::before {
  content: "";
  position: absolute;
  inset: -9px 0 auto;
  height: 9px;
}

.site-nav__submenu .tactile-btn {
  justify-content: flex-start;
  width: 100%;
}

.site-nav__dropdown > [aria-expanded="true"] + .site-nav__submenu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.site-nav__dropdown > [aria-expanded="true"] svg {
  transform: rotate(180deg);
}

@media (hover: hover) {
  .site-nav__dropdown:hover > .site-nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-nav__dropdown:hover > button svg {
    transform: rotate(180deg);
  }
}

/* Below 768px: menu behind hamburger, dropdown inline and expanded. */
@media (max-width: 767.98px) {
  .site-nav__toggle {
    display: inline-flex;
  }

  .site-nav {
    column-gap: 12px;
  }

  .site-nav__brand {
    font-size: clamp(0.8125rem, 4vw, 0.9375rem); /* keeps wordmark + toggle on one row down to 320px */
    letter-spacing: 0.04em;
  }

  .site-nav__menu {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 16px;
  }

  .site-nav__toggle[aria-expanded="true"] + .site-nav__menu {
    display: flex;
  }

  .site-nav__menu .tactile-btn {
    justify-content: flex-start;
    width: 100%;
  }

  .site-nav__dropdown > button {
    pointer-events: none;
  }

  .site-nav__dropdown > button svg {
    display: none;
  }

  .site-nav__submenu {
    position: static;
    min-width: 0;
    padding: 0 0 0 16px;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-nav__submenu::before {
    display: none;
  }
}

/* Shopping list: a pill in the header with a count, opening a native popover. */
/* Brand | menu | list on desktop; brand | list | menu button on phones, where the menu wraps below. */
.site-nav__brand { order: 0; }
.site-nav__menu { order: 1; margin-left: auto; }
.site-nav__list { order: 2; }
.site-nav__toggle { order: 3; }

.list-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0.35em 0.4em 0.35em 0.9em;
  border: 1px solid rgba(232, 241, 246, 0.16);
  border-radius: 999px;
  background: none;
  color: var(--text-grey);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
}

.list-pill:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .list-pill:hover {
    border-color: var(--accent);
    color: var(--text-dark);
  }
}

.list-pill__count {
  min-width: 1.6rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--nitrogen);
  color: var(--abyss);
  font-family: var(--font-data);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
}

.list-popover {
  inset: 76px max(16px, env(safe-area-inset-right, 0px)) auto auto;
  width: min(320px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  margin: 0;
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(232, 241, 246, 0.14);
  border-radius: var(--radius-md);
  background: rgba(14, 20, 32, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  color: var(--text-dark);
  box-shadow: var(--shadow-lg);
  opacity: 1;
  transform: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), display 180ms allow-discrete, overlay 180ms allow-discrete;
}

.list-popover:not(:popover-open) {
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
}

@starting-style {
  .list-popover:popover-open {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.list-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.list-popover__head .section-title {
  margin: 0;
}

@media (max-width: 767.98px) {
  .site-nav__list {
    margin-left: auto;
  }

  .site-nav__menu {
    order: 4;
  }

  .list-pill {
    min-height: 44px;
    padding-inline: 0.75em 0.45em;
  }

  .list-pill__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

/* ---------- Site footer (partials/footer.html) ---------- */
.site-footer {
  margin-top: 96px;
  padding-block: 56px 32px;
  border-top: 1px solid var(--border-color);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 40px 48px;
}

.site-footer__tagline {
  max-width: 36ch;
  margin-top: 16px;
}

.site-footer__social {
  display: flex;
  gap: 8px;
}

.site-footer__social li:has(a[href=""]) {
  display: none;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: start;
  gap: 4px;
}

.site-footer__links .tactile-btn {
  padding-inline: 0.75em;
}

.site-footer__copy {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  border-radius: 50%;
  background: rgba(14, 20, 32, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

@media (max-width: 767.98px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__links {
    justify-content: flex-start;
    margin-inline-start: -0.75em; /* align link text with the brand column */
  }
}

/* ---------- Page scaffolding ---------- */
.page {
  padding-top: clamp(32px, 6vw, 64px);
}

.page-header {
  margin-bottom: 40px;
}

.page-header p {
  max-width: 60ch;
}

.back-link {
  margin: 0 0 24px -0.9em;
}

.section-title {
  margin-bottom: 16px;
  font-size: 1.25rem;
}

.empty-state {
  max-width: 560px;
  margin: 48px auto;
  padding: 48px 32px;
  text-align: center;
}

/* ---------- Badges & chips ---------- */
.badge-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35em 0.8em;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: rgba(232, 241, 246, 0.04);
  font-size: 0.8125rem;
  font-weight: 500;
}

.capitalize {
  text-transform: capitalize;
}

.badge--accent { color: var(--accent); background: var(--accent-glow); border-color: color-mix(in oklch, var(--accent) 30%, transparent); }
.badge--success { color: var(--success); background: var(--success-bg); border-color: rgba(76, 224, 163, 0.3); }
.badge--danger { color: var(--danger); background: var(--danger-bg); border-color: rgba(255, 122, 122, 0.3); }

.chip {
  padding: 0.35em 0.8em;
  border-radius: 999px;
  background: color-mix(in oklch, var(--accent) 14%, transparent);
  color: var(--text-dark);
  font-size: 0.8125rem;
}

/* ---------- Media (image with branded placeholder) ---------- */
/* Gradient shows when there is no image or the image fails (init-page.js hides broken images). */
.media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  background:
    radial-gradient(60% 50% at 50% 100%, color-mix(in oklch, var(--accent) 22%, transparent), transparent 70%),
    var(--vessel);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 20px;
  perspective: 900px;
}

.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(232, 241, 246, 0.07);
  border-radius: 20px;
  background: var(--vessel);
  color: var(--text-dark);
  transform-style: preserve-3d;
}

.item-card .media {
  border-radius: 0;
}

.item-card .media img {
  transition: transform 400ms var(--ease-out);
}

/* Highlight that follows the pointer (motion.js sets --mx/--my). */
.item-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(232, 241, 246, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .item-card:hover .media img {
    transform: scale(1.03);
  }

  .item-card:hover::after {
    opacity: 1;
  }
}

.item-card__body {
  display: grid;
  gap: 4px;
  padding: 16px 18px 18px;
}

.item-card__title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.item-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  color: var(--text-grey);
  font-size: 0.875rem;
}

/* Calculators hub: text-only cards in a list. */
.launcher {
  margin: 0;
  padding: 0;
  list-style: none;
}

.launcher .item-card {
  height: 100%;
}

.launcher .item-card__body {
  padding: 20px;
}

/* Each drink card wears its own pH at rest: its edge and readout take the drink's hue. */
.item-card[data-ph] {
  --accent: color-mix(in oklch, var(--hibiscus) calc(var(--ph) * 100%), var(--pea-text));
  border-color: color-mix(in oklch, var(--accent) 30%, transparent);
}

.ph-readout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--accent);
  font-family: var(--font-data);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.ph-readout__swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.card-grid--sm .ph-readout {
  font-size: 0.75rem;
}

.home-section__note {
  max-width: 60ch;
  margin: 8px 0 0;
}

.item-card__sub {
  margin: 0;
  color: var(--text-grey);
  font-size: 0.875rem;
}

.stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.stock-dot--out {
  background: var(--danger);
}

/* ---------- Detail layout (recipes, bottles) ---------- */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: start;
}

.detail__media {
  position: sticky;
  top: 97px; /* header 73px + 24px */
  margin: 0;
}

.detail__media figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 12px;
  color: var(--text-grey);
  font-size: 0.875rem;
}

.detail__body {
  display: grid;
  gap: 40px;
}

.detail__header h1 {
  margin-bottom: 20px;
}

.detail__header > * + * {
  margin-top: 12px;
}

.detail__body p {
  margin: 0;
  color: var(--text-grey);
}

.detail-panel {
  padding: clamp(20px, 3vw, 32px);
}

.detail-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.detail-panel__head .section-title {
  margin: 0;
}

.detail-panel__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ingredient-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.ingredient-list li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.ingredient-list li:last-child {
  border-bottom: 0;
}

.ingredient-list__qty {
  color: var(--text-dark);
  font-family: var(--font-data);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.provenance {
  margin-bottom: 24px;
  font-size: 0.875rem;
  color: var(--text-grey);
}

.provenance summary {
  cursor: pointer;
}

.provenance ul {
  margin: 8px 0 0;
  padding-left: 1.25em;
}

.step-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-list li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  counter-increment: step;
}

.step-list li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-data);
  font-size: 0.875rem;
}

.step-list li span {
  padding-top: 0.35em;
}

.related {
  margin-top: 96px;
}

@media (max-width: 860px) {
  .detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .detail__media {
    position: static;
    width: min(100%, 420px);
  }
}

/* ---------- Controls: stepper, segmented ---------- */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stepper output {
  min-width: 6.5em;
  font-family: var(--font-data);
  font-weight: 500;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.segmented {
  display: inline-flex;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented span {
  display: block;
  padding: 0.4em 0.95em;
  border-radius: 6px;
  color: var(--text-grey);
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.segmented input:checked + span {
  background: var(--accent-glow);
  color: var(--accent);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Star rating ---------- */
.rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.stars {
  display: inline-flex;
  gap: 2px;
}

.star {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: #5f7083; /* 3.6:1 on the vessel and abyss grounds */
  cursor: pointer;
  transition:
    color 0.2s ease,
    transform 0.2s var(--ease-out);
}

.star.is-on {
  color: var(--accent);
}

/* Hover previews the score: fill up to the hovered star. */
.stars:not([data-locked]):hover .star {
  color: var(--accent);
}

.stars:not([data-locked]) .star:hover ~ .star {
  color: #5f7083;
}

.stars:not([data-locked]) .star:hover {
  transform: scale(1.12);
}

.stars:not([data-locked]) .star:active {
  transform: scale(0.92);
  transition-duration: 0.12s;
}

.stars[data-locked] .star {
  cursor: default;
}

.rating__summary {
  color: var(--text-grey);
  font-size: 0.9375rem;
}

.rating__summary strong {
  color: var(--text-dark);
}

.status-text {
  min-height: 1.6em;
  margin: 12px 0 0;
  color: var(--success);
  font-size: 0.875rem;
}

/* ---------- Calculators (PRD §3 shared template) ---------- */
.calc-switch {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 40px;
  padding: 4px;
  overflow-x: auto;
  list-style: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  scrollbar-width: none;
}

.calc-switch .tactile-btn {
  padding: 0.5em 0.9em;
  font-size: 0.875rem;
  white-space: nowrap;
}

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(232, 241, 246, 0.07);
  border-radius: var(--card-radius);
  background: var(--vessel);
}

.calc__results {
  position: sticky;
  top: 97px;
  padding: clamp(20px, 3vw, 32px);
}

.field {
  display: grid;
  gap: 8px;
}

.field + .field {
  margin-top: 24px;
}

.field__label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

.field__label output {
  color: var(--accent);
}

/* Unit suffix inside a number field: "100 [g]". */
.input-unit {
  position: relative;
}

.input-unit .tactile-field {
  padding-right: 3em;
}

.input-unit span {
  position: absolute;
  top: 50%;
  right: 0.9em;
  transform: translateY(-50%);
  color: var(--text-grey);
  font-size: 0.875rem;
  pointer-events: none;
}

.range {
  width: 100%;
  margin: 4px 0 0;
  accent-color: var(--accent);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-grey);
  font-size: 0.75rem;
}

/* Toggle switch: <label class="switch">Text <input type="checkbox" role="switch"></label> */
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.switch small {
  color: var(--text-grey);
  font-weight: 400;
}

.switch input {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  appearance: none;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out);
}

.switch input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-dark);
  transition:
    transform 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out);
}

.switch input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.switch input:checked::before {
  transform: translateX(18px);
  background: var(--primary);
}

.switch + .switch {
  margin-top: 16px;
}

/* Tabs share the segmented-control look. */
.tabs {
  display: inline-flex;
  margin-bottom: 24px;
  padding: 3px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.tabs [role="tab"] {
  padding: 0.5em 1.1em;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-grey);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.tabs [role="tab"]:hover {
  color: var(--text-dark);
}

.tabs [aria-selected="true"],
.tabs [aria-selected="true"]:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

/* Results */
.result-list {
  margin: 0;
}

.result-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.result-list:first-child > div:first-child {
  padding-top: 0;
}

.result-list dt {
  color: var(--text-grey);
}

.result-list dd {
  margin: 0;
  font-family: var(--font-data);
  font-size: 1.25rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-list .is-sub dt {
  padding-left: 16px;
}

.result-list .is-sub dd {
  font-size: 1.125rem;
}

.result-list__heading {
  margin: 0;
  padding: 24px 0 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-grey);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Single headline result (e.g. water needed). */
.result-hero dt {
  color: var(--text-grey);
  font-size: 0.875rem;
  font-weight: 600;
}

.result-hero dd {
  margin: 4px 0 0;
  color: var(--nitrogen);
  font-family: var(--font-data);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.calc-notes {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-grey);
  font-size: 0.9375rem;
}

.calc-notes h2 {
  margin-bottom: 8px;
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
}

.calc-notes p,
.calc-notes ol {
  margin: 0;
}

.calc-notes ol {
  padding-left: 1.25em;
}

fieldset.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset.field .text-muted {
  margin: 0;
  font-size: 0.875rem;
}

/* Wraps on narrow screens; options stretch so wrapped rows stay even. */
.segmented {
  flex-wrap: wrap;
}

.segmented label {
  flex: 1 1 auto;
  text-align: center;
}

.result-hero dd.is-danger {
  color: var(--danger);
  font-size: 1.75rem;
}

.calc-warning {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 0.875rem;
}

/* Price Calculator: step jump-links | form | results */
.price-calc {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(0, 360px);
  gap: 24px;
  align-items: start;
}

.price-steps {
  position: sticky;
  top: 97px;
}

.price-steps ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.price-steps .tactile-btn {
  justify-content: flex-start;
  width: 100%;
  font-size: 0.875rem;
}

.price-form {
  display: grid;
  gap: 24px;
}

.price-form .panel {
  scroll-margin-top: 97px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 20px;
  margin-top: 20px;
}

.field-grid .field + .field {
  margin-top: 0;
}

.ing-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) 40px;
  gap: 8px;
  align-items: center;
}

.ing-row + .ing-row {
  margin-top: 8px;
}

.ing-row--head {
  margin-bottom: 8px;
  color: var(--text-grey);
  font-size: 0.75rem;
  font-weight: 600;
}

.add-row {
  width: 100%;
  margin-top: 16px;
  border-style: dashed;
}

@media (max-width: 1100px) {
  .price-calc {
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  }

  .price-steps {
    grid-column: 1 / -1;
    position: static;
  }

  .price-steps ol {
    display: flex;
    flex-wrap: wrap;
  }

  .price-steps .tactile-btn {
    width: auto;
  }
}

@media (max-width: 860px) {
  .calc,
  .price-calc {
    grid-template-columns: minmax(0, 1fr);
  }

  .calc__results {
    position: relative;
    top: auto;
  }
}

/* Phones: name on its own line, numbers below; column header hidden (inputs carry placeholders + aria-labels). */
@media (max-width: 600px) {
  .ing-row--head {
    display: none;
  }

  .ing-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 40px;
  }

  .ing-row > :first-child {
    grid-column: 1 / 4;
  }

  .ing-row > :last-child {
    grid-row: 1;
    grid-column: 4;
  }

  .ing-row + .ing-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
  }
}

/* ---------- Shared bits for content pages ---------- */
.social-row {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-row li:has(a[href=""]) {
  display: none;
}

.plain-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-grey);
}

.plain-list li::marker {
  color: var(--accent);
}

/* ---------- Home / About intro (partials/about.html) ---------- */
/* A bar scene: Elad at his own bar. The photo keeps the counter and floor he stands on (darkened, edges faded
   into the page) and drops the wall behind him; a soft light in the current pH hue sits behind his shoulders.
   Real recipe data floats around him on glass chips that drift with the pointer (motion.js, data-depth). */
.intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  column-gap: 24px;
  padding-block: clamp(8px, 2vw, 24px) clamp(48px, 7vw, 96px);
  overflow-x: clip; /* decorations may spill sideways, never into a page scroll */
}

.intro__copy {
  position: relative;
  z-index: 1;
  grid-column: 1 / 6;
  grid-row: 1;
}

.intro__name {
  margin: 0;
  font-size: clamp(3rem, 6.4vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.intro__role {
  margin: 18px 0 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 300;
  letter-spacing: -0.01em;
}

.intro__bio {
  max-width: 46ch;
  margin: 24px 0 0;
  color: var(--text-grey);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  white-space: pre-line; /* the CMS bio keeps its paragraph breaks */
}

.intro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.intro__actions a[href=""],
.chip--handle[href=""] {
  display: none; /* no Instagram URL in the CMS: no follow links */
}

.intro__copy .social-row {
  margin-top: 20px;
}

.intro__down {
  margin-top: 40px;
  border-radius: 50%;
}

/* ----- the stage ----- */
.stage {
  position: relative;
  grid-column: 6 / -1;
  grid-row: 1;
  height: min(80vh, 760px);
  min-height: 520px;
}

/* Bar light behind his shoulders, in the page's current pH hue. */
.stage__glow {
  position: absolute;
  inset: 4% 12% 40% 16%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in oklch, var(--accent) 38%, transparent), transparent);
  filter: blur(30px);
}

/* The scene box matches the photo, so chips placed in % keep their spot beside his head, elbow and torso. */
.stage__person {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  aspect-ratio: 747 / 1000;
  translate: -50% 0;
}

.stage__figure {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ----- glass chips ----- */
.chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 16px;
  background: rgba(14, 20, 32, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 0 0 1px rgba(232, 241, 246, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 36px -16px rgba(0, 0, 0, 0.7);
  color: var(--text-dark);
  font-size: 0.875rem;
  line-height: 1.3;
  width: max-content; /* chips sit in the narrow person box; size to content, not to the space left */
  white-space: nowrap;
  text-decoration: none;
  animation: chip-bob 7s var(--ease-in-out) infinite alternate;
  transition: scale 160ms var(--ease-out), box-shadow 200ms ease;
}

a.chip:hover {
  color: var(--text-dark);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent) 60%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 36px -16px rgba(0, 0, 0, 0.7);
}

a.chip:active {
  scale: 0.97;
}

@keyframes chip-bob {
  to { transform: translateY(-7px); }
}

.chip--recipe {
  --accent: color-mix(in oklch, var(--hibiscus) calc(var(--ph) * 100%), var(--pea-text));
  top: 22%;
  right: 64%;
  padding: 8px 18px 8px 8px;
}

.chip--recipe img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.chip__text {
  display: grid;
  gap: 4px;
}

.chip__text b {
  font-weight: 600;
}

.chip__ph {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-family: var(--font-data);
  font-size: 0.75rem;
}

.chip__bar {
  width: 56px;
  height: 6px;
  border-radius: 999px;
  background: rgba(232, 241, 246, 0.12);
  overflow: hidden;
}

.chip__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pea-text), var(--accent));
}

.chip--spec {
  top: 30%;
  left: 66%;
  display: grid;
  gap: 6px;
  padding: 12px 16px;
  animation-duration: 8.5s;
}

.chip--spec b {
  display: inline-block;
  min-width: 3.6em;
  color: var(--nitrogen);
  font-family: var(--font-data);
  font-weight: 500;
}

.chip--handle {
  top: 7%;
  left: 62%;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--hibiscus);
  color: var(--abyss);
  font-weight: 600;
  box-shadow: 0 14px 28px -12px rgba(255, 95, 174, 0.6);
  animation-duration: 6s;
}

a.chip--handle:hover {
  color: var(--abyss);
  box-shadow: 0 14px 28px -12px rgba(255, 95, 174, 0.8);
}

.chip--counts {
  top: 76%;
  left: 2%;
  gap: 14px;
  color: var(--text-grey);
  font-family: var(--font-data);
  font-size: 0.8125rem;
  animation-duration: 9s;
}

.chip--counts b {
  color: var(--nitrogen);
  font-weight: 500;
}

.chip[hidden] {
  display: none;
}

.home-section {
  margin-top: clamp(32px, 5vw, 64px);
}

.home-section > h2 {
  margin-bottom: 24px;
}

.home-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 24px;
}

.home-section__head h2 {
  margin: 0;
}

.home-section__note {
  max-width: 60ch;
  margin: 8px 0 0;
}

/* Four originals in one row on desktop, two on phones. */
[data-home-originals] {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

@media (max-width: 860px) {
  .intro {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 0;
  }

  .stage,
  .intro__copy {
    grid-column: 1;
  }

  .stage {
    grid-row: 1;
    /* no taller than the photo is at this width (747:1000), so the bar's faded sides stay on screen */
    height: min(64svh, 560px, calc((100vw - var(--gutter)) * 1000 / 747));
    min-height: 0;
    margin-inline: calc(var(--gutter) * -0.5);
  }

  .intro__copy {
    grid-row: 2;
    margin-top: 8px;
  }

  .chip {
    font-size: 0.75rem;
    padding: 8px 12px;
  }

  .chip--recipe {
    top: 26%;
    right: auto;
    left: 9%;
    padding: 6px 12px 6px 6px;
  }

  .chip--recipe img {
    width: 36px;
    height: 36px;
  }

  .chip--spec {
    display: none; /* the recipe card already names the drink; keep the phone scene uncluttered */
  }

  .chip--handle {
    top: 4%;
    left: auto;
    right: 11%;
  }

  .chip--counts {
    top: auto;
    bottom: 3%;
    left: 9%;
    gap: 10px;
  }

  .intro__down {
    display: none;
  }
}

@media (max-width: 600px) {
  [data-home-originals] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

.newsletter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 32px;
  align-items: center;
  margin-top: clamp(64px, 9vw, 112px);
}

.newsletter .text-muted {
  margin: 0;
}

.newsletter__form {
  display: flex;
  gap: 8px;
}

.newsletter .status-text {
  grid-column: 1 / -1;
  margin: 0;
}

/* ---------- Gallery ---------- */
.gallery {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: none;
  color: var(--text-dark);
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.gallery-item .media {
  display: block;
  border-radius: 0;
}

.gallery-item__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(7, 10, 16, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transform: translate(-50%, -50%);
}

.gallery-item__caption {
  position: absolute;
  inset: auto 0 0;
  padding: 32px 16px 14px;
  background: linear-gradient(transparent, rgba(7, 10, 16, 0.85));
  font-weight: 600;
}

/* ---------- Lightbox (init-page.js) ---------- */
.lightbox {
  max-width: min(92vw, 1100px);
  max-height: 92vh;
  padding: 0;
  overflow: visible;
  border: 0;
  background: none;
  color: var(--text-dark);
}

.lightbox::backdrop {
  background: rgba(3, 5, 9, 0.86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox figure {
  margin: 0;
}

.lightbox__media img,
.lightbox__media video {
  max-width: 100%;
  max-height: 80vh;
  margin-inline: auto;
  border-radius: var(--radius-md);
}

.lightbox figcaption {
  margin-top: 12px;
  color: var(--text-grey);
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: -52px;
  right: 0;
  font-size: 1.5rem;
}

/* ---------- Tutorials ---------- */
.tutorial {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.tutorial__topics {
  position: sticky;
  top: 97px;
}

.tutorial__topics ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tutorial__topics .tactile-btn {
  justify-content: flex-start;
  width: 100%;
}

.tutorial__content {
  scroll-margin-top: 97px;
}

.tutorial__content > h2 {
  margin-bottom: 4px;
}

.tutorial__subtitle {
  margin-bottom: 24px;
}

.tutorial__hero {
  display: block;
  width: 100%;
  margin-bottom: 24px;
  padding: 0;
  aspect-ratio: 16 / 7;
  border: 0;
  cursor: zoom-in;
}

.tutorial__body > p {
  color: var(--text-grey);
}

.tutorial__body strong {
  color: var(--text-dark);
}

.accordion-item {
  border-bottom: 1px solid var(--border-color);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 0;
  border: 0;
  background: none;
  color: var(--text-dark);
  text-align: left;
  cursor: pointer;
}

.accordion-header h3 {
  margin: 0;
  font-size: 1.125rem;
  transition: color 0.2s ease;
}

.accordion-header:hover h3,
.accordion-header[aria-expanded="true"] h3 {
  color: var(--accent);
}

.accordion-icon {
  flex: none;
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.2s var(--ease-out);
}

.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: rotate(45deg);
}

/* Height animates via grid rows; visibility keeps closed entries out of the tab order. */
.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition:
    grid-template-rows 0.3s ease,
    visibility 0.3s;
}

.accordion-header[aria-expanded="true"] + .accordion-content {
  grid-template-rows: 1fr;
  visibility: visible;
}

.accordion-body-wrapper {
  min-height: 0;
  overflow: hidden;
}

.tut-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 24px;
  align-items: start;
  padding-bottom: 20px;
}

.tut-entry-text p {
  color: var(--text-grey);
}

.tut-entry-img {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

/* Broken images hide themselves (init-page.js); drop their slot too so text takes the full width. */
.tut-entry-img:has(img[hidden]),
.tutorial__hero:has(img[hidden]) {
  display: none;
}

.tut-entry:has(img[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.tut-entry-zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 8px;
  border: 0;
  background: none;
  cursor: zoom-in;
}

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
  align-items: start;
}

.contact__info {
  padding: clamp(20px, 3vw, 32px);
}

.contact__details {
  display: grid;
  gap: 20px;
  margin: 0 0 24px;
}

.contact__details dt {
  color: var(--text-grey);
  font-size: 0.875rem;
}

.contact__details dd {
  margin: 2px 0 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.contact__form .field-grid {
  margin-top: 24px;
}

.contact__form textarea {
  resize: vertical;
}

.contact__submit {
  margin-top: 24px;
}

@media (max-width: 860px) {
  .newsletter,
  .tutorial,
  .contact {
    grid-template-columns: minmax(0, 1fr);
  }


  .tutorial__topics {
    position: static;
  }

  .tutorial__topics ul {
    display: flex;
    gap: 4px;
    padding-block: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tutorial__topics .tactile-btn {
    width: auto;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .newsletter__form {
    flex-direction: column;
  }

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

  .tut-entry-img {
    max-width: 200px;
  }
}

/* ---------- Admin mode on public pages (init-page.js, editor.js) ---------- */
/* Controls are only rendered in admin mode; "Preview as visitor" hides them without signing out. */
.admin-preview .admin-only {
  display: none !important;
}

.admin-bar {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 8px 8px 16px;
  border: 1px solid color-mix(in oklch, var(--accent) 35%, transparent);
  border-radius: var(--radius-md);
  background: rgba(14, 20, 32, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
}

.admin-bar__label {
  color: var(--accent);
  font-weight: 700;
}

.admin-bar .switch {
  gap: 8px;
  font-size: 0.875rem;
}

.admin-bar .tactile-btn {
  padding: 0.4em 0.8em;
  font-size: 0.875rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

/* In admin mode a card sits with its Edit/Delete row; buttons can't live inside the card's link. */
.card-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-cell > .item-card,
.card-cell > .gallery-item {
  flex: 1;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item-actions .tactile-btn {
  padding: 0.4em 0.8em;
  font-size: 0.8125rem;
}

.editor {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  background: var(--card-bg);
  color: var(--text-dark);
  box-shadow: var(--shadow-lg);
}

.editor::backdrop {
  background: rgba(3, 5, 9, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.editor__form {
  display: grid;
  gap: 20px;
  padding: clamp(20px, 3vw, 28px);
}

.editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.editor__head .section-title {
  margin: 0;
}

.editor__fields {
  display: grid;
  gap: 18px;
}

.editor__fields .field + .field {
  margin-top: 0;
}

.editor__fields textarea {
  resize: vertical;
}

.field__hint {
  margin: 4px 0 0;
  font-size: 0.8125rem;
}

.field__ai {
  justify-self: start;
}

.editor-rows {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.editor-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.editor-row + .editor-row {
  margin-top: 8px;
}

.editor-row > .tactile-field {
  flex: 1 1 0;
  min-width: 0;
}

.editor-row > .tactile-field:first-child {
  flex-grow: 2;
}

.editor__progress {
  width: 100%;
  accent-color: var(--accent);
}

.editor__error {
  margin: 0;
}

.editor__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 600px) {
  .admin-bar {
    right: 72px; /* clear of the back-to-top button */
  }
}

/* ---------- Grid toolbar: search, filter, tile size (grid-tools.js) ---------- */
.grid-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.grid-toolbar__search {
  position: relative;
  flex: 1 1 260px;
}

.grid-toolbar__search svg {
  position: absolute;
  top: 50%;
  left: 0.9em;
  color: var(--text-grey);
  transform: translateY(-50%);
  pointer-events: none;
}

.grid-toolbar__search .tactile-field {
  padding-left: 2.6em;
}

.grid-toolbar > select.tactile-field {
  flex: 0 1 220px;
  width: auto;
}

.grid-toolbar__size {
  flex-wrap: nowrap;
  min-width: 0;
  margin: 0;
}

.grid-count {
  margin: 12px 0 20px;
  font-size: 0.875rem;
}

.grid-empty {
  grid-column: 1 / -1;
  padding: 32px 0;
  text-align: center;
}

/* Tile sizes. Medium is the default .card-grid; phones keep at least one readable column. */
.card-grid--sm {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); /* 130px: two columns even on a 320px phone (288px of content) */
  gap: 16px;
}

.card-grid--sm .item-card__body {
  padding: 12px 12px 14px;
}

.card-grid--sm .item-card__title {
  font-size: 0.9375rem;
}

.card-grid--sm .item-card__meta,
.card-grid--sm .item-card__sub {
  font-size: 0.75rem;
}

.card-grid--lg {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 32px;
}

.card-grid--lg .item-card__body {
  padding: 20px 16px 14px;
}

.card-grid--lg .item-card__title {
  font-size: 1.625rem;
}

@media (max-width: 600px) {
  .grid-toolbar > select.tactile-field {
    flex: 1 1 auto;
  }
}

/* ---------- Status ---------- */
.is-success { color: var(--success); }
.is-danger { color: var(--danger); }

.detail__sub {
  margin: -8px 0 0;
  color: var(--text-grey);
  font-size: 1.0625rem;
}

/* ---------- Alchemist motion pieces (js/shared/motion.js) ---------- */
/* Odometer cells: the old character rolls out as the new one rolls in. */
.odo {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.odo > span {
  display: inline-block;
}

.odo > .odo__old {
  position: absolute;
  inset: 0 auto auto 0;
}

/* Headline words rise through their own masks. */
.word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  vertical-align: top;
}

.word > span {
  display: inline-block;
}

/* Spherification: ingredient pills merge in a gooey filter and drop into the button. */
.sphere-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  filter: url(#alchemist-goo);
}

.sphere-pill {
  position: fixed;
  transform: translateY(-50%);
  padding: 0.45em 0.85em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--abyss);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.sphere-drop {
  position: fixed;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.75), var(--accent) 42%, color-mix(in oklch, var(--accent), #000 40%));
  box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.7);
}

/* Card to detail: the photo morphs across pages (Chrome/Edge 126+, Safari 18.2+; others change instantly). */
@view-transition {
  navigation: auto;
}

::view-transition-group(*) {
  animation-duration: 380ms;
  animation-timing-function: var(--ease-in-out);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }

  /* The pH colour change carries meaning, so it stays, just quicker. */
  :root {
    transition: --ph 150ms linear !important;
  }
}
