/* ==========================================================================
   NewsLab AI — Luxury dark editorial (shared tokens)
   ========================================================================== */
:root,
[data-theme="light"] {
  --color-bg: #0b1626;
  --color-bg-deep: #060d18;
  --color-surface: #101d31;
  --color-surface-2: #142238;
  --color-surface-3: #1a2941;
  --color-border: #24344d;
  --color-divider: #24344d;
  --color-text: #e9e4d8;
  --color-text-muted: #9aa5b8;
  --color-text-faint: #4a5468;
  --color-primary: #c9b896;
  --color-primary-2: #e0cfa8;
  --color-accent: #9aa5b8;
  --color-accent-2: #e9e4d8;
  --color-accent-hover: #e9e4d8;
  --color-lavender: #b9a6d6;
  --color-grid: rgba(233, 228, 216, 0.05);
  --color-glow: rgba(233, 228, 216, 0.08);

  --bg-primary: var(--color-bg);
  --bg-secondary: var(--color-surface);
  --bg-tertiary: var(--color-surface-2);
  --surface: var(--color-surface);
  --surface-hover: var(--color-surface-3);
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text-muted);
  --text-muted: var(--color-text-faint);
  --accent-primary: var(--color-primary);
  --accent-secondary: var(--color-accent-2);
  --accent-tertiary: #c9b07a;
  --gradient-primary: linear-gradient(135deg, var(--color-surface-2) 0%, var(--color-surface-3) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--color-bg-deep) 0%, var(--color-surface) 100%);
  --gradient-bg: linear-gradient(135deg, var(--color-bg-deep) 0%, var(--color-bg) 50%, var(--color-surface) 100%);
  --border-color: var(--color-border);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 32px var(--color-glow);

  --bg: var(--color-bg);
  --surface2: var(--color-surface-2);
  --border: var(--color-border);
  --accent: var(--color-primary);
  --accent2: var(--color-text-muted);
  --accent3: #9cb8a8;
  --accent4: #c9b07a;
  --accent5: #c49a9a;
  --text: var(--color-text);
  --text-dim: var(--color-text-faint);
  --chatgpt-color: #10a37f;
  --claude-color: #cc785c;
  --gemini-color: #4285f4;
  --deepseek-color: #c97d8f;
  --perplexity-color: #6d8fa8;
  --grok-color: #f5a623;
  --max-w: 760px;
  --radius: 10px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-primary: "Inter", sans-serif;
  --font-heading: "Playfair Display", serif;
  --font-mono: "JetBrains Mono", monospace;
}

[data-theme="dark"] {
  --color-bg: #060d18;
  --color-bg-deep: #040914;
  --color-surface: #0b1626;
  --color-surface-2: #101d31;
  --color-surface-3: #142238;
  --color-border: #223148;
  --color-divider: #223148;
  --color-text: #e9e4d8;
  --color-text-muted: #9aa5b8;
  --color-text-faint: #4a5468;
  --color-primary: #c9b896;
  --color-primary-2: #e0cfa8;
  --color-accent: #9aa5b8;
  --color-accent-2: #e9e4d8;
  --color-accent-hover: #e9e4d8;
  --color-lavender: #b9a6d6;
  --color-grid: rgba(233, 228, 216, 0.05);
  --color-glow: rgba(233, 228, 216, 0.1);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

/* ==========================================================================
   Homepage
   ========================================================================== */
body.site-home {
    font-family: var(--font-primary);
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
  }
  
  /* Animated background with gradient orbs */
  .background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
  }
  
  .gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
  }
  
  .orb-1 {
    width: 400px;
    height: 400px;
    background: var(--gradient-secondary);
    opacity: 0.35;
    top: 10%;
    left: 10%;
    animation: float 15s ease-in-out infinite;
  }
  
  .orb-2 {
    width: 300px;
    height: 300px;
    background: var(--gradient-primary);
    bottom: 10%;
    right: 10%;
    animation: float 12s ease-in-out infinite;
  }
  
  .orb-3 {
    width: 200px;
    height: 200px;
    background: var(--gradient-secondary);
    top: 50%;
    left: 50%;
    animation: float 18s ease-in-out infinite;
  }
  
  @keyframes float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-20px, -20px); }
    50% { transform: translate(20px, 20px); }
    75% { transform: translate(20px, -20px); }
  }
  
  /* Container */
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
  }
  
  /* Section styling */
  section {
    padding: 6rem 0;
    position: relative;
  }
  
  /* Hero section */
  .hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
  }
  
  .hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
  }
  
  .hero-badge {
    display: inline-block;
    background: var(--color-grid);
    color: var(--accent-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
  }
  
  .hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    font-family: var(--font-heading);
  }
  
  .title-line {
    display: block;
  }
  
  .hero-tagline {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
  }
  
  /* Section titles */
  .section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    font-family: var(--font-heading);
    text-align: center;
  }
  
  /* Section subtitles */
  .section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem auto;
    line-height: 1.6;
  }
  
  /* Section header */
  .section-header {
    margin-bottom: 3rem;
  }
  
  
  
  /* Text gradients */
  .text-gradient {
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  /* Navigation Bar */
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: color-mix(in srgb, var(--color-bg-deep) 88%, transparent);
    padding: 0.25rem 0;
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(20px);
  }

  .navbar .container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
  }

  .navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 0.5px;
  }

  .navbar-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0;
    margin-bottom: 0;
  }
  
  /* Implementation guides section */
  .implementation-guides {
    background: var(--color-grid);
  }
  
  /* Scroll indicator */
  .scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  
  @keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
      transform: translateX(-50%) rotate(45deg) translateY(0);
    }
    40% {
      transform: translateX(-50%) rotate(45deg) translateY(-10px);
    }
    60% {
      transform: translateX(-50%) rotate(45deg) translateY(-5px);
    }
  }
  
  /* Particle canvas */
  #particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
  }
  
  /* Animation classes for fade-in effects */
  .fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s forwards;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
  }
  
  .fade-in-up.delay-1 {
    animation-delay: 0.2s;
  }
  
  .fade-in-up.delay-2 {
    animation-delay: 0.4s;
  }
  
  .fade-in-up.delay-3 {
    animation-delay: 0.6s;
  }
  
  @keyframes fadeInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Reveal animation for scroll effects */
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    text-align: center;
  }
  
  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  
  /* Responsive design */
  @media (max-width: 768px) {
    .container {
      padding: 0 1rem;
    }
    
    section {
      padding: 3rem 0;
    }
  
  }

