/* ================================================================
   TextCompare — Design System
   Aesthetic: Minimal-AI Clarity, Dark-First, OKLCH, June 2026
   Fonts: Bricolage Grotesque (display) + JetBrains Mono (code)
   ================================================================ */

/* ── Design Tokens ───────────────────────────────────────────────────── */
:root {
  color-scheme: dark light;

  /* Background layers */
  --c-bg:           oklch(13% 0.012 264);
  --c-surface:      oklch(18% 0.013 264);
  --c-surface-2:    oklch(22% 0.014 264);
  --c-surface-3:    oklch(27% 0.015 264);
  --c-border:       oklch(30% 0.016 264);
  --c-border-sub:   oklch(24% 0.013 264);

  /* Brand accent — electric indigo */
  --c-accent:       oklch(64% 0.19 264);
  --c-accent-dim:   oklch(64% 0.19 264 / 0.14);
  --c-accent-glow:  oklch(64% 0.19 264 / 0.30);
  --c-accent-h:     oklch(70% 0.20 264);

  /* Text */
  --c-text:         oklch(94% 0.005 264);
  --c-text-2:       oklch(68% 0.010 264);
  --c-text-3:       oklch(50% 0.010 264);

  /* Diff semantics — never rely on color alone (+/−/~ markers pair) */
  --c-add:          oklch(72% 0.17 150);
  --c-add-bg:       oklch(72% 0.17 150 / 0.12);
  --c-add-in:       oklch(72% 0.17 150 / 0.30);
  --c-rem:          oklch(64% 0.20 18);
  --c-rem-bg:       oklch(64% 0.20 18 / 0.12);
  --c-rem-in:       oklch(64% 0.20 18 / 0.30);
  --c-mod:          oklch(76% 0.15 75);
  --c-mod-bg:       oklch(76% 0.15 75 / 0.10);

  /* Spacing scale */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem;
  --sp-12: 3rem; --sp-16: 4rem; --sp-20: 5rem; --sp-24: 6rem;

  /* Radii */
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-xl: 24px;

  /* Elevation */
  --sh-xs: 0 1px 2px oklch(0% 0 0 / 0.40);
  --sh-sm: 0 2px 8px oklch(0% 0 0 / 0.45);
  --sh:    0 4px 20px oklch(0% 0 0 / 0.50);
  --sh-lg: 0 12px 48px oklch(0% 0 0 / 0.55);

  /* Motion */
  --ease: 0.18s ease;
  --ease-s: 0.32s ease;

  /* Typography */
  --f-display: 'Bricolage Grotesque', 'Arial Black', sans-serif;
  --f-body:    system-ui, -apple-system, 'Segoe UI', Helvetica, sans-serif;
  --f-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  /* Layout */
  --max-w: 1280px;
  --header-h: 60px;
}

