/* ==========================================================================
   Hafzen Design System
   Dark, minimal, rounded, premium. Inspired by profound.is / Linear / Vercel.
   This file is shared between the landing page and the dashboard (demo.html).
   Reuse the tokens and components below — do not hard-code values.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colors — surfaces */
  --bg: #0A0B0F;
  --surface: #101218;
  --surface-2: #12141B;
  --surface-3: #171A22;          /* hover / raised surfaces */
  --overlay: rgba(4, 5, 8, 0.72);

  /* Colors — borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Colors — text */
  --text: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted: #8B93A3;

  /* Colors — brand accent (use sparingly) */
  --accent: #3157D5;
  --accent-hover: #4466E0;
  --accent-soft: rgba(49, 87, 213, 0.12);
  --accent-softer: rgba(49, 87, 213, 0.07);
  --accent-text: #8FA4F0;        /* accent-tinted text on dark bg */

  /* Colors — semantic */
  --success: #16A34A;
  --success-soft: rgba(22, 163, 74, 0.14);
  --success-text: #4ADE80;
  --warning: #D97706;
  --warning-soft: rgba(217, 119, 6, 0.14);
  --warning-text: #FBBF24;
  --error: #DC2626;
  --error-soft: rgba(220, 38, 38, 0.14);
  --error-text: #F87171;

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;             /* inputs, small cards */
  --radius-lg: 16px;             /* cards */
  --radius-xl: 20px;             /* large cards, modals */
  --radius-full: 999px;          /* pills, primary CTAs */

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  /* Shadows — subtle only, no colored glow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 24px 80px rgba(0, 0, 0, 0.55);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: clamp(2.25rem, 4vw, 3rem);
  --text-hero: clamp(2.75rem, 6vw, 4.5rem);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-med: 250ms;

  /* Layout */
  --container: 1160px;
  --container-narrow: 760px;
  --nav-height: 64px;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4 {
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

::selection { background: rgba(49, 87, 213, 0.35); color: #fff; }

/* Visible focus state for accessibility */
:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Numbers that should align (metrics, tables, scores) */
.tnum, .metric-value, .score-display, .table td[data-num] {
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-24); position: relative; }
.section--tight { padding-block: var(--space-16); }

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-12);
}
.section-head--center { margin-inline: auto; text-align: center; }
.section-title {
  font-size: var(--text-3xl);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}
.section-subtitle {
  font-size: var(--text-md);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Eyebrow label above a section title */
.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-4);
}

/* Grid helpers */
.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Minimal utility classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Visually hidden but available to assistive tech (labels, switch names) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   4. Buttons
   Variants: .btn--primary (pill CTA), .btn--ghost, .btn--outline
   Sizes:    .btn--sm, default, .btn--lg
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 550;
  font-size: var(--text-base);
  line-height: 1;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-full);   /* pill for primary CTAs */
  padding-inline: 24px;
}
.btn--primary:hover { background: var(--accent-hover); }

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--outline:hover { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.04); }

.btn--sm { padding: 8px 14px; font-size: var(--text-sm); }
.btn--sm.btn--primary { padding-inline: 18px; }
.btn--lg { padding: 14px 28px; font-size: var(--text-md); }
.btn--lg.btn--primary { padding-inline: 32px; }
.btn--block { width: 100%; }

