/* ============================================================
   Search Central Update — Design System
   main.css | Version 2.0
   Warm cream + navy blue light theme across all pages
   ============================================================ */

/* ── Custom Properties ──────────────────────────────────────── */
:root {
  /* Light Theme (warm cream — all pages) */
  --bg-primary:        #fafaf7;
  --bg-secondary:      #f2f1ec;
  --bg-card:           #ffffff;
  --bg-card-hover:     #f8f7f2;
  --bg-glass:          rgba(37,99,235,0.04);
  --bg-glass-hover:    rgba(37,99,235,0.08);
  --bg-hero:           #f0efe9;

  --text-primary:      #0f172a;
  --text-secondary:    #334155;
  --text-muted:        #64748b;
  --text-inverse:      #ffffff;

  --border:            rgba(15,23,42,0.1);
  --border-hover:      rgba(15,23,42,0.2);
  --border-accent:     rgba(37,99,235,0.3);

  /* Brand Palette — navy blue */
  --accent:            #2563eb;   /* blue-600 */
  --accent-hover:      #1d4ed8;   /* blue-700 */
  --accent-light:      #dbeafe;   /* blue-100 */
  --accent-glow:       rgba(37,99,235,0.15);
  --accent-2:          #7c3aed;   /* violet */
  --accent-3:          #0891b2;   /* cyan-600 */
  --accent-success:    #059669;
  --accent-warning:    #d97706;
  --accent-danger:     #dc2626;

  /* Gradients */
  --gradient-brand:    linear-gradient(135deg, #2563eb 0%, #7c3aed 60%, #0891b2 100%);
  --gradient-hero:     linear-gradient(160deg, #f0efe9 0%, #e8eaf6 50%, #f0efe9 100%);
  --gradient-card:     linear-gradient(135deg, rgba(37,99,235,0.05) 0%, rgba(124,58,237,0.03) 100%);
  --gradient-section:  linear-gradient(180deg, #fafaf7 0%, #f2f1ec 100%);

  /* Typography */
  --font-sans:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:         'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Fluid Type Scale */
  --fs-xs:             clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
  --fs-sm:             clamp(0.8rem, 0.75rem + 0.3vw, 0.9rem);
  --fs-base:           clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  --fs-md:             clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --fs-lg:             clamp(1.2rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-xl:             clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --fs-2xl:            clamp(2rem, 1.6rem + 2vw, 3rem);
  --fs-3xl:            clamp(2.8rem, 2rem + 4vw, 5rem);
  --fs-4xl:            clamp(3.5rem, 2.5rem + 5vw, 7rem);

  /* Spacing */
  --space-1:    4px;
  --space-2:    8px;
  --space-3:    12px;
  --space-4:    16px;
  --space-5:    20px;
  --space-6:    24px;
  --space-8:    32px;
  --space-10:   40px;
  --space-12:   48px;
  --space-16:   64px;
  --space-20:   80px;
  --space-24:   96px;
  --space-32:   128px;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;
  --radius-full: 9999px;

  /* Shadows — lighter for cream bg */
  --shadow-sm:   0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.05);
  --shadow-md:   0 4px 16px rgba(15,23,42,0.1), 0 2px 4px rgba(15,23,42,0.06);
  --shadow-lg:   0 10px 40px rgba(15,23,42,0.12), 0 4px 10px rgba(15,23,42,0.07);
  --shadow-accent: 0 4px 20px rgba(37,99,235,0.2), 0 1px 4px rgba(15,23,42,0.1);
  --shadow-glow:   0 0 40px rgba(37,99,235,0.12);

  /* Transitions */
  --trans-fast:  0.15s ease;
  --trans-base:  0.25s ease;
  --trans-slow:  0.4s ease;
  --trans-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-max: 1200px;
  --content-max:   760px;
  --nav-height:    92px;
}

/* Legacy .light-theme class — no-op since light is the default */
.light-theme { /* inherits :root */ }

/* ── Dark Theme (opt-in via toggle; light is always the default) ── */
[data-theme="dark"] {
  --bg-primary:        #0b0e17;
  --bg-secondary:      #101423;
  --bg-card:           #151a2c;
  --bg-card-hover:     #1a2036;
  --bg-glass:          rgba(96,165,250,0.06);
  --bg-glass-hover:    rgba(96,165,250,0.12);
  --bg-hero:           #0d1120;

  --text-primary:      #f1f5f9;
  --text-secondary:    #cbd5e1;
  --text-muted:        #94a3b8;
  --text-inverse:      #0f172a;

  --border:            rgba(148,163,184,0.15);
  --border-hover:      rgba(148,163,184,0.3);
  --border-accent:     rgba(96,165,250,0.4);

  --accent:            #60a5fa;
  --accent-hover:      #93c5fd;
  --accent-light:      #1e3a8a;
  --accent-glow:       rgba(96,165,250,0.2);

  --gradient-hero:     linear-gradient(160deg, #0d1120 0%, #131b33 50%, #0d1120 100%);
  --gradient-card:     linear-gradient(135deg, rgba(96,165,250,0.08) 0%, rgba(167,139,250,0.05) 100%);
  --gradient-section:  linear-gradient(180deg, #0b0e17 0%, #101423 100%);

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.45), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.35);
  --shadow-accent: 0 4px 20px rgba(96,165,250,0.25), 0 1px 4px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 40px rgba(96,165,250,0.15);

  color-scheme: dark;
}

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

/* Light is the default; dark only when the user opts in via the toggle */
:root { color-scheme: light; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  background-color: var(--bg-primary);
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); }

p { color: var(--text-secondary); max-width: 70ch; }
a { color: var(--accent); text-decoration: none; transition: color var(--trans-fast); }
a:hover { color: var(--accent-hover); }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

code {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  color: var(--accent-3);
}

pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  overflow-x: auto;
}

pre code { background: none; border: none; padding: 0; color: inherit; }

blockquote {
  border-left: 4px solid var(--accent);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-glass);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-8) 0;
  font-style: italic;
  color: var(--text-primary);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-12) 0;
}

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

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: var(--content-max);
}

