/* ============================================================
   VPCheck — Design System
   Tokens, type, layout primitives, components.
   Controlled by data-theme (light|dark) and data-density (compact|regular|comfy) on <html>.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  /* Color tokens — LIGHT */
  --bg: oklch(0.99 0.003 255);
  --bg-2: oklch(0.975 0.006 255);
  --surface: #ffffff;
  --card: oklch(0.985 0.005 255);
  --border: oklch(0.91 0.012 255);
  --border-strong: oklch(0.85 0.018 255);
  --text: oklch(0.18 0.025 255);
  --text-muted: oklch(0.48 0.022 255);
  --text-subtle: oklch(0.62 0.018 255);

  --primary: oklch(0.52 0.20 255);
  --primary-hover: oklch(0.46 0.21 255);
  --primary-soft: oklch(0.96 0.035 255);
  --primary-border: oklch(0.88 0.06 255);
  --primary-contrast: #ffffff;

  --accent: oklch(0.78 0.20 145);
  --accent-strong: oklch(0.68 0.19 145);
  --accent-soft: oklch(0.96 0.06 145);

  --warn: oklch(0.78 0.16 80);
  --warn-soft: oklch(0.96 0.05 80);
  --danger: oklch(0.62 0.20 28);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.10), 0 8px 16px -8px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 1px var(--primary-border), 0 12px 32px -8px oklch(0.52 0.20 255 / 0.25);

  /* Spacing scale (regular density default) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --section-y: 120px;
  --container: 1200px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* Type */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: oklch(0.135 0.015 255);
  --bg-2: oklch(0.165 0.018 255);
  --surface: oklch(0.18 0.02 255);
  --card: oklch(0.195 0.022 255);
  --border: oklch(0.27 0.022 255);
  --border-strong: oklch(0.35 0.025 255);
  --text: oklch(0.97 0.006 255);
  --text-muted: oklch(0.68 0.022 255);
  --text-subtle: oklch(0.55 0.022 255);

  --primary: oklch(0.72 0.16 255);
  --primary-hover: oklch(0.78 0.17 255);
  --primary-soft: oklch(0.28 0.08 255);
  --primary-border: oklch(0.40 0.10 255);
  --primary-contrast: oklch(0.12 0.02 255);

  --accent: oklch(0.82 0.20 145);
  --accent-strong: oklch(0.88 0.20 145);
  --accent-soft: oklch(0.28 0.08 145);

  --warn: oklch(0.85 0.15 80);
  --warn-soft: oklch(0.30 0.08 80);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px var(--primary-border), 0 12px 32px -8px oklch(0.72 0.16 255 / 0.35);
}

html[data-density="compact"] {
  --section-y: 80px;
  --s-5: 18px;
  --s-6: 26px;
  --s-7: 38px;
  --s-8: 52px;
}
html[data-density="comfy"] {
  --section-y: 160px;
  --s-5: 28px;
  --s-6: 40px;
  --s-7: 60px;
  --s-8: 80px;
}

/* ============================================================ Reset + base */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  transition: background-color 0.25s ease, color 0.25s ease;
}
body { min-height: 100vh; overflow-x: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--primary); color: var(--primary-contrast); }

/* ============================================================ Type */

h1, h2, h3, h4, h5, h6, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; line-height: 1.05; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 14px; height: 1px;
  background: var(--border-strong);
}
.display-xxl { font-size: clamp(3rem, 7vw, 6rem); font-weight: 600; letter-spacing: -0.035em; line-height: 0.98; }
.display-xl  { font-size: clamp(2.5rem, 5.5vw, 4.5rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; }
.display-lg  { font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; }
.display-md  { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; letter-spacing: -0.02em; }
.lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-wrap: pretty;
  max-width: 60ch;
}
.mono { font-family: var(--font-mono); font-feature-settings: "ss01", "ss02"; }
.kbd, .tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ============================================================ Layout */

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--section-y) 0; position: relative; }
.section-tight { padding: calc(var(--section-y) * 0.6) 0; }

