/* ============================================================
   TECHAASVIK.COM — MASTER DESIGN SYSTEM
   Inspired by: Linear, Stripe, Vercel, Framer, Perplexity
   Philosophy: Dark-first, AI-native, authority-grade premium
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Sora:wght@400;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --brand-50:   #eef2ff;
  --brand-100:  #e0e7ff;
  --brand-200:  #c7d2fe;
  --brand-300:  #a5b4fc;
  --brand-400:  #818cf8;
  --brand-500:  #6366f1;
  --brand-600:  #4f46e5;
  --brand-700:  #4338ca;
  --brand-800:  #3730a3;
  --brand-900:  #312e81;

  /* Accent — Emerald */
  --accent-400: #34d399;
  --accent-500: #10b981;
  --accent-600: #059669;

  /* Gold — Authority signal */
  --gold-400:   #fbbf24;
  --gold-500:   #f59e0b;

  /* Neutrals (dark theme base) */
  --gray-0:     #ffffff;
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-300:   #cbd5e1;
  --gray-400:   #94a3b8;
  --gray-500:   #64748b;
  --gray-600:   #475569;
  --gray-700:   #334155;
  --gray-800:   #1e293b;
  --gray-850:   #172033;
  --gray-900:   #0f172a;
  --gray-950:   #080d16;

  /* Semantic Colors */
  --color-success:  #22c55e;
  --color-warning:  #f59e0b;
  --color-error:    #ef4444;
  --color-info:     #3b82f6;

  /* ── Background System ─── */
  --bg-base:       #080d16;
  --bg-surface:    #0f172a;
  --bg-elevated:   #1e293b;
  --bg-overlay:    #263147;
  --bg-interactive:#2d3a50;

  /* ── Text System ─── */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-disabled:  #334155;
  --text-inverse:   #080d16;
  --text-brand:     #818cf8;

  /* ── Border System ─── */
  --border-subtle:  rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-strong:  rgba(255,255,255,0.16);
  --border-brand:   rgba(99,102,241,0.5);

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

  --text-xs:    0.75rem;     /* 12px */
  --text-sm:    0.875rem;    /* 14px */
  --text-base:  1rem;        /* 16px */
  --text-lg:    1.125rem;    /* 18px */
  --text-xl:    1.25rem;     /* 20px */
  --text-2xl:   1.5rem;      /* 24px */
  --text-3xl:   1.875rem;    /* 30px */
  --text-4xl:   2.25rem;     /* 36px */
  --text-5xl:   3rem;        /* 48px */
  --text-6xl:   3.75rem;     /* 60px */
  --text-7xl:   4.5rem;      /* 72px */

  --fw-light:    300;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-extrabold:800;
  --fw-black:    900;

  --leading-tight:  1.25;
  --leading-snug:   1.375;
  --leading-normal: 1.5;
  --leading-relaxed:1.625;
  --leading-loose:  2;

  /* ── Spacing (8px grid) ─── */
  --space-1:  0.25rem;   /* 4px  */
  --space-2:  0.5rem;    /* 8px  */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */

  /* ── Border Radius ─── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* ── Shadows ─── */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.5);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.6);
  --shadow-brand: 0 0 0 3px rgba(99,102,241,0.3);
  --shadow-glow:  0 0 40px rgba(99,102,241,0.15);

  /* ── Transitions ─── */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* ── Z-Index ─── */
  --z-below:   -1;
  --z-base:     0;
  --z-raised:  10;
  --z-dropdown:100;
  --z-sticky:  200;
  --z-overlay: 300;
  --z-modal:   400;
  --z-toast:   500;

  /* ── Layout ─── */
  --container-sm:   640px;
  --container-md:   768px;
  --container-lg:   1024px;
  --container-xl:   1280px;
  --container-2xl:  1400px;
  --header-height:  64px;
  --sidebar-width:  280px;
}

