/* ==========================================================================
   The AI Advertising Operating System — Funnel CSS Design System
   Matches manuscript visual identity: Deep Navy, Crimson Red & Magenta Accents
   ========================================================================== */

:root {
  --ink: #0d0d15;
  --paper: #fbfaf7;
  --bg-dark: #12121e;
  --bg-card: #1a1a2b;
  --bg-card-hover: #222238;
  --accent-primary: #e74c3c;
  --accent-hover: #c0392b;
  --accent-secondary: #832c5d;
  --accent-gradient: linear-gradient(135deg, #16162a 0%, #832c5d 50%, #e74c3c 100%);
  --cta-gradient: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  --gold-accent: #f1c40f;
  --success: #2ecc71;
  --muted: #8e8e9e;
  --rule: rgba(255, 255, 255, 0.1);
  --rule-light: #e4e1d8;
  --text-light: #f8f9fa;
  --text-dim: #b0b0c2;
  --text-dark: #1e1e2d;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 50px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 8px 30px rgba(231, 76, 60, 0.35);
  --shadow-book: -15px 15px 35px rgba(0, 0, 0, 0.6), 0 0 15px rgba(131, 44, 93, 0.3);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --container-width: 1140px;
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--ink);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #ff6b5b;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-light);
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #f1a9a0 50%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-highlight {
  color: var(--gold-accent);
}

.section-tag {
  display: inline-block;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-primary);
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

/* Sticky Urgency Header */
.sticky-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(13, 13, 21, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(231, 76, 60, 0.3);
  padding: 10px 0;
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.sticky-bar.visible {
  transform: translateY(0);
}

.sticky-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.sticky-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.sticky-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffbe76;
}

.timer-box {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 1rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sticky-pricing {
  display: flex;
  align-items: center;
  gap: 10px;
}

.strike-price {
  text-decoration: line-through;
  color: var(--muted);
  font-size: 0.9rem;
}

.current-price {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--gold-accent);
}

/* CTA Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: var(--radius-md);
}

.btn-primary {
  background: var(--cta-gradient);
  color: #ffffff;
  padding: 16px 36px;
  font-size: 1.15rem;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(231, 76, 60, 0.5);
  color: #ffffff;
}

.btn-pulse {
  animation: pulse-glow 2.5s infinite;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.6);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(231, 76, 60, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
  }
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}

/* Hero Section */
.hero {
  padding: 120px 0 80px;
  background: var(--accent-gradient);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(to top, var(--ink), transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
  align-items: center;
}

.hero-content h1 {
  font-size: 2.8rem;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.hero-subheadline {
  font-size: 1.25rem;
  color: var(--text-dim);
  margin-bottom: 30px;
  line-height: 1.5;
}

.hero-price-anchor {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.badge-save {
  background: #27ae60;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trust-item svg {
  color: var(--success);
}

/* 3D Book Mockup Container */
.book-wrapper {
  perspective: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.book-3d {
  width: 280px;
  height: 410px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-22deg) rotateX(8deg);
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: var(--shadow-book);
  border-radius: 4px 12px 12px 4px;
}

.book-3d:hover {
  transform: rotateY(-10deg) rotateX(4deg) scale(1.03);
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px 12px 12px 4px;
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 100%;
  background: linear-gradient(90deg, #111, #333 50%, #111);
  transform: rotateY(90deg) translateZ(0px);
  transform-origin: left;
}

/* Problem Section */
.section-padding {
  padding: 90px 0;
}

.bg-darker {
  background-color: #09090e;
}

.section-header {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 60px;
}

.section-header h2 {
  font-size: 2.2rem;
  margin-bottom: 15px;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}

.problem-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 30px;
  border-radius: var(--radius-md);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.problem-card:hover {
  transform: translateY(-5px);
  border-color: rgba(231, 76, 60, 0.4);
}

.problem-icon {
  width: 48px;
  height: 48px;
  background: rgba(231, 76, 60, 0.15);
  color: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.problem-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.problem-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Value Stack Section */
.value-stack-box {
  background: var(--bg-card);
  border: 2px dashed rgba(231, 76, 60, 0.4);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.stack-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.stack-item:last-child {
  border-bottom: none;
}

.stack-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.stack-title svg {
  color: var(--success);
  flex-shrink: 0;
}

.stack-val {
  font-weight: 700;
  color: var(--muted);
  text-decoration: line-through;
}

.stack-total-bar {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 2px solid var(--accent-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.stack-total-text {
  font-size: 1.3rem;
  font-weight: 700;
}

.stack-final-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold-accent);
}

/* Table of Contents Accordion */
.toc-grid {
  max-width: 850px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.accordion-item.active {
  border-color: var(--accent-primary);
}

.accordion-header {
  width: 100%;
  padding: 20px 25px;
  background: none;
  border: none;
  color: var(--text-light);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
}

.accordion-header:hover {
  background: var(--bg-card-hover);
}

.accordion-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
  color: var(--accent-primary);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  background: rgba(0, 0, 0, 0.2);
}

.accordion-body {
  padding: 20px 25px;
  color: var(--text-dim);
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.accordion-body ul {
  list-style: none;
  padding-left: 0;
}

.accordion-body li {
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-body li::before {
  content: '▸';
  color: var(--accent-primary);
}

/* Author Section */
.author-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 40px;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.author-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 4px solid var(--accent-primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
}

.author-bio h3 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.author-title {
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 16px;
  display: block;
}

/* Excerpt Box */
.excerpt-box {
  background: #141422;
  border-left: 4px solid var(--accent-primary);
  padding: 30px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  max-width: 850px;
  margin: 0 auto;
}

.excerpt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.excerpt-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-accent);
  background: rgba(241, 196, 15, 0.15);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* Social Proof Box */
.early-reader-box {
  background: rgba(131, 44, 93, 0.15);
  border: 1px solid rgba(131, 44, 93, 0.4);
  padding: 30px;
  border-radius: var(--radius-md);
  text-align: center;
  max-width: 750px;
  margin: 0 auto;
}

/* Final CTA Section */
.final-cta {
  background: var(--accent-gradient);
  padding: 100px 0;
  text-align: center;
}

.final-cta h2 {
  font-size: 2.6rem;
  margin-bottom: 20px;
}

.final-cta p {
  font-size: 1.2rem;
  color: var(--text-dim);
  max-width: 650px;
  margin: 0 auto 35px;
}

/* Footer */
footer {
  background: #07070b;
  border-top: 1px solid var(--rule);
  padding: 40px 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text-light);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-price-anchor {
    justify-content: center;
  }

  .trust-row {
    justify-content: center;
  }

  .author-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .sticky-bar-content {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .sticky-brand {
    display: none;
  }

  .hero {
    padding: 100px 0 60px;
  }

  .section-padding {
    padding: 60px 0;
  }

  .value-stack-box {
    padding: 25px;
  }

  .stack-item {
    font-size: 0.9rem;
  }

  .stack-final-price {
    font-size: 1.8rem;
  }

  .final-cta h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .btn-primary {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
  }

  .book-3d {
    width: 220px;
    height: 320px;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
