/* ==========================================================================
   Alembic Scroll Experience — Styles

   Dark-mode narrative scroll with snap behavior, text reveals,
   data card overlay, progress dots, and static pricing section.

   Design tokens from ALEMBIC_DESIGN_SYSTEM.md.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Custom Properties (Dark Mode Context)
   -------------------------------------------------------------------------- */
.scroll-sections {
  --se-bg-deepest:      #060810;
  --se-bg-section:      #0a0d14;
  --se-bg-lighter:      #0e1219;

  --se-text-primary:    #FFFFFF;
  --se-text-secondary:  rgba(255, 255, 255, 0.55);
  --se-text-tertiary:   rgba(255, 255, 255, 0.3);

  --se-accent:          #4A9BE8;
  --se-accent-600:      #2383E2;
  --se-accent-glow:     rgba(35, 131, 226, 0.25);
  --se-accent-glow-strong: rgba(35, 131, 226, 0.4);

  --se-green:           #34A853;
  --se-green-bg:        rgba(52, 168, 83, 0.12);
  --se-amber:           #E8A830;
  --se-amber-bg:        rgba(232, 168, 48, 0.12);

  --se-border-subtle:   rgba(35, 131, 226, 0.12);
  --se-border-faint:    rgba(255, 255, 255, 0.06);

  --se-glass-bg:        rgba(12, 16, 24, 0.88);
  --se-glass-blur:      24px;

  --se-font-display:    'Fraunces', Georgia, serif;
  --se-font-body:       'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --se-font-mono:       'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --se-spring:          cubic-bezier(0.34, 1.56, 0.64, 1);
  --se-ease-out:        cubic-bezier(0, 0, 0.2, 1);
  --se-ease-in-out:     cubic-bezier(0.4, 0, 0.2, 1);
}


/* --------------------------------------------------------------------------
   1. Scroll Container
   -------------------------------------------------------------------------- */
.scroll-sections {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--se-bg-deepest);
  transition: background-color 0.8s var(--se-ease-in-out);
}

/* Page-mode override: removes internal scroll, sections flow in normal page layout */
.scroll-sections--page-mode {
  height: auto !important;
  overflow-y: visible !important;
  overflow-x: hidden;
}

/* Subtle noise texture overlay for depth */
.scroll-sections::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

/* Subtle radial glow that follows scroll */
.scroll-sections::after {
  content: '';
  position: fixed;
  top: 30%;
  left: 50%;
  width: 800px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    rgba(35, 131, 226, 0.04) 0%,
    rgba(35, 131, 226, 0.015) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}


/* --------------------------------------------------------------------------
   2. Individual Sections
   -------------------------------------------------------------------------- */
