/* ============================================================
   SIPfy — Pure HTML/CSS/JS
   God-level design system: aubergine + saffron + ivory + rose
   Editorial luxury · glassmorphism · noise · shimmer · magnetic
   ============================================================ */

/* ─────────── Design tokens ─────────── */
:root {
  /* Brand — Deep aubergine/plum (editorial luxury, sophisticated) */
  --plum-950: #0f0712;
  --plum-900: #1a0f24;
  --plum-800: #2d1b3d;
  --plum-700: #4a2e5c;
  --plum-600: #6b3d7e;
  --plum-500: #8b5395;
  --plum-400: #a878b0;
  --plum-300: #c9a3d1;
  --plum-200: #ddc4e3;
  --plum-100: #efe2f3;

  /* Accent — Burnished saffron/marigold (Indian luxury, warm, luminous) */
  --saffron-800: #8a5418;
  --saffron-700: #b8731f;
  --saffron-600: #d4862a;
  --saffron-500: #f4a261;
  --saffron-400: #f7b97d;
  --saffron-300: #fad4aa;
  --saffron-200: #fce4c8;

  /* Secondary accent — Rose copper (warm, human, refined) */
  --rose-700: #9a4a3d;
  --rose-600: #b85c5c;
  --rose-500: #c77b5c;
  --rose-400: #d99a85;
  --rose-300: #e8bba8;

  /* Highlight — Champagne gold (precious, luminous) */
  --gold-600: #a8854a;
  --gold-500: #c9a961;
  --gold-400: #d4b878;
  --gold-300: #e3cd9a;

  /* Neutrals — Warm ivory/bone + warm charcoal */
  --ivory: #faf5ea;
  --cream: #f5ecd9;
  --bone: #efe4cd;
  --paper: #ffffff;
  --sand-100: #f0e4c8;
  --sand-200: #e6d6b3;
  --sand-300: #d3c19b;
  --sage: #6b6558;
  --charcoal: #1f1820;
  --ink: #0f0a14;

  /* Semantic tokens */
  --bg: var(--ivory);
  --bg-elevated: var(--paper);
  --bg-subtle: var(--cream);
  --text: var(--charcoal);
  --text-muted: var(--sage);
  --heading: var(--plum-900);
  --border: var(--sand-200);
  --border-strong: var(--sand-300);

  --primary: var(--plum-700);
  --primary-hover: var(--plum-800);
  --primary-fg: var(--ivory);
  --accent: var(--saffron-500);
  --accent-hover: var(--saffron-600);
  --accent-fg: var(--plum-900);
  --secondary: var(--rose-500);
  --highlight: var(--gold-500);

  /* Effects — layered, color-tinted shadows */
  --shadow-xs: 0 1px 2px rgba(45, 27, 61, 0.06);
  --shadow-sm: 0 2px 4px rgba(45, 27, 61, 0.08), 0 1px 2px rgba(45, 27, 61, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(45, 27, 61, 0.12), 0 3px 8px -2px rgba(45, 27, 61, 0.06);
  --shadow-lg: 0 16px 40px -8px rgba(45, 27, 61, 0.16), 0 6px 16px -4px rgba(45, 27, 61, 0.08);
  --shadow-xl: 0 32px 64px -16px rgba(45, 27, 61, 0.22), 0 12px 28px -8px rgba(45, 27, 61, 0.12);
  --shadow-2xl: 0 48px 96px -24px rgba(45, 27, 61, 0.28), 0 20px 40px -12px rgba(45, 27, 61, 0.16);
  --shadow-brand: 0 16px 40px -8px rgba(74, 46, 92, 0.35), 0 6px 16px -4px rgba(244, 162, 97, 0.15);
  --shadow-glow-saffron: 0 0 32px -4px rgba(244, 162, 97, 0.4), 0 0 64px -8px rgba(244, 162, 97, 0.2);
  --shadow-glow-rose: 0 0 32px -4px rgba(199, 123, 92, 0.4);

  /* Gradients — rich, multi-stop */
  --gradient-brand: linear-gradient(135deg, var(--plum-800) 0%, var(--plum-600) 50%, var(--plum-500) 100%);
  --gradient-accent: linear-gradient(135deg, var(--saffron-600) 0%, var(--saffron-400) 100%);
  --gradient-rose: linear-gradient(135deg, var(--rose-600) 0%, var(--rose-400) 100%);
  --gradient-text: linear-gradient(120deg, var(--plum-700) 0%, var(--saffron-600) 50%, var(--rose-500) 100%);
  --gradient-text-hero: linear-gradient(120deg, var(--plum-800), var(--saffron-500) 40%, var(--rose-500) 80%);
  --gradient-mesh: radial-gradient(40% 50% at 15% 20%, rgba(74, 46, 92, 0.18), transparent 60%),
                   radial-gradient(35% 45% at 85% 15%, rgba(244, 162, 97, 0.18), transparent 60%),
                   radial-gradient(50% 50% at 50% 100%, rgba(199, 123, 92, 0.12), transparent 60%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.4) 100%);
  --gradient-border: linear-gradient(135deg, var(--plum-300), var(--saffron-400), var(--rose-400));

  /* Typography — 5 fonts */
  --font-display: 'Fraunces', 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --font-accent: 'Space Grotesk', 'Inter', sans-serif;
  --font-quote: 'Cormorant Garamond', Georgia, serif;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;

  /* Layout */
  --container: 1200px;
  --container-narrow: 760px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --radius-full: 9999px;

  /* Transitions — multi-layer for richness */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.3s var(--ease);
  --transition-slow: 0.6s var(--ease);

  /* Noise texture (SVG inline, data URI) */
  --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

/* Dark mode — Deep midnight aubergine */
[data-theme="dark"] {
  --bg: #0f0712;
  --bg-elevated: #1a0f24;
  --bg-subtle: #150b1c;
  --text: #efe2f3;
  --text-muted: #a890b5;
  --heading: #f5e8d9;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --primary: var(--plum-400);
  --primary-hover: var(--plum-300);
  --primary-fg: var(--ink);
  --accent: var(--saffron-400);
  --accent-hover: var(--saffron-500);
  --accent-fg: var(--ink);
  --secondary: var(--rose-400);
  --highlight: var(--gold-400);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 32px 64px -16px rgba(0, 0, 0, 0.8);
  --shadow-2xl: 0 48px 96px -24px rgba(0, 0, 0, 0.9);
  --shadow-brand: 0 16px 40px -8px rgba(168, 120, 176, 0.3), 0 6px 16px -4px rgba(247, 185, 125, 0.15);

  --gradient-brand: linear-gradient(135deg, var(--plum-700) 0%, var(--plum-500) 100%);
  --gradient-text: linear-gradient(120deg, var(--plum-300), var(--saffron-400), var(--rose-400));
  --gradient-text-hero: linear-gradient(120deg, var(--plum-300), var(--saffron-400) 40%, var(--rose-400) 80%);
  --gradient-mesh: radial-gradient(40% 50% at 15% 20%, rgba(168, 120, 176, 0.15), transparent 60%),
                   radial-gradient(35% 45% at 85% 15%, rgba(247, 185, 125, 0.12), transparent 60%),
                   radial-gradient(50% 50% at 50% 100%, rgba(217, 154, 133, 0.08), transparent 60%);
  --gradient-glass: linear-gradient(135deg, rgba(45, 27, 61, 0.6) 0%, rgba(26, 15, 36, 0.4) 100%);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  /* Subtle noise overlay for organic, premium feel */
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--noise);
  opacity: 0.025;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

[data-theme="dark"] body::before {
  opacity: 0.04;
  mix-blend-mode: screen;
}

body > * { position: relative; z-index: 2; }

body.has-mobile-ad {
  padding-bottom: 64px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 600;
}

h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.8vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.55rem); }
h4 { font-size: 1.15rem; }

