/* ============================================================
   AmpHour — precision instrument
   Deep warm charcoal · solar amber · monospace readouts
   ============================================================ */

:root {
  /* base */
  --void:        #0a0b09;
  --base:        #101210;
  --surface:     #161815;
  --surface-2:   #1d201c;
  --line:        #282c26;
  --line-bright: #3a3f36;

  /* type */
  --ink:         #ece8e0;
  --ink-soft:    #a8a89c;
  --ink-faint:   #6d6f65;

  /* accents */
  --amber:       #ffb020;
  --amber-hot:   #ffc957;
  --amber-deep:  #b57405;
  --verified:    #5fd68a;
  --verified-dim:#25603c;
  --unknown:     #7e8177;
  --alert:       #ff7a5c;

  /* system */
  --radius:      3px;
  --radius-lg:   5px;
  --ease:        cubic-bezier(.22, 1, .36, 1);
  --ease-snap:   cubic-bezier(.34, 1.56, .64, 1);

  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body:    'IBM Plex Sans', ui-sans-serif, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --maxw: 1440px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-faint); }

/* ---------- film grain ---------- */
.grain {
  position: fixed;
  inset: -120px;
  z-index: 9999;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainshift 6s steps(5) infinite;
}
@keyframes grainshift {
  0%,100% { transform: translate(0,0) }
  20% { transform: translate(-3%, 2%) }
  40% { transform: translate(2%, -3%) }
  60% { transform: translate(-2%, -2%) }
  80% { transform: translate(3%, 1%) }
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem var(--gutter);
  background: rgba(16,18,16,.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.wordmark__glyph {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: var(--amber);
  filter: drop-shadow(0 0 7px rgba(255,176,32,.45));
}
.wordmark__glyph svg { width: 100%; height: 100%; }
.wordmark__text {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 108, 'wght' 800;
  font-size: 1.22rem;
  letter-spacing: -.02em;
}
.wordmark__text em {
  font-style: normal;
  font-variation-settings: 'wdth' 108, 'wght' 400;
  color: var(--ink-soft);
}

.masthead__nav {
  display: flex;
  gap: 1.9rem;
  margin-left: auto;
}
.masthead__nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .87rem;
  letter-spacing: .01em;
  position: relative;
  padding: .2rem 0;
  transition: color .25s var(--ease);
}
.masthead__nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .38s var(--ease);
}
.masthead__nav a:hover { color: var(--ink); }
.masthead__nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.masthead__meta {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .7rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
  padding-left: 1.9rem;
  border-left: 1px solid var(--line);
}
.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--verified);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(95,214,138,.5) }
  50%     { box-shadow: 0 0 0 6px rgba(95,214,138,0) }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(4.5rem, 11vw, 9rem) var(--gutter) clamp(3.5rem, 7vw, 6rem);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 76px 76px;
  opacity: .5;
  mask-image: radial-gradient(ellipse 80% 65% at 22% 34%, #000 10%, transparent 72%);
}
.hero::after {
  content: '';
  position: absolute;
  top: -32%; right: -12%;
  width: 62vw; height: 62vw;
  max-width: 900px; max-height: 900px;
  background: radial-gradient(circle, rgba(255,176,32,.13), rgba(255,176,32,.03) 42%, transparent 68%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 1.6rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 118, 'wght' 800;
  font-size: clamp(2.9rem, 8.4vw, 7.2rem);
  line-height: .93;
  letter-spacing: -.035em;
  margin: 0 0 1.9rem;
  max-width: 16ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--amber);
  position: relative;
  display: inline-block;
}
.hero h1 em::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: .1em;
  height: 5px;
  background: linear-gradient(90deg, var(--amber), transparent);
  opacity: .28;
}

