/* Page shell + per-beat layout rules. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  /* Fixed to the viewport (not the document) so every beat scrolls past the
     same mesh, instead of the old corner-anchored washes only ever covering
     beat 1 while beats 3-8 sat on flat near-white. A subtle noise layer on
     top keeps the glows from reading as flat vector gradients. */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") repeat,
    radial-gradient(1300px 1000px at 10% 0%, var(--mesh-violet), transparent 55%),
    radial-gradient(1200px 950px at 100% 100%, var(--mesh-pink), transparent 55%),
    radial-gradient(850px 700px at 88% 6%, var(--mesh-amber), transparent 60%),
    var(--canvas-bg);
  background-attachment: fixed;
  color: var(--canvas-ink); font-family: var(--font-body);
  overflow-x: hidden;
}

/* ----------------------------------------------------------------- nav */
.topbar { position: sticky; top: 0; z-index: 50; display:flex; align-items:center; justify-content:space-between; padding: 18px 40px; backdrop-filter: blur(20px) saturate(160%); background: rgba(19,18,24,0.55); border-bottom: 1px solid var(--canvas-border); }
.brand { display:flex; align-items:center; gap:9px; font-weight:900; font-size:15px; letter-spacing:-0.01em; }
.brand .mark { width:22px; height:22px; border-radius:7px; background:linear-gradient(135deg, var(--grad-a), var(--grad-b)); }
.beat-counter { font-size:12px; color: var(--canvas-ink-faint); font-weight:600; }

/* --------------------------------------------------------------- beats */
.beat { min-height: 100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding: 90px 24px; gap: 34px; position:relative; }
.beat-eyebrow {
  display:inline-flex; align-items:center; gap:8px; font-size:12px; font-weight:800; letter-spacing:0.12em; text-transform:uppercase;
  color:#D8C6FF; background:rgba(139,92,246,0.22); backdrop-filter:blur(16px);
  border:1px solid rgba(196,171,255,0.3); padding:7px 16px; border-radius:999px;
}
.beat h2 { font-weight:800; letter-spacing:-0.03em; font-size:clamp(26px,3.6vw,40px); text-align:center; max-width:640px; line-height:1.18; }
.beat .beat-sub { color:var(--canvas-ink-dim); font-size:15px; text-align:center; max-width:460px; margin-top:-18px; }