/* Light mode overrides */
@media (prefers-color-scheme: light) {
  :root {
    --c-bg:          oklch(97% 0.005 264);
    --c-surface:     oklch(100% 0 0);
    --c-surface-2:   oklch(94% 0.007 264);
    --c-surface-3:   oklch(90% 0.009 264);
    --c-border:      oklch(83% 0.010 264);
    --c-border-sub:  oklch(89% 0.008 264);
    --c-text:        oklch(14% 0.012 264);
    --c-text-2:      oklch(38% 0.012 264);
    --c-text-3:      oklch(55% 0.010 264);
    --c-accent:      oklch(52% 0.19 264);
    --c-accent-dim:  oklch(52% 0.19 264 / 0.10);
    --c-accent-glow: oklch(52% 0.19 264 / 0.22);
    --c-accent-h:    oklch(46% 0.20 264);
    --sh-xs: 0 1px 2px oklch(0% 0 0 / 0.06);
    --sh-sm: 0 2px 8px oklch(0% 0 0 / 0.08);
    --sh:    0 4px 20px oklch(0% 0 0 / 0.10);
    --sh-lg: 0 12px 48px oklch(0% 0 0 / 0.12);
    --c-add-bg:  oklch(72% 0.17 150 / 0.16);
    --c-add-in:  oklch(72% 0.17 150 / 0.38);
    --c-rem-bg:  oklch(64% 0.20 18 / 0.14);
    --c-rem-in:  oklch(64% 0.20 18 / 0.34);
    --c-mod-bg:  oklch(76% 0.15 75 / 0.14);
  }
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100dvh;
  overflow-x: hidden;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul[role="list"], ol[role="list"] { list-style: none; }
a { color: inherit; text-decoration: none; }

/* ── Accessibility ───────────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100%; left: var(--sp-4);
  background: var(--c-accent); color: #fff;
  padding: var(--sp-2) var(--sp-4); border-radius: 0 0 var(--r) var(--r);
  font-weight: 600; font-size: 0.875rem; z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

.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;
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

@media (forced-colors: active) {
  :focus-visible { outline: 3px solid ButtonText; }
}

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

/* ── Layout ──────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

@media (max-width: 640px) {
  .container { padding-inline: var(--sp-4); }
}

/* ── Header / Nav ────────────────────────────────────────────────────── */
header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: color-mix(in oklch, var(--c-bg) 80%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  z-index: 100;
  transition: border-color var(--ease), box-shadow var(--ease);
}
header.scrolled {
  border-bottom-color: var(--c-border-sub);
  box-shadow: var(--sh-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: var(--sp-6);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-text);
  white-space: nowrap;
  flex-shrink: 0;
}
.logo svg { width: 28px; height: 28px; }
.logo span { color: var(--c-accent); }

nav[aria-label="Primary navigation"] {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

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

.nav-list a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-2);
  border-radius: var(--r-sm);
  transition: color var(--ease), background var(--ease);
}
.nav-list a:hover, .nav-list a.active {
  color: var(--c-text);
  background: var(--c-surface-2);
}
.nav-list a.active { color: var(--c-accent); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: none; background: none;
  color: var(--c-text-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.nav-toggle:hover { background: var(--c-surface-2); color: var(--c-text); }
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-list {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-1);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform var(--ease-s), opacity var(--ease-s);
    pointer-events: none;
  }

  .nav-list.nav-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-list a { padding: var(--sp-3) var(--sp-4); }
}

/* ── Page body offset for fixed header ───────────────────────────────── */
main { padding-top: var(--header-h); }

/* ── Breadcrumb ──────────────────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--c-text-3);
  padding: var(--sp-4) 0 0;
}
.breadcrumb-list,
ol.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumb a { color: var(--c-text-2); transition: color var(--ease); }
.breadcrumb a:hover { color: var(--c-accent); }
.breadcrumb-sep { color: var(--c-text-3); margin-inline: var(--sp-1); }
.breadcrumb [aria-current="page"] { color: var(--c-text); }

/* ── Intro text sections (centered heading + centered prose block) ───── */
.intro-text .section-title {
  font-size: 1.25rem;
  margin-bottom: var(--sp-4);
  /* text-align inherits center from .section-title */
}
.intro-text p {
  color: var(--c-text-2);
  line-height: 1.75;
  max-width: 72ch;
  margin-inline: auto; /* center the paragraph block */
}
.intro-text p + p { margin-top: var(--sp-3); }
.intro-text code {
  font-family: var(--f-mono);
  font-size: 0.85em;
  background: var(--c-surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.5625rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease);
  white-space: nowrap;
  min-height: 44px;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}
.btn-primary:hover {
  background: var(--c-accent-h);
  border-color: var(--c-accent-h);
  box-shadow: 0 0 0 4px var(--c-accent-dim);
}

.btn-secondary {
  background: var(--c-surface-2);
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn-secondary:hover { background: var(--c-surface-3); }

.btn-ghost {
  background: transparent;
  color: var(--c-text-2);
  border-color: var(--c-border-sub);
}
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px; min-height: 36px;
  padding: var(--sp-2);
  border: none;
  background: transparent;
  color: var(--c-text-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.btn-icon:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-icon svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; min-height: 36px; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  padding: var(--sp-20) 0 var(--sp-12);
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: var(--c-accent-dim);
  border: 1px solid color-mix(in oklch, var(--c-accent) 35%, transparent);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--sp-5);
}
.hero-title {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5vw + 1rem, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--c-text);
  margin-bottom: var(--sp-5);
}
.hero-title em { color: var(--c-accent); font-style: normal; }
.hero-desc {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--c-text-2);
  max-width: 56ch;
  margin: 0 auto var(--sp-8);
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: center;
  align-items: center;
}

