/* ============================================================
   EMPRUNT.NET — "La Clarté Immobilière"
   Premium French Mortgage Platform
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Brand Palette */
  --navy-900: #0a1628;
  --navy-800: #0f2140;
  --navy-700: #142d54;
  --navy-600: #1a3a6b;
  --navy-500: #234d8a;
  --navy-400: #3a6db5;
  --navy-300: #5a8fd4;
  --navy-200: #8db4e6;
  --navy-100: #c6d9f2;
  --navy-50: #e8f0fa;

  --gold-500: #c9a84c;
  --gold-400: #d4b85e;
  --gold-300: #e0c976;
  --gold-200: #ebdaa0;
  --gold-100: #f5ecd0;

  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --red-500: #ef4444;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --max-width: 1280px;
  --header-height: 72px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10,22,40,0.06);
  --shadow-md: 0 4px 12px rgba(10,22,40,0.08);
  --shadow-lg: 0 8px 30px rgba(10,22,40,0.12);
  --shadow-xl: 0 16px 50px rgba(10,22,40,0.16);
  --shadow-gold: 0 4px 20px rgba(201,168,76,0.2);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  color: var(--slate-800);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select { font-family: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; color: var(--navy-900); }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); letter-spacing: -0.015em; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin-bottom: var(--space-md);
}

.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--gold-500);
}

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--slate-200);
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--navy-900);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-400);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.logo span { color: var(--gold-500); }

/* Desktop Nav */
.main-nav { display: flex; align-items: center; gap: var(--space-xs); }

.nav-item {
  position: relative;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-700);
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast), background var(--duration-fast);
}

.nav-item:hover {
  color: var(--navy-800);
  background: var(--slate-100);
}

.nav-item.has-dropdown { padding-right: 1.75rem; }

.nav-item.has-dropdown::after {
  content: '';
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-top-color: var(--slate-500);
}

/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 260px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast), transform var(--duration-fast) var(--ease-out);
}

/* Create invisible bridge to maintain hover state */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background: transparent;
  pointer-events: all;
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown,
.nav-dropdown:hover {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.dropdown-link {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast);
}

.dropdown-link:hover { background: var(--slate-50); }

.dropdown-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.dropdown-icon.calc { background: var(--navy-50); color: var(--navy-600); }
.dropdown-icon.rate { background: var(--gold-100); color: var(--gold-500); }
.dropdown-icon.guide { background: #ecfdf5; color: var(--emerald-500); }

.dropdown-text strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 2px;
}

.dropdown-text span {
  font-size: 0.75rem;
  color: var(--slate-500);
  line-height: 1.4;
}

.nav-cta {
  margin-left: var(--space-sm);
  padding: 9px 20px;
  background: var(--navy-800);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast), transform var(--duration-fast);
}

.nav-cta:hover { background: var(--navy-700); transform: translateY(-1px); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--navy-800);
}

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

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  padding: calc(var(--header-height) + var(--space-3xl)) 0 var(--space-4xl);
  background: linear-gradient(175deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
  overflow: hidden;
  min-height: 92vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(201,168,76,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(58,109,181,0.1) 0%, transparent 60%);
  pointer-events: none;
}

/* Subtle grid pattern */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

/* Hero Text */
.hero-content { max-width: 560px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 14px;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-400);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-xl);
}

.hero-badge .pulse {
  width: 6px; height: 6px;
  background: var(--gold-400);
  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(1.5); }
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: var(--space-lg);
}

.hero h1 .accent {
  color: var(--gold-400);
  position: relative;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--navy-200);
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
  max-width: 480px;
}

.hero-metrics {
  display: flex;
  gap: var(--space-2xl);
}

.metric {
  text-align: left;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--white);
  line-height: 1.2;
}

.metric-value span { color: var(--gold-400); font-size: 0.7em; }

.metric-label {
  font-size: 0.75rem;
  color: var(--navy-300);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* ============================================================
   HERO CALCULATOR CARD
   ============================================================ */
.calc-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.1);
  overflow: hidden;
  animation: cardIn 0.8s var(--ease-out) 0.3s both;
}

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

.calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--slate-200);
}

.calc-header h3 {
  font-size: 1.05rem;
  color: var(--navy-900);
}

.calc-header .live-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--emerald-500);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.calc-header .live-dot {
  width: 6px; height: 6px;
  background: var(--emerald-500);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

.calc-body { padding: var(--space-xl); }

.calc-field { margin-bottom: var(--space-lg); }

.calc-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-600);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.02em;
}

.calc-field label .value-display {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--navy-800);
  font-weight: 700;
}

.calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--slate-200);
  outline: none;
  cursor: pointer;
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--navy-800);
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(10,22,40,0.25);
  transition: transform var(--duration-fast) var(--ease-spring);
}

.calc-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.calc-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--navy-800);
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(10,22,40,0.25);
  cursor: pointer;
}

.slider-range {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--slate-400);
  margin-top: 6px;
}