.scroll-section {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.scroll-section-inner {
  max-width: 640px;
  width: 100%;
  padding: 0 32px;
  text-align: center;
}


/* --------------------------------------------------------------------------
   3. Typography — Label, Headline, Body
   -------------------------------------------------------------------------- */

/* Label */
.scroll-section-label {
  font-family: var(--se-font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--se-accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;

  /* Reveal state */
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.5s var(--se-ease-out),
    transform 0.6s var(--se-spring);
}

/* Headline */
.scroll-section-headline {
  font-family: var(--se-font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  font-optical-sizing: auto;
  color: var(--se-text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 20px;

  /* Reveal state */
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.5s var(--se-ease-out),
    transform 0.6s var(--se-spring);
}

/* Body */
.scroll-section-body {
  font-family: var(--se-font-body);
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 400;
  color: var(--se-text-secondary);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;

  /* Reveal state */
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.5s var(--se-ease-out),
    transform 0.6s var(--se-spring);
}

/* V1 reveal class removed — kinetic-text.js manages reveal via its own CSS classes */


/* --------------------------------------------------------------------------
   4. CTA Section (Moment 9 — Promise)
   -------------------------------------------------------------------------- */
.scroll-section--cta .scroll-section-headline {
  font-size: clamp(40px, 6vw, 64px);
  white-space: nowrap;
  letter-spacing: -1px;
}

.scroll-section--cta .scroll-section-inner {
  max-width: 800px;
}

.scroll-section--cta .scroll-section-body {
  font-family: var(--se-font-display);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 24px);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 44px;
  max-width: 560px;
}

.scroll-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;

  /* Reveal state */
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.5s var(--se-ease-out),
    transform 0.6s var(--se-spring);
}

.scroll-cta-button {
  display: inline-block;
  font-family: var(--se-font-body);
  font-size: 17px;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--se-accent-600);
  padding: 18px 56px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow:
    0 0 50px var(--se-accent-glow),
    0 0 100px rgba(35, 131, 226, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.3s var(--se-spring),
    box-shadow 0.3s ease,
    background 0.2s ease;
}

.scroll-cta-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 70px var(--se-accent-glow-strong),
    0 0 120px rgba(35, 131, 226, 0.18),
    0 8px 32px rgba(35, 131, 226, 0.2);
  background: #1D73C9;
}

.scroll-cta-button:active {
  transform: translateY(0);
}

.scroll-cta-subtitle {
  font-family: var(--se-font-body);
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.3px;
}

.scroll-cta-secondary {
  font-family: var(--se-font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--se-accent);
  text-decoration: none;
  margin-top: 6px;
  opacity: 0.85;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.scroll-cta-secondary:hover {
  color: #fff;
  opacity: 1;
}


/* --------------------------------------------------------------------------
   5. Progress Indicator (Fixed Right)
   -------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.scroll-progress-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  padding: 0;
  cursor: pointer;
  transition:
    width 0.3s var(--se-spring),
    height 0.3s var(--se-spring),
    background 0.3s ease,
    box-shadow 0.3s ease;
  outline: none;
}

.scroll-progress-dot:hover {
  background: rgba(255, 255, 255, 0.35);
}

.scroll-progress-dot:focus-visible {
  outline: 2px solid var(--se-accent);
  outline-offset: 4px;
}

.scroll-progress-dot--active {
  width: 6px;
  height: 6px;
  background: var(--se-accent);
  box-shadow: 0 0 12px rgba(74, 155, 232, 0.5), 0 0 4px rgba(74, 155, 232, 0.3);
}


/* --------------------------------------------------------------------------
   6. Scroll Encouragement (Fixed Bottom Center)
   -------------------------------------------------------------------------- */
.scroll-encouragement {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scroll-encouragement--hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  pointer-events: none;
}

.scroll-encouragement-label {
  font-family: var(--se-font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--se-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.scroll-encouragement-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--se-accent), transparent);
  animation: scroll-line-pulse 2s ease-in-out infinite;
  transform-origin: top;
}

@keyframes scroll-line-pulse {
  0%, 100% {
    opacity: 0.4;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.8;
    transform: scaleY(1.2);
  }
}


/* V1 Data Card removed — replaced by extraction-demo.css */


/* --------------------------------------------------------------------------
   8. Pricing Section (Static, Below Scroll Snap)
   -------------------------------------------------------------------------- */
.scroll-pricing {
  position: relative;
  z-index: 2;
  background: var(--se-bg-section);
  border-top: 1px solid var(--se-border-faint);
  padding: 100px 40px 120px;

  /* This section is NOT snapped — it's part of normal flow */
  scroll-snap-align: none;
}

.scroll-pricing-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.scroll-pricing-header {
  text-align: center;
  margin-bottom: 56px;
}

.scroll-pricing-header .scroll-section-label {
  /* Override reveal states — pricing label is always visible */
  opacity: 1;
  transform: none;
}

.scroll-pricing-title {
  font-family: var(--se-font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 500;
  font-optical-sizing: auto;
  color: var(--se-text-primary);
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.scroll-pricing-title em {
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
}

/* Pricing grid */
.scroll-pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Individual card */
.scroll-pricing-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--se-border-faint);
  border-radius: 16px;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.scroll-pricing-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Featured card */
.scroll-pricing-card--featured {
  border-color: rgba(35, 131, 226, 0.3);
  background: rgba(35, 131, 226, 0.06);
  box-shadow: 0 0 0 1px rgba(35, 131, 226, 0.15), 0 8px 32px rgba(35, 131, 226, 0.08);
}

.scroll-pricing-card--featured:hover {
  border-color: rgba(35, 131, 226, 0.45);
}

/* Badge */
.scroll-pricing-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--se-font-body);
  font-size: 11px;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--se-accent-600);
  padding: 3px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Tier name */