/* --------------------------------------------------------------------------
   5. Badges & chips
   .badge--high / --medium / --low map to semantic priorities.
   .chip is a neutral pill for filters/labels in the dashboard.
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  line-height: 1.4;
}
.badge--high    { color: var(--error-text);   background: var(--error-soft);   border-color: rgba(220, 38, 38, 0.25); }
.badge--medium  { color: var(--warning-text); background: var(--warning-soft); border-color: rgba(217, 119, 6, 0.25); }
.badge--low     { color: var(--success-text); background: var(--success-soft); border-color: rgba(22, 163, 74, 0.25); }
.badge--neutral { color: var(--text-secondary); background: rgba(255, 255, 255, 0.06); border-color: var(--border); }
.badge--accent  { color: var(--accent-text);  background: var(--accent-soft);  border-color: rgba(49, 87, 213, 0.3); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip--active { color: var(--text); background: var(--surface-3); border-color: var(--border-strong); }

/* --------------------------------------------------------------------------
   6. Cards
   Base card + hover lift. .metric-card for KPI tiles.
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--dur-med) var(--ease),
              transform var(--dur-med) var(--ease),
              background var(--dur-med) var(--ease);
}
.card--hover:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.card--xl { border-radius: var(--radius-xl); padding: var(--space-8); }

/* KPI tile used in dashboard previews and the dashboard itself */
.metric-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  transition: border-color var(--dur-med) var(--ease);
}
.metric-card:hover { border-color: var(--border-strong); }
.metric-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.metric-value {
  font-size: var(--text-xl);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
.metric-delta {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.metric-delta--up { color: var(--success-text); }
.metric-delta--down { color: var(--error-text); }

/* Large score readout (e.g. AI Visibility score) */
.score-display {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.score-value {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-feature-settings: 'tnum';
}
.score-label { font-size: var(--text-sm); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */
.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--text-base);
  padding: 11px 16px;
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.input::placeholder { color: var(--text-muted); }
.input:hover { border-color: var(--border-strong); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input--lg { padding: 14px 18px; font-size: var(--text-md); border-radius: var(--radius-full); padding-inline: 22px; }

.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 550;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* --------------------------------------------------------------------------
   8. Tables (dashboard-ready)
   -------------------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table th {
  text-align: left;
  font-weight: 550;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.table .cell-primary { color: var(--text); font-weight: 550; }
.table td[data-num], .table th[data-num] { text-align: right; }

/* --------------------------------------------------------------------------
   9. Charts (pure SVG helpers)
   .bar-chart expects inline SVG; these classes style bars/labels/grid.
   -------------------------------------------------------------------------- */
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart .bar { fill: #262B38; transition: fill var(--dur-med) var(--ease); }
.bar-chart .bar:hover { fill: #303747; }
.bar-chart .bar--accent { fill: var(--accent); }
.bar-chart .bar-label { fill: var(--text-muted); font-size: 11px; font-family: var(--font-sans); }
.bar-chart .bar-value { fill: var(--text-secondary); font-size: 11px; font-weight: 600; font-family: var(--font-sans); font-feature-settings: 'tnum'; }
.bar-chart .grid-line { stroke: var(--border); stroke-width: 1; }

.line-chart { width: 100%; height: auto; display: block; }
.line-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .line--secondary { stroke: var(--text-muted); stroke-width: 1.5; opacity: 0.5; }
.line-chart .area { fill: var(--accent-softer); }
.line-chart .dot { fill: var(--accent); }
.line-chart .grid-line { stroke: var(--border); stroke-width: 1; }
.line-chart .axis-label { fill: var(--text-muted); font-size: 10px; font-family: var(--font-sans); }

/* Horizontal progress bar (e.g. engine score breakdown) */
.progress {
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 600ms var(--ease);
}
.progress-fill--success { background: var(--success); }
.progress-fill--warning { background: var(--warning); }
.progress-fill--error { background: var(--error); }

/* Step dots (progress through a flow) */
.progress-dots { display: flex; gap: 6px; }
.progress-dots .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background var(--dur-med) var(--ease);
}
.progress-dots .dot--active { background: var(--accent); }
.progress-dots .dot--done { background: var(--text-muted); }

/* --------------------------------------------------------------------------
   10. App shell — sidebar & topbar (base styles for demo.html dashboard)
   Usage: <div class="app-shell"><aside class="sidebar">…</aside>
            <div class="app-main"><header class="topbar">…</header><main class="app-content">…</main></div></div>
   -------------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding-inline: var(--space-2); }
.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 var(--space-2) var(--space-2);
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--dur-fast) var(--ease);
}
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.sidebar-link--active { color: var(--text); background: var(--accent-soft); }
.sidebar-link--active svg { color: var(--accent-text); }
.sidebar-footer { margin-top: auto; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-inline: var(--space-6);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: var(--text-md); font-weight: 600; letter-spacing: -0.01em; }

.app-content { padding: var(--space-8); flex: 1; }
.app-content > * { max-width: 1080px; }

/* --------------------------------------------------------------------------
   11. Empty state & skeleton loaders
   -------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.empty-state svg { width: 32px; height: 32px; margin: 0 auto var(--space-4); color: var(--text-muted); }
.empty-state-title { font-size: var(--text-md); font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-2); }
.empty-state p { font-size: var(--text-sm); max-width: 380px; margin-inline: auto; }

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
   12. Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease), visibility var(--dur-med);
}
.modal-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
  padding: var(--space-8);
  transform: translateY(12px) scale(0.98);
  transition: transform var(--dur-med) var(--ease);
}

/* Visible close button (top-right corner of any modal) */
.modal-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.modal-close:hover { color: var(--text); border-color: var(--border-strong); }
.modal-overlay.is-open .modal { transform: translateY(0) scale(1); }

.modal-title { font-size: var(--text-lg); font-weight: 650; letter-spacing: -0.02em; }
.modal-subtitle { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-1); }

/* Analysis steps inside the modal */
.analysis-steps { display: flex; flex-direction: column; gap: var(--space-1); margin-block: var(--space-6); }
.analysis-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--text-muted);
  transition: color var(--dur-med) var(--ease), background var(--dur-med) var(--ease);
}
.analysis-step.is-active { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.analysis-step.is-done { color: var(--text-secondary); }

.step-indicator {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.step-indicator .step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background var(--dur-med) var(--ease);
}
.analysis-step.is-active .step-dot {
  background: var(--accent);
  animation: pulse-dot 1s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(49, 87, 213, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(49, 87, 213, 0); }
}
.step-indicator .step-check {
  width: 18px; height: 18px;
  color: var(--success-text);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
}
.analysis-step.is-done .step-check { opacity: 1; transform: scale(1); }
.analysis-step.is-done .step-dot,
.analysis-step.is-active .step-check { display: none; }

/* Spinner (generic) */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-hover);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   LANDING PAGE — components below are specific to index.html,
   but built from the primitives above.
   ========================================================================== */

/* --------------------------------------------------------------------------
   13. Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-height);
  background: rgba(10, 11, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.nav-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Text wordmark — smooth white → Hafzen blue gradient */
.wordmark-text {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(
    100deg,
    #FFFFFF 0%,
    #E8ECFB 28%,
    #B9C6F4 52%,
    #7C97EC 76%,
    #3157D5 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  user-select: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-actions { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px; height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--dur-fast) var(--ease);
}
.nav-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle.is-open .icon-close { display: block; }
.nav-toggle.is-open .icon-menu { display: none; }

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  background: var(--bg);
  z-index: 55;
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease), visibility var(--dur-med);
}
.nav-drawer.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-drawer a {
  font-size: var(--text-lg);
  font-weight: 550;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease);
}
.nav-drawer a:hover { color: var(--text); }
.nav-drawer .btn { margin-top: var(--space-6); font-size: var(--text-base); }

/* --------------------------------------------------------------------------
   14. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: var(--space-24);
  padding-bottom: var(--space-16);
  text-align: center;
  overflow: hidden;
}
/* Single subtle radial halo — the only gradient allowed */
.hero::before {
  content: '';
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 560px;
  background: radial-gradient(closest-side, rgba(49, 87, 213, 0.12), transparent);
  pointer-events: none;
}
.hero > .container { position: relative; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: var(--space-6);
}
.hero-badge .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-hover);
}