p { text-wrap: pretty; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

::selection {
  background: rgba(74, 46, 92, 0.25);
  color: var(--plum-900);
}
[data-theme="dark"] ::selection {
  background: rgba(244, 162, 97, 0.3);
  color: var(--ivory);
}

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

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

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

.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.text-muted { color: var(--text-muted); }

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

.text-gradient-hero {
  background: var(--gradient-text-hero);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradient-pan 8s ease infinite;
}

.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }
.font-accent { font-family: var(--font-accent); }
.font-quote { font-family: var(--font-quote); font-style: italic; }

/* ─────────── Glassmorphism ─────────── */
.glass {
  background: var(--gradient-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .glass {
  border-color: rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: var(--gradient-glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .glass-card {
  border-color: rgba(255, 255, 255, 0.06);
}

/* Gradient border effect */
.gradient-border-card {
  position: relative;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
}

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

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

/* ─────────── Header ─────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 245, 234, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}

[data-theme="dark"] .site-header {
  background: rgba(15, 7, 18, 0.7);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
  background: rgba(250, 245, 234, 0.92);
}

[data-theme="dark"] .site-header.scrolled {
  background: rgba(15, 7, 18, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--heading);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
  transition: transform var(--transition);
}

.brand:hover { transform: scale(1.02); }

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--gradient-brand);
  color: var(--ivory);
  box-shadow: var(--shadow-brand);
  overflow: hidden;
}

.brand-mark::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--saffron-500);
  box-shadow: 0 0 0 2px var(--bg), 0 0 12px var(--saffron-500);
}

.brand-tag {
  display: block;
  font-family: var(--font-accent);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}

.brand-name { line-height: 1; }
.brand-name .accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .main-nav { display: flex; }
}

.main-nav a {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(74, 46, 92, 0.08);
  color: var(--heading);
}

[data-theme="dark"] .main-nav a:hover,
[data-theme="dark"] .main-nav a.active {
  background: rgba(244, 162, 97, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: rgba(74, 46, 92, 0.08);
  color: var(--heading);
  transform: rotate(15deg);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(244, 162, 97, 0.12);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ─────────── Buttons — with shimmer ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  font-family: var(--font-accent);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--gradient-brand);
  color: var(--ivory);
  box-shadow: var(--shadow-brand);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s var(--ease);
}

.btn-primary:hover {
  color: var(--ivory);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl), var(--shadow-brand);
}

.btn-primary:hover::before { left: 100%; }

.btn-gold {
  background: var(--gradient-accent);
  color: var(--accent-fg);
  box-shadow: 0 12px 32px -8px rgba(244, 162, 97, 0.5);
}

.btn-gold::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s var(--ease);
}

.btn-gold:hover {
  color: var(--accent-fg);
  transform: translateY(-2px);
  box-shadow: 0 20px 48px -8px rgba(244, 162, 97, 0.6);
}

.btn-gold:hover::before { left: 100%; }

.btn-outline {
  background: transparent;
  color: var(--heading);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg-elevated);
  color: var(--heading);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover { color: var(--heading); background: rgba(74, 46, 92, 0.06); }

[data-theme="dark"] .btn-ghost:hover { background: rgba(244, 162, 97, 0.08); }

.btn-sm { padding: 0.45rem 0.95rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.95rem 1.9rem; font-size: 1.05rem; }

.btn svg { width: 1em; height: 1em; }

/* ─────────── Mobile menu ─────────── */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--heading);
  transition: all var(--transition);
}

.menu-toggle:hover { background: rgba(74, 46, 92, 0.06); }

@media (min-width: 768px) {
  .menu-toggle { display: none; }
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 360px;
  background: var(--bg-elevated);
  z-index: 100;
  box-shadow: var(--shadow-2xl);
  flex-direction: column;
  padding: 1.25rem;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-spring);
}

.mobile-menu.open {
  transform: translateX(0);
}

@media (min-width: 768px) {
  .mobile-menu { display: none !important; }
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.mobile-menu-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.mobile-menu-close:hover { background: var(--bg-subtle); color: var(--heading); }

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-menu nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-accent);
  font-weight: 500;
  transition: all var(--transition);
}

