/* ==========================================================================
   Peopipe Marketing — Light Theme (brand red, 3D)
   Brand red mirrors peopipe-client/src/styles.css. Change a value here and the
   whole site (Tailwind classes, Font Awesome icons, 3D scene) follows.
   ========================================================================== */
:root {
  /* Brand primary (red) */
  --primary: #d93c2e;
  --primary-50: #fdf3f2;
  --primary-100: #fbe4e1;
  --primary-200: #f7cbc6;
  --primary-300: #f0a59d;
  --primary-400: #e5675b;
  --primary-500: #d93c2e;
  --primary-600: #c03326;
  --primary-700: #a02a20;
  --primary-800: #84261e;
  --primary-900: #6d241e;
  --primary-950: #3b0f0b;

  /* Secondary: hot ember / orange-red — keeps everything in the red family */
  --secondary: #ff5a36;
  --secondary-50: #fff4f0;
  --secondary-100: #ffe4da;
  --secondary-200: #ffc9b6;
  --secondary-300: #ff9a7a;
  --secondary-400: #ff7350;
  --secondary-600: #e2401f;
  --secondary-700: #b83018;
  --secondary-800: #8a2312;
  --secondary-900: #5a170c;

  --accent-blue: #ff2d55; /* neon crimson accent (name kept for compatibility) */

  --error-dark: #dc2626;   --error-light: #fee2e2;
  --success-dark: #16a34a; --success-light: #dcfce7;
  --warning-dark: #d97706; --warning-light: #fef3c7;

  /* Dark cyber surfaces */
  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-tertiary: #64748b;
  --background: #f8f8fa;
  --background-secondary: #ffffff;
  --border-primary: #e8e8ee;
  --border-secondary: #f0c4bf;

  /* Neon */
  --neon: #d93c2e;
  --neon-glow: none;

  /* Icon colors (Font Awesome) */
  --icon-primary: var(--neon);
  --icon-secondary: var(--secondary);
  --icon-muted: var(--text-tertiary);
  --icon-on-brand: #ffffff;

  /* Effects */
  --gradient-brand: linear-gradient(135deg, #ff3b2f 0%, var(--primary) 45%, var(--primary-800) 100%);
  --gradient-text: linear-gradient(90deg, #ff6a3d 0%, #d93c2e 55%, #a02a20 100%);
  --shadow-3d: 0 30px 60px -24px rgba(15,23,42,.25), 0 18px 36px -18px rgba(217,60,46,.35);
  --radius-card: 1rem;

  --font-display: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--background);
  color: var(--text-primary);
  overflow-x: hidden;
}
::selection { background: var(--primary); color: #fff; }

h1, h2, h3, .font-display { font-family: var(--font-display); letter-spacing: -.02em; }
.font-mono, .tag { font-family: var(--font-mono); }

/* ---- Global cyber backdrop: grid + scanlines + vignette ---- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(15,23,42,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
}

/* ---- Icon helpers ---- */
.icon-primary   { color: var(--icon-primary); }
.icon-secondary { color: var(--icon-secondary); }
.icon-muted     { color: var(--icon-muted); }
.icon-tile {
  display: inline-grid; place-items: center;
  width: 3rem; height: 3rem; border-radius: .6rem;
  background: var(--gradient-brand); color: #fff;
  box-shadow: 0 10px 24px -8px rgba(217,60,46,.55), inset 0 1px 0 rgba(255,255,255,.35);
  transform: translateZ(40px);
}

/* ---- Text / surfaces ---- */
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.neon-text { color: #fff; }
.tag {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--neon);
}
.tag::before { content: ""; width: 18px; height: 2px; background: var(--primary); }

.glass {
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 8px 30px -12px rgba(15,23,42,.15);
}
.panel {
  position: relative;
  background: var(--background-secondary);
  border: 1px solid var(--border-primary);
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
/* HUD corner brackets */
.hud::before, .hud::after {
  content: ""; position: absolute; width: 16px; height: 16px; pointer-events: none;
  border-color: var(--primary); border-style: solid; transition: all .3s ease; opacity: 0;
}
.hud::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.hud::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.hud:hover::before, .hud:hover::after { width: 24px; height: 24px; opacity: 1; }
.panel:hover { border-color: var(--border-secondary); }

.btn-brand {
  position: relative; overflow: hidden;
  background: var(--gradient-brand); color: #fff;
  box-shadow: 0 12px 28px -10px rgba(217,60,46,.6), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .2s ease, box-shadow .2s ease;
  border-radius: .75rem;
}
.btn-brand::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transition: transform .6s ease;
}
.btn-brand:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(217,60,46,.7); }
.btn-brand:hover::after { transform: translateX(120%); }
.btn-ghost {
  border: 1px solid var(--border-primary); color: var(--text-primary);
  background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.05);
  border-radius: .75rem;
  transition: all .2s ease;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

/* blinking terminal caret */
.caret::after { content: "_"; color: var(--neon); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

/* pulse dot */
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success-dark); box-shadow: 0 0 10px var(--success-dark); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---- 3D tilt cards ---- */
.scene { perspective: 1200px; }
.tilt {
  transform-style: preserve-3d;
  transition: transform .25s ease-out, box-shadow .25s ease-out, border-color .25s;
  will-change: transform;
}
.tilt:hover { box-shadow: var(--shadow-3d); }
.tilt .pop { transform: translateZ(30px); }
/* moving light that follows the cursor (set by main.js) */
.tilt.glow { background-image: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(217,60,46,.07), transparent 40%); }

