/* ═══════════════════════════════════════════════════
   PepperSprint — Non-Tailwind Rules Only
   All layout / spacing / colour handled by Tailwind.
   This file covers: pseudo-elements, JS-toggled states,
   scrollbar, heading defaults, reveal animation system,
   and the hero-panel cycling text.
═══════════════════════════════════════════════════ */

/* ─── Tokens (still needed for JS-toggled classes & ::before) ─── */
:root {
  --color-bg: #151515;
  --color-elevated: #1c1c1c;
  --color-accent: #f97316;
  --color-accent-dim: rgba(249, 115, 22, 0.12);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-orange-section: #2c1204;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
}

/* ─── Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: #fff;
  overflow-x: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
ul {
  list-style: none;
}

/* ─── Heading base (font-family only; size/weight via Tailwind) ─── */
h1,
h2,
h3 {
  font-family: var(--font-serif);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h4,
h5,
h6 {
  font-family: var(--font-sans);
}

/* ─── Dot-grid background ─── */
.dot-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 80px 80px;
}
.dot-grid::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    rgba(249, 115, 22, 0.07) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ─── GSAP initial hidden state ─── */
.reveal {
  opacity: 0;
}

/* ─── Lenis smooth scroll ─── */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

/* ─── Navigation: scrolled state (JS-toggled) ─── */
#main-nav {
  top: 44px;
  transition: all 0.3s linear;
}
#main-nav.scrolled {
  background: rgba(21, 21, 21, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  top: 0;
}
#main-nav.hide {
  transform: translateY(-130px);
}

/* ─── Mobile menu: open state (JS-toggled) ─── */
.mobile-menu {
  display: none;
}
.mobile-menu.open {
  display: flex;
}

/* ─── Stats section: line-grid ::before pattern ─── */
.stats-section {
  background: var(--color-orange-section);
  position: relative;
  z-index: 1;
}
.stats-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ─── Hero panel: cycling text ─── */
.hero-panel-cycling {
  position: relative;
}
.cycle-line {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.6s ease;
  font-family: var(--font-serif);
  pointer-events: none;
}
.cycle-line.active {
  opacity: 1;
}

/* ─── Hero panel play button hover (compound translate+scale) ─── */
.hero-panel-play:hover {
  transform: translate(-50%, -50%) scale(1.06) !important;
}

/* ─── Testimonial logo: active (JS-toggled) ─── */
.testimonial-logo {
  border-bottom: 2px solid transparent;
  transition:
    opacity 0.2s,
    border-color 0.2s;
}
.testimonial-logo.active {
  opacity: 1 !important;
  border-color: var(--color-accent);
}

.tile-square {
  aspect-ratio: 1 / 1;
}

.ps-marquee__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
}
.ps-marquee__track > * {
  flex: 0 0 auto;
}

/* ─── Mobile overrides ─── */
@media (max-width: 768px) {
  #main-nav {
    top: 40px;
  }

  .hero-panel {
    aspect-ratio: unset !important;
    flex-direction: column !important;
    min-height: 380px;
  }
  .hero-panel > div:first-child {
    position: relative !important;
    width: 100% !important;
    height: 220px;
  }
  .hero-panel > div:nth-child(2) {
    position: relative !important;
    width: 100% !important;
    height: auto;
    min-height: 200px;
  }
  .hero-panel .hero-panel-play {
    top: 220px;
    left: 50%;
  }
  .hero-panel-cycling {
    height: 52px !important;
  }
}

/* ─── Case study detail: overview grid border collapse ─── */
@media (max-width: 767px) {
  .grid > .border-r {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-left: 0;
    padding-right: 0;
  }
  .grid > .border-r:last-of-type {
    border-bottom: none;
  }
}
