/* ============================================================
   CALCMASTER — Design System
   Premium SEO-first Calculator Website
   ============================================================ */

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

/* ============================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* ---- Brand Colors ---- */
  --primary: #4F46E5;
  --primary-deep: #3730A3;
  --primary-soft: #818CF8;
  --primary-tint: #EEF2FF;
  --primary-glow: rgba(79, 70, 229, 0.15);

  --accent: #06B6D4;
  --accent-deep: #0891B2;
  --accent-tint: #ECFEFF;

  --success: #10B981;
  --success-deep: #059669;
  --success-tint: #D1FAE5;

  --warning: #F59E0B;
  --warning-tint: #FEF3C7;

  --danger: #EF4444;
  --danger-tint: #FEE2E2;

  /* ---- Neutral Palette ---- */
  --ink: #0F172A;
  --ink-secondary: #334155;
  --slate: #64748B;
  --slate-light: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --cloud: #F8FAFC;
  --white: #FFFFFF;

  /* ---- Semantic Tokens (Light) ---- */
  --bg-body: var(--cloud);
  --bg-surface: var(--white);
  --bg-surface-hover: #F1F5F9;
  --bg-elevated: var(--white);
  --bg-input: var(--white);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-secondary);
  --text-muted: var(--slate);
  --text-faint: var(--slate-light);
  --border-color: var(--border);
  --border-subtle: var(--border-light);
  --header-bg: rgba(255, 255, 255, 0.88);
  --header-border: var(--border);
  --mega-bg: var(--white);
  --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(79, 70, 229, 0.06);
  --card-shadow-hover: 0 12px 36px rgba(79, 70, 229, 0.12);
  --mega-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --overlay-bg: rgba(15, 23, 42, 0.45);

  /* ---- Typography ---- */
  --font-display: 'Poppins', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

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

  /* ---- Radii ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ---- Transitions ---- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* ---- Layout ---- */
  --max-width: 1160px;
  --header-height: 64px;
  --sidebar-width: 280px;
}

/* ============================================================
   2. DARK MODE TOKENS
   ============================================================ */
html.dark {
  --bg-body: #0B0F1A;
  --bg-surface: #141826;
  --bg-surface-hover: #1C2035;
  --bg-elevated: #1A1E30;
  --bg-input: #141826;
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-faint: #64748B;
  --border-color: #1E293B;
  --border-subtle: #1A1E30;
  --header-bg: rgba(11, 15, 26, 0.88);
  --header-border: #1E293B;
  --mega-bg: #141826;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 12px 36px rgba(79, 70, 229, 0.2);
  --mega-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  --overlay-bg: rgba(0, 0, 0, 0.6);
  --primary-tint: rgba(79, 70, 229, 0.12);
  --accent-tint: rgba(6, 182, 212, 0.1);
  --success-tint: rgba(16, 185, 129, 0.1);
  --warning-tint: rgba(245, 158, 11, 0.1);
  --danger-tint: rgba(239, 68, 68, 0.1);
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv01', 'cv11';
  letter-spacing: -0.006em;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

html.dark :focus-visible {
  outline-color: var(--primary-soft);
}

::selection {
  background-color: var(--primary);
  color: white;
}

/* ============================================================
   4. TYPOGRAPHY
   ============================================================ */
.font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

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

h1 { font-size: clamp(2rem, 5vw, var(--text-5xl)); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.5vw, var(--text-3xl)); }
h3 { font-size: clamp(1.2rem, 2.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

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

/* ============================================================
   5. LAYOUT UTILITIES
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.section {
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
}

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

.grid {
  display: grid;
  gap: var(--space-6);
}

.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-5 { grid-template-columns: repeat(5, 1fr); }

.flex {
  display: flex;
}

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

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ============================================================
   6. HEADER & NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--header-border);
  height: var(--header-height);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--primary);
  letter-spacing: -0.03em;
}

.logo svg {
  width: 32px;
  height: 32px;
}

.logo-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Desktop Navigation */
.desktop-nav {
  display: none;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-item {
  position: relative;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.nav-btn:hover,
.nav-btn:focus {
  color: var(--primary);
  background: var(--primary-tint);
}

.nav-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  transition: transform var(--duration-fast) ease;
}

.nav-item:hover .nav-btn svg,
.nav-item:focus-within .nav-btn svg {
  transform: rotate(180deg);
}

/* Mega Menu */
.mega-menu {
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 12px;
  transition: opacity var(--duration-fast) ease,
              transform var(--duration-fast) ease,
              visibility 0s linear var(--duration-fast);
  z-index: 60;
}

.nav-item:hover > .mega-menu,
.nav-item:focus-within > .mega-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity var(--duration-fast) ease,
              transform var(--duration-fast) ease,
              visibility 0s;
}

/* Invisible hover bridge */
.mega-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
}

.mega-inner {
  background: var(--mega-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--mega-shadow);
  padding: var(--space-6);
  min-width: 360px;
}

.mega-inner.mega-wide {
  min-width: 520px;
}

.mega-inner.mega-extra-wide {
  min-width: 720px;
}

.mega-col-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--primary);
  margin-bottom: var(--space-3);
}