.grid { display: grid; gap: var(--s-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); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; gap: var(--s-3); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.col { display: flex; flex-direction: column; gap: var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }

/* ============================================================ Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklch, var(--bg) 80%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s ease;
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.nav-brand .logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), oklch(0.42 0.22 265));
  color: white;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  letter-spacing: -0.04em;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.25);
}
.nav-brand b { font-weight: 700; }
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  transition: all 0.15s ease;
}
.nav-link:hover { color: var(--text); background: var(--bg-2); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: ""; display: block; height: 2px;
  background: var(--primary);
  border-radius: 2px;
  margin-top: 4px;
  margin-left: 12px; margin-right: 12px;
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: grid; place-items: center;
  transition: all 0.15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle [data-theme-icon] { display: none; }
html[data-theme="dark"]  .theme-toggle [data-theme-icon="dark"]  { display: block; }
html[data-theme="light"] .theme-toggle [data-theme-icon="light"] { display: block; }

/* Hamburger (mobile only) */
.nav-hamburger {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.nav-hamburger:hover { background: var(--bg-2); border-color: var(--border-strong); }
.nav-hamburger.open { background: var(--bg-2); }

/* Mobile menu panel */
.nav-mobile {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 24px 20px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}
.nav-mobile.open { display: block; animation: navMobileIn 0.2s ease; }
@keyframes navMobileIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-mobile ul { list-style: none; padding: 0; margin: 0; }
.nav-mob-link {
  display: block;
  padding: 14px 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: color 0.15s ease;
}
.nav-mob-link:hover { color: var(--primary); }
.nav-mob-link.active { color: var(--primary); }
.nav-mob-link.active::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 10px;
  vertical-align: middle;
}
.nav-mobile-foot {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 4px;
}
.nav-mobile-foot .btn { flex: 1; justify-content: center; }

@media (max-width: 800px) {
  .nav-hamburger { display: inline-flex; }
}

@media (max-width: 800px) {
  .nav-links { display: none; }
}

/* ============================================================ Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-2); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-2); }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: var(--r-md); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ============================================================ Pills + chips */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pill-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* ============================================================ Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  transition: all 0.2s ease;
}
.card-flat { background: var(--bg-2); border-color: transparent; }
.card-hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-feature {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: var(--s-5);
}
.card-feature .ic {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  border: 1px solid var(--primary-border);
}
.card-feature h3 {
  font-size: 1.125rem;
  letter-spacing: -0.015em;
}
.card-feature p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* ============================================================ Footer */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: var(--s-7) 0 var(--s-5);
  margin-top: var(--s-8);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s-6);
}
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: var(--text-muted); font-size: 14px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: var(--container);
  margin: 48px auto 0;
  padding: 24px 24px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-subtle);
}
@media (max-width: 800px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* ============================================================ Decorative */

.dots-bg {
  background-image: radial-gradient(circle at 1px 1px, var(--border-strong) 1px, transparent 0);
  background-size: 24px 24px;
}
.grid-bg {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.5;
}

/* ============================================================ Status badges */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.status .dot { width: 6px; height: 6px; border-radius: 50%; }
.status-ok { background: var(--accent-soft); color: var(--accent-strong); }
.status-ok .dot { background: var(--accent-strong); }
.status-progress { background: var(--warn-soft); color: var(--warn); }
.status-progress .dot { background: var(--warn); }
.status-pending { background: var(--primary-soft); color: var(--primary); }
.status-pending .dot { background: var(--primary); }

/* ============================================================ Page hero shared */

.page-hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.page-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 16px 0 20px;
  max-width: 22ch;
}
.page-hero .lead { font-size: 1.1875rem; max-width: 56ch; }

/* ============================================================ Reveal */

.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================ Utility */

.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-accent { color: var(--accent-strong); }
.text-primary { color: var(--primary); }
.tabular { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--border); width: 100%; }
/* ============================================================ Tweaks panel (vanilla) */

.vp-tweaks {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 2147483646;
  width: 260px;
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  display: none;
  overflow: hidden;
}
.vp-tweaks.open { display: block; }
.vp-tweaks-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--border);
}
.vp-tweaks-head strong { font-size: 12px; font-weight: 600; }
.vp-x {
  background: transparent; border: 0;
  color: var(--text-muted);
  width: 22px; height: 22px;
  border-radius: 6px;
  font-size: 12px;
}
.vp-x:hover { background: var(--bg-2); color: var(--text); }
.vp-tweaks-body {
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.vp-row { display: flex; flex-direction: column; gap: 6px; }
.vp-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.vp-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.vp-seg button {
  background: transparent; border: 0;
  color: var(--text-muted);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  text-transform: capitalize;
}
.vp-seg button:hover { color: var(--text); }
.vp-seg button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ============================================================ Logo image */

.nav-brand .logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}
.footer .nav-brand .logo-img { width: 30px; height: 30px; }

.hide-mobile { display: initial; }
@media (max-width: 700px) {
  .hide-mobile { display: none; }
}
