:root {
  --paper: #f8f5ef;
  --paper-deep: #efe9df;
  --ink: #171713;
  --muted: #77746d;
  --line: rgba(23, 23, 19, 0.12);
  --accent: #ef4b31;
  --accent-soft: #ffd8cf;
  --green: #25775b;
  --shadow: 0 28px 90px rgba(31, 25, 18, 0.18);
  --display: "Noto Sans SC", system-ui, sans-serif;
  --sans: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: #d9d4cc; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% 18%, rgba(255,255,255,.72), transparent 26%),
    linear-gradient(135deg, #d8d3ca 0%, #b9b2a6 100%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
button, a, .feature { -webkit-tap-highlight-color: transparent; }

.desktop-stage {
  position: fixed;
  left: clamp(44px, 9vw, 160px);
  top: 50%;
  width: min(36vw, 470px);
  transform: translateY(-50%);
  color: #343129;
}

.stage-kicker {
  margin: 0 0 22px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
}

.desktop-stage h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(56px, 6vw, 92px);
  line-height: .98;
  letter-spacing: -.07em;
}

.stage-note {
  margin-top: 32px;
  color: rgba(52,49,41,.62);
  font-size: 14px;
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100svh;
  margin-left: auto;
  margin-right: max(4vw, 36px);
  overflow: clip;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: env(safe-area-inset-top) 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.05em;
  text-decoration: none;
}

.brand-dot {
  width: 15px;
  height: 15px;
  border: 4px solid var(--accent);
  border-radius: 50% 50% 50% 12%;
  transform: rotate(-15deg);
}

.icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button svg,
.sort-button svg,
.bottom-nav svg,
.search-box svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button svg { width: 21px; }
.notice-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--accent);
}

.intro { padding: 26px 22px 22px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.intro h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(31px, 9vw, 38px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -.065em;
}

.intro > p:last-child {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search-wrap {
  position: sticky;
  z-index: 15;
  top: 0;
  padding: 10px 0 12px;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: blur(18px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin: 0 22px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255,255,255,.36);
}

.search-box:focus-within { border-color: rgba(239,75,49,.55); }
.search-box svg { width: 19px; color: var(--muted); }
.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}
.search-box input::placeholder { color: #aaa59b; }
.search-box kbd {
  color: var(--muted);
  font-family: var(--display);
  font-size: 10px;
}

.category-strip {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding: 0 22px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-strip::-webkit-scrollbar { display: none; }
.category {
  position: relative;
  flex: 0 0 auto;
  padding: 0 0 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.category::after {
  position: absolute;
  right: 25%;
  bottom: 0;
  left: 25%;
  height: 2px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0);
  transition: .24s ease;
}
.category.active { color: var(--ink); font-weight: 700; }
.category.active::after { opacity: 1; transform: scaleX(1); }

.feature {
  position: relative;
  height: 500px;
  margin-top: 6px;
  overflow: hidden;
  cursor: pointer;
  outline: none;
}
.feature img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1);
}
.feature:hover img,
.feature:focus-visible img { transform: scale(1); }
.feature-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9,9,7,.03) 32%, rgba(10,9,7,.82) 100%);
}
.feature-copy {
  position: absolute;
  right: 22px;
  bottom: 24px;
  left: 22px;
  color: #fff;
}
.feature-label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 8px;
  background: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}
.feature h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.17;
  letter-spacing: -.055em;
}
.feature-price { display: flex; align-items: baseline; gap: 8px; margin-top: 15px; }
.feature-price span { font-size: 11px; opacity: .78; }
.feature-price strong { font-size: 28px; line-height: 1; }
.feature-price del { font-size: 12px; opacity: .55; }
.feature-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,.24);
  font-size: 11px;
  opacity: .9;
}
.feature-meta .arrow { margin-left: auto; font-size: 20px; }

.feed { padding: 42px 22px 10px; }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-heading h3 { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: -.045em; }
.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.sort-button svg { width: 14px; }

.product-item {
  display: grid;
  grid-template-columns: 114px minmax(0,1fr);
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(12px);
  animation: product-in .5s forwards;
}
@keyframes product-in { to { opacity: 1; transform: translateY(0); } }
.product-image {
  position: relative;
  height: 142px;
  overflow: hidden;
  background: var(--paper-deep);
  cursor: pointer;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s ease; }
.product-image:hover img { transform: scale(1.045); }
.product-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 22px;
  padding: 4px 6px;
  background: rgba(248,245,239,.9);
  font-size: 9px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.product-body { display: flex; min-width: 0; flex-direction: column; }