.section {
  padding: var(--space-24) 0;
}

.section--sm {
  padding: var(--space-12) 0;
}

.section--hero {
  padding: var(--space-32) 0 var(--space-24);
  position: relative;
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(250,250,247,0.88);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background var(--trans-slow), border-color var(--trans-slow), box-shadow var(--trans-slow);
}

[data-theme="dark"] .nav {
  background: rgba(11,14,23,0.88);
}

.nav.scrolled {
  background: rgba(250,250,247,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(15,23,42,0.07);
}

[data-theme="dark"] .nav.scrolled {
  background: rgba(11,14,23,0.92);
  box-shadow: 0 1px 12px rgba(0,0,0,0.4);
}

/* ── Theme toggle button (in nav) ───────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  transition: background var(--trans-fast), border-color var(--trans-fast), transform var(--trans-fast);
}
.theme-toggle:hover {
  border-color: var(--border-hover);
  transform: scale(1.08);
}
.theme-toggle .tt-sun  { display: none; }
.theme-toggle .tt-moon { display: inline; }
[data-theme="dark"] .theme-toggle .tt-sun  { display: inline; }
[data-theme="dark"] .theme-toggle .tt-moon { display: none; }

.nav > .container { height: 100%; }   /* without this, nav__inner's 100% height collapses and content pins to the top */

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 800;
  font-size: var(--fs-md);
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.nav__logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav__logo span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.nav__links a {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--trans-fast);
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--trans-base);
}

.nav__mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4);
  z-index: 999;
}

.nav__mobile.open { display: block; }

.nav__mobile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav__mobile-links a {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--trans-fast);
}

.nav__mobile-links a:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--trans-spring);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--trans-fast);
}

.btn:hover::after { background: rgba(255,255,255,0.07); }
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 0 30px var(--accent-glow), 0 4px 12px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.btn--gradient {
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}

.btn--gradient:hover {
  color: #fff;
  box-shadow: 0 8px 30px rgba(99,102,241,0.4);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.btn--ghost {
  background: var(--bg-glass);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
}

.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-md);
  border-radius: var(--radius-lg);
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--trans-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity var(--trans-base);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card:hover::before { opacity: 1; }

.card--glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
}

