/* ══════════════════════════════════════════════════════════════
   SoCalPerv — design system
   OLED-dark base with a Southern-California sunset accent. The dark
   ground keeps thumbnails the brightest thing on screen; the coral is
   reserved almost entirely for the one action that matters (buy).
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* ── Surface ramp ── */
  --bg:        #08070A;
  --surface:   #101014;
  --surface-2: #17161C;
  --surface-3: #1F1D26;
  --line:      #26242E;
  --line-soft: #1B1A21;

  /* ── Ink ── */
  --ink:    #F7F5F3;   /* 18:1 on --bg */
  --ink-2:  #B8B2C0;
  --muted:  #8F8899;   /* 6.7:1 on --bg — safe for secondary text */

  /* ── Accent ──
     Named generically, not by colour: a second property (SirCappin) runs the
     same stylesheet with a different palette injected at the <head>. Anything
     hard-coded to "coral" here would have to be found and changed twice. */
  --coral:      #FF5C39;   /* primary accent   — overridden per brand */
  --coral-dim:  #E0492A;
  --amber:      #FFAE4B;   /* secondary accent — overridden per brand */
  --on-accent:  #0A0708;   /* dark text on the accent; never white (contrast) */
  --ok:         #4ADE80;
  --danger:     #F0483E;

  /* ── Type ── */
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* ── Space (density 6/10) ── */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-full: 999px;
  --shadow: 0 12px 40px -12px rgba(0,0,0,.8);
  --glow: 0 0 0 1px rgba(255,92,57,.35), 0 8px 32px -8px rgba(255,92,57,.4);
  --ease: cubic-bezier(.2,.7,.3,1);
  --t: 180ms var(--ease);
  --maxw: 1320px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* A single warm bloom behind the top of the page. Fixed, pointer-events off —
   it must never intercept a tap. */
body::before {
  content: '';
  position: fixed; inset: 0 0 auto 0; height: 70vh;
  background:
    radial-gradient(60% 55% at 18% 0%, rgba(255,92,57,.14), transparent 70%),
    radial-gradient(50% 50% at 88% 6%, rgba(255,174,75,.09), transparent 70%);
  pointer-events: none; z-index: 0;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.12;
  margin: 0;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-5); position: relative; z-index: 1; }
@media (max-width: 640px) { .wrap { padding: 0 var(--s-4); } }

/* ── Header ─────────────────────────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,7,10,.82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.hdr-in { display: flex; align-items: center; gap: var(--s-5); height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(145deg, var(--amber), var(--coral));
  display: grid; place-items: center; color: var(--on-accent);
}
.brand-mark svg { width: 16px; height: 16px; }
.brand em { font-style: normal; color: var(--coral); }

.nav { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.nav a {
  padding: 10px 14px; border-radius: var(--r-full); font-size: 14.5px; font-weight: 500;
  color: var(--ink-2); transition: color var(--t), background var(--t);
  min-height: 44px; display: inline-flex; align-items: center; cursor: pointer;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.active { color: var(--ink); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 12px 22px; border-radius: var(--r-full);
  border: 1px solid transparent; font-weight: 600; font-size: 15px;
  cursor: pointer; transition: transform var(--t), background var(--t), box-shadow var(--t), border-color var(--t);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--coral); color: var(--on-accent); box-shadow: 0 6px 22px -8px rgba(255,92,57,.7); }
.btn-primary:hover { background: #FF6E4E; transform: translateY(-1px); box-shadow: var(--glow); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-3); border-color: #34313F; }
.btn-lg { min-height: 54px; padding: 15px 30px; font-size: 16.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { padding: clamp(56px, 9vw, 104px) 0 var(--s-7); }
.hero h1 { font-size: clamp(38px, 7.5vw, 76px); font-weight: 800; max-width: 15ch; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--amber), var(--coral) 62%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--ink-2); font-size: clamp(16px, 2vw, 19px); max-width: 54ch; margin: var(--s-5) 0 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--amber); background: rgba(255,174,75,.1);
  border: 1px solid rgba(255,174,75,.22); padding: 7px 14px; border-radius: var(--r-full);
  margin-bottom: var(--s-5);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

/* ── Toolbar ────────────────────────────────────────────────── */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3);
  padding: var(--s-5) 0 var(--s-4);
}
.toolbar h2 { font-size: 26px; margin-right: auto; }
.field {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-full); padding: 0 16px; min-height: 44px;
  transition: border-color var(--t);
}
.field:focus-within { border-color: var(--coral); }
.field svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.field input, .field select {
  background: none; border: 0; outline: none; min-width: 0; width: 100%;
  font-size: 14.5px; padding: 10px 0; cursor: text;
}
.field select { cursor: pointer; -webkit-appearance: none; appearance: none; padding-right: 4px; }
.field select option { background: var(--surface-2); }

