/* ============================================
   CSS VARIABLES & RESET
   ============================================ */
:root {
  --bg: #0c0f1a;
  --bg-2: #111525;
  --bg-3: #161b2e;
  --surface: #1a2035;
  --surface-2: #202640;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);
  --text: #e8ecf4;
  --text-muted: #7a84a0;
  --text-dim: #4a5270;
  --accent: #4fffb0;
  --accent-dim: rgba(79,255,176,0.12);
  --accent-glow: rgba(79,255,176,0.3);
  --blue: #5b9cf6;
  --blue-dim: rgba(91,156,246,0.12);
  --orange: #ff8c42;
  --orange-dim: rgba(255,140,66,0.12);
  --purple: #a78bfa;
  --purple-dim: rgba(167,139,250,0.12);
  --pink: #fb7185;
  --pink-dim: rgba(251,113,133,0.12);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251,191,36,0.12);
  --teal: #22d3ee;
  --teal-dim: rgba(34,211,238,0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 68px;
}

/* Light theme — blue accent palette matching the CalcPocket logo */
body.light-theme {
  --bg: #f0f4ff;
  --bg-2: #e8edfb;
  --bg-3: #dde4f7;
  --surface: #ffffff;
  --surface-2: #eef2fc;
  --border: rgba(37,99,235,0.1);
  --border-hover: rgba(37,99,235,0.22);
  --text: #0d1533;
  --text-muted: #4a5680;
  --text-dim: #8e9abf;
  /* Primary accent: vivid blue matching the logo */
  --accent: #2563eb;
  --accent-dim: rgba(37,99,235,0.1);
  --accent-glow: rgba(37,99,235,0.28);
  /* Secondary blue kept consistent */
  --blue: #1d4ed8;
  --blue-dim: rgba(29,78,216,0.1);
  /* Keep other palette colours but slightly adjusted for light bg */
  --orange: #ea6f1a;
  --orange-dim: rgba(234,111,26,0.1);
  --purple: #7c3aed;
  --purple-dim: rgba(124,58,237,0.1);
  --pink: #e11d48;
  --pink-dim: rgba(225,29,72,0.1);
  --teal: #0891b2;
  --teal-dim: rgba(8,145,178,0.1);
  --shadow: 0 4px 24px rgba(37,99,235,0.08);
  --shadow-lg: 0 8px 48px rgba(37,99,235,0.14);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ============================================
   BACKGROUND GRID
   ============================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(79,255,176,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,255,176,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

body.light-theme::before {
  background-image:
    linear-gradient(rgba(37,99,235,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.04) 1px, transparent 1px);
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(12,15,26,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

body.light-theme .site-header {
  background: rgba(240,244,255,0.92);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: block;
}
.logo-wordmark {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.logo-calc { color: var(--text); }
.logo-pocket { color: var(--accent); }

/* Nav */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 16px;
}
.nav-menu a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-menu a:hover {
  color: var(--text);
  background: var(--surface);
}

/* Desktop Search */
.nav-search {
  flex: 1;
  max-width: 320px;
  position: relative;
}
.nav-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav-search input::placeholder { color: var(--text-dim); }
.nav-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
}

/* Search dropdown (shared by nav + hero search) */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
}
.search-dropdown.open { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.search-result-item:hover { background: var(--surface-2); color: var(--text); }
.search-result-cat {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  /* Always on the far right */
  margin-left: auto;
}
/* Hide hamburger on desktop; mobile-menu.js shows it via JS on ≤1024px */
#menuToggle {
  display: none;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-2);
}

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.mobile-menu-overlay.open { opacity: 1; visibility: visible; }

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  background: var(--bg-2);
  z-index: 151;
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* Mobile search — inside the drawer */
.mobile-search {
  position: relative;
  margin-bottom: 20px;
}
.mobile-search input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.mobile-search input::placeholder { color: var(--text-dim); }
.mobile-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.mobile-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
}
/* Mobile search dropdown */
.mobile-search .search-dropdown {
  right: 0;
}

.mobile-nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav a {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}
.mobile-nav a i { width: 18px; text-align: center; color: var(--text-dim); transition: color var(--transition); }
.mobile-nav a:hover { background: var(--surface); color: var(--text); }
.mobile-nav a:hover i { color: var(--accent); }

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 60px;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79,255,176,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}
body.light-theme .hero::before {
  background: radial-gradient(circle, rgba(37,99,235,0.07) 0%, transparent 70%);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}
.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.hero-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 20px;
  color: var(--text);
}
.hero-title span {
  color: var(--accent);
  position: relative;
}
.hero-title span::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.4;
}

