/* ==========================================================================
   ERLANGLY DESIGN SYSTEM & GLOBAL STYLES
   Theme: Dark "Control Room" | Palette: Deep Space Navy / Teal / Amber / Coral
   Typography: Inter (sans) + IBM Plex Mono (numeric/display/mono)
   ========================================================================== */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Design Tokens --- */
:root {
  /* Color Palette - Surfaces & Backgrounds */
  --bg-base: #080c14;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #162038;
  --bg-surface-hover: #1e2c4c;
  --bg-surface-glass: rgba(15, 23, 42, 0.85);
  --bg-input: #0b1120;
  --bg-input-focus: #0f172a;

  /* Color Palette - Borders & Dividers */
  --border-subtle: #1e293b;
  --border-default: #2b3954;
  --border-strong: #3d5077;
  --border-focus: #00d2d3;

  /* Color Palette - Accents & Brand */
  --accent: #00d2d3;
  --accent-light: #54f0f0;
  --accent-dark: #009e9f;
  --accent-muted: rgba(0, 210, 211, 0.15);
  --accent-glow: 0 0 20px rgba(0, 210, 211, 0.35);

  /* Color Palette - Status & Indicators */
  --success: #10b981;
  --success-light: #34d399;
  --success-muted: rgba(16, 185, 129, 0.15);
  --success-glow: 0 0 15px rgba(16, 185, 129, 0.3);

  --warn: #f59e0b;
  --warn-light: #fbbf24;
  --warn-muted: rgba(245, 158, 11, 0.15);
  --warn-glow: 0 0 15px rgba(245, 158, 11, 0.3);

  --danger: #ef4444;
  --danger-light: #f87171;
  --danger-muted: rgba(239, 68, 68, 0.15);
  --danger-glow: 0 0 15px rgba(239, 68, 68, 0.3);

  --info: #38bdf8;
  --info-muted: rgba(56, 189, 248, 0.15);

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-dim: #475569;
  --text-accent: #00d2d3;

  /* Typography Font Families */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */

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

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.6);
  --shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.45);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout Max Width */
  --max-width: 1280px;
  --nav-height: 64px;

  /* Native UI hint */
  color-scheme: dark;
  accent-color: var(--accent);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--sans);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 210, 211, 0.08), transparent 70%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.04), transparent 50%);
  background-attachment: fixed;
}

/* --- Accessibility & Focus States --- */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Typography Helpers --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

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

.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* --- Navigation Bar --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

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

.brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent) 0%, #007791 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--accent-glow);
  color: #041018;
  font-weight: 800;
  font-family: var(--mono);
  font-size: var(--text-lg);
}

.brand-text {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-family: var(--sans);
}

.brand-text span {
  color: var(--accent);
}

.brand-tagline {
  display: none;
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  border-left: 1px solid var(--border-default);
  padding-left: var(--space-3);
  margin-left: var(--space-2);
}

@media (min-width: 900px) {
  .brand-tagline {
    display: inline-block;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-muted);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    padding: var(--space-4) var(--space-6);
    gap: var(--space-2);
    box-shadow: var(--shadow-lg);
  }
  .mobile-menu-toggle {
    display: inline-flex;
  }
}

/* --- Layout Containers --- */
.page-container {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  flex: 1;
}

/* --- Tool Layout Grid --- */
.tool-header {
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-6);
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-muted);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-2);
}

.tool-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.tool-description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 800px;
}

.tool-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .tool-body {
    grid-template-columns: 380px 1fr;
  }
}

/* --- Panels & Cards --- */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.panel-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.panel-body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  flex: 1;
}

.panel-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: rgba(11, 17, 32, 0.6);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* --- Form Controls --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-label-val {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 600;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

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

.form-control:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.form-control::placeholder {
  color: var(--text-dim);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
  cursor: pointer;
}

/* Range Sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--accent-glow);
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--accent-light);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--accent-glow);
  cursor: pointer;
}

/* Input Addons */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-addon {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-left: none;
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: var(--text-xs);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #041018;
  box-shadow: var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(0, 210, 211, 0.5);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-muted);
  border-color: var(--danger);
  color: var(--danger-light);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  height: 32px;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  height: 48px;
  padding: 0 var(--space-8);
  font-size: var(--text-base);
}

/* --- Metric Cards & Grid --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
}

.metric-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.metric-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.metric-card.highlight {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(0, 210, 211, 0.08) 0%, var(--bg-surface-elevated) 100%);
}

.metric-card.highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  box-shadow: var(--accent-glow);
}

.metric-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-family: var(--mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-card.highlight .metric-value {
  color: var(--accent-light);
}

.metric-subtext {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success {
  background: var(--success-muted);
  color: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warn {
  background: var(--warn-muted);
  color: var(--warn-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: var(--danger-muted);
  color: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-neutral {
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

/* --- Data Tables --- */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-sm);
}

.data-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-family: var(--sans);
  font-weight: 600;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: var(--bg-surface-hover);
}

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

/* --- Dropzone / CSV Upload --- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.dropzone:hover, .dropzone.active {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.dropzone-icon {
  font-size: var(--text-3xl);
  color: var(--accent);
}

.dropzone-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.dropzone-text strong {
  color: var(--text-primary);
}

/* --- Sparklines & Visualization Container --- */
.sparkline-container {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
  padding-top: var(--space-2);
}

.sparkline-bar {
  flex: 1;
  background: var(--border-strong);
  border-radius: 2px 2px 0 0;
  transition: height var(--transition-fast), background-color var(--transition-fast);
  min-height: 2px;
  position: relative;
}

.sparkline-bar.target {
  background: var(--accent);
  box-shadow: var(--accent-glow);
}

.sparkline-bar.active {
  background: var(--success);
}

/* --- Toast Notifications --- */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: slideInToast 200ms ease-out forwards;
}

.toast-success { border-color: var(--success); border-left-width: 4px; }
.toast-error { border-color: var(--danger); border-left-width: 4px; }
.toast-warn { border-color: var(--warn); border-left-width: 4px; }

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

/* --- Landing Page Hero & Feature Sections --- */
.hero-wrapper {
  padding: var(--space-8) 0 var(--space-12);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  align-items: start;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1.1fr;
    gap: var(--space-12);
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.hero-headline {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

@media (min-width: 768px) {
  .hero-headline {
    font-size: var(--text-5xl);
  }
}

.hero-subhead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition-normal);
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.5);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  color: var(--accent);
}

.feature-title {
  font-size: var(--text-lg);
  font-weight: 700;
}

.feature-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-meta {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--accent);
}

/* --- Section Dividers & Explainer Callouts --- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.section-tag {
  font-family: var(--mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.explainer-box {
  background: linear-gradient(135deg, var(--bg-surface-elevated) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin: var(--space-12) 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .explainer-box {
    grid-template-columns: 1fr 1fr;
  }
}

.formula-display {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--accent-light);
  overflow-x: auto;
  line-height: 1.6;
}

/* --- Site Footer --- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: var(--space-8) var(--space-6);
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .footer-container {
    flex-direction: row;
  }
}

.footer-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

.footer-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.footer-link {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.footer-link:hover {
  color: var(--accent);
}