/* ── Tool Workspace ──────────────────────────────────────────────────── */
.tool-section {
  padding: 0 0 var(--sp-16);
}

.tool-wrapper {
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--c-surface);
  box-shadow: var(--sh);
}

/* Input area */
.inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--c-border);
}

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

.input-panel {
  display: flex;
  flex-direction: column;
  position: relative;
}
.input-panel:first-child { border-right: 1px solid var(--c-border); }

@media (max-width: 768px) {
  .input-panel:first-child { border-right: none; border-bottom: 1px solid var(--c-border); }
}

.input-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border-sub);
  background: var(--c-surface-2);
  gap: var(--sp-3);
}

.panel-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-text-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.panel-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.line-count {
  font-size: 0.75rem;
  color: var(--c-text-3);
  font-family: var(--f-mono);
}

.drag-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: 0.875rem;
  color: var(--c-text-3);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--ease);
  background: color-mix(in oklch, var(--c-accent-dim) 50%, transparent);
  border-radius: var(--r-sm);
}
.input-panel.drag-over .drag-label { opacity: 1; }
.input-panel.drag-over textarea { opacity: 0.3; }

textarea.tc-input {
  width: 100%;
  min-height: 220px;
  padding: var(--sp-4);
  background: transparent;
  color: var(--c-text);
  border: none;
  resize: vertical;
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  outline: none;
  caret-color: var(--c-accent);
  transition: opacity var(--ease);
}
textarea.tc-input::placeholder { color: var(--c-text-3); }

/* ── Options bar ─────────────────────────────────────────────────────── */
.options-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-2);
}

.opt-group {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.opt-divider {
  width: 1px; height: 20px;
  background: var(--c-border);
  flex-shrink: 0;
}

.opt-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Radio tabs for diff mode */
.mode-tabs {
  display: flex;
  background: var(--c-surface-3);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}

.mode-tab {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.mode-tab input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}

.mode-tab-label {
  display: block;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-3);
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
  min-height: 28px;
  line-height: 22px;
}

.mode-tab input:checked + .mode-tab-label {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--sh-xs);
}

/* Checkboxes */
.opt-check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--c-text-2);
  white-space: nowrap;
  min-height: 24px;
}
.opt-check input { accent-color: var(--c-accent); width: 15px; height: 15px; cursor: pointer; }
.opt-check:hover { color: var(--c-text); }

/* Actions in options bar */
.options-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
  flex-wrap: wrap;
}

/* ── Stats bar ───────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
  font-size: 0.8125rem;
}

.stat { display: flex; align-items: center; gap: var(--sp-1); }
.stat span[aria-hidden] { font-weight: 700; }
.s-add { color: var(--c-add); }
.s-rem { color: var(--c-rem); }
.s-mod { color: var(--c-mod); }
.s-eq  { color: var(--c-text-3); }
.s-sim { color: var(--c-text-2); font-weight: 600; margin-left: auto; }

/* ── Results section ─────────────────────────────────────────────────── */
.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
}

.pane-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--c-border-sub);
  background: var(--c-surface-2);
}

/* ── Diff panes ──────────────────────────────────────────────────────── */
.panes-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.pane {
  overflow: auto;
  max-height: 65vh;
  min-height: 200px;
  background: var(--c-surface);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}

.pane:first-child { border-right: 1px solid var(--c-border); }

.pane-unified {
  max-height: 65vh;
  min-height: 200px;
  overflow: auto;
  background: var(--c-surface);
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}

@media (max-width: 640px) {
  .panes-container { grid-template-columns: 1fr; }
  .pane:first-child { border-right: none; border-bottom: 1px solid var(--c-border); }
  .pane-labels { grid-template-columns: 1fr; }
  .pane-labels span:last-child { display: none; }
}

/* ── Diff lines ──────────────────────────────────────────────────────── */
[role="row"].dl {
  display: grid;
  grid-template-columns: 3.25rem 1.5rem 1fr;
  min-width: 100%;
  width: max-content;
  min-height: 1.4375rem;
  line-height: 1.4375rem;
  font-family: var(--f-mono);
  font-size: 0.8rem;
  white-space: pre;
}