.hero-desc {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-num {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}
.stat-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

/* ============================================
   HERO CALCULATOR
   ============================================ */
.calc-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 60px var(--accent-dim);
  animation: floatUp 0.7s cubic-bezier(0.4,0,0.2,1) both;
  animation-delay: 0.1s;
  width: 100%;
}
@keyframes floatUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.calc-titlebar {
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.calc-dots { display: flex; gap: 6px; }
.calc-dot { width: 11px; height: 11px; border-radius: 50%; }
.calc-dot:nth-child(1) { background: #ff5f57; }
.calc-dot:nth-child(2) { background: #febc2e; }
.calc-dot:nth-child(3) { background: #28c840; }
.calc-title-text {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 6px;
}

.calc-display {
  padding: 20px 20px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.calc-expression {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-dim);
  min-height: 18px;
  text-align: right;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calc-value {
  font-family: 'Bricolage Grotesque', monospace;
  font-size: 44px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  line-height: 1;
  letter-spacing: -2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.1s;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  padding: 1px;
}
.calc-btn {
  background: var(--surface);
  border: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  padding: 18px 10px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.08s;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.calc-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--text);
  opacity: 0;
  transition: opacity 0.15s;
}
.calc-btn:hover::after { opacity: 0.04; }
.calc-btn:active { transform: scale(0.95); }
.calc-btn:active::after { opacity: 0.08; }
.calc-btn.fn { background: var(--bg-3); color: var(--accent); font-size: 14px; }
.calc-btn.op { background: var(--bg-3); color: var(--blue); font-family: 'DM Mono', monospace; }
.calc-btn.eq {
  background: var(--accent);
  color: #0c0f1a;
  font-weight: 700;
  grid-row: span 2;
}
.calc-btn.eq:hover::after { opacity: 0.1; }
.calc-btn.zero { grid-column: span 2; }

/* ============================================
   HERO SEARCH BAR
   ============================================ */
.search-section {
  max-width: 1280px;
  margin: 0 auto;
  /* Extra bottom padding so the dropdown has room before the trust strip */
  padding: 0 24px 80px;
  position: relative;
  /* Isolate stacking context so the dropdown floats above everything below */
  z-index: 20;
  isolation: isolate;
}
.search-bar {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  /* overflow visible is critical — lets dropdown escape the bar bounds */
  overflow: visible;
}
.search-bar input {
  width: 100%;
  padding: 16px 60px 16px 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  z-index: 1;
}
.search-bar input::placeholder { color: var(--text-dim); }
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 4px var(--accent-dim);
}
.search-bar-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 16px;
  pointer-events: none;
  z-index: 2;
}
/* Hero search dropdown — must float above the trust-strip below */
.search-bar .search-dropdown {
  border-radius: var(--radius);
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  /* High z-index within the isolated stacking context */
  z-index: 9999;
  /* Override overflow:hidden from base .search-dropdown */
  overflow: visible;
}

/* ============================================
   CATEGORIES SECTION
   ============================================ */
.categories-section {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 16px;
}
.section-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--text);
}
.section-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: gap var(--transition);
}
.section-link:hover { gap: 10px; }

/* Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.cat-card:hover {
  border-color: var(--card-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 40px var(--card-glow);
}

.cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent);
  opacity: 0;
  transition: opacity var(--transition);
}
.cat-card:hover::before { opacity: 1; }

.cat-card::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--card-glow-bg) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}
.cat-card:hover::after { opacity: 1; }

/* Per-card accent colors */
.cat-card.finance    { --card-accent: var(--accent);  --card-glow: var(--accent-glow);    --card-glow-bg: var(--accent-dim);  }
.cat-card.health     { --card-accent: var(--pink);     --card-glow: rgba(251,113,133,0.2); --card-glow-bg: var(--pink-dim);    }
.cat-card.datetime   { --card-accent: var(--blue);     --card-glow: rgba(91,156,246,0.2);  --card-glow-bg: var(--blue-dim);    }
.cat-card.math       { --card-accent: var(--orange);   --card-glow: rgba(255,140,66,0.2);  --card-glow-bg: var(--orange-dim);  }
.cat-card.converters { --card-accent: var(--purple);   --card-glow: rgba(167,139,250,0.2); --card-glow-bg: var(--purple-dim);  }
.cat-card.other      { --card-accent: var(--teal);     --card-glow: rgba(34,211,238,0.2);  --card-glow-bg: var(--teal-dim);    }

/* Centered icon + title header */
.cat-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.cat-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--card-glow-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--card-accent);
  margin-bottom: 12px;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid rgba(255,255,255,0.06);
}
.cat-card:hover .cat-icon-wrap {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 0 20px var(--card-glow);
}

.cat-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}

.cat-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}
.cat-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
  margin: 0 -10px;
}
.cat-links a::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--card-accent);
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity var(--transition);
}
.cat-links a:hover {
  background: var(--card-glow-bg);
  color: var(--text);
  padding-left: 14px;
}
.cat-links a:hover::before { opacity: 1; }

.cat-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.cat-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--card-accent);
  transition: gap var(--transition);
}
.cat-cta:hover { gap: 12px; }

/* ============================================
   TRUST STRIP
   ============================================ */
.trust-strip {
  position: relative;
  /* z-index: 0 keeps trust-strip behind .search-section (z-index:20) */
  z-index: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 80px;
}
.trust-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
.trust-item i { font-size: 18px; color: var(--accent); }

/* ============================================
   FOOTER
   ============================================ */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  position: relative;
  z-index: 1;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy { font-size: 13px; color: var(--text-dim); }
.footer-links { display: flex; gap: 4px; flex-wrap: wrap; }
.footer-links a {
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.footer-links a:hover { color: var(--text); background: var(--surface); }
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.footer-social a:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface);
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .nav-menu { display: none; }
  .nav-search { display: none; }

  /* On mobile the logo stays left; header-actions (margin-left:auto) goes right */
  .header-inner {
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 48px 24px 40px;
    gap: 40px;
  }

  /* Calculator takes full width on tablet, capped at 440px and centered */
  .calc-widget {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
  }

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

@media (max-width: 640px) {
  .hero { padding: 32px 20px 32px; }
  .hero-stats { gap: 20px; }
  .stat-divider { display: none; }

  /* Calculator full width on mobile */
  .calc-widget {
    max-width: 100%;
  }
  .calc-btn { padding: 16px 8px; font-size: 15px; }
  .calc-value { font-size: 36px; }

  .category-grid { grid-template-columns: 1fr; }
  .trust-inner { gap: 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
