/* ==========================================================================
   ALEXZAREMSKY.COM — CORE DESIGN SYSTEM (Light Theme Only, Engineered & Crisp)
   ========================================================================== */

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Canvas & Neutrals (Clean White with Soft Slate Undertones) */
  --bg-canvas: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F1F5F9;
  --bg-accent-soft: #EEF2FF;

  /* Borders & Dividers */
  --border-light: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-focus: #4F46E5;

  /* Typography */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-brand: #4338CA;

  /* Accent Palette (Tech Cobalt / Indigo + Status Shades) */
  --brand-primary: #4F46E5;
  --brand-hover: #4338CA;
  --brand-active: #3730A3;
  --brand-glow: rgba(79, 70, 229, 0.12);

  --color-emerald: #059669;
  --color-emerald-bg: #ECFDF5;
  --color-amber: #D97706;
  --color-amber-bg: #FFFBEB;
  --color-rose: #E11D48;
  --color-rose-bg: #FFF1F2;
  --color-blue: #2563EB;
  --color-blue-bg: #EFF6FF;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-card-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.03);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --max-width: 1200px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.bg-grid-pattern {
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.05) 0%, transparent 60%),
    linear-gradient(to right, #F1F5F9 1px, transparent 1px),
    linear-gradient(to bottom, #F1F5F9 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  background-position: top center, 0 0, 0 0;
}

/* ==========================================================================
   STICKY NAVBAR
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: border-color 0.2s ease;
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.nav-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-primary) 0%, #312E81 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.nav-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
  border: 1px solid rgba(79, 70, 229, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-collapse {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--brand-primary);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: white;
  background: var(--brand-primary);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
  transition: all 0.2s ease;
}

.nav-cta:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.25);
}

/* Mobile Hamburger Toggle Button */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.hamburger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-toggle.open .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.open .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.open .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  padding: 56px 0 40px;
  position: relative;
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--color-blue-bg);
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-blue);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text-primary);
  max-width: 860px;
  margin-bottom: 16px;
}

.hero-title span {
  background: linear-gradient(135deg, var(--brand-primary) 0%, #2563EB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 36px;
}

/* Topic Hub Pills */
.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.pill-btn:hover, .pill-btn.active {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--bg-accent-soft);
  transform: translateY(-1px);
}

.pill-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-muted);
}

/* ==========================================================================
   HERO INTERACTIVE BENCHMARK WIDGET
   ========================================================================== */
.hero-widget-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 64px;
  position: relative;
  overflow: hidden;
}

.hero-widget-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-primary), #2563EB, #059669);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  align-items: end;
}

.hero-widget-card .input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-widget-card .input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-widget-card .input-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.hero-widget-card .input-prefix {
  position: absolute;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
  border: none;
  background: transparent;
  padding: 0;
}

.hero-widget-card .input-field {
  width: 100%;
  padding: 10px 12px 10px 28px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.15s ease;
}

.hero-widget-card .input-field:focus {
  background: white;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.widget-result-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.result-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.result-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-emerald-bg);
  color: var(--color-emerald);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

/* ==========================================================================
   SECTION HEADERS
   ========================================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.section-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s ease;
}

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

/* ==========================================================================
   CARDS GRID (TOOLS & CALCULATORS)
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 64px;
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(79, 70, 229, 0.4);
}

.tool-card-top {
  margin-bottom: 20px;
}

.tool-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tool-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  border: 1px solid rgba(79, 70, 229, 0.12);
}

.tool-category-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-ppc { background: #EEF2FF; color: #4338CA; }
.badge-seo { background: #ECFDF5; color: #047857; }
.badge-ai { background: #FAF5FF; color: #7E22CE; }
.badge-growth { background: #FFF7ED; color: #C2410C; }

.tool-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.tool-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.tool-formula-preview {
  margin-top: 16px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
  margin-top: 20px;
}

.tool-action-btn {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-link-study {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tool-link-study:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   RESEARCH & BENCHMARKS (DEEP DIVES)
   ========================================================================== */
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 64px;
}

@media (max-width: 840px) {
  .research-grid { grid-template-columns: 1fr; }
}

.research-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.research-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.research-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: center;
}