.hero-title {
  font-size: var(--text-hero);
  letter-spacing: -0.03em;
  font-weight: 650;
  line-height: 1.08;
  max-width: 820px;
  margin-inline: auto;
}
.hero-subtitle {
  font-size: var(--text-md);
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
  margin: var(--space-5) auto 0;
}

/* Inline URL analysis form */
.hero-form {
  display: flex;
  gap: var(--space-3);
  max-width: 520px;
  margin: var(--space-8) auto 0;
}
.hero-form .input { flex: 1; }
.hero-reassurance {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.hero-reassurance svg { width: 14px; height: 14px; color: var(--success-text); }

/* --------------------------------------------------------------------------
   15. Dashboard preview (pure HTML/CSS mock — hero centerpiece)
   -------------------------------------------------------------------------- */
.preview-wrap {
  margin-top: var(--space-16);
  position: relative;
  perspective: 1400px;
}
.preview-frame {
  max-width: 920px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: rotateX(4deg);
  transform-origin: center top;
  text-align: left;
}
.preview-titlebar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.window-dots { display: flex; gap: 6px; }
.window-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.preview-url {
  flex: 1;
  max-width: 320px;
  margin-inline: auto;
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  text-align: center;
}
.preview-body { padding: var(--space-6); }

.preview-score-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}
.preview-chart-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.preview-chart-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.preview-chart-title span { font-weight: 500; color: var(--text-muted); font-size: var(--text-xs); }