[data-reveal] { opacity:0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-visible { opacity:1; transform: translateY(0); }

/* ---------------------------------------------------------- beat 1 hero */
#beat-1 { min-height: 108vh; }
.hero-phone-inner { display:flex; flex-direction:column; height:100%; }

/* ---------------------------------------------- beat 2 trust side panel */
.beat-2-layout { display:flex; flex-direction:column; align-items:center; gap:24px; }
/* Generic orb-icon + number + label strip — first built for beat 2's trust
   count, now reused for beat 3's memory count too, hence the generic name. */
.metric-strip { display:flex; align-items:center; gap:14px; padding:16px 22px; }
.metric-strip .num { font-size:26px; font-weight:800; color:var(--canvas-ink); font-variant-numeric: tabular-nums; }
.metric-strip .lbl { font-size:12px; color:var(--canvas-ink-dim); font-weight:600; }
.video-bubble { display:flex; align-items:center; gap:10px; padding:10px 14px; }
.video-thumb { width:38px; height:38px; border-radius:10px; background:linear-gradient(135deg, var(--trust-b), var(--trust-c)); display:flex; align-items:center; justify-content:center; color:#fff; font-size:13px; flex-shrink:0; }
.video-wave { display:flex; align-items:center; gap:2px; height:18px; }
.video-wave span { width:2px; background:#fff; opacity:0.7; border-radius:1px; }

/* ----------------------------------------------- beat 3 memory timeline */
.beat-3-layout { display:flex; align-items:flex-start; justify-content:center; gap:48px; flex-wrap:wrap; }
.memory-rail { display:flex; flex-direction:column; gap:0; padding: 8px 0; }
.memory-node { display:flex; gap:14px; position:relative; padding-bottom:26px; }
.memory-node:last-child { padding-bottom:0; }
.memory-node::before { content:""; position:absolute; left:5px; top:16px; bottom:-6px; width:1.5px; background: var(--border-strong); }
.memory-node:last-child::before { display:none; }
.memory-dot { width:11px; height:11px; border-radius:50%; background: linear-gradient(135deg, var(--memory-b), var(--memory-c)); flex-shrink:0; margin-top:3px; box-shadow: 0 0 0 3px rgba(255,184,107,0.18); }
.memory-day { font-size:10.5px; font-weight:800; color: var(--canvas-ink-faint); letter-spacing:0.04em; text-transform:uppercase; }
.memory-label { font-size:13px; color:var(--canvas-ink); margin-top:2px; }
.memory-chip { display:inline-flex; padding:10px 16px; border-radius:14px; font-size:12px; font-weight:600; color:var(--ink); background: linear-gradient(120deg, var(--memory-a), rgba(201,184,232,0.5)); border:1px solid rgba(255,184,107,0.3); max-width: 260px; }
.memory-fields { display:grid; grid-template-columns:1fr; gap:8px; padding:20px; }
.memory-field { display:flex; justify-content:space-between; gap:16px; font-size:12.5px; padding:8px 0; border-bottom:1px solid var(--border); }
.memory-field:last-child { border-bottom:none; }
.memory-field { border-bottom-color: var(--canvas-border); }
.memory-field .f-label { color:var(--canvas-ink-faint); font-weight:700; letter-spacing:0.03em; }
.memory-field .f-value { color:var(--canvas-ink); text-align:right; }

/* ------------------------------------------------- beat 4 iPad profile */
.ipad-topbar {
  display:flex; align-items:center; justify-content:space-between; padding:22px 42px;
  background: linear-gradient(120deg, rgba(255,184,107,0.24), rgba(201,184,232,0.20) 55%, rgba(139,92,246,0.16));
}
.profile-card { width:100%; height:calc(100% - 92px); padding:24px 42px 34px; display:flex; gap:36px; align-items:center; }
.profile-left { flex:1; }
.profile-right { display:flex; gap:28px; align-items:center; }
.profile-avatar-lg {
  position:relative; width:56px; height:56px; border-radius:50%; overflow:hidden;
  background:radial-gradient(circle at 38% 34%, #C9AFFF 0%, #9B6FF0 30%, #7C3AED 62%, #501E9E 100%);
  box-shadow: 0 10px 24px -6px rgba(124,58,237,0.5), inset -6px -6px 12px rgba(20,6,50,0.4), inset 3px 3px 7px rgba(255,255,255,0.3);
  display:flex; align-items:center; justify-content:center; color:#fff; font-weight:900; font-size:20px;
}
.profile-avatar-lg::after {
  content:""; position:absolute; top:14%; left:20%; width:36%; height:26%;
  background:radial-gradient(ellipse, rgba(255,255,255,0.95), rgba(255,255,255,0) 72%);
  border-radius:50%;
}
.profile-handle { font-size:16px; font-weight:800; margin-top:10px; }
.profile-chips { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.profile-quote { font-size:12.5px; color:var(--ink-dim); margin-top:16px; font-style:italic; max-width:280px; }
.gauge-block, .ring-block { display:flex; flex-direction:column; align-items:center; gap:6px; }
.gauge-label, .ring-label { font-size:11px; color:var(--ink-dim); font-weight:700; text-align:center; }

/* ---------------------------------------------------- beat 5/6 desktop */
.dash-main { padding: 30px 34px; }
.dash-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:22px; }
.dash-head h4 { font-size:17px; font-weight:800; }
.dash-head .period { font-size:12px; color:var(--ink-faint); }
.donut-row { display:flex; align-items:center; gap:36px; flex-wrap:wrap; }
.donut-legend { display:flex; flex-direction:column; gap:12px; flex:1; min-width:200px; }
.legend-item { display:flex; align-items:center; gap:10px; font-size:13px; }
.legend-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.legend-item .lbl { flex:1; color:var(--ink-dim); }
.legend-item .val { font-weight:800; color:var(--ink); }
.cpl-row { display:flex; gap:18px; margin-top:22px; padding-top:18px; border-top:1px solid var(--border); flex-wrap:wrap; }
.cpl-item { font-size:12px; color:var(--ink-dim); }
.cpl-item b { color:var(--ink); }

/* A lead-in strip for the Campaign Performance section now, not a footer
   divider below it — cost-per-lead trend is a fact about the campaigns
   that follow, so it reads as part of that section, not bolted after it. */
.sparkline-block { display:flex; align-items:center; gap:16px; margin-bottom:22px; }

/* ------------------------------------------------ beat 7 command center */
.perf-grid { display:flex; flex-direction:column; gap:22px; }

/* ---------------------------------------------------------- beat 8 close */
#beat-8 { gap: 44px; }
.close-line { font-size:14px; color:var(--canvas-ink-dim); text-align:center; max-width:420px; }
.close-wordmark { font-size:22px; font-weight:900; letter-spacing:-0.02em; }

@media (max-width: 900px) {
  /* .profile-card is NOT re-flowed here on purpose: it lives inside
     .ipad-screen-inner, a fixed 640x470 layout that's scaled as one unit
     (see the ResizeObserver in index.html) so it renders identically at
     every viewport width, just smaller. Restyling it per-breakpoint would
     fight that scale transform. */
  .beat-3-layout { flex-direction:column; align-items:center; }
  .trio-wrap { flex-direction:column; align-items:center; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat-tile.wide { flex-direction: column; align-items: stretch; gap: 12px; }
  .stat-tile.wide .stat-progress-track { max-width: none; }
  .campaign-stats { flex-wrap: wrap; gap: 14px; }
  .dash-main { padding: 22px 18px; }

  .app-nav, .ipad-topbar { flex-wrap:wrap; gap:10px; padding:12px 16px; }
  .tab-bar { max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  .tab-bar::-webkit-scrollbar { display:none; }
  .btn-glass { flex-shrink:0; }
}
