/* ============================================================
   THRIVE 88.1 FM — Base
   Layer 2: Reset · Typography · Utilities
   ============================================================ */

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

/* Suppress transitions on first load (theme-init.js adds .no-transition) */
html.no-transition * { transition: none !important; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 400; }
p { margin: 0; }

/* ── Typography scale ───────────────────────────────────────── */
.serif {
  font-family: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
}

/* Kicker — section labels */
.kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 400;
}

/* Gradient italic for hero/section headings */
em.gradient,
.gradient-text {
  font-style: italic;
  background: linear-gradient(110deg, var(--ember) 20%, var(--vesper) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Layout utilities ───────────────────────────────────────── */
.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

.section-tight {
  padding: 80px 0;
}

.entry-content {
  max-width: 760px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-mute);
}

.entry-content h1, .entry-content h2, .entry-content h3 {
  color: var(--ink);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

/* Flex / grid utilities */
.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; }
.gap-10        { gap: 10px; }
.gap-12        { gap: 12px; }
.gap-14        { gap: 14px; }

/* Visibility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Animated stage effects ─────────────────────────────────── */

/* Grain overlay — applied to .stage sections */
.stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.stage::before {
  content: '';
  position: absolute; inset: -10%;
  background:
    radial-gradient(60% 40% at 20% 0%, color-mix(in oklch, var(--vesper) 38%, transparent), transparent 70%),
    radial-gradient(70% 50% at 85% 10%, color-mix(in oklch, var(--ember) 32%, transparent), transparent 65%),
    radial-gradient(80% 60% at 50% 100%, color-mix(in oklch, var(--vesper-deep) 30%, transparent), transparent 70%);
  filter: blur(40px);
  z-index: -2;
  pointer-events: none;
}

.stage::after {
  content: '';
  position: absolute; inset: 0;
  /* SVG grain texture */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  z-index: -1;
  pointer-events: none;
}

/* Light beams */
.beams {
  position: absolute; inset: -10% 0;
  z-index: -2;
  pointer-events: none;
}

.beam {
  position: absolute;
  top: -20%;
  width: 70vw;
  height: 140%;
  transform-origin: top center;
  mix-blend-mode: screen;
  filter: blur(28px);
  opacity: 0.7;
  background: linear-gradient(
    to bottom,
    color-mix(in oklch, var(--c) 55%, transparent) 0%,
    color-mix(in oklch, var(--c) 18%, transparent) 35%,
    transparent 75%
  );
  clip-path: polygon(48% 0%, 52% 0%, 90% 100%, 10% 100%);
  animation: thvSway var(--dur, 18s) ease-in-out infinite alternate;
}

@keyframes thvSway {
  0%   { transform: translateX(var(--x, 0)) rotate(var(--r1, -8deg)); opacity: 0.55; }
  50%  { opacity: 0.85; }
  100% { transform: translateX(var(--x, 0)) rotate(var(--r2, 10deg)); opacity: 0.5; }
}

html[data-anim="off"] .beam { animation: none !important; }

/* Floating particles */
.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  animation: thvDrift var(--dur, 22s) linear infinite;
}

@keyframes thvDrift {
  0%   { transform: translate3d(0,0,0); opacity: 0; }
  10%  { opacity: var(--max, .55); }
  90%  { opacity: var(--max, .55); }
  100% { transform: translate3d(var(--dx, 60px), -120vh, 0); opacity: 0; }
}

html[data-anim="off"] .particle { animation: none !important; opacity: 0; }

/* EQ bars */
.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.eq i {
  display: block;
  width: 3px;
  background: currentColor;
  border-radius: 1px;
  animation: thvEq 1s ease-in-out infinite alternate;
}

.eq i:nth-child(1) { animation-delay: 0s;   height: 40%; }
.eq i:nth-child(2) { animation-delay: .2s;  height: 90%; }
.eq i:nth-child(3) { animation-delay: .4s;  height: 60%; }
.eq i:nth-child(4) { animation-delay: .1s;  height: 80%; }

@keyframes thvEq { from { height: 20%; } to { height: 95%; } }

html[data-anim="off"] .eq i { animation: none !important; }

/* Pulse dot */
.pulse {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 0 var(--ember);
  animation: thvPulse 2s ease-out infinite;
  flex-shrink: 0;
}

@keyframes thvPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklch, var(--ember) 70%, transparent); }
  70%  { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Marquee */
.marquee {
  overflow: hidden;
  padding: 14px 0;
}

.marquee-track {
  display: flex;
  gap: 60px;
  animation: thvScrollX 50s linear infinite;
  white-space: nowrap;
}

html[data-anim="off"] .marquee-track { animation-duration: 200s; }

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

.marquee-item .dot {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ember);
  flex-shrink: 0;
}

@keyframes thvScrollX {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 980px) {
  .shell { padding: 0 20px; }
}