/* ── Light Mode Override ───────────────────────────────────── */
[data-theme="light"] {
  --bg-base:       #ffffff;
  --bg-surface:    #f8fafc;
  --bg-elevated:   #f1f5f9;
  --bg-overlay:    #e2e8f0;
  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --border-subtle: rgba(0,0,0,0.06);
  --border-default:rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.16);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--text-brand);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--brand-300); }

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol { list-style: none; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-sm  { max-width: var(--container-sm); }
.container-md  { max-width: var(--container-md); }
.container-lg  { max-width: var(--container-lg); }
.container-2xl { max-width: var(--container-2xl); }

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

.grid          { display: grid; }
.grid-2        { grid-template-columns: repeat(2, 1fr); }
.grid-3        { grid-template-columns: repeat(3, 1fr); }
.grid-4        { grid-template-columns: repeat(4, 1fr); }
.grid-auto     { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.gap-4         { gap: var(--space-4); }
.gap-6         { gap: var(--space-6); }
.gap-8         { gap: var(--space-8); }

.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.items-center  { align-items: center; }
.justify-center{ justify-content: center; }
.justify-between{justify-content: space-between; }
.gap-2         { gap: var(--space-2); }
.gap-3         { gap: var(--space-3); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-6xl)); font-weight: var(--fw-extrabold); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl), 3vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { margin-bottom: var(--space-4); color: var(--text-secondary); line-height: var(--leading-relaxed); }
p:last-child { margin-bottom: 0; }

strong { font-weight: var(--fw-semibold); color: var(--text-primary); }
em     { font-style: italic; }
small  { font-size: var(--text-sm); color: var(--text-muted); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  color: var(--brand-300);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  overflow-x: auto;
  line-height: var(--leading-relaxed);
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }

blockquote {
  border-left: 3px solid var(--brand-500);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-8) 0;
  background: rgba(99,102,241,0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Article body typography */
.prose h2 { margin: var(--space-10) 0 var(--space-4); }
.prose h3 { margin: var(--space-8) 0 var(--space-3); }
.prose h4 { margin: var(--space-6) 0 var(--space-2); }
.prose p  { margin-bottom: var(--space-5); }
.prose ul, .prose ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-5);
  color: var(--text-secondary);
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: var(--space-2); line-height: var(--leading-relaxed); }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-8) 0;
  font-size: var(--text-sm);
}
.prose th, .prose td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  text-align: left;
}
.prose th { background: var(--bg-elevated); font-weight: var(--fw-semibold); }
.prose tr:hover td { background: rgba(255,255,255,0.02); }
.prose img {
  border-radius: var(--radius-lg);
  margin: var(--space-8) 0;
  box-shadow: var(--shadow-lg);
}
.prose a { color: var(--brand-400); border-bottom: 1px solid transparent; transition: border-color var(--transition-fast); }
.prose a:hover { border-color: var(--brand-400); }
.prose hr { border: none; border-top: 1px solid var(--border-default); margin: var(--space-10) 0; }

/* ============================================================
   COMPONENTS — BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-600);
  box-shadow: 0 1px 0 rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover {
  background: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-secondary:hover {
  background: var(--bg-overlay);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }

.btn-danger { background: var(--color-error); color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-success { background: var(--accent-500); color: #fff; border-color: var(--accent-600); }
.btn-success:hover { background: var(--accent-600); color: #fff; }

.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--text-base); border-radius: var(--radius-xl); }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }

/* Gradient CTA button */
.btn-gradient {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500), #8b5cf6);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}
.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,0.5);
  color: #fff;
}

