/* ============================================================
   Save on Supps — design system
   Minimal, big, bold. Blue + red. Flat surfaces, heavy borders,
   no decoration. One dominant action per screen.
   ============================================================ */

:root {
  --blue:      #1B4DE4;
  --blue-dark: #1139B8;
  --blue-tint: #EDF2FE;
  --red:       #E01B2E;
  --red-tint:  #FDEBED;

  --flame:  #E0490F;
  --hot-line: #F4A15C;
  --hot-tint: #FFF6EF;

  --gold:   #B98900;
  --silver: #64707E;
  --bronze: #9C5A28;

  --ink:   #0A0F1A;
  --ink-2: #515F76;
  --ink-3: #8792A3;
  --line:  #DFE5EE;
  --card:  #FFFFFF;
  --bg:    #FFFFFF;
  --ok:    #067647;

  --r: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #FFFFFF; --ink-2: #A2AEC0; --ink-3: #737F91;
    --line: #262F40; --card: #0E141F; --bg: #080B12;
    --blue: #4A79FF; --blue-dark: #6B92FF; --blue-tint: #121E3D;
    --red: #FF5A67; --red-tint: #2E1116;
    --gold: #E0AC1F; --silver: #97A3B2; --bronze: #C87B3E;
  }
}
:root[data-theme="dark"] {
  --ink: #FFFFFF; --ink-2: #A2AEC0; --ink-3: #737F91;
  --line: #262F40; --card: #0E141F; --bg: #080B12;
  --blue: #4A79FF; --blue-dark: #6B92FF; --blue-tint: #121E3D;
  --red: #FF5A67; --red-tint: #2E1116;
  --flame: #FF8A3D; --hot-line: #6B3417; --hot-tint: #1D1108;
  --gold: #E0AC1F; --silver: #97A3B2; --bronze: #C87B3E;
}

* { box-sizing: border-box; }

/* Author display rules beat the UA's [hidden] rule, so state it loudly —
   every show/hide in the app toggles el.hidden. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; }

.shell { max-width: 640px; margin: 0 auto; padding: 0 20px 110px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 72px; padding: 0 20px;
  display: flex; align-items: center;
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}
.topbar__inner {
  max-width: 640px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; gap: 14px;
}
.back {
  width: 46px; height: 46px; margin-left: -11px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
}
.back:hover { background: var(--blue-tint); color: var(--blue); }
.wordmark { font-size: 22px; font-weight: 850; letter-spacing: -.035em; }
.wordmark span { color: var(--red); }
.crumb {
  font-size: 17px; font-weight: 750; letter-spacing: -.02em; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- home hero ---------- */
.hero { padding: 40px 0 4px; }
.foot { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.foot a { color: var(--ink-3); } .foot a:hover { color: var(--blue); }
.prose { max-width: 60ch; padding-top: 8px; }
.prose p { font-size: 16px; line-height: 1.6; color: var(--ink-2); margin: 0 0 14px; }
.prose h3 { margin: 26px 0 8px; font-size: 13px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.prose a { color: var(--blue); font-weight: 650; }
.prose__legal { font-size: 13px; color: var(--ink-3); margin-top: 26px; }
.hero__eyebrow {
  display: inline-block; margin-bottom: 16px; padding: 7px 12px;
  background: var(--blue-tint); color: var(--blue); border-radius: 8px;
  font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(42px, 12.5vw, 62px);
  line-height: .98; letter-spacing: -.045em; font-weight: 860;
}
.hero h1 em { font-style: normal; color: var(--blue); }
.hero p {
  margin: 0 0 26px; max-width: 30ch;
  font-size: 18px; line-height: 1.4; font-weight: 500; color: var(--ink-2);
}

/* ---------- search ---------- */
.searchwrap { position: relative; }
.search {
  display: flex; align-items: center; gap: 12px;
  height: 70px; padding: 0 20px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: var(--r);
  transition: border-color .1s, box-shadow .1s;
}
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-tint); }
.search svg { flex: none; color: var(--ink-3); }
.search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: none; color: var(--ink);
  font-size: 19px; font-weight: 650; letter-spacing: -.02em;
}
.search input::placeholder { color: var(--ink-3); font-weight: 550; letter-spacing: -.01em; }
.search__clear { color: var(--ink-3); padding: 8px; }