.card--accent {
  border-color: var(--border-accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

/* ── Badge / Tag ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid currentColor;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge--accent {
  color: var(--accent);
  background: rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.3);
}

.badge--purple {
  color: var(--accent-2);
  background: rgba(168,85,247,0.1);
  border-color: rgba(168,85,247,0.3);
}

.badge--cyan {
  color: var(--accent-3);
  background: rgba(6,182,212,0.1);
  border-color: rgba(6,182,212,0.3);
}

.badge--success {
  color: var(--accent-success);
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.3);
}

.badge--warning {
  color: var(--accent-warning);
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.3);
}

.badge--danger {
  color: var(--accent-danger);
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
}

/* ── Gradient Text ───────────────────────────────────────────── */
.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ── Hero Background Effects ─────────────────────────────────── */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-bg__gradient {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.08) 0%, rgba(124,58,237,0.05) 40%, transparent 70%);
  animation: heroPulse 8s ease-in-out infinite;
}

.hero-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37,99,235,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.hero-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 10s ease-in-out infinite;
}

.hero-bg__orb--1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -100px;
  background: rgba(37,99,235,0.07);
  animation-delay: -3s;
}

.hero-bg__orb--2 {
  width: 300px;
  height: 300px;
  bottom: -50px;
  left: -50px;
  background: rgba(124,58,237,0.06);
  animation-delay: -6s;
}

.hero-bg__orb--3 {
  width: 200px;
  height: 200px;
  top: 40%;
  left: 20%;
  background: rgba(8,145,178,0.05);
  animation-delay: -1s;
}

@keyframes heroPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 20px) scale(0.95); }
}

/* ── Animated Gradient Border ────────────────────────────────── */
.gradient-border {
  position: relative;
  border-radius: var(--radius-lg);
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-brand);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--trans-base);
}

.gradient-border:hover::before { opacity: 1; }

/* ── Grid Layouts ────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

/* ── Tool Input Components ───────────────────────────────────── */
.tool-input-group {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.input {
  flex: 1;
  min-width: 200px;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--trans-fast);
  outline: none;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input::placeholder { color: var(--text-muted); }

.select {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: border-color var(--trans-fast);
}

.select:focus { border-color: var(--accent); }

/* ── Tool Results ─────────────────────────────────────────────── */
.result-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  min-height: 200px;
  position: relative;
}

.result-box--loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-12);
  color: var(--text-muted);
  text-align: center;
}

.result-empty__icon {
  font-size: 48px;
  opacity: 0.3;
}

/* ── Loading Spinner ──────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress Bar ─────────────────────────────────────────────── */
.progress {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Tabs ─────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--trans-fast);
  color: var(--text-muted);
  border: none;
  background: none;
  font-family: var(--font-sans);
}

.tab:hover { color: var(--text-primary); }

.tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ── Section Headers ──────────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-header .badge {
  margin-bottom: var(--space-4);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  max-width: 60ch;
  margin: 0 auto;
  font-size: var(--fs-md);
}

/* ── Breadcrumb ───────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--trans-fast);
}

.breadcrumb a:hover { color: var(--accent); }

.breadcrumb__sep { opacity: 0.4; }

/* ── Article (Blog Light Theme) ──────────────────────────────── */
.article {
  padding-top: calc(var(--nav-height) + var(--space-12));
}

.article__hero-img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
}

.article__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.article__author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--text-primary);
}

.article__author-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.article__body {
  font-size: var(--fs-md);
  line-height: 1.8;
}

.article__body h2 {
  font-size: var(--fs-xl);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}

.article__body h3 {
  font-size: var(--fs-lg);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.article__body p {
  margin-bottom: var(--space-5);
  color: var(--text-secondary);
  max-width: 100%;
}

.article__body ul, .article__body ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-5);
  color: var(--text-secondary);
}

.article__body li { margin-bottom: var(--space-2); }

.article__body img {
  border-radius: var(--radius-md);
  margin: var(--space-8) auto;
}

.article__body .key-takeaway {
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-5) var(--space-6);
  margin: var(--space-8) 0;
}