/* ---- 3D dashboard mockup ---- */
.mockup {
  transform: rotateX(18deg) rotateY(-14deg) rotateZ(3deg);
  transform-style: preserve-3d;
  box-shadow: var(--shadow-3d);
  transition: transform .8s cubic-bezier(.2,.8,.2,1);
}
.mockup:hover { transform: rotateX(6deg) rotateY(-4deg) rotateZ(0deg); }
.floater { transform: translateZ(80px); animation: bob 5s ease-in-out infinite; }
.floater.d2 { animation-delay: -2.5s; }
@keyframes bob { 50% { translate: 0 -12px; } }

/* ---- 3D rotating cube (holographic) ---- */
.cube-wrap { perspective: 900px; }
.cube {
  width: 220px; height: 220px; position: relative;
  transform-style: preserve-3d; animation: spin 18s linear infinite;
}
.cube:hover { animation-play-state: paused; }
.cube .face {
  position: absolute; inset: 0; border-radius: .5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  color: #fff; font-weight: 700; font-size: 1.05rem;
  border: 1px solid rgba(255,255,255,.35);
  backface-visibility: visible;
}
.cube .face i { font-size: 2.5rem; }
.f1 { background: linear-gradient(135deg, var(--primary), var(--primary-700)); transform: translateZ(110px); }
.f2 { background: linear-gradient(135deg, var(--secondary), var(--primary-600)); transform: rotateY(90deg) translateZ(110px); }
.f3 { background: linear-gradient(135deg, var(--primary-400), var(--primary-800)); transform: rotateY(180deg) translateZ(110px); }
.f4 { background: linear-gradient(135deg, var(--primary-600), var(--primary-900)); transform: rotateY(-90deg) translateZ(110px); }
.f5 { background: linear-gradient(135deg, var(--secondary-400), var(--primary)); transform: rotateX(90deg) translateZ(110px); }
.f6 { background: linear-gradient(135deg, var(--primary-700), var(--primary-950)); transform: rotateX(-90deg) translateZ(110px); }
@keyframes spin {
  from { transform: rotateX(-20deg) rotateY(0); }
  to   { transform: rotateX(-20deg) rotateY(360deg); }
}
.cube-shadow {
  position: absolute; bottom: -10px; left: 50%; width: 260px; height: 40px; translate: -50% 0;
  background: radial-gradient(closest-side, rgba(15,23,42,.22), transparent);
  filter: blur(6px);
}

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(40px) rotateX(12deg); transition: all .9s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---- Synthwave grid floor ---- */
.grid-floor {
  position: absolute; inset: auto -50% -10% -50%; height: 60%;
  background-image:
    linear-gradient(var(--primary-200) 1px, transparent 1px),
    linear-gradient(90deg, var(--primary-200) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(600px) rotateX(70deg);
  mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 80%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 80%);
  animation: floor 4s linear infinite;
  pointer-events: none;
}
@keyframes floor { to { background-position: 0 60px; } }

/* horizon glow line */
.horizon {
  position: absolute; left: 0; right: 0; bottom: 38%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-200), transparent);
  pointer-events: none;
}

/* section divider */
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border-secondary), transparent); }

/* marquee ticker */
.ticker { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ticker-track { display: flex; gap: 3rem; width: max-content; animation: ticker 30s linear infinite; }
@keyframes ticker { to { transform: translateX(-50%); } }

details summary::-webkit-details-marker { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Scroll story — fixed 3D world, chapters, progress rail, stacked stage
   ========================================================================== */
#world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; transition: opacity .6s ease, filter .6s ease; }
#world.dim { opacity: .18; filter: blur(2px); }
main, footer { position: relative; z-index: 1; }

#nav nav { transition: box-shadow .3s ease, background .3s ease; }
#nav.scrolled nav { background: rgba(255,255,255,.92); box-shadow: 0 12px 40px -18px rgba(15,23,42,.3); }

/* Readability veil behind left-column story text on desktop */
.story-veil {
  position: fixed; inset: 0 auto 0 0; width: 58vw; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(248,248,250,.92) 0%, rgba(248,248,250,.75) 55%, rgba(248,248,250,0) 100%);
}
.story-veil { transition: opacity .8s ease; }
.story-veil.right { inset: 0 0 0 auto; background: linear-gradient(270deg, rgba(248,248,250,.92) 0%, rgba(248,248,250,.75) 55%, rgba(248,248,250,0) 100%); opacity: 0; }
.story-veil.off { opacity: 0; }
.story-veil.right.on { opacity: 1; }
@media (max-width: 1023px) { .story-veil { display: none; } }

/* Chapters */
.chapter { min-height: 100vh; display: flex; align-items: center; }
.chapter .chapter-card {
  opacity: .35; transform: translateY(24px) scale(.98);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1), box-shadow .7s ease;
}
.chapter.active .chapter-card { opacity: 1; transform: none; }
.chapter-num {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .25em; color: var(--primary);
  display: inline-flex; align-items: center; gap: .6rem;
}
.chapter-num::after { content: ""; width: 40px; height: 1px; background: var(--primary-300); }
.chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .75rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--border-primary); font-size: .8rem; font-weight: 600; color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.chip i { color: var(--primary); }