/* Unified view has two line-number columns */
.result-unified [role="row"].dl {
  grid-template-columns: 2.75rem 2.75rem 1.5rem 1fr;
  /* min-width/width: max-content inherited from [role="row"].dl */
}

.dl-ln {
  text-align: right;
  padding-inline: 0.375rem;
  color: var(--c-text-3);
  user-select: none;
  border-right: 1px solid var(--c-border-sub);
  flex-shrink: 0;
}

.dl-ln2 {
  text-align: right;
  padding-inline: 0.25rem;
  color: var(--c-text-3);
  user-select: none;
  border-right: 1px solid var(--c-border-sub);
  flex-shrink: 0;
}

.dl-mk {
  text-align: center;
  padding-inline: 0.25rem;
  font-weight: 700;
  user-select: none;
  flex-shrink: 0;
}

.dl-code {
  padding-inline: var(--sp-3);
  font-family: inherit;
  font-size: inherit;
  background: none;
  display: block;
  white-space: pre;
}

/* Row types */
.dl-eq   { }
.dl-add  { background: var(--c-add-bg); }
.dl-add .dl-mk  { color: var(--c-add); }
.dl-rem  { background: var(--c-rem-bg); }
.dl-rem .dl-mk  { color: var(--c-rem); }
.dl-mod  { background: var(--c-mod-bg); }
.dl-mod .dl-mk  { color: var(--c-mod); }

.dl-empty {
  background: repeating-linear-gradient(
    45deg,
    transparent, transparent 4px,
    var(--c-surface-2) 4px, var(--c-surface-2) 5px
  );
  opacity: 0.5;
}

/* Intra-line diff highlights */
del.dr {
  background: var(--c-rem-in);
  text-decoration: none;
  border-radius: 2px;
}
ins.da {
  background: var(--c-add-in);
  text-decoration: none;
  border-radius: 2px;
}

/* ── Toast notifications ─────────────────────────────────────────────── */
.tc-toast {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  max-width: 340px;
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  z-index: 9000;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}
.tc-toast.tc-toast-show { opacity: 1; transform: translateY(0); }
.tc-toast-success { border-left: 3px solid var(--c-add); }
.tc-toast-error   { border-left: 3px solid var(--c-rem); }

/* ── Shortcuts modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: oklch(0% 0 0 / 0.60);
  display: grid; place-items: center;
  z-index: 1000;
  padding: var(--sp-4);
}
.modal-backdrop[aria-hidden="true"] { display: none; }

.modal {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--sh-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.modal-header h2 { font-size: 1rem; font-weight: 700; }

.shortcut-list {
  display: grid;
  gap: var(--sp-3);
}
.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}
.shortcut-item span { color: var(--c-text-2); }
.shortcut-keys {
  display: flex;
  gap: var(--sp-1);
}
kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-text-2);
}

/* ── Features section ────────────────────────────────────────────────── */
.section { padding: var(--sp-20) 0; }
.section-sm { padding: var(--sp-12) 0; }

.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3);
  text-align: center;
}

.section-title {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--c-text);
  text-align: center;
  margin-bottom: var(--sp-4);
}

.section-desc {
  font-size: 1rem;
  color: var(--c-text-2);
  max-width: 56ch;
  margin: 0 auto var(--sp-12);
  text-align: center;
  line-height: 1.7;
}

/* Feature cards (bento-ish grid) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .features-grid { grid-template-columns: 1fr; }
}

.feature-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.feature-card:hover {
  border-color: color-mix(in oklch, var(--c-accent) 40%, transparent);
  box-shadow: var(--sh);
}

.feature-icon {
  width: 40px; height: 40px;
  background: var(--c-accent-dim);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-accent);
  flex-shrink: 0;
}
.feature-icon svg { width: 20px; height: 20px; }

.feature-title {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--c-text);
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--c-text-2);
  line-height: 1.6;
}

/* ── How it works steps ──────────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-6);
}

@media (max-width: 900px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .steps-grid { grid-template-columns: 1fr; }
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  align-items: flex-start;
}

.step-num {
  width: 36px; height: 36px;
  background: var(--c-accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.step-title {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--c-text);
}

.step-desc { font-size: 0.875rem; color: var(--c-text-2); line-height: 1.6; }

/* ── FAQ ─────────────────────────────────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: 800px;
  margin-inline: auto;
}

.faq-item {
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--c-surface);
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: none;
  border: none;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  transition: background var(--ease);
  min-height: 56px;
}
.faq-q:hover { background: var(--c-surface-2); }

.faq-chevron {
  width: 20px; height: 20px;
  color: var(--c-text-3);
  transition: transform var(--ease);
  flex-shrink: 0;
}
.faq-q[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); }

.faq-a {
  padding: 0 var(--sp-5) var(--sp-4);
  font-size: 0.9rem;
  color: var(--c-text-2);
  line-height: 1.7;
}
.faq-a p + p { margin-top: var(--sp-3); }

/* ── Use cases / cards ───────────────────────────────────────────────── */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 640px) {
  .use-cases-grid { grid-template-columns: 1fr; }
}

