:root {
  --ground: #F3F5F2;
  --surface: #FFFFFF;
  --surface-sunk: #EEF1ED;
  --text: #15211C;
  --text-muted: #5C6B63;
  --accent: #1C6B52;
  --accent-strong: #16553F;
  --good-bg: #E4F1EA;
  --warn: #9A6410;
  --warn-bg: #FBF1DC;
  --danger: #B84C4C;
  --danger-bg: #F7E8E8;
  --line: #DBE2DC;
  --display: "Bricolage Grotesque", Georgia, serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* ensure the hidden attr beats component display rules */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: 96px; /* room for sticky bar */
}
.num { font-family: var(--mono); font-feature-settings: "tnum" 1; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Hero */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 56px 20px 24px; }
.hero__eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em;
  text-transform: lowercase; color: var(--text-muted); margin: 0 0 20px;
}
.hero__row { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; }
.hero__lede { flex: 1 1 380px; }
.hero__title {
  font-family: var(--display); font-weight: 700; line-height: 1.04;
  font-size: clamp(34px, 6vw, 60px); letter-spacing: -0.02em; margin: 0 0 16px;
}
.hero__sub { font-size: 17px; color: var(--text-muted); max-width: 46ch; margin: 0; }
.manifest {
  flex: 0 1 280px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px 22px;
}
.manifest__line { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; color: var(--text-muted); }
.manifest__line .num { color: var(--text); font-size: 20px; font-weight: 600; }
.manifest__note { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 14px; }

/* Grid */
.grid {
  max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 40px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } }

/* Trust footer */
.trust { max-width: var(--maxw); margin: 0 auto; padding: 8px 20px 64px; }
.trust__title { font-family: var(--display); font-size: 22px; margin: 0 0 12px; }
.trust__list { margin: 0; padding-left: 20px; color: var(--text-muted); }
.trust__list li { padding: 4px 0; }

/* Sticky bar */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(21,33,28,.08);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; flex-wrap: wrap;
}
.bar__summary { font-size: 15px; color: var(--text-muted); }
.bar__summary .num { color: var(--text); font-weight: 600; }
.bar__warn { color: var(--warn); font-weight: 600; }
.bar__actions { display: flex; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--body); font-weight: 600; font-size: 15px;
  padding: 11px 18px; border-radius: 10px; text-decoration: none; border: 1px solid transparent;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); }
.btn--ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); }
.btn.is-disabled { opacity: .45; pointer-events: none; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(21,33,28,.92);
  display: flex; align-items: center; justify-content: center;
}
.lightbox__img { max-width: 92vw; max-height: 82vh; border-radius: 8px; }
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: none;
  cursor: pointer; border-radius: 999px; line-height: 1;
}
.lightbox__close { top: 18px; right: 18px; width: 44px; height: 44px; font-size: 26px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 32px; }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__count { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column;
}
.card__media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--surface-sunk); }
.card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card__img-btn { position: absolute; inset: 0; border: none; padding: 0; background: none; cursor: zoom-in; }
.card__placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-family: var(--mono); font-size: 14px; letter-spacing: .04em;
}
.card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.card__eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin: 0;
}
.card__name { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.2; margin: 0; }
.card__model { font-size: 12px; color: var(--text-muted); margin: 0; }
.card__amazon { font-size: 14px; font-weight: 600; text-decoration: none; align-self: flex-start; }
.card__amazon:hover { text-decoration: underline; }
.card__note { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }

.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.price__was { color: var(--text-muted); text-decoration: line-through; font-size: 14px; }
.price__arrow { color: var(--text-muted); }
.price__ask { font-size: 24px; font-weight: 600; }
.price__save {
  background: var(--good-bg); color: var(--accent); border-radius: 999px;
  padding: 3px 10px; font-size: 13px; font-weight: 600;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.chip--good { background: var(--good-bg); color: var(--accent); border-color: transparent; }
.chip--amber { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip--muted { background: var(--surface-sunk); color: var(--text-muted); border-color: transparent; font-family: var(--mono); }

.card__media.has-gallery { cursor: zoom-in; }
.gal__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(255,255,255,.85); color: var(--text); font-size: 22px; line-height: 1;
  opacity: 0; transition: opacity .15s ease;
}
.card__media:hover .gal__nav, .card__media:focus-within .gal__nav { opacity: 1; }
.gal__nav--prev { left: 8px; } .gal__nav--next { right: 8px; }
.gal__dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.gal__dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.6); pointer-events: none; }
.gal__dot.is-on { background: #fff; }
@media (hover: none) { .gal__nav { opacity: 1; } }

.card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.offer { margin-top: 6px; }
.offer__toggle {
  width: 100%; padding: 11px 16px; border-radius: 10px; cursor: pointer;
  font-family: var(--body); font-weight: 600; font-size: 15px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
.card.is-selected .offer__toggle { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.offer__panel { margin-top: 12px; }
.offer__label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.offer__field {
  display: flex; align-items: center; gap: 6px; max-width: 200px;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface);
}
.offer__field:focus-within { border-color: var(--accent); }
.offer__field--error { border-color: var(--warn); }
.offer__currency { color: var(--text-muted); font-family: var(--mono); }
.offer__number {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: var(--mono); font-size: 18px; font-weight: 600; color: var(--text);
}
.offer__hint { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }
.offer__error { font-size: 12px; color: var(--warn); font-weight: 600; margin: 6px 0 0; }

@media (prefers-reduced-motion: no-preference) {
  .card { opacity: 0; transform: translateY(10px); animation: card-in .5s ease forwards; }
  .card:nth-child(2n) { animation-delay: .06s; }
  @keyframes card-in { to { opacity: 1; transform: none; } }
}
