/* =========================================================
   CINDER — Made on fire.
   Premium smash burger, dark moody editorial.
   ========================================================= */

:root {
  --bg-dark: #0a0a0a;
  --bg-darker: #050505;
  --bg-accent: #140a06;
  --text-on-dark: #f1ede5;
  --text-muted: #7a746b;
  --text-accent: #d97742;
  --rule: rgba(241, 237, 229, 0.08);

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle atmospheric radial gradient on the body — gives the dark bg
   depth so it doesn't read as a flat black rectangle behind the burger. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 65% 50%, rgba(217, 119, 66, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 90% 90% at 30% 30%, rgba(20, 10, 6, 0.5) 0%, transparent 70%);
  mix-blend-mode: screen;
}

a { color: inherit; text-decoration: none; }
em { font-style: italic; }
img { display: block; max-width: 100%; }

/* =========================================================
   1. Loader
   ========================================================= */

#loader {
  position: fixed; inset: 0;
  z-index: 9999;
  background: var(--bg-darker);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 0.08em;
  color: var(--text-on-dark);
}
.loader-bar-wrap {
  width: min(280px, 60vw);
  height: 1px;
  background: var(--rule);
  overflow: hidden;
}
#loader-bar {
  width: 0%;
  height: 100%;
  background: var(--text-accent);
  transition: width 0.2s ease;
}
#loader-percent {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* =========================================================
   2. Header
   ========================================================= */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 2.5rem;
  mix-blend-mode: difference;
  color: var(--text-on-dark);
}

.site-header .logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
}

.site-header nav {
  display: flex;
  gap: 2.25rem;
}

.site-header nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}
.site-header nav a:hover { opacity: 1; }

/* =========================================================
   3. Hero (standalone 100vh)
   ========================================================= */

.hero-standalone {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--bg-darker);
  display: flex;
  align-items: center;
  padding-left: 5vw;
  padding-right: 5vw;
  overflow: hidden;
}

.hero-inner {
  max-width: min(80vw, 1200px);
}

.hero-heading {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(4.5rem, 13vw, 14rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
  color: var(--text-on-dark);
}
.hero-heading .word {
  display: block;
  overflow: hidden;
}
.hero-heading .word span {
  display: inline-block;
  will-change: transform, opacity;
}
.hero-heading em {
  font-style: italic;
  color: var(--text-accent);
  font-weight: 600;
}

.hero-tagline {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.5;
  max-width: 38ch;
  color: var(--text-muted);
}

.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  right: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.scroll-indicator svg {
  animation: scroll-bob 2.2s ease-in-out infinite;
}
@keyframes scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* =========================================================
   4. Canvas (fixed, slightly right-biased)
   ========================================================= */

.canvas-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  clip-path: circle(0% at 50% 50%);
  will-change: clip-path, opacity;
  /* The burger is offset horizontally via BURGER_X_OFFSET inside drawFrame —
     canvas covers the full viewport so no bg-color seam can appear. */
}

#canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================================================
   5. Dark overlay (for stats section)
   ========================================================= */

#dark-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 2;          /* sits above canvas (1), below scroll-container (3) */
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   6. Scroll container + sections
   ========================================================= */

#scroll-container {
  position: relative;
  width: 100%;
  min-height: 600vh;   /* tightened from 800vh — pacing felt too long */
  z-index: 3;          /* must sit above dark-overlay so stats are visible */
}

/* Sections sit fixed in the viewport — opacity is toggled by scroll progress.
   This makes the math reliable across viewports and avoids the absolute-
   positioning-inside-relative-container drift that hides sections at wrong
   scroll points. */
.scroll-section {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 5vw;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  will-change: opacity, transform;
}
.scroll-section.section-stats,
.scroll-section.section-cta {
  z-index: 10;
}

/* Side-aligned text zones — burger occupies the right ~55-90% of viewport,
   text confined strictly to the left ~5-38vw zone to avoid overlap. */
