/* Luxe Dark — SE Renovation design system
 * Charleston SC luxury renovation contractor — fixed-price + on-time guarantee
 * Tokens, type, layout, components, persistent overlays, a11y utilities.
 */

:root {
  /* Palette */
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --bg-soft: #1c1c1c;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --accent-gold: #fbbf24;
  --accent-red: #dc2626;
  --accent-red-glow: rgba(220, 38, 38, 0.45);
  --border: #27272a;

  /* Layout */
  --container: 1280px;
  --rhythm: 96px;            /* desktop section spacing */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

@media (max-width: 768px) {
  :root { --rhythm: 64px; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* Type scale */
h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 16px 0;
}
h1 { font-size: clamp(36px, 6vw, 72px); }
h2 { font-size: clamp(28px, 4vw, 48px); }
h3 { font-size: clamp(20px, 2.5vw, 28px); }

p { margin: 0 0 16px; }
a { color: var(--accent-gold); }

.label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lede {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 60ch;
}

/* Layout */
.section {
  padding: var(--rhythm) 24px;
}
.section .inner {
  max-width: var(--container);
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 800;
  border-radius: var(--radius-pill);
  border: 0;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  min-height: 48px;       /* WCAG 2.5.5 — 44px+ tap target */
  transition: transform 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-red {
  background: var(--accent-red);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);  /* lifts white-on-red contrast above 4.5:1 */
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-gold {
  background: var(--accent-gold);
  color: #0a0a0a;
}

/* Voice CTA pulse animation — sticky bottom-center pill */
@keyframes voicePulse {
  0%, 100% {
    box-shadow:
      0 0 0 0 var(--accent-red-glow),
      0 12px 32px var(--accent-red-glow);
  }
  50% {
    box-shadow:
      0 0 0 14px transparent,
      0 12px 32px var(--accent-red-glow);
  }
}

.voice-pill {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: var(--accent-red);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  border: 0;
  z-index: 60;
  animation: voicePulse 1.8s ease-in-out infinite;
  text-decoration: none;
  min-height: 48px;
}

/* Dakota AI CTA — the whole card is the click target. Red glow signals
   "live agent available" without needing a separate red pill button.
   Three states: idle (subtle red ring), pulse (slow), hover (lift + brighter). */
@keyframes dakotaGlow {
  0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(220,38,38,0.55), 0 0 22px 4px rgba(220,38,38,0.30); }
  50%      { box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(220,38,38,0.85), 0 0 38px 10px rgba(220,38,38,0.55); }
}
.ai-cta-card {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 60;
  background: linear-gradient(135deg, #1a0608 0%, #2a0a0e 100%);
  border-radius: 18px;
  padding: 14px 18px 14px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 24px);
  width: 360px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  animation: dakotaGlow 2.6s ease-in-out infinite;
}
.ai-cta-card:hover {
  transform: translateX(-50%) translateY(-3px);
  animation-play-state: paused;
  box-shadow: 0 20px 56px rgba(0,0,0,0.55), 0 0 0 1.5px rgba(239,68,68,1), 0 0 48px 14px rgba(239,68,68,0.65);
}

.ai-cta-card__avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ef4444 0%, #b91c1c 60%, #7f1d1d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12), 0 4px 10px rgba(220,38,38,0.45);
}
.ai-cta-card__avatar-icon {
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4));
}

.ai-cta-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.25;
}
.ai-cta-card__headline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #fafafa;
  letter-spacing: -0.01em;
}
/* Pulsing green online indicator next to "Dakota — Online" */
@keyframes onlinePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.7); transform: scale(1); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0); transform: scale(1.1); }
}
.ai-cta-card__live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: onlinePulse 1.6s ease-in-out infinite;
}
.ai-cta-card__sub {
  font-size: 12.5px;
  color: #fda4a4;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.ai-cta-card__arrow {
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 700;
  color: #fda4a4;
  transition: transform 0.2s ease, color 0.2s ease;
}
.ai-cta-card:hover .ai-cta-card__arrow {
  transform: translateX(4px);
  color: #fff;
}

