/* ══════════════════════════════════════════════════════════════════
   STILL ALIVE - DESIGN SYSTEM & CORE STYLES (v2.0)
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* Colors */
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --emerald: #10B981;
  --amber: #F59E0B;
  --red: #EF4444;
  --dark: #111827;
  --gray-light: #F9FAFB;
  --gray-border: #E5E7EB;
  --gray-text: #4B5563;
  --gray-text-light: #9CA3AF;
  
  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-main);
  
  /* Spacing */
  --container-max: 1200px;
}

/* 1. RESET & BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: white;
  color: var(--dark);
  line-height: 1.5;
  overflow-x: hidden;
}

section {
  padding: 80px 20px;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: 36px;
  text-align: center;
}

.section-subheadline {
  text-align: center;
  color: var(--gray-text);
  margin-top: 16px;
  font-size: 18px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* 2. NAVIGATION */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 40px;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
  color: var(--dark);
}

.nav-logo span {
  color: var(--emerald);
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-text);
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

/* Language Switcher */
.lang-switcher {
  position: relative;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  color: var(--dark);
  padding: 4px 8px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  background: var(--gray-light);
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  display: none;
  flex-direction: column;
  min-width: 80px;
  margin-top: 8px;
  overflow: hidden;
}

.lang-switcher:hover .lang-dropdown {
  display: flex;
}

.lang-dropdown a {
  padding: 10px 16px;
  color: var(--gray-text);
  text-decoration: none;
}

.lang-dropdown a:hover {
  background: var(--gray-light);
  color: var(--primary);
}

.btn-app-store {
  background: var(--dark);
  color: white;
  padding: 10px 20px;
  border-radius: 80px;
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.btn-app-store:hover {
  transform: scale(1.05);
}

/* 3. BUTTONS */
.cta-primary {
  background: var(--primary);
  color: white;
  padding: 16px 32px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
  text-align: center;
  border: none;
  cursor: pointer;
}

.cta-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.cta-subtext {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  font-weight: 400;
  margin-top: 4px;
}

/* 4. HERO SECTION */
.hero-visual {
  position: relative;
}

.hero-animation-container {
  background: #0D1117;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.05);
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.hero-svg {
  width: 100%;
  height: auto;
}

/* Step Animations */
.anim-step-1, .anim-step-2, .anim-step-3 {
  opacity: 0;
}

@keyframes cycleSteps {
  0%, 30% { opacity: 0; }
  2%, 28% { opacity: 1; }
}

.anim-step-1 { animation: cycleSteps 9s infinite; }
.anim-step-2 { animation: cycleSteps 9s infinite 3s; }
.anim-step-3 { animation: cycleSteps 9s infinite 6s; }

/* Hand Tap */
.tap-button { transform-origin: 200px 220px; }
@keyframes handTap {
  0%, 10% { transform: translateY(0); }
  2%, 8% { transform: translateY(-5px); }
}
.hand-icon { animation: handTap 9s infinite; }

/* Timer Progress */
.timer-progress {
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
}
@keyframes timerRun {
  0% { stroke-dashoffset: 314; }
  100% { stroke-dashoffset: 0; }
}
.anim-step-2 .timer-progress { animation: timerRun 3s linear forwards; }

/* Alert Pulse */
@keyframes alertPulse {
  0% { r: 0; opacity: 1; }
  100% { r: 150; opacity: 0; }
}
.alert-pulse { animation: alertPulse 1.5s infinite; }

/* Labels */
.anim-labels {
  display: flex;
  margin-top: 20px;
  gap: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.anim-labels span { opacity: 0.3; transition: opacity 0.3s; }
.anim-step-1:not([style*="opacity: 0"]) ~ .anim-labels .label-1,
.anim-step-2:not([style*="opacity: 0"]) ~ .anim-labels .label-2,
.anim-step-3:not([style*="opacity: 0"]) ~ .anim-labels .label-3 {
  opacity: 1;
  color: var(--emerald);
}

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

.hero h1 {
  font-size: 72px;
  letter-spacing: -2px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--dark) 0%, #374151 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subheadline {
  font-size: 22px;
  line-height: 1.6;
  color: var(--gray-text);
  margin-bottom: 40px;
  max-width: 550px;
}

.trust-inline {
  display: flex;
  gap: 24px;
  margin-top: 32px;
  color: var(--gray-text-light);
  font-size: 14px;
  font-weight: 500;
}

.trust-inline span {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 5. CALCULATOR (Section 4.2.5 in Spec) */
.section-calculator {
  background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
}

.calculator-form {
  max-width: 800px;
  margin: 40px auto 0;
}

.calculator-question {
  border: none;
  padding: 0;
  margin-bottom: 48px;
}

.calculator-question legend {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 24px;
  width: 100%;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.option-card {
  position: relative;
  display: block;
  cursor: pointer;
  border: 2px solid var(--gray-border);
  border-radius: 16px;
  padding: 32px 16px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
}

.option-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.1);
}

.option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card:has(input:checked) {
  border-color: var(--primary);
  background: #EFF6FF;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.option-icon {
  display: block;
  font-size: 32px;
  margin-bottom: 8px;
}

.option-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.btn-calculate {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 48px auto 0;
  padding: 18px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}

.calculator-result {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s ease;
  margin-top: 48px;
}

.calculator-result.visible {
  opacity: 1;
  max-height: 2000px;
}

.result-container {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  max-width: 700px;
  margin: 0 auto;
}

/* 6. TRUST BLOCK (Section 4.3.4 in Spec) */
.trust-block {
  background: #F3F4F6;
  padding: 60px 20px;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.trust-item {
  text-align: center;
  padding: 32px 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.trust-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* 7. HOW IT WORKS */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-top: 60px;
}

.step {
  text-align: center;
}

.step-number {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 24px;
}

/* 8. COMPARISON TABLE (Section 4.6.3 in Spec) */
.comparison-section {
  padding: 80px 20px;
  background: white;
}

.comparison-table-wrapper {
  overflow-x: auto;
  margin: 40px 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.comparison-table th, .comparison-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-border);
}

.comparison-table th {
  background: #F9FAFB;
  font-weight: 600;
  color: #111827;
}

.comparison-table .highlight-col {
  background: #EFF6FF;
  font-weight: 600;
  color: var(--primary);
}

/* 9. FAQ ACCORDION (Section 4.8.4) */
.faq-section { background: #F9FAFB; }
.faq-accordion { max-width: 800px; margin: 40px auto 0; }
.faq-item { background: white; border-radius: 8px; margin-bottom: 12px; border: 1px solid var(--gray-border); }

.faq-item summary {
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::after { content: '+'; float: right; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 24px 20px; color: var(--gray-text); }

/* 10. FINAL CTA */
.final-cta {
  padding: 100px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #2563EB 100%);
  color: white;
  text-align: center;
}

.final-cta h2 { font-size: 36px; margin-bottom: 16px; }
.cta-final {
  background: white;
  color: var(--primary);
  padding: 18px 48px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  display: inline-block;
}

/* 11. FOOTER */
.site-footer {
  margin-top: 80px;
  padding: 48px 20px;
  border-top: 1px solid var(--gray-border);
  text-align: center;
}
.dark-mode .site-footer {
  border-top-color: rgba(255, 255, 255, 0.05);
}
.footer-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
@media (min-width: 768px) {
  .footer-container {
    flex-direction: row;
  }
}
.footer-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.5px;
}
.footer-brand span {
  color: var(--emerald);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-links a {
  color: var(--gray-text-light);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--primary);
}

/* 12. STORY TEASER & EXTRAS */
.story-teaser {
  padding: 80px 20px;
  background: white;
}
.how-it-works {
  padding: 80px 20px;
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero h1 { font-size: 40px; }
  .trust-inline { flex-direction: column; align-items: center; }
  .navbar { padding: 0 20px; }
  
  .mobile-cta-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--primary);
    padding: 12px 20px;
    z-index: 999;
  }

  /* Mobile: Swipe Carousel for Stories */
  .stories-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 20px;
    margin-left: -20px;
    margin-right: -20px;
    -webkit-overflow-scrolling: touch;
  }
  
  .story-item {
    flex: 0 0 85%;
    scroll-snap-align: center;
  }

  .section-hero { padding-top: 120px !important; padding-bottom: 40px !important; }
  .chapter-title { font-size: 22px; }
  .article-prose { padding: 0 20px; }
}