.mobile-menu nav a:hover { background: var(--bg-subtle); padding-left: 1.25rem; }

.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 7, 18, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.menu-overlay.open { display: block; opacity: 1; }

@media (min-width: 768px) {
  .menu-overlay { display: none !important; }
}

/* ─────────── Badges & eyebrows ─────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.badge-primary {
  background: rgba(74, 46, 92, 0.1);
  color: var(--primary);
}

[data-theme="dark"] .badge-primary {
  background: rgba(168, 120, 176, 0.15);
  color: var(--plum-300);
}

.badge-gold {
  background: rgba(244, 162, 97, 0.15);
  color: var(--saffron-700);
}

[data-theme="dark"] .badge-gold {
  background: rgba(244, 162, 97, 0.18);
  color: var(--saffron-400);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

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

.card-hover {
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 46, 92, 0.3);
  box-shadow: var(--shadow-xl);
}

[data-theme="dark"] .card-hover:hover {
  border-color: rgba(244, 162, 97, 0.3);
}

/* Shine effect on hover */
.card-hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transition: left 0.8s var(--ease);
  pointer-events: none;
}

.card-hover:hover::after { left: 150%; }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: rgba(74, 46, 92, 0.1);
  color: var(--primary);
  margin-bottom: 1rem;
  transition: all var(--transition);
}