/* ============================================================
   COMPONENTS — CARDS
   ============================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
}
.card:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-glass {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.card-interactive {
  cursor: pointer;
}
.card-interactive:hover .card-title { color: var(--brand-400); }

/* Post card */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}
.post-card:hover {
  border-color: var(--border-brand);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(99,102,241,0.1);
}
.post-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-elevated);
}
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.post-card:hover .post-card-image img { transform: scale(1.04); }
.post-card-body { padding: var(--space-5); flex: 1; }
.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.post-card-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  line-height: var(--leading-snug);
  transition: color var(--transition-fast);
}
.post-card:hover .post-card-title { color: var(--brand-400); }
.post-card-excerpt { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-relaxed); }
.post-card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   COMPONENTS — BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}
.badge-brand   { background: rgba(99,102,241,0.15); color: var(--brand-400); border: 1px solid rgba(99,102,241,0.3); }
.badge-success { background: rgba(16,185,129,0.15); color: var(--accent-400); border: 1px solid rgba(16,185,129,0.3); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--gold-400); border: 1px solid rgba(245,158,11,0.3); }
.badge-error   { background: rgba(239,68,68,0.15);  color: #f87171;         border: 1px solid rgba(239,68,68,0.3); }
.badge-gray    { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border-subtle); }

.tag {
  display: inline-flex;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  text-decoration: none;
}
.tag:hover { background: rgba(99,102,241,0.1); color: var(--brand-400); border-color: rgba(99,102,241,0.3); }

/* ============================================================
   COMPONENTS — FORMS
   ============================================================ */
.form-group { margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.form-label span { color: var(--color-error); margin-left: 2px; }

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
  transition: all var(--transition-fast);
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: var(--shadow-brand);
  background: var(--bg-overlay);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 120px; resize: vertical; }
.form-select { cursor: pointer; }
.form-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }
.form-error { font-size: var(--text-xs); color: var(--color-error); margin-top: var(--space-1); }
.form-input.is-error, .form-textarea.is-error, .form-select.is-error {
  border-color: var(--color-error);
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: var(--header-height);
  background: rgba(8,13,22,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.site-logo-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-black);
  background: linear-gradient(135deg, #fff 30%, var(--brand-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.site-nav-link {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
}
.site-nav-link:hover, .site-nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-20) 0 var(--space-8);
  margin-top: var(--space-20);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}
.footer-brand p { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-4); max-width: 280px; }

.footer-col-title {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.footer-links { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--text-primary); }

.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-copyright { font-size: var(--text-sm); color: var(--text-muted); }

.social-links { display: flex; gap: var(--space-3); }
.social-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  text-decoration: none;
}
.social-link:hover {
  background: rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.3);
  color: var(--brand-400);
}

/* ============================================================
   HERO SECTIONS
   ============================================================ */
.hero {
  position: relative;
  padding: var(--space-32) 0 var(--space-24);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--brand-300);
  margin-bottom: var(--space-6);
}
.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-400);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.5); }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-family: var(--font-display);
  font-weight: var(--fw-extrabold);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  max-width: 900px;
  margin-bottom: var(--space-6);
}
.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--brand-400), #a78bfa, var(--accent-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  max-width: 680px;
  margin-bottom: var(--space-10);
  line-height: var(--leading-relaxed);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-top: var(--space-16);
  padding-top: var(--space-16);
  border-top: 1px solid var(--border-subtle);
}
.hero-stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--fw-extrabold);
  font-family: var(--font-display);
  color: var(--text-primary);
}
.hero-stat-label { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-1); }

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color var(--transition-fast); }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb-sep { color: var(--text-disabled); }
.breadcrumb-current { color: var(--text-secondary); }

/* ============================================================
   TABLE OF CONTENTS
   ============================================================ */
.toc {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin: var(--space-8) 0;
}
.toc-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.toc-list { display: flex; flex-direction: column; gap: var(--space-2); }
.toc-item a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-1) 0;
  transition: color var(--transition-fast);
  border-left: 2px solid transparent;
  padding-left: var(--space-3);
}
.toc-item a:hover, .toc-item.active a { color: var(--brand-400); border-left-color: var(--brand-500); }
.toc-item.toc-h3 a { padding-left: var(--space-6); font-size: var(--text-xs); }

/* ============================================================
   AUTHOR BOX
   ============================================================ */