/* ── Video grid ─────────────────────────────────────────────── */
.grid {
  display: grid; gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(266px, 1fr));
  padding-bottom: var(--s-8);
}
@media (max-width: 560px) { .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: var(--s-3); } }

.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: var(--shadow); }
.card:hover .thumb img { transform: scale(1.045); }

/* aspect-ratio reserves the box before the image loads — this is the whole
   CLS story on a page that is mostly thumbnails. */
.thumb {
  position: relative; aspect-ratio: 27 / 16; background: var(--surface-3); overflow: hidden;
}
/* cover fills the cell; object-position biases the crop toward the bottom so a
   source narrower than the 27:16 cell (1400x1080 etc) loses headroom rather than
   the burned-in watermark, which sits in the bottom-left. For 16:9 sources the
   crop is horizontal, so the vertical bias costs nothing. */
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 85%; transition: transform 400ms var(--ease); }
.thumb-empty { display: grid; place-items: center; height: 100%; color: #3A3745; }
.thumb-empty svg { width: 34px; height: 34px; }

.pill {
  position: absolute; border-radius: var(--r-sm); font-size: 12px; font-weight: 600;
  padding: 4px 8px; backdrop-filter: blur(8px); letter-spacing: .01em;
}
.pill-time { right: 8px; bottom: 8px; background: rgba(8,7,10,.82); color: var(--ink); }
.pill-price { left: 8px; top: 8px; background: var(--coral); color: var(--on-accent); }
.pill-featured { left: 8px; top: 8px; background: rgba(255,174,75,.95); color: var(--on-accent); }

.card-body { padding: var(--s-3) var(--s-4) var(--s-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title {
  font-weight: 600; font-size: 14.5px; line-height: 1.35; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 10px; margin-top: auto; }

/* ── Detail page ────────────────────────────────────────────── */
.detail { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--s-6); padding: var(--s-6) 0 var(--s-8); align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; gap: var(--s-5); } }

.stage { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface); position: relative; }
.stage .thumb { aspect-ratio: 27 / 16; }
.stage-lock {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px;
  background: linear-gradient(to top, rgba(8,7,10,.94), rgba(8,7,10,.5));
  text-align: center; padding: var(--s-5);
}
.stage-lock svg { width: 30px; height: 30px; color: var(--amber); }
.stage-lock p { margin: 0; color: var(--ink-2); font-size: 14.5px; max-width: 34ch; }

.buybox {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-5); position: sticky; top: 88px;
}
@media (max-width: 900px) { .buybox { position: static; } }
.price { font-family: var(--font-display); font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.price small { font-size: 14px; font-weight: 500; color: var(--muted); font-family: var(--font-body); letter-spacing: 0; }

.speclist { list-style: none; margin: var(--s-5) 0; padding: 0; display: grid; gap: 10px; }
.speclist li { display: flex; justify-content: space-between; gap: var(--s-4); font-size: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.speclist li:last-child { border-bottom: 0; padding-bottom: 0; }
.speclist span:first-child { color: var(--muted); }
.speclist span:last-child { font-weight: 500; text-align: right; }

.assure { display: grid; gap: 11px; margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--line-soft); }
.assure div { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); }
.assure svg { width: 16px; height: 16px; color: var(--ok); flex: none; margin-top: 2px; }

