/* =============================================================================
   580drop design system
   Mechanic-driven brand: a falling price (heat), a growing crowd unlocking
   savings (unlock-green), and a clock (mono). Warm paper base, app-like cards.
   ========================================================================== */

:root {
  /* All values come from brand.css (load /css/brand.css first). To reskin,
     edit brand.css — not this file. These are semantic aliases only. */
  --paper:        var(--brand-paper);
  --paper-deep:   var(--brand-surface);
  --ink:          var(--brand-ink);
  --ink-soft:     var(--brand-ink-soft);
  --heat:         var(--brand-accent);       /* price / urgency / primary CTA */
  --ember:        var(--brand-accent-press);
  --unlock:       var(--brand-positive);     /* savings unlocked              */
  --unlock-bright:var(--brand-positive);
  --muted:        var(--brand-muted);
  --line:         var(--brand-line);
  --card:         var(--brand-card);
  --card-warm:    var(--brand-surface);
  --shadow:       var(--brand-shadow);
  --shadow-lg:    var(--brand-shadow-lg);
  --radius:       var(--brand-radius);
  --radius-sm:    var(--brand-radius-sm);
  --maxw:         1080px;

  --display: var(--brand-font-display);
  --body:    var(--brand-font-body);
  --mono:    var(--brand-font-mono);
}

/* mono is a sans in the placeholder, so force tabular figures for data */
.mono, .price, .countdown, .cd-cell, .pprice, .reflink, .count, .clock { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* header logo (placeholder mark; swap /img/logo-mark.png) */
.brand-logo { width: 30px; height: 30px; border-radius: 8px; flex: none; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* ---- type --------------------------------------------------------------- */
h1, h2, h3 { font-family: var(--display); font-weight: 900; letter-spacing: -.02em; margin: 0; line-height: 1.02; }
.display {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(2.3rem, 7vw, 4.4rem); letter-spacing: -.035em; line-height: .96;
  text-transform: uppercase;
}
.eyebrow {
  font-family: var(--mono); font-weight: 600; font-size: .68rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--heat);
}
.lede { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--ink-soft); max-width: 46ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.price { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  font-family: var(--body); font-weight: 700; font-size: .98rem;
  border: 0; border-radius: 999px; padding: .82em 1.4em; cursor: pointer;
  display: inline-flex; align-items: center; gap: .5em; justify-content: center;
  text-decoration: none; transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-heat { background: var(--heat); color: #fff; box-shadow: 0 10px 22px -12px var(--heat); }
.btn-heat:hover { background: var(--ember); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-soft); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); background: var(--card-warm); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .55em 1em; font-size: .85rem; }

/* ---- header ------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.3) blur(10px);
  background: rgba(246,241,231,.82);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--ink);
  display: grid; place-items: center; position: relative; overflow: hidden; flex: none;
}
.brand-mark::before { /* falling chevron = "drop" */
  content: ""; width: 11px; height: 11px; border-right: 3px solid var(--heat);
  border-bottom: 3px solid var(--heat); transform: rotate(45deg) translateY(-2px);
}
.brand-name { font-family: var(--display); font-weight: 900; font-size: 1.18rem; letter-spacing: -.03em; }
.brand-name b { color: var(--heat); }

/* ---- countdown ---------------------------------------------------------- */
.countdown { display: inline-flex; align-items: stretch; gap: 5px; }
.cd-cell {
  background: var(--ink); color: var(--paper); border-radius: 9px;
  padding: 7px 9px 5px; min-width: 46px; text-align: center;
}
.cd-cell b { font-family: var(--mono); font-weight: 700; font-size: 1.35rem; line-height: 1; font-variant-numeric: tabular-nums; display: block; }
.cd-cell span { font-family: var(--mono); font-size: .54rem; letter-spacing: .14em; text-transform: uppercase; opacity: .72; }
.countdown.sm .cd-cell { min-width: 36px; padding: 5px 7px 4px; }
.countdown.sm .cd-cell b { font-size: 1.05rem; }
.cd-ending .cd-cell { background: var(--heat); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255,77,23,.16); } }