[data-theme="dark"] .card-icon {
  background: rgba(168, 120, 176, 0.15);
  color: var(--plum-300);
}

.card-hover:hover .card-icon {
  background: var(--gradient-brand);
  color: var(--ivory);
  transform: scale(1.08) rotate(-5deg);
}

/* ─────────── Hero ─────────── */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  z-index: 0;
  animation: mesh-shift 20s ease-in-out infinite;
}

@keyframes mesh-shift {
  0%, 100% { transform: scale(1) translate(0, 0); }
  33% { transform: scale(1.05) translate(-2%, 1%); }
  66% { transform: scale(1.02) translate(2%, -1%); }
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.4;
  mask-image: radial-gradient(70% 60% at 50% 0%, black, transparent);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, black, transparent);
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding: 3.5rem 0 4rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-inner {
    grid-template-columns: 7fr 5fr;
    padding: 5rem 0 6rem;
    gap: 3rem;
  }
}

.hero h1 { margin-bottom: 1.25rem; }
.hero-lead { font-size: 1.15rem; color: var(--text-muted); max-width: 36rem; margin-bottom: 1.75rem; }
@media (min-width: 640px) { .hero-lead { font-size: 1.25rem; } }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hero-trust span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.hero-trust svg { width: 14px; height: 14px; color: var(--accent); }

/* Hero preview card */
.hero-preview {
  position: relative;
}

.hero-preview::before {
  content: '';
  position: absolute;
  inset: -1.5rem;
  background: radial-gradient(circle, rgba(244, 162, 97, 0.15) 0%, rgba(199, 123, 92, 0.1) 50%, transparent 70%);
  border-radius: var(--radius-2xl);
  filter: blur(40px);
  z-index: 0;
  animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.preview-card {
  position: relative;
  background: var(--gradient-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-2xl);
  z-index: 1;
}

[data-theme="dark"] .preview-card {
  border-color: rgba(255, 255, 255, 0.08);
}

.preview-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.preview-card .label {
  font-family: var(--font-accent);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.preview-result {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.preview-result .amount {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1;
}

.preview-result .change {
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--saffron-600);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  background: rgba(244, 162, 97, 0.12);
}

[data-theme="dark"] .preview-result .change { color: var(--saffron-400); }

.preview-result .change svg { width: 14px; height: 14px; }

.preview-chart {
  height: 150px;
  margin-bottom: 0.75rem;
}

/* ─────────── Stats ─────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 2.5rem;
  box-shadow: var(--shadow-md);
}

@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat {
  background: var(--bg-elevated);
  padding: 1.75rem 1.25rem;
  text-align: center;
  transition: background var(--transition);
}

.stat:hover { background: var(--bg-subtle); }

.stat-value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (min-width: 640px) {
  .stat-value { font-size: 2.4rem; }
}

.stat-label {
  margin-top: 0.5rem;
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ─────────── Ticker ─────────── */
.ticker {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 0.75rem 0;
  overflow: hidden;
  position: relative;
}

.ticker::before, .ticker::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.ticker::before { left: 0; background: linear-gradient(to right, var(--bg-subtle), transparent); }
.ticker::after { right: 0; background: linear-gradient(to left, var(--bg-subtle), transparent); }

.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee 45s linear infinite;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ticker-item::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient-accent);
  box-shadow: 0 0 8px var(--saffron-500);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ─────────── Calculator grid (bento) ─────────── */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .calc-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .calc-grid { grid-template-columns: repeat(4, 1fr); }
}

.calc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  transition: all var(--transition);
  color: var(--text);
  overflow: hidden;
}

.calc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.calc-card:hover {
  color: var(--text);
  transform: translateY(-4px);
  border-color: rgba(74, 46, 92, 0.25);
  box-shadow: var(--shadow-xl);
}

[data-theme="dark"] .calc-card:hover {
  border-color: rgba(244, 162, 97, 0.3);
}

.calc-card:hover::before { transform: scaleX(1); }

.calc-card.featured {
  grid-column: span 1;
}

@media (min-width: 640px) {
  .calc-card.featured { grid-column: span 2; grid-row: span 2; }
}

.calc-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.calc-card p { font-size: 0.9rem; color: var(--text-muted); }

.calc-card .tag {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
}