.use-case-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.use-case-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-accent);
}
.use-case-title { font-weight: 700; font-size: 1rem; }
.use-case-desc { font-size: 0.875rem; color: var(--c-text-2); line-height: 1.6; }

/* ── Blog grid ───────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}
@media (max-width: 860px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .blog-grid { grid-template-columns: 1fr; }
}

.blog-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color var(--ease), transform var(--ease);
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  border-color: color-mix(in oklch, var(--c-accent) 40%, transparent);
  transform: translateY(-2px);
}

.blog-card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-accent);
}
.blog-card-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--c-text);
}
.blog-card-desc {
  font-size: 0.8125rem;
  color: var(--c-text-2);
  line-height: 1.6;
  flex: 1;
}
.blog-card-meta {
  font-size: 0.75rem;
  color: var(--c-text-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ── Prose (blog / content pages) ───────────────────────────────────── */
.prose {
  max-width: 720px;
  margin-inline: auto;
  color: var(--c-text-2);
  line-height: 1.8;
  font-size: 0.9375rem;
}
.prose h2 {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--c-text);
  margin-top: var(--sp-12);
  margin-bottom: var(--sp-4);
  letter-spacing: -0.02em;
}
.prose h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--c-text);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}
.prose p { margin-bottom: var(--sp-4); }
.prose ul, .prose ol { margin: var(--sp-4) 0 var(--sp-4) var(--sp-6); }
.prose li { margin-bottom: var(--sp-2); }
.prose a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--c-accent-h); }
.prose code {
  font-family: var(--f-mono);
  font-size: 0.85em;
  background: var(--c-surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}
.prose pre {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: var(--sp-5);
  overflow-x: auto;
  margin: var(--sp-5) 0;
}
.prose pre code { background: none; padding: 0; font-size: 0.875rem; }
.prose strong { color: var(--c-text); font-weight: 700; }
.prose blockquote {
  border-left: 3px solid var(--c-accent);
  padding-left: var(--sp-4);
  margin: var(--sp-5) 0;
  color: var(--c-text-2);
  font-style: italic;
}

/* ── Article meta (author, date) ─────────────────────────────────────── */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  font-size: 0.8125rem;
  color: var(--c-text-3);
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--c-border);
}
.article-author { font-weight: 600; color: var(--c-text-2); }
.article-date { }

/* ── Contact form ────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: var(--sp-4);
  max-width: 600px;
}

.form-row { display: grid; gap: var(--sp-2); }

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text-2);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.625rem var(--sp-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  color: var(--c-text);
  font-size: 0.9rem;
  transition: border-color var(--ease), box-shadow var(--ease);
  min-height: 44px;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--c-text-3); }
.form-input:focus, .form-textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-dim);
  outline: none;
}
.form-textarea { resize: vertical; min-height: 140px; line-height: 1.6; }

/* ── Glossary ────────────────────────────────────────────────────────── */
.glossary-list { display: flex; flex-direction: column; gap: var(--sp-6); }
.glossary-term {
  border-left: 3px solid var(--c-accent);
  padding-left: var(--sp-4);
}
.glossary-dt {
  font-weight: 700;
  font-size: 1rem;
  color: var(--c-text);
  margin-bottom: var(--sp-2);
}
.glossary-dd { font-size: 0.9rem; color: var(--c-text-2); line-height: 1.7; }