/* ---- badges / chips ----------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono);
  font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  background: var(--card-warm);
}
.chip-live { color: #fff; background: var(--heat); border-color: transparent; }
.chip-live .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.chip-save { color: #fff; background: var(--unlock); border-color: transparent; }
.chip-spiff { color: var(--ink); background: #FFD23F; border-color: transparent; }
.chip-soon { color: var(--ink); }

/* ---- cards / grid ------------------------------------------------------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-media { aspect-ratio: 16 / 10; background: var(--paper-deep) center/cover no-repeat; position: relative; }
.card-media .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.card-media .overlay { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 12px; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.biz-row { display: flex; align-items: center; gap: 9px; }
.biz-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; background: var(--paper-deep); border: 1px solid var(--line); flex: none; }
.biz-name { font-weight: 600; font-size: .85rem; color: var(--muted); }
.card-title { font-family: var(--display); font-weight: 800; font-size: 1.28rem; letter-spacing: -.02em; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fromprice { display: flex; align-items: baseline; gap: 7px; }
.fromprice .now { font-family: var(--mono); font-weight: 700; font-size: 1.5rem; color: var(--heat); }
.fromprice .lab { font-size: .72rem; color: var(--muted); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---- crowd / progress --------------------------------------------------- */
.crowd { display: flex; flex-direction: column; gap: 7px; }
.crowd .meter { height: 9px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; }
.crowd .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--unlock), var(--unlock-bright)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.crowd .note { font-size: .82rem; color: var(--ink-soft); }
.crowd .note b { color: var(--unlock); }
.count-pill { font-family: var(--mono); font-weight: 600; font-size: .78rem; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }

/* =============================================================================
   THE SIGNATURE: the drop ladder.
   Tier rungs from start price down to the floor. Unlocked rungs are filled
   green; the current rung glows heat; locked rungs are quiet with the crowd
   target shown. This is where the brand spends its boldness.
   ========================================================================== */
.ladder { display: flex; flex-direction: column; gap: 0; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.rung {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  padding: 11px 13px; background: var(--card-warm); position: relative;
  border-bottom: 1px solid var(--line);
}
.rung:last-child { border-bottom: 0; }
.rung .step { font-family: var(--mono); font-size: .7rem; font-weight: 700; color: var(--muted); }
.rung .step .who { display: block; font-weight: 500; font-size: .62rem; letter-spacing: .05em; }
.rung .lab { font-weight: 600; font-size: .9rem; }
.rung .lab small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); }
.rung .amt { font-family: var(--mono); font-weight: 700; font-size: 1.08rem; text-align: right; }
.rung .amt .save { display: block; font-size: .64rem; font-weight: 600; color: var(--unlock); letter-spacing: .02em; }

.rung.unlocked { background: var(--brand-positive-soft); }
.rung.unlocked .step { color: var(--unlock); }
.rung.unlocked::before { content: "✓"; position: absolute; left: 14px; font-family: var(--mono); color: var(--unlock); font-weight: 700; font-size: .8rem; }
.rung.unlocked .step b { visibility: hidden; }

.rung.current { background: #fff; box-shadow: inset 3px 0 0 var(--heat); }
.rung.current .amt { color: var(--heat); }
.rung.current .lab small { color: var(--heat); }

.rung.locked .amt { color: var(--ink-soft); }
.rung.locked { opacity: .9; }

.ladder-foot {
  display: flex; align-items: center; gap: 8px; padding: 11px 13px; background: var(--ink); color: var(--paper);
  font-size: .85rem;
}
.ladder-foot b { font-family: var(--mono); color: #fff; }
.ladder-foot .arrow { color: var(--heat); }

/* ---- sections ----------------------------------------------------------- */
.section { padding: 30px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); }
.section-head .eyebrow { margin-bottom: 6px; }

/* hero */
.hero { padding: 46px 0 26px; }
.hero .eyebrow { margin-bottom: 14px; }
.hero .lede { margin-top: 16px; }
.hero-cta { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.how .step-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow); }
.how .n { font-family: var(--mono); font-weight: 700; color: var(--heat); font-size: .8rem; }
.how h3 { font-size: 1.05rem; margin: 8px 0 4px; }
.how p { margin: 0; font-size: .9rem; color: var(--muted); }