.calc-card .open-cta {
  margin-top: 1rem;
  font-family: var(--font-accent);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transform: translateX(-8px);
  transition: all var(--transition);
}

.calc-card:hover .open-cta { opacity: 1; transform: translateX(0); }

/* ─────────── Knowledge categories ─────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
}

@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  color: var(--text);
  transition: all var(--transition);
}

.cat-card:hover {
  color: var(--text);
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(244, 162, 97, 0.3);
  box-shadow: var(--shadow-md);
}

.cat-card .label {
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--heading);
  margin-top: 0.5rem;
}
.cat-card .count { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ─────────── Guide cards ─────────── */
.guides-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) { .guides-grid { grid-template-columns: repeat(3, 1fr); } }

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  color: var(--text);
}

.guide-card:hover {
  color: var(--text);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(244, 162, 97, 0.3);
}

.guide-card-img {
  position: relative;
  height: 120px;
  background: linear-gradient(135deg, rgba(74, 46, 92, 0.15), rgba(244, 162, 97, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.guide-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.5;
}

.guide-card .badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--charcoal);
  z-index: 2;
  backdrop-filter: blur(8px);
}

.guide-card-body {
  padding: 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.guide-card h3 { font-family: var(--font-quote); font-size: 1.18rem; line-height: 1.3; font-weight: 500; }
.guide-card h3 a { color: var(--heading); }
.guide-card h3 a:hover { color: var(--primary); }
.guide-card p { font-size: 0.875rem; color: var(--text-muted); }
.guide-card .meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-accent);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* ─────────── Value props ─────────── */
.value-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) { .value-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .value-grid { grid-template-columns: repeat(4, 1fr); } }

/* ─────────── FAQ ─────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.faq-item[open] {
  border-color: rgba(244, 162, 97, 0.3);
  box-shadow: var(--shadow-md);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading);
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
  content: '+';
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--accent);
  transition: transform var(--transition);
  line-height: 1;
}

.faq-item[open] .faq-question::after { transform: rotate(45deg); }

.faq-answer {
  padding: 0 1.4rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ─────────── CTA ─────────── */
.cta {
  position: relative;
  overflow: hidden;
  background: var(--gradient-brand);
  color: var(--ivory);
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(244, 162, 97, 0.3) 50%, transparent 70%);
  background-size: 200% 200%;
  animation: gradient-pan 8s ease infinite;
}

.cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 50%, black, transparent);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 50%, black, transparent);
}

.cta-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4.5rem 0;
}

.cta h2 { color: var(--ivory); }
.cta p { color: rgba(255, 255, 255, 0.88); margin: 1rem auto 1.75rem; max-width: 36rem; }

.cta .btn-outline {
  background: transparent;
  color: var(--ivory);
  border-color: rgba(255, 255, 255, 0.35);
}

.cta .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ivory);
  border-color: rgba(255, 255, 255, 0.5);
}

@keyframes gradient-pan {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ─────────── Footer ─────────── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 3.5rem 0 1.5rem;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0.5;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 4fr 2fr 2fr 2fr 2fr; }
}

.footer-brand p { font-size: 0.875rem; color: var(--text-muted); margin-top: 1rem; max-width: 28rem; }

.footer-social { display: flex; gap: 0.5rem; margin-top: 1.25rem; }

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.footer-social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(244, 162, 97, 0.3);
}

.footer-col h4 {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--heading);
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.625rem; }
.footer-col a { font-size: 0.875rem; color: var(--text-muted); }
.footer-col a:hover { color: var(--accent); }

.footer-form { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }

.footer-form input {
  height: 40px;
  padding: 0 0.875rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color var(--transition);
}

.footer-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.footer-form button {
  height: 40px;
  padding: 0 0.875rem;
  border-radius: var(--radius);
  background: var(--gradient-brand);
  color: var(--ivory);
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
}

.footer-form button:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

.footer-bottom p { max-width: 36rem; text-align: left; }
@media (min-width: 640px) { .footer-bottom p:last-child { text-align: right; } }

/* ─────────── Ad slots ─────────── */
.ad-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  padding: 0.5rem;
  margin: 0 auto;
}

.ad-slot .ad-label {
  display: flex;
  justify-content: space-between;
  padding: 0 0.25rem 0.375rem;
  font-family: var(--font-accent);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.6;
}

