/* ============================================================
   MyFireplaceVideo — styles
   1. Tokens & base      4. Controls dock
   2. Hero & video        5. Content sections
   3. Lighting overlays   6. Responsive
   ============================================================ */

/* ── 1. Tokens & base ─────────────────────────────────────── */
:root {
  --bg: #120b07;
  --bg-2: #1a100a;
  --card: #1f140d;
  --line: rgba(255, 214, 170, 0.12);
  --ink: #f4e8d8;
  --muted: #c4ae97;
  --accent: #ff9d45;
  --accent-2: #ffcf7a;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ── 2. Hero & video ──────────────────────────────────────── */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 460px;
  overflow: hidden;
  background: #000;
  isolation: isolate;
}
.hero.idle { cursor: none; }
.hero:fullscreen { height: 100vh; }

.scene { position: absolute; inset: 0; background: #000; }

/* two stacked, looping background videos; the incoming one crossfades in
   over the outgoing one purely via opacity (see js/video.js) */
.bg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  opacity: 0;
  transition: opacity 900ms ease;
  will-change: opacity;
  background: #000;
}
.bg-video.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .bg-video { transition: none; }
}

/* ── 3. Lighting overlays ─────────────────────────────────── */
/* sleep-timer fade to near-black; opacity only, set every 250ms by main.js */
.dim-overlay {
  position: absolute; inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
  transition: opacity 250ms linear;
}
.vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 92% 80% at 50% 58%, transparent 42%, rgba(0,0,0,.32) 78%, rgba(0,0,0,.6) 100%),
    linear-gradient(180deg, rgba(0,0,0,.4) 0, transparent 24%, transparent 76%, rgba(0,0,0,.55) 100%);
}

/* ── 4. Brand, dock & controls ────────────────────────────── */
.brand {
  position: absolute; top: max(18px, env(safe-area-inset-top)); left: 24px; z-index: 5;
  transition: opacity .6s ease;
  pointer-events: none;
}
.brand h1 {
  margin: 0;
  font: 600 clamp(22px, 2.4vw, 30px)/1.1 var(--serif);
  letter-spacing: .01em;
  text-shadow: 0 2px 16px rgba(0,0,0,.8);
}
.brand-accent { color: var(--accent); font-style: italic; }
.brand p { margin: 2px 0 0; font-size: 13px; color: var(--muted); text-shadow: 0 1px 10px rgba(0,0,0,.9); transition: opacity .6s ease; }

.dock {
  position: absolute; left: 50%; bottom: max(40px, calc(env(safe-area-inset-bottom) + 34px)); z-index: 6;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 6px;
  background: rgba(24, 14, 9, .55);
  border: 1px solid var(--line);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
  transition: opacity .6s ease, transform .6s ease;
  max-width: calc(100vw - 24px);
}
.dock-group { display: flex; align-items: center; gap: 2px; }
.dock-group + .dock-group { border-left: 1px solid var(--line); padding-left: 6px; margin-left: 2px; }

.icon-btn, .vibe-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s;
}
.icon-btn:hover, .vibe-btn:hover { background: rgba(255,230,200,.08); }
.icon-btn svg, .timer svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-btn .spk { fill: currentColor; stroke: none; }
#fs-btn, .sound-btn { padding: 0 10px; }

.sound-btn .wave { display: none; }
.sound-btn[aria-pressed="true"] { color: var(--accent-2); background: rgba(255,157,69,.14); }
.sound-btn[aria-pressed="true"] .wave { display: block; }
.sound-btn[aria-pressed="true"] .mute { display: none; }
.sound-btn[aria-pressed="false"] { animation: hint 2.6s ease-in-out 2s 3; }
.sound-pending .sound-btn { animation: hint 1.6s ease-in-out infinite; }
@keyframes hint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,170,90,0); }
  50% { box-shadow: 0 0 0 5px rgba(255,170,90,.25); }
}

.vibe-btn { padding: 0 11px; color: var(--muted); }
.vibe-btn .vs { display: none; }
.vibe-btn[aria-checked="true"] {
  color: var(--ink);
  background: rgba(255,157,69,.16);
  border-color: rgba(255,170,90,.35);
}

.range { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; height: 40px; }
.range input {
  -webkit-appearance: none; appearance: none;
  width: 84px; height: 4px; border-radius: 4px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent) 0 var(--fill, 50%), rgba(255,230,200,.2) var(--fill, 50%));
}
.range input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 1px 6px rgba(0,0,0,.5); border: 0;
}
.range input::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 0;
}

.timer {
  display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 4px 0 10px;
  border-radius: 999px; cursor: pointer;
}
.timer:hover { background: rgba(255,230,200,.08); }
.timer select {
  -webkit-appearance: none; appearance: none;
  background: transparent; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 500; padding: 4px 6px;
}
.timer select option { background: #24170f; color: var(--ink); }

.scroll-cue {
  position: absolute; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 5;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase;
  transition: opacity .6s ease, color .2s;
  text-shadow: 0 1px 8px rgba(0,0,0,.9);
}
.scroll-cue:hover { color: var(--ink); }
.scroll-cue svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }

/* the MyFireplaceVideo logo itself always stays on screen; only its subtitle
   fades with the rest of the idle UI */
.hero.idle .dock, .hero.idle .brand p, .hero.idle .scroll-cue { opacity: 0; pointer-events: none; }
.hero.idle .dock { transform: translate(-50%, 10px); }
.hero.is-fs .scroll-cue { display: none; }

/* fullscreen: the only control is the exit button */
.fs-exit { display: none; }
.hero.is-fs .fs-enter { display: none; }
.hero.is-fs .fs-exit { display: block; }
.hero.is-fs .dock-group:not(:last-child),
.hero.is-fs .timer { display: none; }
.hero.is-fs .dock-group + .dock-group { border-left: 0; padding-left: 0; margin-left: 0; }
.hero.is-fs .dock { width: auto; border-radius: 999px; padding: 6px; }

/* ?ui=0 — no controls */
.hero.no-ui .dock, .hero.no-ui .scroll-cue { display: none; }

/* ── 5. Content sections ──────────────────────────────────── */
.content {
  position: relative;
  background: linear-gradient(180deg, #050302 0, var(--bg) 180px);
  padding: 72px 20px 40px;
}
.content section { max-width: 920px; margin: 0 auto; padding: 44px 0; }
.content section + section { border-top: 1px solid var(--line); }
.content h2 {
  font: 600 clamp(28px, 4vw, 40px)/1.15 var(--serif);
  margin: 0 0 18px; letter-spacing: -.01em;
}
.content h3 { font: 600 20px/1.3 var(--serif); margin: 26px 0 8px; }
.content p { margin: 0 0 14px; color: #e6d7c4; }
.content a { color: var(--accent-2); }
.eyebrow { color: var(--accent) !important; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; margin-bottom: 8px !important; }
.lede { font-size: 19px; color: var(--ink) !important; max-width: 760px; }
kbd {
  font: 500 13px var(--sans); padding: 1px 7px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--card);
}

.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.features li {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.features strong { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.features span { color: var(--muted); font-size: 15.5px; }

.steps { padding-left: 22px; margin: 0; }
.steps li { margin: 0 0 10px; color: #e6d7c4; padding-left: 4px; }
.steps li::marker { color: var(--accent); font-weight: 600; }

.vibe-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.vibe-cards article { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; padding-bottom: 10px; }
.vibe-cards img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.vibe-cards h3 { margin: 12px 20px 6px; }
.vibe-cards p { margin: 0 20px; font-size: 15.5px; color: var(--muted); }

.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 36px; }
.why-grid h3 { margin-top: 12px; }
.why-grid p { font-size: 16px; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 28px 16px 0; position: relative;
  font-weight: 600; font-size: 16.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 22px; font-weight: 400; transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); font-size: 15.5px; padding-bottom: 6px; }

.back-to-fire { text-align: center; border-top: 0 !important; }
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  background: linear-gradient(180deg, #ffac5c, #e8762a); color: #1b0e05 !important;
  font-weight: 600; text-decoration: none; box-shadow: 0 6px 24px rgba(255,120,40,.3);
}
.btn:hover { filter: brightness(1.08); }

.site-footer { text-align: center; padding: 26px 20px 40px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; }

/* ── 6. Responsive ────────────────────────────────────────── */
@media (max-width: 1250px) {
  .vibe-btn .vn { display: none; }
  .vibe-btn .vs { display: inline; }
}
@media (max-width: 900px) {
  .range input { width: 70px; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .brand { left: 0; right: 0; text-align: center; }
  .brand p { font-size: 12px; }

  .dock {
    flex-wrap: wrap; justify-content: center;
    border-radius: 22px;
    width: calc(100vw - 24px);
    bottom: max(34px, calc(env(safe-area-inset-bottom) + 30px));
    row-gap: 4px;
  }
  .dock-group + .dock-group { border-left: 0; padding-left: 0; margin-left: 0; }
  /* 8 scenes don't fit one row on a phone; wrap instead of overflowing */
  .vibes { order: -1; width: 100%; justify-content: center; flex-wrap: wrap; row-gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  .vibe-btn { padding: 0 8px; font-size: 13.5px; }
  .dock { gap: 0; padding: 6px 4px; }
  .range { padding: 0 6px; }
  .range input { width: 50px; }
  .icon-btn { padding: 0 9px; }
  .timer { padding: 0 2px 0 8px; }
  .timer select { padding: 4px 2px; }

  .content { padding-top: 48px; }
  .features, .why-grid { grid-template-columns: 1fr; }
}