html.dark .mega-col-title {
  color: var(--primary-soft);
}

.mega-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mega-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--duration-fast) ease;
}

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

html.dark .mega-links a:hover {
  color: var(--white);
}

.mega-view-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: var(--space-3);
}

html.dark .mega-view-all {
  color: var(--primary-soft);
}

/* Mega featured card */
.mega-featured {
  background: var(--success-tint);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
}

.mega-featured-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success-deep);
  margin-bottom: var(--space-1);
}

html.dark .mega-featured-label {
  color: var(--success);
}

.mega-featured-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--leading-snug);
}

.mega-featured-title:hover {
  color: var(--primary);
}

/* Right cluster */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Search trigger */
.search-trigger {
  display: none;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  border-radius: var(--radius-full);
  padding: 0 var(--space-3);
  height: 40px;
  width: 220px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast) ease;
}

.search-trigger:hover {
  border-color: var(--primary);
}

.search-trigger svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.search-trigger kbd {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-faint);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1px 6px;
}

.search-trigger-mobile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.search-trigger-mobile svg {
  width: 20px;
  height: 20px;
}

/* Theme Toggle */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: background var(--duration-fast) ease;
}

.theme-toggle:hover {
  background: var(--primary-tint);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-moon {
  display: none;
}

html.dark .theme-toggle .icon-sun {
  display: none;
}

html.dark .theme-toggle .icon-moon {
  display: block;
}

/* Mobile menu button */
.menu-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   7. MOBILE DRAWER
   ============================================================ */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--ease-out);
}

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

.drawer-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 88%;
  max-width: 380px;
  background: var(--bg-surface);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
}

.drawer-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.drawer-close svg {
  width: 20px;
  height: 20px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
}

.drawer-search-btn {
  display: flex;
  width: 100%;
  align-items: center;
  gap: var(--space-3);
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.drawer-search-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.drawer-label {
  padding: 0 var(--space-1);
  margin-bottom: var(--space-1);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.drawer-links a {
  display: block;
  padding: var(--space-3) 0;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-links a:last-child {
  border-bottom: none;
}

/* ============================================================
   8. SEARCH OVERLAY
   ============================================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
}

.search-overlay.open {
  display: block;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.search-dialog {
  position: relative;
  max-width: 580px;
  width: 92%;
  margin: 10vh auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--mega-shadow);
  overflow: hidden;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.search-input-row svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  padding: var(--space-4) 0;
  background: transparent;
  outline: none;
  font-size: var(--text-base);
  color: var(--text-primary);
}

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

.search-esc {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-faint);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
}

.search-esc:hover {
  color: var(--primary);
}

.search-results {
  max-height: 58vh;
  overflow-y: auto;
  padding: var(--space-2);
}

.search-results-label {
  padding: var(--space-2) var(--space-3);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  transition: background var(--duration-fast) ease;
}

.search-result-item:hover,
.search-result-item.active {
  background: var(--primary-tint);
}

.search-result-name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-cat {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  flex-shrink: 0;
}

.search-empty {
  padding: var(--space-8) var(--space-3);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ============================================================
   9. HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-blob-1 {
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: var(--primary-tint);
  filter: blur(80px);
  opacity: 0.5;
}

html.dark .hero-blob-1 {
  background: var(--primary);
  opacity: 0.06;
}

.hero-blob-2 {
  position: absolute;
  bottom: -60px;
  left: 20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.08);
  filter: blur(60px);
}

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

.hero-grid {
  display: grid;
  gap: var(--space-12);
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  box-shadow: var(--card-shadow);
}

html.dark .hero-badge {
  color: var(--primary-soft);
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.hero h1 {
  margin-top: var(--space-6);
  max-width: 640px;
}

.hero h1 .highlight {
  color: var(--primary);
}

html.dark .hero h1 .highlight {
  color: var(--primary-soft);
}

.hero-desc {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 560px;
  line-height: var(--leading-relaxed);
}

/* Hero Search Bar */
.hero-search {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: var(--space-2);
  margin-top: var(--space-8);
  max-width: 560px;
}

.hero-search-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  padding: 0 var(--space-3);
}

.hero-search-inner svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.hero-search-input {
  width: 100%;
  padding: var(--space-1) 0;
  background: transparent;
  outline: none;
  font-size: 0.98rem;
  color: var(--text-primary);
}

.hero-search-input::placeholder {
  color: var(--text-faint);
}

.hero-search-btn {
  flex-shrink: 0;
  background: var(--success);
  color: white;
  font-weight: 600;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-lg);
  transition: background var(--duration-fast) ease;
}

.hero-search-btn:hover {
  background: var(--success-deep);
}

/* Popular Tags */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.hero-tags-label {
  font-size: 0.84rem;
  color: var(--text-faint);
  margin-right: var(--space-1);
}

.hero-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 500;
  transition: all var(--duration-fast) ease;
}