/* ── Steps ──────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); padding: var(--s-6) 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: var(--s-5); }
.step-n {
  width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: rgba(255,92,57,.13); color: var(--coral); font-family: var(--font-display);
  font-weight: 700; font-size: 15px; margin-bottom: var(--s-4);
}
.step h3 { font-size: 17px; margin-bottom: 7px; }
.step p { color: var(--ink-2); font-size: 14.5px; margin: 0; }

/* ── Empty / states ─────────────────────────────────────────── */
.empty {
  text-align: center; padding: var(--s-8) var(--s-5); border: 1px dashed var(--line);
  border-radius: var(--r-lg); color: var(--muted); background: rgba(16,16,20,.4);
}
.empty svg { width: 40px; height: 40px; color: #35323F; margin-bottom: var(--s-4); }
.empty h3 { color: var(--ink-2); font-size: 18px; margin-bottom: 8px; }
.empty p { margin: 0 auto; max-width: 44ch; font-size: 14.5px; }

.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sh 1.4s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* ── Modal / age gate ───────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: var(--s-4); background: rgba(4,3,6,.86); backdrop-filter: blur(8px); }
.modal[hidden] { display: none; }
.modal-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-6); max-width: 460px; width: 100%; box-shadow: var(--shadow); text-align: center;
}
.modal-card h2 { font-size: 24px; margin-bottom: var(--s-3); }
.modal-card p { color: var(--ink-2); font-size: 14.5px; margin: 0 0 var(--s-5); }
.modal-actions { display: grid; gap: var(--s-3); }

/* ── Footer ─────────────────────────────────────────────────── */
.ftr { border-top: 1px solid var(--line-soft); margin-top: var(--s-8); padding: var(--s-7) 0 var(--s-6); color: var(--muted); font-size: 13.5px; }
.ftr-grid { display: flex; flex-wrap: wrap; gap: var(--s-6); justify-content: space-between; }
.ftr-links { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.ftr-links a { transition: color var(--t); }
.ftr-links a:hover { color: var(--ink); }
.ftr-note { max-width: 62ch; margin-top: var(--s-5); font-size: 12.5px; line-height: 1.65; color: #6E6879; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink);
  padding: 13px 20px; border-radius: var(--r-full); font-size: 14px; z-index: 300;
  box-shadow: var(--shadow); animation: rise 220ms var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }

/* Everything decorative stops when the OS asks it to. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .card:hover { transform: none; }
}

/* ── Preview player ─────────────────────────────────────────── */
/* Sits in the same box the still occupied, so nothing shifts when the video
   swaps in.
   `contain`, NOT `cover`. Previews are encoded 1280x720 with
   force_original_aspect_ratio=decrease + pad precisely so the whole frame - and
   the burned-in watermark - always survives. `cover` threw that away again:
   a 16:9 clip in this 27:16 box was scaled to fill and clipped at the sides,
   which is what cut "SIR CAPPIN" down to "R CAPPIN" on the video page.
   The cost is a ~2.7% bar each side; the benefit is never cropping the frame. */
.stage .preview {
  display: block; width: 100%; aspect-ratio: 27 / 16;
  object-fit: contain; background: #000;
}
.preview-tag {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  background: rgba(8,7,10,.82); backdrop-filter: blur(8px);
  color: var(--ink-2); font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: var(--r-sm); pointer-events: none;
}

/* Brands that ship a wordmark image use it in place of the generated mark. */
.brand-mark-img { background: none !important; width: auto; height: 30px; border-radius: 0; }
.brand-mark-img img { height: 30px; width: auto; display: block; }