/* Progress rail */
.rail { position: fixed; right: 28px; top: 50%; transform: translateY(-50%); z-index: 40; display: none; }
@media (min-width: 1024px) { .rail { display: block; } }
.rail-track { position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border-primary); border-radius: 2px; overflow: hidden; }
.rail-track span { position: absolute; inset: 0; background: var(--primary); transform-origin: top; transform: scaleY(0); }
.rail ul { position: relative; display: flex; flex-direction: column; gap: 34px; }
.rail a { display: flex; align-items: center; gap: 12px; font-size: .7rem; font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary); }
.rail a::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--border-secondary);
  transition: all .3s ease; flex: none;
}
.rail a span { opacity: 0; transform: translateX(-6px); transition: all .3s ease; }
.rail:hover a span, .rail a.current span { opacity: 1; transform: none; }
.rail a.on { color: var(--text-primary); }
.rail a.on::before { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(217,60,46,.15); }

/* Scroll cue */
.scroll-cue { width: 26px; height: 42px; border: 2px solid var(--border-secondary); border-radius: 14px; position: relative; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--primary); animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 60% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* Stacked stage cards */
.stack-card {
  position: sticky; top: calc(6.5rem + var(--i) * 1.4rem);
  transform-origin: center top; will-change: transform;
  background: #fff; border: 1px solid var(--border-primary);
  box-shadow: 0 -10px 40px -20px rgba(15,23,42,.25), 0 30px 60px -30px rgba(15,23,42,.25);
}
.stack-card + .stack-card { margin-top: 12vh; }

/* Rising dashboard */
.stage-screen { transform-origin: center bottom; will-change: transform, opacity; box-shadow: var(--shadow-3d); }
.stage-floor {
  position: absolute; left: 5%; right: 5%; bottom: -60px; height: 120px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(217,60,46,.22), transparent); filter: blur(10px);
}

/* Mini UI bits used inside story/stack visuals */
.mini { background: #fff; border: 1px solid var(--border-primary); border-radius: .9rem; box-shadow: 0 10px 30px -18px rgba(15,23,42,.35); }
.bar { height: 6px; border-radius: 6px; background: var(--primary-100); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--gradient-brand); border-radius: 6px; }


/* ==========================================================================
   Content sections — module explorer, integrations hub, setup steps
   ========================================================================== */
.mod-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.mod-tab {
  display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--border-primary); font-weight: 600; font-size: .9rem; color: var(--text-tertiary);
  transition: all .25s ease;
}
.mod-tab i { color: var(--primary); }
.mod-tab:hover { color: var(--text-primary); transform: translateY(-2px); }
.mod-tab.on { background: var(--gradient-brand); color: #fff; border-color: transparent; box-shadow: 0 12px 28px -12px rgba(217,60,46,.6); }
.mod-tab.on i { color: #fff; }
.mod-pane { animation: paneIn .5s cubic-bezier(.2,.8,.2,1); }
@keyframes paneIn { from { opacity: 0; transform: translateY(16px) rotateX(8deg); } to { opacity: 1; transform: none; } }

.hub { position: absolute; inset: -40px; display: grid; place-items: center; pointer-events: none; z-index: 0; }
.hub-ring { position: absolute; border-radius: 50%; border: 1px dashed var(--primary-200); }
.hub-ring.r1 { width: 70%; aspect-ratio: 1; animation: spin2 40s linear infinite; }
.hub-ring.r2 { width: 105%; aspect-ratio: 1; animation: spin2 60s linear infinite reverse; }
@keyframes spin2 { to { transform: rotate(360deg); } }
.int-card { position: relative; z-index: 1; }

.steps-line {
  position: absolute; left: 6%; right: 6%; top: 46px; height: 2px;
  background: linear-gradient(90deg, var(--primary-200), var(--primary), var(--primary-200));
}

.rail { transition: opacity .4s ease; }
.rail.away { opacity: 0; pointer-events: none; }