/* ── Comparison table (Alternative page) ────────────────────────────── */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: var(--sp-6) 0;
}
.compare-table th, .compare-table td {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  text-align: left;
}
.compare-table th {
  background: var(--c-surface-2);
  font-weight: 700;
  color: var(--c-text);
}
.compare-table tr:nth-child(even) td { background: var(--c-surface); }
.ct-check { color: var(--c-add); font-weight: 700; }
.ct-cross { color: var(--c-rem); font-weight: 700; }
.ct-partial { color: var(--c-mod); font-weight: 700; }
.ct-ours { background: var(--c-accent-dim) !important; }

/* ── Ad slots (reserved, no live code) ──────────────────────────────── */
.ad-slot {
  background: var(--c-surface-2);
  border: 1px dashed var(--c-border);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-3);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ad-slot-banner { height: 90px; width: 100%; }
.ad-slot-box    { height: 250px; width: min(300px, 100%); }

/* ── CTA section ─────────────────────────────────────────────────────── */
.cta-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-16) var(--sp-8);
  text-align: center;
  margin: var(--sp-12) 0;
}
.cta-section h2 {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: var(--sp-4);
}
.cta-section p { color: var(--c-text-2); margin-bottom: var(--sp-6); max-width: 52ch; margin-inline: auto; }

/* ── Internal links row ──────────────────────────────────────────────── */
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--c-border);
}
.related-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 0.875rem;
  color: var(--c-accent);
  border: 1px solid color-mix(in oklch, var(--c-accent) 30%, transparent);
  border-radius: 100px;
  padding: var(--sp-1) var(--sp-3);
  transition: background var(--ease), border-color var(--ease);
  text-decoration: none;
}
.related-link:hover { background: var(--c-accent-dim); border-color: var(--c-accent); }

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: var(--sp-16) 0 var(--sp-8);
  margin-top: var(--sp-20);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  margin-bottom: var(--sp-12);
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand { }
.footer-brand .logo { margin-bottom: var(--sp-3); }
.footer-brand p {
  font-size: 0.875rem;
  color: var(--c-text-3);
  line-height: 1.6;
  max-width: 28ch;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  margin-bottom: var(--sp-4);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  list-style: none;
}
.footer-links a {
  font-size: 0.875rem;
  color: var(--c-text-2);
  transition: color var(--ease);
  text-decoration: none;
}
.footer-links a:hover { color: var(--c-accent); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-border-sub);
  font-size: 0.8125rem;
  color: var(--c-text-3);
}

.footer-bottom a { color: var(--c-text-2); transition: color var(--ease); }
.footer-bottom a:hover { color: var(--c-accent); }

/* ── Scroll-driven reveal (progressive enhancement) ──────────────────── */
@supports (animation-timeline: view()) {
  .reveal {
    animation: reveal-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
  @keyframes reveal-up {
    from { opacity: 0; translate: 0 1.5rem; }
    to   { opacity: 1; translate: 0 0; }
  }
}

@supports not (animation-timeline: view()) {
  .reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity 0.5s, transform 0.5s; }
  .reveal.visible { opacity: 1; transform: translateY(0); }
}

/* ── Chip / badge ────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-3);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-2);
}

/* ── Page header (non-home inner pages) ──────────────────────────────── */
.page-header {
  padding: var(--sp-12) 0 var(--sp-8);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--sp-12);
}
.page-header h1 {
  font-family: var(--f-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--c-text);
  margin-bottom: var(--sp-3);
}
.page-header p {
  font-size: 1rem;
  color: var(--c-text-2);
  max-width: 60ch;
  line-height: 1.7;
}

/* ── Divider ─────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--c-border);
  margin: var(--sp-12) 0;
}

/* ── Two-col layout helper ───────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--sp-12);
  align-items: start;
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ── Utility classes ─────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-accent { color: var(--c-accent); }
.text-muted  { color: var(--c-text-3); }
.mt-4  { margin-top: var(--sp-4); }
.mt-6  { margin-top: var(--sp-6); }
.mt-8  { margin-top: var(--sp-8); }
.mt-12 { margin-top: var(--sp-12); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-6  { margin-bottom: var(--sp-6); }
.mb-8  { margin-bottom: var(--sp-8); }
.gap-3 { gap: var(--sp-3); }
.flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.hidden { display: none !important; }