@media (max-width: 480px) {
  .ai-cta-card {
    width: auto;
    left: 12px;
    right: 12px;
    transform: none;
    padding: 12px 16px 12px 12px;
    gap: 12px;
    border-radius: 16px;
  }
  .ai-cta-card:hover { transform: translateY(-2px); }
  .ai-cta-card__avatar { width: 44px; height: 44px; font-size: 22px; }
  .ai-cta-card__headline { font-size: 15px; }
  .ai-cta-card__sub { font-size: 12px; }
  .ai-cta-card__arrow { font-size: 20px; }
}

/* BBB dynamic seal injected by seal-columbia.bbb.org/badge/badge.min.js
   sits at #bbb-badge (bottom-left, fixed). On small screens we hide it so
   it doesn't collide with the AI CTA card; the BBB Accreditation is still
   visible in the trust strip, footer credentials, and About page. */
@media (max-width: 640px) {
  #bbb-badge { display: none !important; }
}

/* Sticky top offer bar — appears at 25% scroll */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #000;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 55;
  transform: translateY(-100%);
  transition: transform 0.24s ease;
  font-size: 14px;
  gap: 12px;
}
.top-bar.is-visible {
  transform: translateY(0);
}
.top-bar .btn {
  padding: 8px 14px;
  min-height: 36px;
  font-size: 13px;
}

/* Activity ticker — appears mid-page, rotates every 15s */
.ticker {
  position: fixed;
  left: 16px;
  bottom: 96px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  z-index: 50;
  max-width: 320px;
  transform: translateY(20px);
  opacity: 0;
  transition: 0.24s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ticker.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* Hero — video → quiz transition */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  /* White fallback (matches the SR logo card behind the video). Was #000 — that
     was making the logo land on dark gray when the video didn't play. */
  background: #ffffff url(/assets/hero-frames/hero-intro-final.jpg) center/cover no-repeat;
  overflow: hidden;
}
.hero video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.6s ease, opacity 0.4s ease;
}
.hero video.is-frozen {
  filter: brightness(0.55);
}
/* iOS Safari resets <video> to black after `ended`. Hiding the video reveals
   the .hero background-image (last frame) so the user never sees a black flash. */
.hero video.is-hidden {
  opacity: 0;
  pointer-events: none;
}
/* Soft bottom shadow ONLY when the quiz is visible — keeps quiz tile copy
   readable without darkening the SR logo before the user scrolls. */
.hero .quiz-step.is-visible::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
  z-index: -1;
  pointer-events: none;
}

/* Mute / unmute toggle on hero video */
.hero-mute-toggle {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, transform 0.1s ease;
}
.hero-mute-toggle:hover { background: rgba(0, 0, 0, 0.75); }
.hero-mute-toggle:active { transform: scale(0.94); }
.hero-mute-toggle[hidden] { display: none; }
.hero .quiz-step {
  position: relative;
  z-index: 2;
  padding: 48px 24px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(16px);
  transition: 0.5s ease;
}
@media (max-width: 640px) {
  .hero .quiz-step {
    padding: 24px 16px 40px;
  }
  .hero .quiz-step .quiz-prompt {
    font-size: 24px;
    margin-bottom: 16px;
  }
  .quiz-tiles {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .quiz-tiles button {
    padding: 14px 8px;
    min-height: 60px;
    font-size: 15px;
  }
}
.hero .quiz-step.is-visible {
  opacity: 1;
  transform: none;
}
.hero h1, .hero h2.quiz-prompt {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.skip-intro {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.skip-intro:hover { background: rgba(0, 0, 0, 0.6); }

.quiz-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 18px 0 16px;
}
.quiz-tiles button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 16px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 56px;
}
.quiz-tiles button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent-gold);
}

/* Cards (offer stack, proof tiles, founder block, etc.) */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

/* Trust strip */
.trust-strip {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}
.trust-strip strong { color: var(--text); }
.trust-strip .gold { color: var(--accent-gold); }

/* Reduced motion overrides */
@media (prefers-reduced-motion: reduce) {
  .voice-pill { animation: none; }
  .hero video { display: none; }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Accessibility utilities */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  background: var(--accent-gold);
  color: #000;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}