.ad-leaderboard { min-height: 90px; max-width: 728px; width: 100%; }
.ad-in-article { min-height: 250px; max-width: 970px; width: 100%; }
.ad-rectangle { min-height: 250px; width: 300px; }
.ad-sidebar { min-height: 600px; width: 300px; }
.ad-anchor { min-height: 50px; max-width: 320px; width: 100%; }

.ad-placeholder {
  position: absolute;
  inset: 1.75rem 0.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-accent);
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
  gap: 0.25rem;
}

/* Mobile sticky ad */
.mobile-sticky-ad {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(250, 245, 234, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 0.375rem 0.5rem;
  box-shadow: 0 -8px 24px -4px rgba(45, 27, 61, 0.15);
}

[data-theme="dark"] .mobile-sticky-ad { background: rgba(15, 7, 18, 0.95); }

@media (max-width: 767px) {
  .mobile-sticky-ad { display: block; }
}

.mobile-sticky-ad .close-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  z-index: 2;
}

.mobile-sticky-ad .ad-slot { border: none; background: transparent; padding: 0; }

/* ─────────── Section header ─────────── */
.section-header {
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.section-header h2 { margin-bottom: 0.75rem; }
.section-header p { color: var(--text-muted); font-size: 1.0625rem; }

.accent-bar {
  display: block;
  width: 56px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  margin: 1.25rem auto 0;
  transform: scaleX(0);
  transform-origin: center;
  animation: scale-in 0.8s var(--ease) forwards;
  box-shadow: 0 0 16px rgba(244, 162, 97, 0.4);
}

@keyframes scale-in { to { transform: scaleX(1); } }

/* ─────────── Animation utilities ─────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

.stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.stagger.in-view > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger.in-view > *:nth-child(1) { transition-delay: 0.06s; }
.stagger.in-view > *:nth-child(2) { transition-delay: 0.12s; }
.stagger.in-view > *:nth-child(3) { transition-delay: 0.18s; }
.stagger.in-view > *:nth-child(4) { transition-delay: 0.24s; }
.stagger.in-view > *:nth-child(5) { transition-delay: 0.3s; }
.stagger.in-view > *:nth-child(6) { transition-delay: 0.36s; }
.stagger.in-view > *:nth-child(7) { transition-delay: 0.42s; }
.stagger.in-view > *:nth-child(8) { transition-delay: 0.48s; }

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-float-slow { animation: float 9s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

/* Shimmer for loading/skeleton */
.shimmer {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(244, 162, 97, 0.1) 50%,
    transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─────────── Calculator (interactive) ─────────── */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .calc-layout { grid-template-columns: 5fr 7fr; gap: 2.5rem; }
}

.calc-inputs {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.calc-inputs h3 { margin-bottom: 1.4rem; font-size: 1.2rem; }

.input-group { margin-bottom: 1.4rem; }

.input-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.input-label label {
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--heading);
}

.input-label .value {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(74, 46, 92, 0.08);
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .input-label .value { background: rgba(168, 120, 176, 0.15); }

.input-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.input-row input[type="number"] {
  flex: 1;
  height: 44px;
  padding: 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  transition: all var(--transition);
}

.input-row input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 46, 92, 0.12);
}

.input-row .suffix {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: linear-gradient(to right, var(--plum-600), var(--saffron-500));
  border-radius: var(--radius-full);
  outline: none;
  margin: 0;
}

[data-theme="dark"] input[type="range"] {
  background: linear-gradient(to right, var(--plum-500), var(--saffron-400));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  border-color: var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.calc-results {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.result-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
}

@media (min-width: 480px) {
  .result-cards { grid-template-columns: repeat(3, 1fr); }
}

.result-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  transition: all var(--transition);
}

.result-card:hover { box-shadow: var(--shadow-md); }

.result-card.highlight {
  background: var(--gradient-brand);
  color: var(--ivory);
  border-color: transparent;
  box-shadow: var(--shadow-brand);
}

