/* ===== Base ===== */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

/* subtle paper grain */
.noise-bg {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.12 0 0 0 0 0.14 0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.6;
  mix-blend-mode: multiply;
}

/* ===== 320x50 Banner Ad (hand-coded) ===== */
.banner-320 {
  position: relative;
  width: 320px;
  height: 50px;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 10px;
  background: linear-gradient(135deg, #0a3a5e 0%, #072845 50%, #0a3a5e 100%);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.banner-320:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(10,58,94,0.3); }
.banner-320-shine {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shine 3s ease-in-out 1s infinite;
  pointer-events: none;
}
@keyframes shine {
  0%, 60% { transform: translateX(-100%); }
  100%    { transform: translateX(100%); }
}
.banner-320-logo {
  display: flex; align-items: center; gap: 3px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.18);
  padding-right: 8px;
}
.banner-320-check {
  color: #FFC845;
  font-size: 16px; font-weight: 900; line-height: 1;
}
.banner-320-brand {
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
}
.banner-320-copy {
  display: flex; flex-direction: column; justify-content: center; line-height: 1.15;
  flex: 1; min-width: 0;
}
.banner-320-headline {
  color: #fff; font-size: 11px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.banner-320-sub {
  color: rgba(255,255,255,0.75); font-size: 9px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.banner-320-sub b { color: #FFC845; font-weight: 800; }
.banner-320-cta {
  flex-shrink: 0;
  background: #FFC845;
  color: #111;
  font-size: 10px; font-weight: 800;
  padding: 6px 9px;
  border-radius: 4px;
  white-space: nowrap;
  transition: background 0.2s ease;
  position: relative; z-index: 1;
}
.banner-320:hover .banner-320-cta { background: #FFD45A; }

/* ===== A/B Toggle ===== */
.ab-toggle.active {
  background: #2D5F5F;
  color: #FFFFFF;
}

/* ===== A/B Tabs (Hypothesis / KPIs / Setup) ===== */
.ab-tab { color: rgba(31,30,34,0.55); background: rgba(31,30,34,0.02); }
.ab-tab:hover { background: rgba(31,30,34,0.04); color: #1F1E22; }
.ab-tab .ab-tab-bar { transform: scaleX(0); }
.ab-tab.is-active { background: #FFFFFF; color: #1F1E22; }
.ab-tab.is-active .ab-tab-bar { transform: scaleX(1); }
.ab-pane { animation: abPaneIn 0.4s ease-out; }
@keyframes abPaneIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== A/B Phone Frame ===== */
.ab-phone {
  position: relative;
  width: 280px;
  max-width: 100%;
  aspect-ratio: 9 / 17;
  background: #1F1E22;
  border-radius: 38px;
  padding: 8px;
  box-shadow: 0 0 0 2px rgba(31,30,34,0.15), 0 30px 60px -20px rgba(31,30,34,0.25), inset 0 0 0 1px rgba(255,255,255,0.05);
}
.ab-phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 30px;
  overflow: hidden;
}
.ab-phone-notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 18px;
  background: #000;
  border-radius: 999px;
  z-index: 20;
}
@media (min-width: 768px) {
  .ab-phone { width: 320px; }
}

/* ===== Funnel ===== */
.funnel-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #FFFFFF;
  border: 1px solid rgba(31,30,34,0.10);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin: 0 auto;
  transition: all 0.3s;
  position: relative;
  color: #1F1E22;
}
.funnel-step.warn {
  border-color: rgba(184, 88, 56, 0.35);
  background: linear-gradient(90deg, rgba(184,88,56,0.10), rgba(184,88,56,0.04));
}
.funnel-step .alert {
  position: absolute;
  right: -10px; top: -10px;
  background: #B85838;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 11px;
  width: 22px; height: 22px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(184, 88, 56, 0.5); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(184, 88, 56, 0); }
}

/* ===== iPhone frame (Part 3) ===== */
.iphone-frame {
  position: relative;
  width: 260px;
  height: 540px;
  background: #1F1E22;
  border-radius: 38px;
  padding: 8px;
  box-shadow: 0 0 0 2px rgba(31,30,34,0.15), 0 30px 60px -20px rgba(31,30,34,0.25), inset 0 0 0 1px rgba(255,255,255,0.05);
}
.iphone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 30px;
  overflow: hidden;
}
.iphone-notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 22px;
  background: #000;
  border-radius: 999px;
  z-index: 20;
}

/* nav active state */
.nav-link.active {
  color: #1F1E22;
  background: rgba(45, 95, 95, 0.08);
}

/* ===== Bottleneck Accordion ===== */
.bottleneck > summary { list-style: none; }
.bottleneck > summary::-webkit-details-marker { display: none; }
.bottleneck > summary::marker { content: ""; }
.bottleneck > div {
  animation: bottleneckOpen 0.35s ease-out;
}
@keyframes bottleneckOpen {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Bottleneck cards (linked-hover with funnel) ===== */
.bottleneck-card.is-active {
  border-color: rgba(184, 88, 56, 0.5);
  background: linear-gradient(90deg, rgba(184,88,56,0.06), #fff 60%);
  transform: translateX(4px);
  box-shadow: 0 25px 60px -30px rgba(184, 88, 56, 0.45);
}
.bottleneck-card.is-active > div:first-child { opacity: 1; }
.bottleneck-card.is-active span.font-mono.text-3xl { color: #B85838; }

.funnel-step.is-active {
  transform: scale(1.03) translateX(4px);
  box-shadow: 0 15px 35px -15px rgba(184, 88, 56, 0.5);
}

/* ===== Findings Spotlight ===== */
.finding-chip { border: 1px solid transparent; }
.finding-chip:hover { background: rgba(31,30,34,0.04); }
.finding-chip.is-active {
  background: #FFFFFF;
  border-color: rgba(31,30,34,0.10);
  box-shadow: 0 6px 20px -10px rgba(31,30,34,0.15);
}
.finding-chip.is-active .finding-dot {
  box-shadow: 0 0 0 4px rgba(74, 124, 89, 0.18);
  animation: pulseDot 1.5s ease-in-out infinite;
}
.finding-chip.is-active[data-type="warn"] .finding-dot {
  box-shadow: 0 0 0 4px rgba(184, 88, 56, 0.18);
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.25); }
}
.finding-panel { animation: findingIn 0.45s ease-out; }
@keyframes findingIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* responsive */
@media (max-width: 768px) {
  .iphone-frame { width: 220px; height: 460px; }
}