.research-sources-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--bg-accent-soft);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.research-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.research-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.research-excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.stat-banner {
  display: flex;
  gap: 20px;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.stat-desc {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   CURATED GROWTH STACK (AFFILIATE MATRIX)
   ========================================================================== */
.stack-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 64px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.stack-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.stack-table th {
  background: var(--bg-subtle);
  padding: 16px 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
}

.stack-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  vertical-align: middle;
}

.stack-table tr:last-child td {
  border-bottom: none;
}

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

.tool-entity {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.tool-thumb {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.btn-affiliate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--bg-accent-soft);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(79, 70, 229, 0.15);
  transition: all 0.15s ease;
}

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

/* ==========================================================================
   E-E-A-T AUTHOR SECTION
   ========================================================================== */
.author-section {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 64px;
}

.author-inner {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
}

.author-avatar-wrap {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-primary), #1E1B4B);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
  flex-shrink: 0;
}

.author-text {
  flex: 1;
  min-width: 280px;
}

.author-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.author-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.author-role-chip {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary);
  background: var(--bg-accent-soft);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.author-bio {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.author-links {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  font-weight: 600;
}

.author-links a {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

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

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 40px 0;
  background: white;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

/* Page inner layout */
.page-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 40px;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.breadcrumb-nav {
  margin-bottom: 20px;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.breadcrumb-list a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb-list a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.breadcrumb-list li[aria-current="page"] {
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   GEO DIRECT ANSWER BOX (AI Search Snippet Target)
   ========================================================================== */
.geo-answer-box {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, rgba(37, 99, 235, 0.02) 100%);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 36px;
}

.geo-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-primary);
  background: var(--brand-subtle);
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 12px;
}

.geo-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0;
}

.geo-text code {
  background: white;
  border: 1px solid var(--border-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--brand-primary);
  font-weight: 600;
}

/* ==========================================================================
   INTERACTIVE CALCULATOR WORKBENCH (TWO-COLUMN)
   ========================================================================== */
.calculator-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
}

.calc-panel {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.calc-panel-results {
  position: sticky;
  top: 96px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFF 100%);
  border-color: rgba(79, 70, 229, 0.2);
}

.calc-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.calc-inputs-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calc-results-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  letter-spacing: 0.01em;
}

.input-field-wrap {
  display: flex;
  align-items: center;
  position: relative;
  background: white;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  overflow: hidden;
}

.input-field-wrap:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.input-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-right: 1.5px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  user-select: none;
  min-width: 44px;
  flex-shrink: 0;
}

.input-field {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 8px 12px;
  border: none;
  outline: none;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  font-family: var(--font-main);
  line-height: 1.4;
}

.input-field:focus {
  outline: none;
}

.input-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
  line-height: 1.4;
}

.calc-advanced-details {
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: var(--bg-subtle);
}

.calc-advanced-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

/* Results KPI Cards */
.results-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.kpi-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--brand-primary);
  line-height: 1.15;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.kpi-value .kpi-unit,
.kpi-unit {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  letter-spacing: normal;
  text-transform: none;
}

.kpi-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Gauge Bar */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.gauge-track {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.gauge-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}

/* Financial Breakdown List */
.financial-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.breakdown-item-name {
  color: var(--text-secondary);
}

.breakdown-item-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

/* Spoke Cross-Link Box */
.spoke-callout-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 16px;
}

/* FAQ Accordion */
.faq-item {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: all 0.2s ease;
}

.faq-item[open] {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--text-primary);
  user-select: none;
}

.faq-question:hover {
  color: var(--brand-primary);
}

.faq-answer {
  margin-top: 12px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-answer code {
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--brand-primary);
}

/* ==========================================================================
   SENSITIVITY MATRIX STYLES
   ========================================================================== */
.matrix-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: white;
  margin-top: 14px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.85rem;
}

.matrix-table th, .matrix-table td {
  padding: 10px 8px;
  border: 1px solid var(--border-light);
}

.matrix-corner-hdr {
  background: var(--bg-subtle);
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.matrix-hdr-col {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-primary);
}