html.dark .hero-tag {
  color: var(--text-secondary);
}

.hero-tag:hover {
  background: var(--primary);
  color: white;
}

/* Hero Visual */
.hero-visual {
  display: none;
  position: relative;
}

.hero-illustration {
  position: relative;
  width: 320px;
  margin: 0 auto;
}

.hero-float-card {
  position: absolute;
  bottom: -10px;
  left: -40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow-hover);
  padding: var(--space-3);
  width: 180px;
  animation: floatCard 0.6s var(--ease-out) 0.35s both;
}

.hero-float-label {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.hero-float-result {
  margin-top: var(--space-1);
  background: var(--success-tint);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.hero-float-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

html.dark .hero-float-number {
  color: var(--primary-soft);
}

/* Hero decorative blobs */
.hero-deco-1 {
  position: absolute;
  left: -24px;
  top: 40px;
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: rgba(16, 185, 129, 0.1);
  transform: rotate(12deg);
  animation: blobFloat 6.5s ease-in-out infinite;
}

.hero-deco-2 {
  position: absolute;
  right: -16px;
  top: -12px;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(79, 70, 229, 0.08);
  transform: rotate(-6deg);
  animation: blobFloat 8s ease-in-out infinite;
  animation-delay: -2s;
}

/* ============================================================
   10. CATEGORY GRID
   ============================================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.category-card {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-top: 3px solid transparent;
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: var(--space-5);
  transition: all var(--duration-normal) var(--ease-out);
}

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

.category-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--primary-tint);
  color: var(--primary);
  margin-bottom: var(--space-4);
}

html.dark .category-icon {
  color: var(--primary-soft);
}

.category-icon svg {
  width: 24px;
  height: 24px;
}

.category-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
}

.category-count {
  font-size: 0.84rem;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ============================================================
   11. CALCULATOR CARD (for listings)
   ============================================================ */
.calc-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--card-shadow);
  transition: all var(--duration-normal) var(--ease-out);
}

.calc-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.calc-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-tint);
  color: var(--primary);
  flex-shrink: 0;
}

html.dark .calc-card-icon {
  color: var(--primary-soft);
}

.calc-card-icon svg {
  width: 22px;
  height: 22px;
}

.calc-card-info {
  flex: 1;
  min-width: 0;
}

.calc-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.calc-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.calc-card-arrow {
  color: var(--text-faint);
  flex-shrink: 0;
  transition: transform var(--duration-fast) ease;
}

.calc-card:hover .calc-card-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

.calc-card-arrow svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   12. SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.section-header p {
  margin-top: var(--space-2);
  color: var(--text-muted);
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  transition: gap var(--duration-fast) ease;
}

html.dark .section-link {
  color: var(--primary-soft);
}

.section-link:hover {
  gap: 8px;
}

/* ============================================================
   13. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-6);
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-deep);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: var(--success-deep);
}

.btn-outline {
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
}

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

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

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

/* ============================================================
   14. FAQ ACCORDION
   ============================================================ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--duration-fast) ease;
}

.faq-item:hover {
  box-shadow: var(--card-shadow);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  gap: var(--space-3);
}

.faq-question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform var(--duration-normal) ease;
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) ease;
}

.faq-answer-inner {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  font-size: 0.95rem;
}

/* ============================================================
   15. FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-20);
}

.footer-grid {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-16) 0 var(--space-12);
}

.footer-brand p {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 300px;
  line-height: var(--leading-relaxed);
}

.footer-col-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--duration-fast) ease;
}

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

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

.footer-bottom-links {
  display: flex;
  gap: var(--space-4);
}

.footer-bottom-links a {
  color: var(--text-faint);
  transition: color var(--duration-fast) ease;
}

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

/* ============================================================
   16. BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  font-size: var(--text-sm);
}

.breadcrumbs a {
  color: var(--text-muted);
  transition: color var(--duration-fast) ease;
}

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

.breadcrumbs .sep {
  color: var(--text-faint);
  font-size: 0.7rem;
}

.breadcrumbs .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================================
   17. AD SLOTS (Reserved)
   ============================================================ */
.ad-slot {
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-faint);
  margin: var(--space-8) 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   18. ANIMATIONS
   ============================================================ */
@keyframes floatCard {
  from {
    transform: translateY(12px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes blobFloat {
  0%, 100% {
    transform: translateY(0) rotate(var(--blob-rotate, 12deg));
  }
  50% {
    transform: translateY(14px) rotate(var(--blob-rotate, 12deg));
  }
}

@keyframes heroFloat {
  0%, 100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-16px) rotate(-1.5deg);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s var(--ease-out) both;
}

.animate-float {
  animation: heroFloat 5.5s ease-in-out infinite;
  transform-origin: 50% 90%;
  will-change: transform;
}

/* ============================================================
   19. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .search-trigger-mobile {
    display: none;
  }

  .search-trigger {
    display: flex;
  }

  .hero-content {
    padding: var(--space-20) 0 var(--space-24);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .category-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .hero-visual {
    display: block;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
  :root {
    --max-width: 1200px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