/* Engine mini-cards inside the preview */
.engine-card { display: flex; flex-direction: column; gap: 8px; }
.engine-card .engine-name {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.engine-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-hover); }
.engine-card .metric-value { font-size: var(--text-lg); }

/* --------------------------------------------------------------------------
   16. Engines strip
   -------------------------------------------------------------------------- */
.engines-strip {
  border-block: 1px solid var(--border);
  padding-block: var(--space-10);
}
.engines-strip p {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}
.engines-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 6vw, 64px);
  flex-wrap: wrap;
}
.engine-logo {
  font-weight: 650;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
  color: var(--text-muted);
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color var(--dur-med) var(--ease), opacity var(--dur-med) var(--ease);
}
.engine-logo:hover { color: var(--text-secondary); opacity: 1; }
.engine-logo svg { width: 18px; height: 18px; }

/* --------------------------------------------------------------------------
   17. Steps ("From AI answers to clear actions.")
   -------------------------------------------------------------------------- */
.step-card { display: flex; flex-direction: column; gap: var(--space-4); }
.step-number {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--accent-text);
  font-feature-settings: 'tnum';
  letter-spacing: 0.04em;
}
.step-card h3 { font-size: var(--text-lg); letter-spacing: -0.02em; }
.step-card p { font-size: var(--text-base); color: var(--text-secondary); line-height: 1.65; }

/* --------------------------------------------------------------------------
   18. Features grid
   -------------------------------------------------------------------------- */
.feature-card { display: flex; flex-direction: column; gap: var(--space-3); }
.feature-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent-text);
  margin-bottom: var(--space-1);
}
.feature-icon svg { width: 18px; height: 18px; }
.feature-card h3 { font-size: var(--text-md); letter-spacing: -0.01em; }
.feature-card p { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6; }

/* --------------------------------------------------------------------------
   19. Insight section ("Insight > Data")
   -------------------------------------------------------------------------- */
.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}
.insight-copy .section-title { font-size: var(--text-3xl); }
.insight-copy p { color: var(--text-secondary); font-size: var(--text-md); line-height: 1.65; margin-top: var(--space-4); }

