/* HOLY Rating Card — shop-aligned cards on a warm cream, no borders/shadows.
   Brand fonts: Obviously Narrow (app title + product names only) + PP Agrandir
   (everything else). Category accent colours match the live shop feed. */

@font-face {
  font-family: "Obviously Narrow";
  src: url("/ObviouslyNarrow-Black.otf") format("opentype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "PP Agrandir";
  src: url("/PPAgrandirText-Regular.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "PP Agrandir";
  src: url("/PPAgrandirText-Bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --energy:    #FFEA23;
  --hydration: #65BDE6;
  --icedtea:   #FFD854;
  --milkshake: #FBABD4;
  --magenta:   #e50b7d;
  --ink:       #111;
  --paper:     #f3ede1;   /* clean warm cream, matches the shop */
  --card:      #fff;
  --neutral:   #eae4d8;   /* unrated media block — "not caught yet" */
  --radius:    18px;
  --shadow:    none;
  --shadow-sm: none;
  --hair:      rgba(0,0,0,.10);
  --edge:      3px;                       /* consumed by stats.html inline styles */
  --shadow-lg: none;                      /* consumed by stats.html inline styles */
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "PP Agrandir", system-ui, sans-serif;
  font-weight: 500;
  -webkit-text-size-adjust: 100%;
  padding-bottom: 40px;
}
.hidden { display: none !important; }

/* uppercase chrome — body font (PP Agrandir); Obviously Narrow is reserved for
   the app title (.brand) and product titles (.name) only */
.pill, .btn, .lang-btn, .counter, .eyebrow, .toast, h1 {
  font-family: "PP Agrandir", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* save-link banner */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--energy);
  padding: 12px 16px;
}
.banner-text { line-height: 1.3; }
.banner-text span { font-size: 13px; font-weight: 700; }
.save-link {
  font-size: 13px; font-weight: 700; color: var(--ink);
  text-decoration: underline; text-underline-offset: 2px; word-break: break-all;
}
.banner-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* sticky header — topbar + pills stick together as one unit (no overlap) */
.sticky-top { position: sticky; top: 0; z-index: 20; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(243,237,225,.9);
  backdrop-filter: blur(8px);
}
.brand {
  display: flex; align-items: center; gap: 8px; font-size: 26px; line-height: 1;
  font-family: "Obviously Narrow", sans-serif;
}
.brand-holy { color: var(--ink); }
.brand-dex {
  background: var(--magenta); color: #fff;
  padding: 2px 8px 0; border-radius: 8px;
  box-shadow: var(--shadow-sm); transform: rotate(-2deg);
}
.counter {
  font-size: 15px; background: var(--card); color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px 3px; box-shadow: var(--shadow-sm); white-space: nowrap;
}

/* buttons */
.btn {
  font-size: 15px; cursor: pointer;
  background: var(--ink); color: #fff;
  border: none; border-radius: 999px;
  padding: 9px 17px 7px; box-shadow: var(--shadow-sm);
  transition: transform .08s;
}
.btn.ghost { background: var(--card); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-icon {
  cursor: pointer; background: var(--card); color: var(--ink);
  border-radius: 999px;
  width: 34px; height: 34px; font-size: 20px; line-height: 1;
  box-shadow: var(--shadow-sm);
}
.lang {
  display: flex; border-radius: 999px;
  overflow: hidden; box-shadow: var(--shadow-sm); background: var(--card);
}
.lang-btn {
  border: none; background: transparent; color: var(--ink);
  padding: 7px 12px 5px; font-size: 14px; cursor: pointer;
}
.lang-btn.active { background: var(--energy); }

/* category pills */
.pills {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 14px 16px; background: rgba(243,237,225,.9);
  backdrop-filter: blur(8px);
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  white-space: nowrap; cursor: pointer; font-size: 15px;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 8px 16px 6px;
  transition: transform .08s;
}
.pill:active { transform: translateY(1px); }
.pill.active { box-shadow: none; }
.pill.active[data-cat="All"]       { background: var(--ink); color: #fff; }
.pill.active[data-cat="Energy"]    { background: var(--energy); }
.pill.active[data-cat="Hydration"] { background: var(--hydration); }
.pill.active[data-cat="Iced Tea"]  { background: var(--icedtea); }
.pill.active[data-cat="Milkshake"] { background: var(--milkshake); }

/* flavour grid */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  max-width: 1040px; margin: 0 auto; padding: 20px 16px;
}

.card {
  position: relative;
  --cat: var(--milkshake);
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
  animation: pop-in .32s cubic-bezier(.2,1.1,.5,1) backwards;
  animation-delay: calc(var(--i, 0) * 22ms);
}
.card[data-cat="Energy"]    { --cat: var(--energy); }
.card[data-cat="Hydration"] { --cat: var(--hydration); }
.card[data-cat="Iced Tea"]  { --cat: var(--icedtea); }
.card[data-cat="Milkshake"] { --cat: var(--milkshake); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* media block — the sachet floats (contained) on the variant colour block;
   the image does NOT fill the card. */
.media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg, var(--neutral));
  display: grid; place-items: center;
  overflow: hidden;
}
/* floats, centered in the square, at ~60% of the block height; tweak to resize. */
.media img {
  display: block; width: auto; height: 60%; max-width: 76%;
  object-fit: contain;
}

/* caught ✓ stamp (rated only) */
.badge {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; display: none; place-items: center;
  background: var(--magenta); color: #fff; font-size: 15px; line-height: 1;
  border-radius: 999px; box-shadow: var(--shadow-sm);
  transform: rotate(6deg);
}
.card.rated .badge { display: grid; animation: stamp .3s cubic-bezier(.2,1.4,.5,1) backwards; }

/* card body — white panel below the image. */
.body {
  background: var(--card);
  padding: 16px 13px 14px; display: flex; flex-direction: column; gap: 7px;
}
.eyebrow { font-size: 11px; color: #6b675d; }
.name {
  margin: 0; font-family: "Obviously Narrow", sans-serif;
  font-weight: 400; font-size: 21px; line-height: 1.02;
}

/* stars */
.stars { display: flex; gap: 3px; margin-top: 2px; }
.star {
  border: none; background: none; padding: 0; cursor: pointer;
  font-size: 24px; line-height: 1;
  color: #d8d5cb; transition: transform .08s;
}
.star.on { color: var(--magenta); }
.star:active { transform: scale(1.3); }
.clear {
  border: none; background: none; cursor: pointer;
  color: #b8b4aa; font-size: 15px; line-height: 1;
  padding: 4px 6px; margin-left: 6px;
  transition: color .08s, transform .08s;
}
.clear:hover { color: var(--ink); }
.clear:active { transform: scale(1.2); }

/* note toggle + shop link share one row */
.card-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 2px;
}
.note-toggle {
  border: none; background: none; cursor: pointer;
  font-family: "PP Agrandir", sans-serif; text-transform: none; font-weight: 700;
  font-size: 12px; color: #6b675d; padding: 0;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px;
}
.note {
  width: 100%; font: inherit; font-size: 13px; font-weight: 500;
  border-radius: 10px; padding: 7px 9px;
  resize: vertical; min-height: 46px; background: #fffdf9;
}
.note:disabled { background: #f4f2ec; color: #6b675d; cursor: not-allowed; }
.note:focus { outline: 2px solid var(--cat); outline-offset: 1px; }

/* little link back to the shop (shares the row with the note toggle) */
.shop-link {
  font-size: 12px; font-weight: 700; color: #6b675d; white-space: nowrap;
  text-decoration: underline; text-underline-offset: 2px;
}
.shop-link:hover { color: var(--ink); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  border-radius: 999px;
  padding: 11px 20px 9px; font-size: 14px; box-shadow: var(--shadow);
  z-index: 40; max-width: 90vw; text-align: center;
  animation: pop-in .25s cubic-bezier(.2,1.2,.5,1);
}

/* motion */
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes stamp  { from { opacity: 0; transform: rotate(6deg) scale(1.8); } }
@media (prefers-reduced-motion: reduce) {
  .card, .toast, .card.rated .badge { animation: none; }
  .btn, .pill, .star, .clear, .media, .body { transition: none; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .brand { font-size: 22px; }
  .counter { display: none; }
  .name { font-size: 18px; }
}