.product-topline { display: flex; align-items: flex-start; gap: 8px; }
.product-title {
  min-width: 0;
  flex: 1;
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.025em;
  cursor: pointer;
}
.favorite-button {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9a968e;
  cursor: pointer;
  transition: .2s ease;
}
.favorite-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.favorite-button.saved { color: var(--accent); transform: scale(1.08); }
.favorite-button.saved svg { fill: currentColor; }
.product-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.product-tag {
  padding: 3px 5px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 700;
}
.product-tag.muted { color: var(--muted); background: #e9e4db; }
.product-bottom { margin-top: auto; }
.product-price-row { display: flex; align-items: baseline; gap: 5px; }
.product-price-row small { font-size: 9px; color: var(--muted); }
.product-price { font-size: 23px; font-weight: 700; letter-spacing: -.04em; }
.product-price-row del { margin-left: 2px; color: #aaa59c; font-size: 10px; }
.product-stats { display: flex; justify-content: space-between; margin-top: 8px; font-size: 10px; color: var(--muted); }
.product-rebate { color: var(--green); font-weight: 700; }

.empty-state { padding: 70px 10px; text-align: center; border-top: 1px solid var(--line); }
.empty-state span { font-size: 17px; font-weight: 700; }
.empty-state p { margin: 8px 0 18px; color: var(--muted); font-size: 12px; }
.empty-state button { padding: 10px 16px; border: 1px solid var(--ink); background: transparent; cursor: pointer; }

.trust-note { margin: 32px 22px 0; padding: 20px 0; border-top: 1px solid var(--line); }
.trust-mark { color: var(--ink); font-size: 11px; font-weight: 700; }
.trust-note p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.bottom-spacer { height: 102px; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: max(4vw, 36px);
  bottom: 0;
  display: grid;
  width: min(100%, 430px);
  grid-template-columns: repeat(4, 1fr);
  padding: 10px 12px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(248,245,239,.92);
  backdrop-filter: blur(20px);
}
.nav-item { display: grid; gap: 3px; place-items: center; border: 0; background: transparent; color: #969187; font-size: 9px; cursor: pointer; }
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { color: var(--ink); font-weight: 700; }

.sheet-backdrop { position: fixed; z-index: 50; inset: 0; background: rgba(16,15,12,.46); opacity: 0; backdrop-filter: blur(3px); transition: opacity .28s ease; }
.sheet-backdrop.visible { opacity: 1; }
.product-sheet {
  position: fixed;
  z-index: 60;
  right: max(4vw, 36px);
  bottom: 0;
  width: min(100%, 430px);
  max-height: 91svh;
  overflow: auto;
  background: var(--paper);
  transform: translateY(103%);
  transition: transform .42s cubic-bezier(.2,.85,.25,1);
}
.product-sheet.visible { transform: translateY(0); }
.sheet-handle { position: absolute; z-index: 2; top: 9px; left: 50%; width: 38px; height: 4px; border-radius: 10px; background: rgba(255,255,255,.68); transform: translateX(-50%); }
.sheet-close { position: absolute; z-index: 2; top: 18px; right: 18px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(248,245,239,.88); font-size: 22px; cursor: pointer; backdrop-filter: blur(10px); }
.sheet-image-wrap { position: relative; height: 300px; background: var(--paper-deep); }
.sheet-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.sheet-image-wrap > span { position: absolute; bottom: 14px; left: 18px; padding: 5px 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; }
.sheet-content { padding: 24px 22px calc(26px + env(safe-area-inset-bottom)); }
.sheet-content h3 { margin: 0; font-family: var(--display); font-size: 24px; line-height: 1.35; letter-spacing: -.045em; }
.sheet-price-row { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 20px; }
.sheet-price-row > div { display: grid; gap: 2px; }
.sheet-price-row span { color: var(--muted); font-size: 10px; }
.sheet-price-row strong { font-size: 30px; line-height: 1; }
.sheet-rebate { text-align: right; }
.sheet-rebate strong { color: var(--green); font-size: 19px; }
.coupon-line { margin-top: 20px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.coupon-line span { color: var(--accent); font-size: 12px; font-weight: 700; }
.coupon-line p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.primary-action { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 56px; margin-top: 22px; padding: 0 18px; border: 0; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.primary-action span { font-size: 21px; }
.primary-action.claimed { background: var(--green); }
.sheet-footnote { margin: 10px 0 0; color: var(--muted); font-size: 9px; text-align: center; }

.toast { position: fixed; z-index: 100; right: calc(max(4vw, 36px) + 22px); bottom: 94px; width: min(calc(100% - 44px), 386px); padding: 13px 15px; background: var(--ink); color: #fff; font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .26s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 820px) {
  body { background: var(--paper); }
  .desktop-stage { display: none; }
  .app-shell { width: 100%; margin: 0; box-shadow: none; }
  .bottom-nav, .product-sheet { right: 0; width: 100%; }
  .toast { right: 22px; }
}

@media (max-width: 360px) {
  .intro h2 { font-size: 30px; }
  .feature { height: 465px; }
  .product-item { grid-template-columns: 104px minmax(0,1fr); gap: 13px; }
  .product-image { height: 134px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