.hero__lede {
  max-width: 60ch;
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  color: var(--ink-soft);
  margin: 0 0 3rem;
  line-height: 1.68;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: 1.9rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.2rem;
}
.stat { display: flex; flex-direction: column; gap: .35rem; }
.stat__num {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -.03em;
}
.stat__label {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hero__disclaimer {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  max-width: 68ch;
  font-size: .84rem;
  line-height: 1.6;
  color: var(--ink-faint);
  margin: 0;
}
.hero__disclaimer svg {
  width: 16px; height: 16px;
  flex: none;
  margin-top: .22rem;
  color: var(--ink-faint);
}

/* ---------- console (system setup) ----------
   Not sticky. It holds the one-time system setup (bank, temperature,
   controller); the browse filters live in the always-visible sidebar. */
.console {
  z-index: 40;
  background: rgba(13,15,13,.9);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.console__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.4rem var(--gutter) 1.1rem;
}
.console__row {
  display: flex;
  flex-wrap: wrap;
  gap: 2.4rem;
  align-items: flex-end;
}
.control { display: flex; flex-direction: column; gap: .65rem; }
.control--grow { flex: 1 1 320px; }
.control__label {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* segmented control */
.segmented {
  position: relative;
  display: inline-flex;
  padding: 3px;
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.segmented__btn {
  position: relative;
  z-index: 2;
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  padding: .52rem 1.05rem;
  font-family: var(--font-mono);
  font-size: .84rem;
  font-weight: 500;
  color: var(--ink-faint);
  border-radius: var(--radius);
  transition: color .3s var(--ease);
  white-space: nowrap;
}
.segmented__btn span { font-size: .7em; opacity: .65; margin-left: 1px; }
.segmented__btn:hover { color: var(--ink-soft); }
.segmented__btn.is-active { color: var(--void); }
.segmented__thumb {
  position: absolute;
  top: 3px; left: 3px;
  height: calc(100% - 6px);
  background: var(--amber);
  border-radius: var(--radius);
  box-shadow: 0 0 18px rgba(255,176,32,.32);
  transition: transform .42s var(--ease-snap), width .42s var(--ease-snap);
  z-index: 1;
}

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  appearance: none;
  cursor: pointer;
  padding: .5rem 1rem;
  background: transparent;
  border: 1px solid var(--line-bright);
  border-radius: 100px;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: .81rem;
  letter-spacing: .01em;
  transition: all .28s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--ink-faint); }
.chip.is-active {
  color: var(--ink);
  border-color: var(--amber);
  background: rgba(255,176,32,.09);
  box-shadow: inset 0 0 12px rgba(255,176,32,.07);
}

.console__readout {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-top: 1.15rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
  font-size: .74rem;
  letter-spacing: .06em;
  color: var(--ink-soft);
}
.console__sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-bright); }

/* ---------- catalog grid ---------- */
.catalog { padding: clamp(2.5rem, 5vw, 4rem) var(--gutter) clamp(4rem, 8vw, 7rem); }
.catalog__inner { max-width: var(--maxw); margin: 0 auto; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(335px, 1fr));
  gap: 1.15rem;
}

/* ---------- product card ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
  animation: cardIn .5s var(--ease) both;
  animation-delay: var(--d, 0ms);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) }
  to   { opacity: 1; transform: none }
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255,176,32,.055), transparent 62%);
  opacity: 0;
  transition: opacity .4s var(--ease);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-bright);
  box-shadow: 0 16px 40px -18px rgba(0,0,0,.85);
}
.card:hover::before { opacity: 1; }

.card__head {
  padding: 1.15rem 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
}
.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.card__brand {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* fit badge */
.fit {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .55rem .25rem .4rem;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: none;
}
.fit svg { width: 11px; height: 11px; flex: none; }
.fit--yes {
  color: var(--verified);
  background: rgba(95,214,138,.1);
  border: 1px solid rgba(95,214,138,.26);
}
.fit--unknown {
  color: var(--unknown);
  background: rgba(126,129,119,.1);
  border: 1px solid rgba(126,129,119,.26);
}

.card__title {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 100, 'wght' 600;
  font-size: 1.06rem;
  line-height: 1.28;
  letter-spacing: -.012em;
  margin: 0;
  color: var(--ink);
}

/* spec strip */
.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,.16);
}
.spec {
  flex: 1 1 auto;
  min-width: 74px;
  padding-right: .9rem;
}
.spec + .spec {
  padding-left: .9rem;
  border-left: 1px solid var(--line);
}
.spec__val {
  display: block;
  font-family: var(--font-mono);
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -.01em;
}
.spec__val small {
  font-size: .62em;
  color: var(--ink-faint);
  margin-left: 1px;
  letter-spacing: 0;
}
.spec__val.is-missing { color: var(--unknown); }
.spec__key {
  display: block;
  font-size: .6rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: .22rem;
}