.result-card .label {
  font-family: var(--font-accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
  margin-bottom: 0.4rem;
}

.result-card .value {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
}

@media (min-width: 640px) {
  .result-card .value { font-size: 1.55rem; }
}

.result-chart {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.result-chart h4 { font-size: 0.95rem; margin-bottom: 0.75rem; font-family: var(--font-accent); }

.result-table {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.result-table-header {
  padding: 0.9rem 1.3rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--heading);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-table-scroll {
  max-height: 380px;
  overflow-y: auto;
}

.result-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.result-table th {
  position: sticky;
  top: 0;
  background: var(--bg-subtle);
  text-align: left;
  padding: 0.7rem 1.05rem;
  font-family: var(--font-accent);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.result-table td {
  padding: 0.7rem 1.05rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  color: var(--text);
}

.result-table tr:last-child td { border-bottom: none; }
.result-table td:first-child { color: var(--text-muted); }

.result-table tr:hover td { background: var(--bg-subtle); }

/* Custom scrollbar */
.result-table-scroll::-webkit-scrollbar { width: 8px; }
.result-table-scroll::-webkit-scrollbar-track { background: var(--bg-subtle); }
.result-table-scroll::-webkit-scrollbar-thumb {
  background: var(--gradient-accent);
  border-radius: 4px;
}

/* Save/share buttons */
.calc-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

/* ─────────── Article / blog layout ─────────── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .article-layout { grid-template-columns: 8fr 3fr; }
}

.article-body { font-size: 1.0625rem; line-height: 1.8; color: var(--text); }
.article-body p { margin-bottom: 1.3rem; }
.article-body h2 { margin-top: 2.75rem; margin-bottom: 1.1rem; }
.article-body h3 { margin-top: 2.2rem; margin-bottom: 0.85rem; }
.article-body ul, .article-body ol { margin: 1.1rem 0 1.3rem 1.6rem; }
.article-body li { margin-bottom: 0.55rem; }
.article-body blockquote {
  margin: 1.75rem 0;
  padding: 1.25rem 1.75rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-quote);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--heading);
  position: relative;
}

.article-body blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 10px;
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.3;
  font-family: var(--font-display);
}

.article-body code {
  background: var(--bg-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--primary);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.article-meta span { display: inline-flex; align-items: center; gap: 0.375rem; }
.article-meta svg { width: 14px; height: 14px; }

.sidebar-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-card h4 {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.sidebar-card ul { list-style: none; }
.sidebar-card li { padding: 0.625rem 0; border-bottom: 1px solid var(--border); }
.sidebar-card li:last-child { border-bottom: none; }
.sidebar-card a { font-size: 0.875rem; color: var(--text); display: flex; gap: 0.625rem; align-items: flex-start; transition: color var(--transition); }
.sidebar-card a:hover { color: var(--accent); }
.sidebar-card .num { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; color: var(--accent); opacity: 0.7; }

@media (min-width: 1024px) {
  .article-sidebar { position: sticky; top: 90px; align-self: start; }
}

/* ─────────── Page hero (inner pages) ─────────── */
.page-hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0 3rem;
  overflow: hidden;
}

.page-hero .bg-mesh {
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  z-index: 0;
  animation: mesh-shift 25s ease-in-out infinite;
}

.page-hero > .container { position: relative; z-index: 1; }
.page-hero h1 { margin-bottom: 0.85rem; }
.page-hero .lead { font-size: 1.15rem; color: var(--text-muted); max-width: 42rem; }
.page-hero .breadcrumbs {
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.page-hero .breadcrumbs a { color: var(--text-muted); }
.page-hero .breadcrumbs a:hover { color: var(--accent); }
.page-hero .breadcrumbs span { margin: 0 0.5rem; }

/* ─────────── Founder card (about page) ─────────── */
.founder-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.founder-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent);
}

@media (min-width: 768px) {
  .founder-card { grid-template-columns: 200px 1fr; padding: 2.75rem; }
}

.founder-avatar {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  margin: 0 auto;
  box-shadow: var(--shadow-brand);
  position: relative;
}

.founder-avatar::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.4;
  animation: pulse-ring 3s ease-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.15); opacity: 0; }
}

.founder-info h3 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.founder-info .title {
  font-family: var(--font-accent);
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
}
.founder-info .bio { color: var(--text-muted); margin-bottom: 1rem; }

.founder-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.founder-details div { display: flex; flex-direction: column; gap: 0.125rem; }
.founder-details .key {
  font-family: var(--font-accent);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.founder-details .val { color: var(--heading); font-weight: 500; }

/* ─────────── Contact form ─────────── */
.contact-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .contact-form { grid-template-columns: 1fr 1fr; }
}

.contact-form .full { grid-column: 1 / -1; }
.contact-form label {
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--heading);
  display: block;
  margin-bottom: 0.4rem;
}
.contact-form input, .contact-form textarea, .contact-form select {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  transition: all var(--transition);
}

.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 46, 92, 0.12);
}

.contact-form textarea { min-height: 150px; resize: vertical; }

/* ─────────── Utility ─────────── */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }

/* ─────────── Decorative elements ─────────── */
.decorative-line {
  position: relative;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-strong), transparent);
  margin: 3rem 0;
}

.decorative-line::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
}

/* ─────────── Reduced motion ─────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .stagger > * { opacity: 1 !important; transform: none !important; }
  .hero-bg, .cta::before, .hero-preview::before, .founder-avatar::after { animation: none !important; }
}

/* ─────────── Print ─────────── */
@media print {
  .site-header, .site-footer, .mobile-sticky-ad, .ad-slot, .menu-toggle, .theme-toggle, .cta, body::before { display: none !important; }
  body { color: black; background: white; }
}

/* ─────────── Mobile fixes for blog sidebar and overflow ─────────── */

/* On mobile, sidebar should appear below article, not blur or disappear */
@media (max-width: 1023px) {
  .article-layout {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .article-sidebar {
    position: static !important;
    top: auto !important;
    align-self: auto !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    max-height: none !important;
    overflow: visible !important;
    transform: none !important;
  }

  .sidebar-card {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
}

/* Fix horizontal overflow on mobile */
@media (max-width: 767px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .container, .container-narrow {
    padding: 0 1rem;
    max-width: 100%;
  }

  /* Prevent tables from causing horizontal scroll */
  .result-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .result-table table {
    min-width: 500px;
  }

  /* Fix chart containers */
  .result-chart, .preview-chart {
    overflow: hidden;
    max-width: 100%;
  }

  .result-chart svg, .preview-chart svg {
    max-width: 100%;
    height: auto;
  }

  /* Fix hero preview on mobile */
  .hero-inner {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  .hero-preview {
    max-width: 100%;
    overflow: hidden;
  }

  .preview-card {
    max-width: 100%;
    overflow: hidden;
  }

  /* Fix calculator layout on mobile */
  .calc-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  .calc-inputs, .calc-results {
    max-width: 100%;
    overflow: hidden;
  }

  /* Fix result cards on mobile */
  .result-cards {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  /* Fix grid-2 on mobile */
  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  /* Fix stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Fix calc grid */
  .calc-grid {
    grid-template-columns: 1fr !important;
  }

  .calc-card.featured {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }

  /* Fix guides grid */
  .guides-grid {
    grid-template-columns: 1fr !important;
  }

  /* Fix category grid */
  .cat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Fix value grid */
  .value-grid {
    grid-template-columns: 1fr !important;
  }

  /* Fix founder card */
  .founder-card {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* Fix footer grid */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* Ensure all text is readable */
  body {
    font-size: 16px;
  }

  h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
  h2 { font-size: clamp(1.5rem, 5vw, 2rem); }

  /* Fix article body on mobile */
  .article-body {
    font-size: 1rem;
    line-height: 1.7;
  }

  .article-body p { margin-bottom: 1rem; }
  .article-body h2 { margin-top: 2rem; margin-bottom: 0.75rem; }
  .article-body h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; }

  /* Fix blockquote on mobile */
  .article-body blockquote {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
  }

  /* Fix input groups on mobile */
  .input-group {
    margin-bottom: 1rem;
  }

  .input-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .value-display {
    width: 100%;
  }

  .value-input {
    width: 100%;
    text-align: left;
  }

  /* Fix cookie banner on mobile */
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .cookie-banner-content {
    flex-direction: row;
  }

  .cookie-banner-actions {
    justify-content: flex-end;
  }
}

/* Fix for very small screens */
@media (max-width: 380px) {
  .container, .container-narrow {
    padding: 0 0.75rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }

  .btn { font-size: 0.85rem; padding: 0.6rem 1.1rem; }
  .btn-lg { font-size: 0.95rem; padding: 0.8rem 1.5rem; }

  .section { padding: 2.5rem 0; }
  .page-hero { padding: 2rem 0 1.5rem; }
}

/* Ensure sidebar is always visible (not blurred) */
.sidebar-card {
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  -webkit-filter: none !important;
}

/* Fix backdrop-filter issues on mobile */
@media (max-width: 767px) {
  .site-header,
  .preview-card,
  .glass,
  .glass-card,
  .cookie-banner,
  .mobile-sticky-ad {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  /* If backdrop-filter causes blur on content, remove it */
  .article-body,
  .sidebar-card,
  .card,
  .calc-inputs,
  .calc-results,
  .result-chart,
  .result-table {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    -webkit-filter: none !important;
  }
}