/* ══════════════════════════════════════════════════════════════════
   STORY MODE & PILLAR ARTICLE STYLES
   ══════════════════════════════════════════════════════════════════ */

/* Layout sections for article pages */
.section-hero {
  padding-top: 140px;
  padding-bottom: 60px;
  padding-left: 20px;
  padding-right: 20px;
}

.section-body {
  padding: 60px 20px 80px;
}

.section-stats {
  padding: 40px 20px;
}

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

/* CTA Box used inside articles */
.cta-box {
  margin-top: 80px;
  padding: 60px;
  text-align: center;
  border-radius: 24px;
}

/* Utility */
.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.dark-mode {
  background-color: #030712;
  color: white;
}

.article-prose {
  max-width: 720px;
  margin: 0 auto;
}

.article-prose p {
  font-size: 18px;
  line-height: 1.8;
  color: var(--gray-text);
  margin-bottom: 24px;
}

.dark-mode .article-prose p {
  color: #9CA3AF;
}

.article-prose .lead {
  font-size: 22px;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 32px;
}

.dark-mode .article-prose .lead {
  color: white;
}

.chapter-title {
  font-size: 28px;
  margin: 48px 0 24px;
  text-align: left;
}

.pull-quote {
  border-left: 4px solid var(--primary);
  padding: 24px 32px;
  margin: 40px 0;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 0 16px 16px 0;
}

.pull-quote p {
  font-family: 'Playfair Display', serif;
  font-size: 20px !important;
  font-style: italic;
  color: var(--dark) !important;
  margin: 0 !important;
}

.dark-mode .pull-quote p {
  color: white !important;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin: 48px 0;
}

.stat-item {
  background: white;
  padding: 32px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--gray-border);
}

.dark-mode .stat-item {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.1);
}

.stat-val {
  font-size: 40px;
  font-weight: 900;
  display: block;
  margin-bottom: 8px;
}

.stat-desc {
  font-size: 14px;
  color: var(--gray-text-light);
  text-transform: uppercase;
  font-weight: 700;
}

/* Navbar overrides for dark pages */
.dark-nav {
  background: rgba(3, 7, 18, 0.9) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-nav .nav-logo, .dark-nav .nav-links a {
  color: white !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}
