/* ==========================================================================
   hellodemocracy.film — Styles v5
   
   Core principle: each section fills the viewport like a slide.
   Texture: embedded SVG grain filter + directional gradients + vignette.
   ========================================================================== */

:root {
  --color-primary: #0C0C10;
  --color-red-bright: #E9474A;
  --color-red-core: #DE1317;
  --color-red-deep: #AE1114;
  --color-blue-bright: #3983C1;
  --color-blue-core: #0E6EAA;
  --color-blue-deep: #106198;
  --color-white: #FFFFFF;
  --color-off-white: #F2F2F2;
  --color-grey-lightest: #D8D8D8;
  --color-grey-silver: #C0C0C0;
  --color-grey-dark: #A1A1A1;
  --color-grey-darkest: #9E9E9E;

  --nav-height: 64px;
  --section-padding-x: clamp(24px, 5vw, 64px);
  --content-max: clamp(1000px, 82vw, 1400px);
  --content-narrow: clamp(600px, 52vw, 900px);

  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(1rem, 1vw, 1.1875rem);
  line-height: 1.7;
  color: var(--color-primary);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Depth-of-field scroll blur — fixed strips at viewport edges */
body::before,
body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  height: clamp(80px, 12vh, 140px);
  pointer-events: none;
  z-index: 50;
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}

body::before {
  top: var(--nav-height);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1), transparent);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1), transparent);
}

body::after {
  bottom: 0;
  mask-image: linear-gradient(to top, rgba(0,0,0,1), transparent);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1), transparent);
}

a {
  color: var(--color-blue-core);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-blue-deep); }
a:visited { color: var(--color-blue-deep); }

/* Focus indicators — WCAG AA */
:focus-visible {
  outline: 2px solid var(--color-blue-core);
  outline-offset: 2px;
}

.video-facade:focus-visible {
  outline-width: 3px;
  outline-offset: 3px;
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 200;
  padding: 8px 16px;
  background: var(--color-white);
  color: var(--color-primary);
  font-family: 'Lora', Georgia, serif;
  text-decoration: none;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.skip-link:focus {
  top: 12px;
}

/* --------------------------------------------------------------------------
   Texture System
   
   Each .has-texture section gets:
   - Background: base color + directional CSS gradients (on the element itself)
   - ::before: grain overlay using embedded SVG filter (#gggrain-filter)
   - ::after: vignette radial gradient
   
   Decorative images (.section-bg-img) sit at z-index 0.
   Grain + vignette at z-index 1. Content at z-index 2.
   -------------------------------------------------------------------------- */
.has-texture {
  position: relative;
  overflow: hidden;
}

/* Decorative background images */
.section-bg-img {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  max-width: none;
}

.bg-capitol-hero {
  right: -2%;
  bottom: -10%;
  width: clamp(360px, 48vw, 800px);
  height: auto;
}

.bg-flag-reactions {
  left: 0;
  top: 0;
  width: auto;
  height: 100%;
}

.bg-lottery-faq {
  right: 0;
  bottom: 0;
  width: clamp(500px, 50vw, 900px);
  height: auto;
  opacity: 1;
}

/* Grain overlay — references embedded SVG filter */
.has-texture::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: white;
  filter: url(#gggrain-filter);
  opacity: 0.38;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

/* Vignette — visible edge darkening */
.has-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(12, 12, 16, 0.08) 50%,
    rgba(12, 12, 16, 0.2) 70%,
    rgba(12, 12, 16, 0.35) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Content above texture layers */
.has-texture > .section-inner {
  position: relative;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   Per-section gradient backgrounds
   
   Each section layers two angled linear gradients over its base color,
   creating subtle directional shading (inspired by gggrain.com output).
   Gradients use palette greys fading to transparent.
   -------------------------------------------------------------------------- */

/* Hero — warm gradient from upper-left */
.hero {
  background:
    linear-gradient(200deg, rgba(216, 216, 216, 0.35) 0%, transparent 50%),
    linear-gradient(25deg, rgba(192, 192, 192, 0.25) 0%, transparent 45%),
    var(--color-white);
}

/* Reactions — noticeably darker than hero and FAQ */
.reactions {
  background:
    linear-gradient(-155deg, rgba(170, 170, 170, 0.4) 0%, transparent 50%),
    linear-gradient(30deg, rgba(155, 155, 155, 0.3) 0%, transparent 40%),
    #D0D0D0;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
.film-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(2rem, 3.2vw, 3.5rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.title-line {
  white-space: nowrap;
  display: block;
}

.title-line:first-child {
  filter: blur(0.7px);
  opacity: 0.82;
}

.section-heading {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: rgba(255, 255, 255, 0);
  border-bottom: 1px solid transparent;
  transition: background-color var(--transition-base),
              border-color var(--transition-base);
}

.site-nav.is-scrolled {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(192, 192, 192, 0.25);
}

.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--section-padding-x);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  gap: clamp(28px, 4vw, 52px);
  list-style: none;
}

.nav-links a {
  font-family: 'Lora', Georgia, serif;
  font-weight: 400;
  font-size: clamp(0.875rem, 1vw, 1.0625rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  text-decoration: none;
  opacity: 0.5;
  filter: blur(0.4px);
  transition: opacity var(--transition-fast), filter var(--transition-fast);
}
.nav-links a:hover { opacity: 1; filter: none; }
.nav-links a:visited { color: var(--color-primary); }
.nav-links a.is-active { opacity: 1; filter: none; }

/* --------------------------------------------------------------------------
   Section Scaffolding
   -------------------------------------------------------------------------- */
section { scroll-margin-top: var(--nav-height); }

.section-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--section-padding-x);
}

/* --------------------------------------------------------------------------
   Hero — viewport slide, content vertically centered
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  padding-bottom: var(--nav-height);
}

.hero > .section-inner {
  width: 100%;
  padding-top: clamp(32px, 4vw, 56px);
  padding-bottom: clamp(32px, 4vw, 56px);
}

.hero-header {
  text-align: center;
  margin-bottom: clamp(32px, 4vw, 52px);
}

.hero-columns {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
}

/* Video facade */
.video-facade {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background-color: var(--color-primary);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(12, 12, 16, 0.1),
              0 1px 3px rgba(12, 12, 16, 0.06);
}

.video-facade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--transition-base);
}
.video-facade:hover img { opacity: 0.88; }