.action-card { display: flex; flex-direction: column; gap: var(--space-4); }
.action-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.action-card-label { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.action-card h3 { font-size: var(--text-md); letter-spacing: -0.01em; line-height: 1.4; }
.action-card p { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6; }
.action-evidence {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-evidence li { display: flex; gap: 8px; align-items: flex-start; }
.action-evidence svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; color: var(--accent-text); }

/* --------------------------------------------------------------------------
   20. Pricing
   -------------------------------------------------------------------------- */
.pricing-grid { align-items: stretch; }
.price-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  position: relative;
}
.price-card--featured {
  border-color: rgba(49, 87, 213, 0.45);
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box;
}
.price-popular { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); }
.price-name { font-size: var(--text-md); font-weight: 600; }
.price-desc { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.price-amount { display: flex; align-items: baseline; gap: 6px; }
.price-amount .amount {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-feature-settings: 'tnum';
  line-height: 1;
}
.price-amount .period { font-size: var(--text-sm); color: var(--text-muted); }
.price-features { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.price-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.price-features svg { width: 15px; height: 15px; color: var(--success-text); flex-shrink: 0; }

/* --------------------------------------------------------------------------
   21. Final CTA
   -------------------------------------------------------------------------- */
.cta-final {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: var(--space-24) var(--space-8);
  position: relative;
  overflow: hidden;
}
.cta-final::before {
  content: '';
  position: absolute;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(closest-side, rgba(49, 87, 213, 0.10), transparent);
  pointer-events: none;
}
.cta-final h2 { font-size: var(--text-3xl); letter-spacing: -0.03em; position: relative; }
.cta-final p { color: var(--text-secondary); margin-top: var(--space-4); position: relative; }
.cta-final .btn { margin-top: var(--space-8); position: relative; }

/* --------------------------------------------------------------------------
   22. Footer
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-16) var(--space-8);
  margin-top: var(--space-24);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}
.footer-brand p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-4);
  max-width: 240px;
  line-height: 1.6;
}
.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-4);
  letter-spacing: 0;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease);
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   23. Scroll reveal animation (IntersectionObserver adds .is-visible)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
/* Staggered children: add .reveal to each child, set --d delay */
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }
.reveal[data-delay="5"] { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .preview-frame { transform: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   24. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .insight-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform var(--dur-med) var(--ease);
    height: 100%;
  }
  .sidebar.is-open { transform: translateX(0); }
}

@media (max-width: 640px) {
  :root { --nav-height: 58px; }
  .container { padding-inline: var(--space-4); }
  .section { padding-block: var(--space-16); }
  .hero { padding-top: var(--space-16); }
  .nav-links, .nav-actions .btn--ghost { display: none; }
  .nav-toggle { display: inline-flex; }
  .hero-form { flex-direction: column; }
  .hero-form .btn { width: 100%; padding-block: 14px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .preview-wrap { margin-top: var(--space-10); }
  .preview-frame { transform: none; border-radius: var(--radius-lg); }
  .preview-body { padding: var(--space-4); overflow-x: auto; }
  .preview-score-row { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .engines-logos { gap: var(--space-6); }
  .cta-final { padding: var(--space-16) var(--space-5); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .app-content { padding: var(--space-4); }
  .modal { padding: var(--space-6); }
}

/* --------------------------------------------------------------------------
   25. Legal page (legal.html)
   -------------------------------------------------------------------------- */
.legal-content {
  max-width: 720px;
  margin-inline: auto;
  padding-block: var(--space-16) var(--space-24);
}
.legal-content h1 { font-size: var(--text-2xl); letter-spacing: -0.03em; margin-bottom: var(--space-2); }
.legal-updated { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-8); }
.legal-content h2 {
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  scroll-margin-top: calc(var(--nav-height) + var(--space-6));
}
.legal-content p { color: var(--text-secondary); font-size: var(--text-base); line-height: 1.7; }
.legal-content p + p { margin-top: var(--space-3); }
.legal-content ul {
  list-style: disc;
  padding-left: var(--space-6);
  margin-block: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.legal-content li { color: var(--text-secondary); font-size: var(--text-base); line-height: 1.7; }