/* ==========================================================================
   Article
   ========================================================================== */
body.article-page {
  background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg) 35%, var(--color-bg) 100%);
  color: var(--text);
  font-family: var(--font-primary), system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  padding: 0 16px;
}

body.article-page article {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 0 80px;
}

/* =========================================================
   HEADINGS
========================================================= */
body.article-page h1 {
  font-family: var(--font-heading), Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5em;
  color: var(--color-text);
}

body.article-page h2 {
  font-family: var(--font-heading), Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 2.5em 0 0.7em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}

body.article-page h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 1.8em 0 0.5em;
}

body.article-page p { margin-bottom: 1em; }

body.article-page a {
  color: var(--color-primary);
  text-decoration: none;
}
body.article-page a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

/* =========================================================
   HERO
========================================================= */
body.article-page .hero {
  text-align: center;
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

body.article-page .hero-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.4em;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

body.article-page .hero-meta span { display: flex; align-items: center; gap: 4px; }

body.article-page .hero-img,
body.article-page .section-img {
  filter: saturate(0.82) brightness(0.98);
}

body.article-page .hero-img {
  width: 100%;
  border-radius: var(--radius);
  margin: 24px 0 12px;
  border: 1px solid var(--border);
}

body.article-page .hero-caption {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 0;
}

/* =========================================================
   TABLE OF CONTENTS
========================================================= */
body.article-page nav.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 32px 0;
}

body.article-page nav.toc h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border: none;
  margin: 0 0 12px;
  padding: 0;
  color: var(--text-muted);
}

body.article-page nav.toc ol {
  margin: 0;
  padding-left: 1.4em;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
}

body.article-page nav.toc li { font-size: 0.92rem; }
body.article-page nav.toc a { color: var(--color-text-muted); }
body.article-page nav.toc a:hover { color: var(--color-text); }

@media (max-width: 480px) {
body.article-page nav.toc ol { grid-template-columns: 1fr; }
}

/* =========================================================
   HIGHLIGHT BOXES
========================================================= */
.box {
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
  font-size: 0.94rem;
}

.box-title {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-win {
  background: color-mix(in srgb, var(--accent3) 12%, transparent);
  border-left: 3px solid var(--accent3);
}
.quick-win .box-title { color: var(--accent3); }

.pro-tip {
  background: var(--color-grid);
  border-left: 3px solid var(--color-primary);
}
.pro-tip .box-title { color: var(--color-primary); }

.pitfall {
  background: color-mix(in srgb, var(--accent5) 12%, transparent);
  border-left: 3px solid var(--accent5);
}
.pitfall .box-title { color: var(--accent5); }

  .insight {
    background: var(--color-grid);
    border-left: 3px solid var(--color-border);
  }
  .insight .box-title { color: var(--color-text); }

/* =========================================================
   STATS BAR CHART (CSS)
========================================================= */
.chart-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.bar-chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 12px;
  margin: 24px 0;
}

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.bar-label {
  width: 90px;
  font-size: 0.85rem;
  text-align: right;
  color: var(--text-muted);
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  background: var(--surface2);
  border-radius: 4px;
  height: 22px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  transition: width 0.4s ease;
}