/* empty / loading */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--heat); border-radius: 50%; animation: spin 1s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--paper-deep) 25%, #f3ece0 50%, var(--paper-deep) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---- drop detail -------------------------------------------------------- */
.detail-hero { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--card); }
.detail-hero .media { aspect-ratio: 21 / 9; background: var(--paper-deep) center/cover no-repeat; }
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; margin-top: 22px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel + .panel { margin-top: 18px; }
.sticky { position: sticky; top: 80px; }
.bizcard { display: flex; gap: 12px; align-items: flex-start; }
.bizcard .biz-logo { width: 46px; height: 46px; }
.kv { font-size: .88rem; color: var(--ink-soft); }
.kv a { color: var(--heat); text-decoration: none; }
.maplink { font-family: var(--mono); font-size: .76rem; color: var(--heat); text-decoration: none; }

.product { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.product:first-child { border-top: 0; }
.product .pmedia { width: 96px; height: 96px; border-radius: var(--radius-sm); object-fit: cover; background: var(--paper-deep); border: 1px solid var(--line); flex: none; }
.product .pbody { flex: 1; min-width: 0; }
.product h4 { font-family: var(--display); font-weight: 800; font-size: 1.1rem; margin: 0 0 2px; }
.pprice { display: flex; align-items: baseline; gap: 9px; margin: 6px 0; }
.pprice .now { font-family: var(--mono); font-weight: 700; font-size: 1.35rem; color: var(--heat); }
.pprice .was { font-family: var(--mono); font-size: .9rem; color: var(--muted); text-decoration: line-through; }
.pprice .save { font-size: .72rem; color: var(--unlock); font-weight: 700; }

.spiff-banner {
  display: flex; align-items: center; gap: 12px; background: var(--brand-surface); border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm); padding: 12px 14px; color: #6b5200; font-weight: 600; font-size: .92rem;
}
.spiff-banner .bolt { font-size: 1.2rem; }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font-family: var(--body); font-size: .95rem; padding: .65em .8em; border: 1.5px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--heat); outline-offset: 0; border-color: var(--heat); }
.field .hint { font-size: .74rem; color: var(--muted); }
.seg { display: inline-flex; background: var(--paper-deep); border-radius: 999px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; font-family: var(--body); font-weight: 600; font-size: .88rem; padding: .5em 1em; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.totrow { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ink-soft); margin: 4px 0; }
.totrow.big { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.totrow .price { color: var(--ink); }

/* share */
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
  flex: 1; min-width: 84px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: .7em; cursor: pointer;
  font-family: var(--body); font-weight: 600; font-size: .85rem; color: var(--ink); text-decoration: none;
}
.share-btn:hover { border-color: var(--ink); background: var(--card-warm); }
.reflink { font-family: var(--mono); font-size: .8rem; background: var(--paper-deep); border-radius: 10px; padding: .7em .8em; word-break: break-all; }

/* success */
.success { text-align: center; }
.success .big-save { font-family: var(--display); font-weight: 900; font-size: 2.2rem; color: var(--unlock); letter-spacing: -.03em; }

/* toast */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; z-index: 200; pointer-events: none; padding: 0 14px; }
.toast { background: var(--ink); color: var(--paper); padding: .8em 1.2em; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .9rem; font-weight: 600; pointer-events: auto; animation: rise .25s ease; max-width: 92vw; }
.toast.err { background: var(--ember); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0; color: var(--muted); font-size: .85rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(24,20,16,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 150; padding: 16px; }
.modal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; padding: 22px; }
.modal h3 { font-size: 1.4rem; margin-bottom: 6px; }
.modal-x { float: right; border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; color: var(--muted); line-height: 1; }

@media (max-width: 800px) {
  .detail-grid { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .how { grid-template-columns: 1fr; }
}

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