.scroll-pricing-name {
  font-family: var(--se-font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--se-text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

/* Price */
.scroll-pricing-price {
  font-family: var(--se-font-display);
  font-size: 36px;
  font-weight: 500;
  color: var(--se-text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.scroll-pricing-period {
  font-size: 16px;
  font-weight: 400;
  color: var(--se-text-tertiary);
}

/* Description */
.scroll-pricing-desc {
  font-family: var(--se-font-body);
  font-size: 13px;
  color: var(--se-text-secondary);
  margin-bottom: 24px;
}

/* Features list */
.scroll-pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  flex: 1;
}

.scroll-pricing-features li {
  font-family: var(--se-font-body);
  font-size: 14px;
  color: var(--se-text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scroll-pricing-features li::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 11.5L3 8l1-1 2.5 2.5L12 4l1 1-6.5 6.5z' fill='%234A9BE8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}

/* Buttons */
.scroll-pricing-btn {
  width: 100%;
  font-family: var(--se-font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition:
    all 0.2s var(--se-ease-in-out);
  margin-top: auto;
}

.scroll-pricing-btn--primary {
  background: var(--se-accent-600);
  color: #FFFFFF;
  border: none;
}

.scroll-pricing-btn--primary:hover {
  background: #1D73C9;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(35, 131, 226, 0.3);
}

.scroll-pricing-btn--ghost {
  background: transparent;
  color: var(--se-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.scroll-pricing-btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--se-text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* Usage note */
.scroll-pricing-note {
  font-family: var(--se-font-mono);
  font-size: 12px;
  color: var(--se-text-tertiary);
  text-align: center;
  margin-top: 32px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}


/* --------------------------------------------------------------------------
   9. Responsive — Tablet (768–1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .scroll-section-headline {
    font-size: clamp(30px, 4.5vw, 44px);
  }

  .scroll-section-body {
    font-size: clamp(15px, 1.6vw, 18px);
  }

  .scroll-section--cta .scroll-section-headline {
    font-size: clamp(34px, 5vw, 52px);
    white-space: normal;
  }

  /* Progress indicator: smaller gap */
  .scroll-progress {
    right: 20px;
    gap: 12px;
  }

  /* Pricing: 2 columns */
  .scroll-pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 720px;
    margin: 0 auto;
  }

  .scroll-pricing {
    padding: 80px 32px 100px;
  }
}


/* --------------------------------------------------------------------------
   10. Responsive — Mobile (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .scroll-section-inner {
    padding: 0 24px;
  }

  .scroll-section-label {
    font-size: 10px;
    letter-spacing: 2px;
  }

  .scroll-section-headline {
    font-size: clamp(28px, 7vw, 38px);
    letter-spacing: -0.3px;
  }

  .scroll-section-body {
    font-size: 16px;
    line-height: 1.65;
  }

  .scroll-section--cta .scroll-section-headline {
    font-size: clamp(32px, 8vw, 44px);
    white-space: normal;
  }

  .scroll-section--cta .scroll-section-body {
    font-size: 17px;
  }

  .scroll-cta-button {
    padding: 14px 36px;
    font-size: 15px;
  }

  /* Hide progress dots on mobile */
  .scroll-progress {
    display: none;
  }

  /* Pricing: single column */
  .scroll-pricing {
    padding: 64px 20px 80px;
  }

  .scroll-pricing-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
    gap: 16px;
  }

  .scroll-pricing-card {
    padding: 28px 24px;
  }

  .scroll-pricing-title {
    font-size: clamp(28px, 6vw, 40px);
  }

  .scroll-pricing-price {
    font-size: 32px;
  }

  /* Scroll encouragement smaller */
  .scroll-encouragement {
    bottom: 20px;
  }

  .scroll-encouragement-line {
    height: 28px;
  }
}


/* --------------------------------------------------------------------------
   11. Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-sections,
  .scroll-section-label,
  .scroll-section-headline,
  .scroll-section-body,
  .scroll-cta-wrap,
  .scroll-cta-button,
  .scroll-encouragement,
  .scroll-encouragement-line,
  .scroll-progress-dot,
  .scroll-pricing-card,
  .scroll-pricing-btn {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  /* Show content immediately */
  .scroll-section-label,
  .scroll-section-headline,
  .scroll-section-body,
  .scroll-cta-wrap {
    opacity: 1;
    transform: none;
  }
}


/* --------------------------------------------------------------------------
   12. Print
   -------------------------------------------------------------------------- */
@media print {
  .scroll-sections {
    height: auto;
    overflow: visible;
    scroll-snap-type: none;
  }

  .scroll-section {
    height: auto;
    min-height: auto;
    page-break-inside: avoid;
    padding: 40px 0;
  }

  .scroll-progress,
  .scroll-encouragement {
    display: none;
  }

  .scroll-section-label,
  .scroll-section-headline,
  .scroll-section-body,
  .scroll-cta-wrap {
    opacity: 1;
    transform: none;
  }
}