.article__body .key-takeaway strong {
  display: block;
  color: var(--accent);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

/* ── TOC (Table of Contents) ─────────────────────────────────── */
.toc {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin: var(--space-8) 0;
}

.toc__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.toc__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toc__list a {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: all var(--trans-fast);
}

.toc__list a:hover,
.toc__list a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.toc__list a::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0.4;
}

.toc__list a.active::before { opacity: 1; }

/* ── Stats / Metrics ─────────────────────────────────────────── */
.stat-card {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.stat-card__number {
  font-size: var(--fs-3xl);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-card__label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 500;
}

/* ── FAQ Accordion ───────────────────────────────────────────── */
.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:first-child { border-top: 1px solid var(--border); }

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--text-primary);
  transition: color var(--trans-fast);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
}

.faq-question:hover { color: var(--accent); }

.faq-question__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  transition: transform var(--trans-base);
}

.faq-item.open .faq-question__icon {
  transform: rotate(45deg);
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

.faq-item.open .faq-answer { max-height: 500px; }

.faq-answer__inner {
  padding: 0 0 var(--space-5);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Share gate styles removed — tools are freely accessible ── */

/* ── Gamification Elements ────────────────────────────────────── */
.xp-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  animation: streakPulse 2s ease-in-out infinite;
}

@keyframes streakPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--space-20) 0 var(--space-8);
  margin-top: auto;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}

.footer__brand {
  max-width: 300px;
}

.footer__brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 800;
  font-size: var(--fs-md);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-decoration: none;
}

.footer__brand p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.footer__col h4 {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.footer__col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__col a {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: color var(--trans-fast);
}

.footer__col a:hover { color: var(--accent); }

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  gap: var(--space-6);
  flex-wrap: wrap;
}

.footer__bottom p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  max-width: none;
}

.footer__social {
  display: flex;
  gap: var(--space-3);
}

.footer__social a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  transition: all var(--trans-base);
}

.footer__social a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-2px);
}

/* ── Animations ──────────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.fade-in.visible { opacity: 1; }

.stagger > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger.visible > *:nth-child(1)  { animation: staggerIn 0.5s ease 0.1s forwards; }
.stagger.visible > *:nth-child(2)  { animation: staggerIn 0.5s ease 0.2s forwards; }
.stagger.visible > *:nth-child(3)  { animation: staggerIn 0.5s ease 0.3s forwards; }
.stagger.visible > *:nth-child(4)  { animation: staggerIn 0.5s ease 0.4s forwards; }
.stagger.visible > *:nth-child(5)  { animation: staggerIn 0.5s ease 0.5s forwards; }
.stagger.visible > *:nth-child(6)  { animation: staggerIn 0.5s ease 0.6s forwards; }

@keyframes staggerIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Toast Notifications ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  animation: toastSlide 0.3s var(--trans-spring);
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast--success { border-left: 3px solid var(--accent-success); }
.toast--error   { border-left: 3px solid var(--accent-danger); }
.toast--info    { border-left: 3px solid var(--accent); }

/* ── Page Body Padding ───────────────────────────────────────── */
.page-content {
  padding-top: var(--nav-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  /* Tablet: desktop links start crowding, switch to hamburger early */
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
}

@media (max-width: 600px) {
  /* Phone: logo + toggle + hamburger only; the CTA lives in the mobile menu */
  .nav__actions .btn { display: none; }
  .nav__logo span { font-size: 0.95rem; }
  .nav__logo-icon { width: 32px; height: 32px; font-size: 16px; }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 76px;
  }

  .nav__links,
  .nav__actions .btn--outline { display: none; }

  .nav__hamburger { display: flex; }

  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }

  .footer__grid { grid-template-columns: 1fr; }
  .footer__brand { max-width: 100%; }
  .footer__bottom { flex-direction: column; text-align: center; }

  .section { padding: var(--space-16) 0; }
  .section--hero { padding: var(--space-20) 0 var(--space-16); }

  .share-gate__card { padding: var(--space-8) var(--space-6); }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  .grid-4 { grid-template-columns: 1fr; }
  .tabs { flex-wrap: wrap; }
}

/* ── Reduce Motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  .nav, .footer, .share-gate, .toast-container { display: none !important; }
  body { background: white; color: black; }
  .page-content { padding-top: 0; }
}