.matrix-hdr-row {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.matrix-cell {
  font-weight: 700;
  font-family: var(--font-mono);
  transition: all 0.15s ease;
}

.cell-baseline {
  outline: 2.5px solid var(--brand-primary);
  position: relative;
  z-index: 2;
}

.cell-profit-high {
  background: rgba(16, 185, 129, 0.18);
  color: #065f46;
}

.cell-profit-modest {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
}

.cell-neutral {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.cell-loss-modest {
  background: rgba(244, 63, 94, 0.08);
  color: #be123c;
}

.cell-loss-severe {
  background: rgba(244, 63, 94, 0.18);
  color: #9f1239;
}

.matrix-toggle-group {
  display: inline-flex;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  padding: 2px;
}

.matrix-toggle-btn {
  padding: 4px 12px;
  border: none;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.matrix-toggle-btn.active-toggle {
  background: white;
  color: var(--brand-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE COMPATIBILITY
   ========================================================================== */

/* Tablet & Smaller Desktops (< 900px) */
@media (max-width: 900px) {
  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .calc-panel-results {
    position: static;
    top: auto;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Devices & Tablets (< 768px) */
@media (max-width: 768px) {
  /* Container Padding */
  .container {
    padding: 0 16px;
  }

  /* Navigation Bar & Mobile Drawer */
  .navbar {
    position: sticky;
    top: 0;
  }

  .nav-inner {
    height: 64px;
  }

  .nav-brand {
    font-size: 1.05rem;
    gap: 8px;
  }

  .nav-brand span.nav-badge {
    display: none; /* Hide badge on small screens to save header space */
  }

  .mobile-menu-toggle {
    display: flex;
    z-index: 110;
  }

  .nav-collapse {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    align-items: stretch;
    padding: 24px 20px;
    gap: 20px;
    display: none;
    z-index: 105;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .nav-collapse.open {
    display: flex;
    animation: mobileNavFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

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

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
  }

  .nav-link {
    font-size: 1.05rem;
    padding: 8px 0;
    width: 100%;
    border-bottom: 1px solid var(--border-light);
    display: block;
  }

  .nav-cta {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.95rem;
  }

  /* Hero Section */
  .hero {
    padding: 36px 0 24px;
  }

  .hero-title {
    font-size: 2.1rem;
    letter-spacing: -0.025em;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .topic-pills {
    gap: 8px;
    margin-bottom: 28px;
  }

  .pill-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* Hero Widget */
  .hero-widget-card {
    padding: 20px 16px;
    margin-bottom: 40px;
  }

  .widget-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .widget-result-box {
    padding: 12px 14px;
  }

  .result-value {
    font-size: 1.25rem;
  }

  /* Section Headers */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .section-title {
    font-size: 1.3rem;
  }

  /* Card Grids */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 40px;
  }

  .tool-card {
    padding: 20px;
  }

  /* Page Header */
  .page-header {
    padding: 28px 0 20px;
    margin-bottom: 24px;
  }

  .page-title {
    font-size: 1.75rem;
  }

  .page-subtitle {
    font-size: 0.95rem;
  }

  /* GEO Box */
  .geo-answer-box {
    padding: 18px 16px;
    margin-bottom: 24px;
  }

  .geo-text {
    font-size: 0.9rem;
  }

  /* Calculator Panels & Inputs */
  .calc-panel-header {
    padding: 16px;
  }

  .calc-inputs-body {
    padding: 16px;
    gap: 16px;
  }

  .calc-results-body {
    padding: 16px;
    gap: 18px;
  }

  /* Two-column and Three-column sub-grids stack gracefully */
  .calc-inputs-body div[style*="grid-template-columns: 1fr 1fr"],
  .calc-inputs-body div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* KPI Grid */
  .results-kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .kpi-card {
    padding: 14px 12px;
  }

  .kpi-value {
    font-size: 1.65rem;
  }

  /* Responsive Tables & Sensitivity Matrices */
  .matrix-container,
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .matrix-table th, .matrix-table td {
    padding: 8px 6px;
    font-size: 0.78rem;
    min-width: 65px;
  }

  /* Author Section */
  .author-section {
    padding: 24px 20px;
    margin-bottom: 40px;
  }

  .author-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .author-avatar-wrap {
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
  }

  /* Footer */
  .footer {
    padding: 32px 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .footer-meta {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* Small Smart Phones (< 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.85rem;
  }

  .nav-brand span:not(.nav-badge) {
    font-size: 1rem;
  }

  .input-prefix {
    padding: 6px 8px;
    min-width: 36px;
    font-size: 0.78rem;
  }

  .input-field {
    padding: 8px 10px;
    font-size: 0.92rem;
  }

  .kpi-value {
    font-size: 1.5rem;
  }

  .tool-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}