/* Result Panel */
.calc-result {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin-top: var(--space-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.calc-result::before {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(201,168,76,0.1), transparent 70%);
  pointer-events: none;
}

.result-label {
  font-size: 0.75rem;
  color: var(--navy-300);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.result-amount {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--white);
  line-height: 1.1;
}

.result-amount .currency {
  font-size: 0.5em;
  color: var(--gold-400);
  vertical-align: super;
}

.result-amount .period {
  font-size: 0.35em;
  color: var(--navy-300);
  font-family: var(--font-body);
}

.result-meta {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.result-meta-item {
  font-size: 0.75rem;
  color: var(--navy-300);
}

.result-meta-item strong {
  display: block;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.calc-footer {
  padding: var(--space-md) var(--space-xl) var(--space-lg);
}

.btn-simulate {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px;
  background: var(--gold-500);
  color: var(--navy-900);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  transition: background var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
}

.btn-simulate:hover {
  background: var(--gold-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.btn-simulate svg { width: 16px; height: 16px; }

/* ============================================================
   TRUST BAR
   ============================================================ */
.trust-bar {
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  padding: var(--space-xl) 0;
}

.trust-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xl);
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--slate-600);
}

.trust-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}

.trust-icon.shield { background: #ecfdf5; color: var(--emerald-500); }
.trust-icon.clock { background: var(--navy-50); color: var(--navy-600); }
.trust-icon.bank { background: var(--gold-100); color: var(--gold-500); }
.trust-icon.lock { background: #fef2f2; color: var(--red-500); }

/* ============================================================
   SECTION: SIMULATEURS
   ============================================================ */
.section { padding: var(--space-4xl) 0; }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-3xl);
}

.section-header p {
  color: var(--slate-500);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-top: var(--space-md);
}

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

.tool-card {
  position: relative;
  padding: var(--space-xl);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration-normal), box-shadow var(--duration-normal), transform var(--duration-fast);
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy-700), var(--gold-500));
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.tool-card:hover {
  border-color: var(--navy-200);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

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

.tool-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
}

.tool-icon.blue { background: var(--navy-50); color: var(--navy-600); }
.tool-icon.gold { background: var(--gold-100); color: var(--gold-500); }
.tool-icon.green { background: #ecfdf5; color: var(--emerald-500); }
.tool-icon.purple { background: #f5f3ff; color: #7c3aed; }

.tool-card h3 {
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
}

.tool-card p {
  font-size: 0.875rem;
  color: var(--slate-500);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.tool-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-600);
  transition: color var(--duration-fast), gap var(--duration-fast);
}

.tool-card:hover .card-link {
  color: var(--gold-500);
  gap: 10px;
}

.card-link svg { width: 14px; height: 14px; }

/* ============================================================
   SECTION: TAUX / RATES
   ============================================================ */
.section--rates {
  background: var(--slate-50);
  border-top: 1px solid var(--slate-200);
  border-bottom: 1px solid var(--slate-200);
}

.rates-dashboard {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.rates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--slate-200);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.rates-header h3 { font-size: 1.1rem; }

.rates-updated {
  font-size: 0.75rem;
  color: var(--slate-500);
}

.rates-updated time {
  font-weight: 600;
  color: var(--navy-800);
}

.rates-table-wrap { overflow-x: auto; }

.rates-table {
  width: 100%;
  border-collapse: collapse;
}

.rates-table th {
  padding: var(--space-md) var(--space-xl);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
  text-align: left;
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-50);
}

.rates-table td {
  padding: var(--space-md) var(--space-xl);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--slate-100);
}

.rates-table tbody tr {
  transition: background var(--duration-fast);
}

.rates-table tbody tr:hover { background: var(--slate-50); }

.rate-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--navy-900);
  font-size: 1rem;
}

.rate-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
}

.rate-trend.down { background: #ecfdf5; color: #059669; }
.rate-trend.up { background: #fef2f2; color: #dc2626; }
.rate-trend.stable { background: var(--slate-100); color: var(--slate-600); }

.rates-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: var(--slate-50);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.rates-links {
  display: flex;
  gap: var(--space-lg);
}

.rates-links a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-600);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--duration-fast);
}

.rates-links a:hover { color: var(--gold-500); }

.rates-links a svg { width: 14px; height: 14px; }

/* ============================================================
   SECTION: GUIDES
   ============================================================ */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--space-lg);
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-normal), box-shadow var(--duration-normal), transform var(--duration-fast);
}

.guide-card:hover {
  border-color: var(--navy-200);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.guide-visual {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.guide-visual.v1 { background: linear-gradient(135deg, var(--navy-50), var(--navy-100)); }
.guide-visual.v2 { background: linear-gradient(135deg, var(--gold-100), #fef3c7); }
.guide-visual.v3 { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }

.guide-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 60%, rgba(255,255,255,0.6));
}

.guide-body {
  padding: var(--space-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.guide-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: var(--space-md);
  width: fit-content;
}

.guide-tag.law { background: var(--navy-50); color: var(--navy-600); }
.guide-tag.finance { background: var(--gold-100); color: var(--gold-500); }
.guide-tag.practical { background: #ecfdf5; color: #059669; }

.guide-card h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-sm);
}

.guide-card p {
  font-size: 0.875rem;
  color: var(--slate-500);
  line-height: 1.6;
  flex: 1;
}

.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-lg);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-600);
  transition: color var(--duration-fast), gap var(--duration-fast);
}