/* =========================================================
   TABLES
========================================================= */
.table-wrap { overflow-x: auto; margin: 20px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead tr { background: var(--surface2); }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 0.88rem;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-grid); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green { background: color-mix(in srgb, var(--accent3) 18%, transparent); color: var(--accent3); }
.badge-blue  { background: var(--color-grid); color: var(--color-text-muted); }
.badge-amber { background: color-mix(in srgb, var(--accent4) 18%, transparent); color: var(--accent4); }
.badge-red   { background: color-mix(in srgb, var(--accent5) 18%, transparent); color: var(--accent5); }

/* =========================================================
   TESTIMONIAL CARDS
========================================================= */
.testimonials { display: grid; gap: 16px; margin: 24px 0; }

.testimonial {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.testimonial blockquote {
  font-style: italic;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 10px;
  font-size: 0.93rem;
  border: none;
  padding: 0;
}

.testimonial blockquote::before { content: '\201C'; color: var(--color-text-faint); font-size: 1.4em; line-height: 0; vertical-align: -0.3em; }
.testimonial blockquote::after  { content: '\201D'; color: var(--color-text-faint); font-size: 1.4em; line-height: 0; vertical-align: -0.3em; }

.testimonial .source {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.testimonial .source strong { color: var(--text-muted); }

/* =========================================================
   INLINE STATS CARDS
========================================================= */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
}

.stat-number {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================================================
   DETAILS / COLLAPSIBLE
========================================================= */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 24px 0;
  overflow: hidden;
}

summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

summary::before { content: '▶'; font-size: 0.7em; transition: transform 0.2s; }
details[open] summary::before { transform: rotate(90deg); }

details .details-body {
  padding: 0 18px 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
}

details .details-body code {
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  color: var(--accent3);
}

/* =========================================================
   SECTION IMAGES
========================================================= */
.section-img {
  width: 100%;
  border-radius: var(--radius);
  margin: 20px 0 8px;
  border: 1px solid var(--border);
  display: block;
}

.img-caption {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 0;
  text-align: center;
}

/* =========================================================
   UNEXPECTED INSIGHTS
========================================================= */
.insight-list { counter-reset: insight-counter; list-style: none; padding: 0; margin: 0; }

.insight-item {
  counter-increment: insight-counter;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 18px 60px;
  margin-bottom: 14px;
  position: relative;
}

.insight-item::before {
  content: counter(insight-counter);
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
}

.insight-item h4 {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.insight-item p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

/* =========================================================
   FAQ
========================================================= */
.faq details { margin: 8px 0; }
.faq summary { font-size: 0.95rem; color: var(--text); }
.faq .details-body { color: var(--text-muted); }

/* =========================================================
   PLAYBOOK STEPS
========================================================= */
.steps { counter-reset: step-counter; list-style: none; padding: 0; margin: 0; }

.step {
  counter-increment: step-counter;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; }

.step-num {
  width: 36px;
  height: 36px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.step-content h4 {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.step-content p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* =========================================================
   ENDNOTES
========================================================= */
.endnotes {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.endnotes h2 {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  border: none;
}

.endnotes ol {
  padding-left: 1.4em;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.7;
}

.endnotes-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 16px;
  line-height: 1.6;
}

.endnotes li { margin-bottom: 4px; }
.endnotes a { color: var(--text-dim); word-break: break-all; }
.endnotes a:hover { color: var(--color-text); }

/* =========================================================
   WARNING FLAG
========================================================= */
.warn {
  background: color-mix(in srgb, var(--accent4) 10%, transparent);
  border-left: 3px solid var(--accent4);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 14px;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 14px 0;
}

/* =========================================================
   MODEL COLOR DOTS
========================================================= */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* =========================================================
   SECTION DIVIDER
========================================================= */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 520px) {
  body.article-page article { padding: 24px 0 60px; }
  body.article-page h1 { font-size: 1.7rem; }
  body.article-page h2 { font-size: 1.25rem; }
  body.article-page .stat-grid { grid-template-columns: 1fr 1fr; }
  body.article-page .bar-label { width: 70px; font-size: 0.78rem; }
}