.video-facade .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(64px, 6vw, 88px);
  height: clamp(64px, 6vw, 88px);
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
.video-facade:hover .play-btn {
  transform: translate(-50%, -50%) scale(1.06);
  background-color: rgba(255, 255, 255, 1);
}

.play-btn svg {
  width: clamp(22px, 2.2vw, 30px);
  height: clamp(22px, 2.2vw, 30px);
  margin-left: 2px;
  fill: var(--color-primary);
}

.video-facade iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Hero right column */
.hero-right {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 4px;
  min-width: 0;
}

.logline {
  font-family: 'Lora', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1rem, 1.1vw, 1.1875rem);
  line-height: 1.7;
  color: var(--color-primary);
  margin: 0;
  padding: 0;
}
.logline + .logline { margin-top: 1em; }

.signup-cta-inline {
  font-style: normal;
  font-weight: 600;
}

.signup-embed {
  width: 100%;
  margin-left: -2px;
}

.signup-embed iframe {
  width: 100%;
  border: 0;
}

/* --------------------------------------------------------------------------
   Reactions — viewport slide
   -------------------------------------------------------------------------- */
.reactions {
  min-height: calc(100dvh - var(--nav-height));
  display: flex;
  align-items: center;
}

.reactions .section-inner {
  max-width: clamp(700px, 50vw, 950px);
  text-align: center;
  width: 100%;
}

.reactions .section-heading { margin-bottom: clamp(32px, 4vw, 48px); }

/* --------------------------------------------------------------------------
   FAQ — generous padding (content may exceed viewport when open)
   -------------------------------------------------------------------------- */
.faq {
  min-height: calc(100dvh - var(--nav-height));
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--color-off-white) 0%, #C0C0C0 100%);
}

.faq::after {
  opacity: 0.3;
}

.faq > .section-inner {
  max-width: var(--content-narrow);
  width: 100%;
  padding-top: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(80px, 8vw, 120px);
}

.faq .section-heading {
  text-align: center;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.faq-item { border-bottom: 1px solid rgba(192, 192, 192, 0.4); }
.faq-item:first-child { border-top: 1px solid rgba(192, 192, 192, 0.4); }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1rem, 1.1vw, 1.1875rem);
  line-height: 1.4;
  color: var(--color-primary);
  text-align: left;
  min-height: 44px;
  transition: color var(--transition-fast);
}
.faq-question:hover { color: var(--color-blue-core); }

.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
}
.faq-icon::before, .faq-icon::after {
  content: '';
  position: absolute;
  background-color: currentColor;
  transition: transform var(--transition-base);
}
.faq-icon::before {
  width: 14px; height: 1.5px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.faq-icon::after {
  width: 1.5px; height: 14px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.faq-question[aria-expanded="true"] .faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow);
}

.faq-answer-inner {
  padding-bottom: 24px;
  line-height: 1.75;
  color: var(--color-primary);
}
.faq-answer-inner a { color: var(--color-blue-core); }
.faq-answer-inner a:hover { color: var(--color-blue-deep); }
.faq-answer-inner p + p { margin-top: 1em; }

/* --------------------------------------------------------------------------
   Copyright — bottom-left of FAQ section, mirrors nav styling
   -------------------------------------------------------------------------- */
.site-copyright {
  position: absolute;
  bottom: clamp(24px, 3vw, 40px);
  left: var(--section-padding-x);
  font-family: 'Lora', Georgia, serif;
  font-weight: 400;
  font-size: clamp(0.875rem, 1vw, 1.0625rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.5;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* Tablet — stacked hero, keep nav visible */
@media (max-width: 860px) {
  .nav-links {
    gap: clamp(20px, 3vw, 32px);
  }
  .nav-links a {
    font-size: 0.8125rem;
  }

  .hero-columns {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero-right {
    text-align: left;
    align-items: stretch;
  }

  .signup-embed {
    margin-left: 0;
  }

  /* Lottery balls — moderate scale on tablets */
  .bg-lottery-faq {
    width: clamp(400px, 65vw, 700px);
    right: -5%;
  }

  .faq > .section-inner {
    padding-bottom: clamp(120px, 15vw, 180px);
  }
}

/* Phone */
@media (max-width: 600px) {
  .film-title { font-size: clamp(1.625rem, 7vw, 2.25rem); }
  .video-facade .play-btn { width: 52px; height: 52px; }
  .play-btn svg { width: 18px; height: 18px; }

  .bg-lottery-faq {
    width: clamp(280px, 75vw, 450px);
    right: -8%;
  }

  .faq > .section-inner {
    padding-bottom: clamp(140px, 20vw, 200px);
  }

  body::before,
  body::after {
    height: 40px;
    backdrop-filter: blur(0.75px);
    -webkit-backdrop-filter: blur(0.75px);
  }
}