.guide-card:hover .guide-link {
  color: var(--gold-500);
  gap: 10px;
}

/* ============================================================
   SECTION: FORMULA / METHODOLOGY
   ============================================================ */
.section--formula {
  background: var(--navy-900);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.section--formula::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(201,168,76,0.06), transparent 70%);
  pointer-events: none;
}

.formula-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.formula-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
}

.formula-display {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--gold-400);
  margin-bottom: var(--space-xl);
  line-height: 2;
  text-align: center;
  padding: var(--space-lg);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
  border: 1px solid rgba(201,168,76,0.15);
}

.formula-legend {
  list-style: none;
}

.formula-legend li {
  padding: var(--space-sm) 0;
  font-size: 0.85rem;
  color: var(--navy-200);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.formula-legend li + li {
  border-top: 1px solid rgba(255,255,255,0.06);
}

.formula-var {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold-400);
  min-width: 24px;
}

.formula-text .section-label { color: var(--gold-400); }
.formula-text .section-label::before { background: var(--gold-400); }

.formula-text h2 { color: var(--white); margin-bottom: var(--space-lg); }

.formula-text p {
  font-size: 1rem;
  color: var(--navy-200);
  line-height: 1.8;
  margin-bottom: var(--space-lg);
}

.formula-text .hcsf-callout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--navy-100);
  line-height: 1.6;
}

.hcsf-callout .icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ============================================================
   SECTION: CTA
   ============================================================ */
.section--cta {
  background: linear-gradient(135deg, var(--slate-50), var(--white));
  border-top: 1px solid var(--slate-200);
}

.cta-box {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.cta-box h2 { margin-bottom: var(--space-md); }

.cta-box p {
  font-size: 1.05rem;
  color: var(--slate-500);
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
}

.cta-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
}

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

.btn--primary:hover {
  background: var(--navy-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn--outline {
  background: transparent;
  color: var(--navy-800);
  border: 2px solid var(--slate-300);
}

.btn--outline:hover {
  border-color: var(--navy-800);
  transform: translateY(-1px);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--navy-900);
  padding: var(--space-4xl) 0 var(--space-xl);
  color: var(--navy-200);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.footer-brand .logo {
  color: var(--white);
  margin-bottom: var(--space-lg);
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--navy-300);
  max-width: 320px;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-400);
  margin-bottom: var(--space-lg);
}

.footer-col ul { list-style: none; }

.footer-col li + li { margin-top: var(--space-sm); }

.footer-col a {
  font-size: 0.85rem;
  color: var(--navy-300);
  transition: color var(--duration-fast);
}

.footer-col a:hover { color: var(--gold-400); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--navy-400);
}

.footer-legal {
  display: flex;
  gap: var(--space-lg);
}

.footer-legal a {
  font-size: 0.75rem;
  color: var(--navy-400);
  transition: color var(--duration-fast);
}

.footer-legal a:hover { color: var(--gold-400); }

/* ============================================================
   ANIMATIONS (Intersection Observer triggers)
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content { max-width: 100%; }
  .hero-subtitle { max-width: 100%; }
  .hero-metrics { justify-content: center; }
  .calc-card { max-width: 520px; margin: 0 auto; }
  .formula-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --header-height: 60px; }

  .main-nav { display: none; }
  .nav-cta.desktop { display: none; }
  .menu-toggle { display: flex; }

  /* Mobile nav overlay */
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: var(--white);
    padding: var(--space-xl);
    gap: var(--space-xs);
    overflow-y: auto;
    animation: slideDown 0.3s var(--ease-out);
    z-index: 999;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .main-nav.open .nav-item {
    font-size: 1rem;
    padding: var(--space-md);
    border-bottom: 1px solid var(--slate-100);
  }

  .main-nav.open .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: all;
    box-shadow: none;
    border: none;
    padding: 0;
    padding-left: var(--space-md);
    min-width: auto;
  }

  .hero { min-height: auto; padding-bottom: var(--space-3xl); }
  .hero-metrics { gap: var(--space-xl); }
  .section { padding: var(--space-3xl) 0; }
  .guides-grid { grid-template-columns: 1fr; }
  .trust-inner { gap: var(--space-lg); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-metrics { flex-direction: column; gap: var(--space-md); align-items: center; }
  .result-meta { flex-direction: column; gap: var(--space-sm); }
  .cta-buttons { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .tools-grid { grid-template-columns: 1fr; }
}

/* Print */
@media print {
  .site-header, .site-footer, .section--cta { display: none; }
  .hero { background: none; color: #000; min-height: auto; }
  .hero h1, .hero-subtitle { color: #000; }
}