.cta {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 72px; margin-top: 14px;
  background: var(--blue); color: #fff;
  font-size: 21px; font-weight: 800; letter-spacing: -.03em;
  border-radius: var(--r);
  transition: background .1s, transform .06s;
}
.cta:hover { background: var(--blue-dark); }
.cta:active { transform: translateY(2px); }

/* suggestions */
.suggest {
  position: absolute; left: 0; right: 0; top: 78px; z-index: 30;
  background: var(--card); border: 2.5px solid var(--ink);
  border-radius: var(--r); overflow: hidden;
}
.suggest__row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px; padding: 12px 18px;
  border-bottom: 1.5px solid var(--line); text-align: left;
}
.suggest__row:last-child { border-bottom: 0; }
.suggest__row:hover { background: var(--blue-tint); }
.suggest__kind {
  flex: none; font-size: 10px; font-weight: 850; letter-spacing: .09em;
  text-transform: uppercase; color: #fff; background: var(--blue);
  padding: 5px 8px; border-radius: 6px;
}
.suggest__txt { flex: 1; min-width: 0; }
.suggest__name { display: block; font-size: 17px; font-weight: 750; letter-spacing: -.022em; }
.suggest__sub { display: block; font-size: 14px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.suggest__price { font-size: 18px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }

/* ---------- section heads ---------- */
.sect { margin: 42px 0 16px; }
.sect h2 {
  margin: 0; font-size: 13px; font-weight: 850;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
}
.sect--row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sect__link {
  font-size: 15px; font-weight: 800; color: var(--blue);
  text-transform: none; letter-spacing: -.02em; white-space: nowrap;
}

/* ---------- category tiles ---------- */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cat {
  display: flex; flex-direction: column; justify-content: space-between; gap: 26px;
  min-height: 158px; padding: 20px;
  background: var(--card); border: 2.5px solid var(--ink);
  border-radius: var(--r); text-align: left;
  transition: background .1s, color .1s, border-color .1s, transform .06s;
}
.cat:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.cat:hover .cat__meta { color: rgba(255,255,255,.72); }
.cat:hover .cat__icon { background: rgba(255,255,255,.18); color: #fff; }
.cat:active { transform: translateY(2px); }
.cat__icon {
  width: 52px; height: 52px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--blue-tint); color: var(--blue);
  transition: background .1s, color .1s;
}
.cat__name { font-size: 25px; font-weight: 850; letter-spacing: -.035em; line-height: 1.05; }
.cat__meta { font-size: 14px; font-weight: 550; color: var(--ink-3); margin-top: 3px; }

/* ---------- deals bar: thinner than the search, warmer than everything else ---------- */
.dealsbar {
  display: flex; align-items: center; gap: 12px;
  min-height: 54px; margin-top: 14px; padding: 0 16px 0 14px;
  background: var(--hot-tint); border: 2.5px solid var(--hot-line); border-radius: var(--r);
  transition: border-color .1s, transform .06s;
}
.dealsbar:hover { border-color: var(--flame); }
.dealsbar:active { transform: translateY(2px); }
.dealsbar__flag {
  display: flex; align-items: center; gap: 7px; flex: none;
  font-size: 15px; font-weight: 850; letter-spacing: -.02em; color: var(--flame);
}
.dealsbar__flag svg { width: 22px; height: 22px; }
.dealsbar__sub {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 550; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dealsbar__go { flex: none; color: var(--flame); display: grid; place-items: center; }
@media (max-width: 420px) { .dealsbar__sub { display: none; } }

/* ---------- brand chips ---------- */
.brands { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 56px; padding: 0 20px;
  display: inline-flex; align-items: center;
  background: var(--card); border: 2.5px solid var(--line);
  border-radius: 999px; font-size: 17px; font-weight: 750; letter-spacing: -.022em;
  transition: background .1s, color .1s, border-color .1s;
}
.chip:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- list rows ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.row {
  display: flex; align-items: center; gap: 16px;
  width: 100%; min-height: 90px; padding: 16px 18px;
  background: var(--card); border: 2.5px solid var(--line);
  border-radius: var(--r); text-align: left;
  transition: border-color .1s, transform .06s;
}
.row:hover { border-color: var(--ink); }
.row:active { transform: translateY(2px); }
.rank {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 850;
  background: var(--line); color: var(--ink-2);
}
.rank--1 { background: var(--gold);   color: #fff; }
.rank--2 { background: var(--silver); color: #fff; }
.rank--3 { background: var(--bronze); color: #fff; }

.row__body { flex: 1 1 auto; min-width: 0; }
.row__brand {
  font-size: 11.5px; font-weight: 850; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row__name {
  font-size: 18px; font-weight: 800; letter-spacing: -.032em;
  line-height: 1.15; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.row__sub {
  font-size: 13.5px; font-weight: 550; color: var(--ink-2); margin-top: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* ---------- featured brand slot ---------- */
.row--hot { border-color: var(--hot-line); background: var(--hot-tint); }
.row--hot:hover { border-color: var(--flame); }

.hot__flag {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 2px;
  font-size: 11.5px; font-weight: 850; letter-spacing: .11em;
  text-transform: uppercase; color: var(--flame);
}
.hot__flag svg { flex: none; margin-left: -2px; }

/* The paid slot's message is the thing being bought — let it wrap
   rather than clip it like an ordinary sub-line. */
.row--hot .row__sub { white-space: normal; overflow: visible; }

/* The flame flickers: the outer body breathes and leans, the inner core
   runs on a shorter, offset cycle so the two never sync up. */
.flame__out {
  transform-origin: 50% 88%;
  animation: flame-out 1.5s ease-in-out infinite;
}
.flame__in {
  transform-origin: 50% 92%;
  animation: flame-in 1.05s ease-in-out infinite;
}
@keyframes flame-out {
  0%, 100% { transform: scale(1, 1)       skewX(0deg);    opacity: 1;   }
  28%      { transform: scale(1.07, 1.12) skewX(-3.5deg); opacity: .93; }
  55%      { transform: scale(.95, 1.04)  skewX(3deg);    opacity: 1;   }
  78%      { transform: scale(1.04, .96)  skewX(-1.5deg); opacity: .96; }
}
@keyframes flame-in {
  0%, 100% { transform: scale(1, 1)      translateY(0);      opacity: .95; }
  40%      { transform: scale(.86, 1.18) translateY(-.6px);  opacity: 1;   }
  70%      { transform: scale(1.1, .9)   translateY(.3px);   opacity: .85; }
}

.row__chev { flex: none; display: grid; place-items: center; color: var(--ink-3); }
.row--hot .row__chev { color: var(--flame); }
.row:hover .row__chev { color: var(--blue); }

/* ---------- the reveal: one dominant action, nothing competes ---------- */
.cta--reveal { height: 82px; margin-top: 30px; font-size: 23px; }
.prompt {
  margin-top: 14px; text-align: center;
  font-size: 15px; font-weight: 600; color: var(--ink-3);
}

/* ---------- result: winner big, leaderboard beside it ---------- */
.result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 26px; }
.result > * { min-width: 0; }
.result--in { animation: rise .22s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.board {
  background: var(--card); border: 2.5px solid var(--line);
  border-radius: var(--r); padding: 8px 18px 14px;
}
.board__head {
  padding: 14px 0 10px;
  font-size: 12px; font-weight: 850; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3);
}
.board__head--sub { border-top: 2px solid var(--line); margin-top: 8px; }
.board__empty { padding: 6px 0 10px; font-size: 15px; font-weight: 500; color: var(--ink-3); }

.brow {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0; border-top: 1.5px solid var(--line);
}
.brow:first-of-type { border-top: 0; }
.brow:hover .brow__name { color: var(--blue); }
.brow__go { flex: none; color: var(--ink-3); margin-left: 2px; }
.brow:hover .brow__go { color: var(--blue); }
.brow--oos { opacity: .6; }
.brow__body { flex: 1; min-width: 0; }
.brow__name {
  font-size: 18px; font-weight: 800; letter-spacing: -.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brow__sub { font-size: 13px; font-weight: 550; color: var(--ink-3); margin-top: 3px; }
.brow__right { flex: none; text-align: right; }
.brow__price { font-size: 22px; font-weight: 850; letter-spacing: -.04em; white-space: nowrap; }
.brow__delta { font-size: 13px; font-weight: 700; color: var(--red); margin-top: 2px; }

/* ---------- product result: the hero answer ---------- */
.answer {
  padding: 26px 24px 24px;
  background: var(--card); border: 3px solid var(--blue);
  border-radius: var(--r);
  align-self: start;
}
.answer__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 850; letter-spacing: .13em;
  text-transform: uppercase; color: var(--blue);
}
.answer__retailer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 14px; font-size: 26px; font-weight: 850; letter-spacing: -.04em; line-height: 1.1;
}
.answer__price {
  margin-top: 4px; font-size: clamp(58px, 17vw, 82px); font-weight: 870;
  letter-spacing: -.055em; line-height: .95;
}
.answer__split { margin-top: 12px; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.answer__alt { margin-top: 12px; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.answer__alt strong { color: var(--ink); font-weight: 800; }
.stock {
  display: inline-block; vertical-align: middle; padding: 4px 9px; letter-spacing: .08em; white-space: nowrap;
  border-radius: 6px; font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase;
}
.stock--in  { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.stock--out { background: var(--line); color: var(--ink-3); }
.answer__thresh {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; font-size: 15px; font-weight: 750; color: var(--blue);
}
.answer__save {
  margin-top: 18px; padding: 15px 18px;
  background: var(--red-tint); border: 2.5px solid var(--red);
  border-radius: var(--r);
  font-size: 18px; font-weight: 800; letter-spacing: -.028em; color: var(--red);
}

.buy {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  width: 100%; height: 72px; margin-top: 22px;
  background: var(--blue); color: #fff;
  font-size: 21px; font-weight: 800; letter-spacing: -.03em;
  border-radius: var(--r);
  transition: background .1s, transform .06s;
}
.buy:hover { background: var(--blue-dark); }
.buy:active { transform: translateY(2px); }


/* product header */
.phead { padding: 30px 0 0; }
.phead__brand { font-size: 13px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; color: var(--blue); }
.phead__name { margin: 7px 0 0; font-size: clamp(31px, 8.6vw, 42px); font-weight: 860; letter-spacing: -.045em; line-height: 1.03; }
.phead__variant { margin-top: 9px; font-size: 17px; font-weight: 550; color: var(--ink-2); }


.stamp {
  display: flex; align-items: center; gap: 9px;
  margin: 28px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-3);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }

.lede { margin: 0 0 20px; font-size: 17px; line-height: 1.45; font-weight: 500; color: var(--ink-2); }
.lede--top { margin-top: 30px; }

.empty { padding: 60px 8px; text-align: center; font-size: 17px; font-weight: 500; color: var(--ink-3); }
.empty strong { display: block; font-size: 24px; font-weight: 850; letter-spacing: -.035em; color: var(--ink); margin-bottom: 8px; }

/* ---------- desktop: more air, same shape ---------- */
@media (min-width: 760px) {
  .shell { max-width: 700px; }
  .topbar__inner { max-width: 700px; }
  .hero { padding-top: 64px; }
  .hero h1 { font-size: 64px; }
  .cats { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .answer__price { font-size: 84px; }
}

/* The product screen gets a wider frame so the winner and the
   leaderboard can sit side by side. */
@media (min-width: 980px) {
  .shell--wide { max-width: 1000px; }
  .result { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .cta--reveal { max-width: 560px; }
  .prompt { max-width: 560px; text-align: left; padding-left: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .flame__out, .flame__in { animation: none; }
  .result--in { animation: none; }
}