.align-left {
  padding-left: 5vw;
  padding-right: 62vw;
}
.align-left .section-inner {
  max-width: 33vw;
}

/* Section typography */
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.5rem, 7.5vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.028em;
  color: var(--text-on-dark);
  margin-bottom: 2rem;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.65);
}
.section-heading em {
  font-style: italic;
  font-weight: 600;
  color: var(--text-accent);
}

.section-body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.1rem, 1.4vw, 1.4rem);
  line-height: 1.55;
  color: var(--text-on-dark);
  max-width: 36ch;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.section-note {
  margin-top: 2.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* =========================================================
   Stats section
   ========================================================= */

.section-stats {
  padding: 0 8vw;
  z-index: 10;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4vw;
  max-width: 1400px;
  margin: 0 auto;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 1rem;
  border-left: 1px solid var(--rule);
  padding-left: 1.5rem;
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(4rem, 8vw, 9rem);
  line-height: 1;
  color: var(--text-on-dark);
  letter-spacing: -0.025em;
}

.stat-suffix {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-accent);
  margin-top: 0.15rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

/* =========================================================
   CTA section
   ========================================================= */

.section-cta {
  z-index: 10;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.15rem 2.25rem;
  background: var(--text-accent);
  color: var(--bg-darker);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 999px;
  margin-top: 0.5rem;
  transition: background 0.3s ease, transform 0.3s ease;
  will-change: transform;
}
.cta-button:hover {
  background: #e58a55;
  transform: translateX(4px);
}
.cta-button span { display: inline-block; transition: transform 0.3s ease; }
.cta-button:hover span { transform: translateX(4px); }

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 768px) {
  .site-header {
    padding: 1.1rem 1.25rem;
  }
  .site-header nav { display: none; }
  .site-header .logo { font-size: 1.05rem; }

  .hero-standalone { padding: 0 1.25rem; }
  .hero-heading {
    font-size: clamp(3rem, 16vw, 5.5rem);
    line-height: 0.92;
    margin-bottom: 1.5rem;
  }
  .hero-tagline { font-size: 1rem; max-width: 32ch; }
  .scroll-indicator { bottom: 2rem; right: 1.25rem; font-size: 0.62rem; }

  .canvas-wrap { left: 0; }

  #scroll-container { min-height: 500vh; }

  /* Mobile: vertical stack — burger occupies upper 50%, text sits in bottom 35%.
     The JS canvas renderer pulls the burger up 18vh on mobile so the lower
     portion of the viewport is clear for the text section. */
  .scroll-section {
    top: 76%;          /* section center at 76% of viewport */
    padding: 0 1.25rem;
  }

  .align-left {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .align-left .section-inner {
    max-width: 100%;
    /* NO glassmorphism — text sits on the page bg below the burger */
    background: transparent;
    padding: 0;
    border-radius: 0;
    backdrop-filter: none;
  }

  .section-label {
    font-size: 0.7rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.55rem;
  }
  .section-heading {
    font-size: clamp(2.4rem, 10vw, 3.6rem);
    margin-bottom: 1rem;
    line-height: 0.95;
  }
  .section-body {
    font-size: 1.02rem;
    max-width: 100%;
    line-height: 1.5;
  }
  .section-note { font-size: 0.7rem; margin-top: 1.5rem; }

  /* Stats: 2x2 grid, centered, with the dark overlay covering the upper burger too */
  .section-stats { padding: 0 1.5rem; top: 50%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1.5rem; }
  .stat-number { font-size: clamp(2.8rem, 14vw, 4.5rem); }
  .stat-suffix { font-size: 0.95rem; }
  .stat-label  { font-size: 0.72rem; margin-top: 0.85rem; }
  .stat { padding-left: 1rem; }

  /* CTA */
  .cta-button {
    font-size: 0.74rem;
    padding: 1rem 1.65rem;
  }
}