.author-box {
  display: flex;
  gap: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-top: var(--space-12);
}
.author-box-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-elevated);
}
.author-box-name { font-weight: var(--fw-semibold); color: var(--text-primary); }
.author-box-credentials { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.author-box-bio { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-2); }

/* ============================================================
   NEWSLETTER / LEAD CAPTURE
   ============================================================ */
.newsletter-box {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.05));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-8);
  text-align: center;
}
.newsletter-box h3 { font-size: var(--text-2xl); color: var(--text-primary); }
.newsletter-box p  { color: var(--text-secondary); margin: var(--space-3) 0 var(--space-6); }
.newsletter-form {
  display: flex;
  gap: var(--space-3);
  max-width: 460px;
  margin: 0 auto;
}
.newsletter-form .form-input { flex: 1; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
}
.stat-card:hover { border-color: var(--border-brand); box-shadow: var(--shadow-glow); }
.stat-card-value {
  font-size: var(--text-4xl);
  font-weight: var(--fw-black);
  font-family: var(--font-display);
  background: linear-gradient(135deg, var(--text-primary), var(--brand-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-card-label { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-1); }

/* ============================================================
   GLOSSARY TERM
   ============================================================ */
.glossary-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.glossary-letter {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--brand-600);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-black);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  position: relative;
  max-width: 640px;
  width: 100%;
}
.search-bar input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-base);
  outline: none;
  transition: all var(--transition-fast);
}
.search-bar input:focus { border-color: var(--brand-500); box-shadow: var(--shadow-brand); }
.search-bar-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-12);
}
.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  background: var(--bg-surface);
}
.pagination a:hover { background: var(--bg-elevated); border-color: var(--border-default); color: var(--text-primary); }
.pagination .active { background: var(--brand-600); color: #fff; border-color: var(--brand-500); }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ============================================================
   ALERTS / MESSAGES
   ============================================================ */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: var(--accent-400); }
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.25);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); color: var(--gold-400); }
.alert-info    { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25); color: #60a5fa; }

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-overlay) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text  { height: 1em; margin-bottom: 0.5em; }
.skeleton-title { height: 1.5em; width: 60%; }
.skeleton-image { aspect-ratio: 16/9; }

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-500), #8b5cf6, var(--accent-500));
  z-index: calc(var(--z-sticky) + 10);
  transition: width 100ms linear;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.25rem; }
  .hero-subtitle { font-size: var(--text-base); }
  .site-nav { display: none; }
  .menu-toggle { display: flex; }
  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0; bottom: 0;
    background: var(--bg-surface);
    padding: var(--space-6);
    z-index: var(--z-overlay);
    overflow-y: auto;
  }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .newsletter-form { flex-direction: column; }
  .author-box { flex-direction: column; }
  .hero-stats { flex-direction: column; gap: var(--space-6); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  .hero { padding: var(--space-16) 0; }
  .section { padding: var(--space-12) 0; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-primary { color: var(--text-primary); }
.text-secondary{color: var(--text-secondary); }
.text-muted   { color: var(--text-muted); }
.text-brand   { color: var(--brand-400); }
.text-success { color: var(--color-success); }
.text-error   { color: var(--color-error); }
.text-sm      { font-size: var(--text-sm); }
.text-xs      { font-size: var(--text-xs); }
.font-bold    { font-weight: var(--fw-bold); }
.font-semibold{ font-weight: var(--fw-semibold); }
.sr-only      { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded-full { border-radius: var(--radius-full); }
.hidden       { display: none; }
.w-full       { width: 100%; }
.mt-4         { margin-top: var(--space-4); }
.mt-6         { margin-top: var(--space-6); }
.mt-8         { margin-top: var(--space-8); }
.mb-4         { margin-bottom: var(--space-4); }
.mb-6         { margin-bottom: var(--space-6); }
.mb-8         { margin-bottom: var(--space-8); }
.gradient-text {
  background: linear-gradient(135deg, var(--brand-400), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