/* offer rows */
.offers { padding: .55rem 0 .3rem; }
.offers__label {
  display: flex;
  justify-content: space-between;
  padding: .35rem 1.25rem .5rem;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.offer {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem 1.25rem;
  border-left: 2px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.offer:hover { background: rgba(255,255,255,.028); }
.offer--best {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, rgba(255,176,32,.07), transparent 55%);
}
.offer--best:hover { background: linear-gradient(90deg, rgba(255,176,32,.1), transparent 55%); }

.offer__merchant {
  flex: 1;
  min-width: 0;
  font-size: .87rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.offer--best .offer__merchant { color: var(--ink); }
.offer__tag {
  font-family: var(--font-mono);
  font-size: .55rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .12rem .35rem;
  border-radius: 2px;
  flex: none;
}
.tag--best { color: var(--void); background: var(--amber); font-weight: 600; }
.tag--oos  { color: var(--alert); border: 1px solid rgba(255,122,92,.32); }
.tag--paid { color: var(--ink-faint); border: 1px solid var(--line-bright); }

.offer__price {
  font-family: var(--font-mono);
  font-size: .96rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -.02em;
  flex: none;
}
.offer--best .offer__price { color: var(--amber-hot); }
.offer__price.is-hidden {
  font-size: .74rem;
  color: var(--ink-faint);
  letter-spacing: .03em;
}

/* card foot */
.card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem 1.25rem;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,.2);
}
.freshness {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-mono);
  font-size: .63rem;
  letter-spacing: .05em;
  color: var(--ink-faint);
}
.freshness__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--verified);
  flex: none;
}
.freshness--stale .freshness__dot { background: var(--alert); }
.freshness--stale { color: var(--alert); }

.card__cta {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: color .25s var(--ease), gap .25s var(--ease);
}
.card__cta:hover { color: var(--amber); gap: .55rem; }
.card__cta svg { width: 11px; height: 11px; }

/* note row for unverified components */
.card__note {
  display: flex;
  gap: .55rem;
  padding: .7rem 1.25rem;
  background: rgba(126,129,119,.06);
  border-top: 1px solid var(--line);
  font-size: .74rem;
  line-height: 1.5;
  color: var(--ink-faint);
}
.card__note svg { width: 13px; height: 13px; flex: none; margin-top: .18rem; }

/* ---------- empty ---------- */
.empty {
  text-align: center;
  padding: 5rem 1rem;
  border: 1px dashed var(--line-bright);
  border-radius: var(--radius-lg);
}
.empty h3 {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 110, 'wght' 700;
  font-size: 1.4rem;
  margin: 0 0 .6rem;
}
.empty p { color: var(--ink-faint); margin: 0 auto; max-width: 46ch; font-size: .92rem; }

/* ---------- method ---------- */
.method {
  padding: clamp(4rem, 9vw, 7.5rem) var(--gutter);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%, rgba(255,176,32,.05), transparent 60%),
    var(--void);
}
.method__inner { max-width: var(--maxw); margin: 0 auto; }
.method h2 {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 114, 'wght' 700;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -.03em;
  margin: 0 0 3.2rem;
  max-width: 18ch;
}
.method__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.method__card {
  padding: 2rem 1.7rem 2.2rem;
  background: var(--base);
  transition: background .35s var(--ease);
}
.method__card:hover { background: var(--surface); }
.method__num {
  display: block;
  font-size: .74rem;
  letter-spacing: .16em;
  color: var(--amber);
  margin-bottom: 1.4rem;
}
.method__card h3 {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 100, 'wght' 600;
  font-size: 1.02rem;
  line-height: 1.32;
  letter-spacing: -.01em;
  margin: 0 0 .75rem;
}
.method__card p {
  margin: 0;
  font-size: .87rem;
  line-height: 1.66;
  color: var(--ink-faint);
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--base);
  padding: clamp(3rem, 6vw, 4.5rem) var(--gutter) 0;
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 2.6rem;
  padding-bottom: 3rem;
}
.footer__brand .wordmark__text { font-size: 1.15rem; display: block; margin-bottom: .7rem; }
.footer h4 {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 .7rem;
  font-weight: 500;
}
.footer p {
  margin: 0;
  font-size: .83rem;
  line-height: 1.66;
  color: var(--ink-faint);
  max-width: 46ch;
}
.footer__base {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  font-size: .68rem;
  letter-spacing: .06em;
  color: var(--ink-faint);
}

/* ---------- reveal ---------- */
.reveal {
  animation: reveal .78s var(--ease) both;
  animation-delay: var(--d, 0ms);
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(18px) }
  to   { opacity: 1; transform: none }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .masthead__nav { display: none; }
  .masthead__meta { margin-left: auto; padding-left: 0; border-left: 0; }
  .console { top: 55px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .console__row { gap: 1.4rem; }
  .segmented { width: 100%; }
  .segmented__btn { flex: 1; padding-inline: .6rem; }
  .masthead__meta span:not(.pulse) { display: none; }
  .hero__stats { gap: 1.8rem 2.6rem; }
}

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

/* focus visibility */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 2px;
}

/* [hidden] must beat the flex display on console rows (same trap as .lightbox) */
.console__row[hidden] { display: none; }
