/* ============================================================
   VYKEN — Property Vulnerability Intelligence
   Design system: black surfaces, signal-red accent
   Display: Exo 2  ·  Body: Inter
   ============================================================ */

/* ---------- Type scale ---------- */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 0.5rem + 6.5vw, 7rem);

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

  /* ---------- Radius ---------- */
  --radius-sm: 0.25rem; --radius-md: 0.4rem; --radius-lg: 0.6rem;
  --radius-xl: 0.9rem;  --radius-full: 9999px;

  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ---------- Content widths ---------- */
  --content-narrow: 680px;
  --content-default: 1040px;
  --content-wide: 1280px;

  /* ---------- Fonts ---------- */
  --font-display: 'Exo 2', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

/* ============================================================
   COLOR — Dark mode is the brand default (black + red).
   Light mode provided for accessibility / system preference.
   ============================================================ */
:root,
[data-theme='dark'] {
  --color-bg: #0a0a0b;
  --color-surface: #0f0f11;
  --color-surface-2: #161618;
  --color-surface-offset: #1c1c1f;
  --color-surface-3: #232327;
  --color-divider: #26262b;
  --color-border: #303036;
  --color-border-strong: #44444c;

  --color-text: #f5f5f5;
  --color-text-muted: #9a9aa2;
  --color-text-faint: #65656d;
  --color-text-inverse: #0a0a0b;

  /* Signal Red */
  --color-primary: #e02424;
  --color-primary-hover: #f23a3a;
  --color-primary-active: #b81818;
  --color-primary-deep: #8b0e0e;
  --color-primary-glow: rgba(224, 36, 36, 0.35);
  --color-primary-faint: rgba(224, 36, 36, 0.10);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
  --shadow-red: 0 8px 32px rgba(224, 36, 36, 0.22);

  --grid-line: rgba(255, 255, 255, 0.035);
}

[data-theme='light'] {
  --color-bg: #ffffff;
  --color-surface: #fafafa;
  --color-surface-2: #f4f4f5;
  --color-surface-offset: #efeff1;
  --color-surface-3: #e7e7ea;
  --color-divider: #ececee;
  --color-border: #e2e2e6;
  --color-border-strong: #cdcdd3;

  --color-text: #1a1a1f;
  --color-text-muted: #5c5c66;
  --color-text-faint: #9a9aa3;
  --color-text-inverse: #ffffff;

  /* Slightly deeper, less neon red so it reads refined on white */
  --color-primary: #c41f24;
  --color-primary-hover: #a81519;
  --color-primary-active: #8b0e0e;
  --color-primary-deep: #8b0e0e;
  --color-primary-glow: rgba(196, 31, 36, 0.16);
  --color-primary-faint: rgba(196, 31, 36, 0.055);

  --shadow-sm: 0 1px 2px rgba(26, 26, 31, 0.05);
  --shadow-md: 0 8px 24px rgba(26, 26, 31, 0.08);
  --shadow-lg: 0 20px 56px rgba(26, 26, 31, 0.12);
  --shadow-red: 0 10px 30px rgba(196, 31, 36, 0.18);

  --grid-line: rgba(26, 26, 31, 0.035);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none; text-size-adjust: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'], ol[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  text-wrap: balance;
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 700;
}
p, li, figcaption { text-wrap: pretty; max-width: 68ch; }

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

::selection { background: var(--color-primary); color: #fff; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

button { cursor: pointer; background: none; border: none; }

a, button, [role='button'], input, textarea, select {
  transition: color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */
.wrap { width: 100%; max-width: var(--content-wide); margin-inline: auto; padding-inline: var(--space-6); }
.wrap--default { max-width: var(--content-default); }
.wrap--narrow { max-width: var(--content-narrow); }

.section { padding-block: clamp(var(--space-16), 9vw, var(--space-32)); }
.section--tight { padding-block: clamp(var(--space-12), 6vw, var(--space-20)); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.eyebrow::before {
  content: ''; width: 26px; height: 1.5px;
  background: var(--color-primary);
}

.lead { font-size: var(--text-lg); color: var(--color-text-muted); line-height: 1.5; max-width: 56ch; }

.text-muted { color: var(--color-text-muted); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-red);
}
.btn--primary:hover { background: var(--color-primary-hover); transform: translateY(-2px); box-shadow: 0 12px 36px var(--color-primary-glow); }
.btn--primary:active { background: var(--color-primary-active); transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-2px); }

.btn--lg { padding: 1rem 2rem; font-size: var(--text-base); }
.btn svg { width: 1.05em; height: 1.05em; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.header--scrolled { box-shadow: var(--shadow-sm); border-color: var(--color-border); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 4.5rem; gap: var(--space-6); }

.brand { display: inline-flex; align-items: center; gap: var(--space-3); }
.brand__mark { width: 34px; height: 23px; color: var(--color-primary); flex-shrink: 0; }
.brand__type { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  letter-spacing: 0.32em; color: var(--color-text); padding-left: 0.32em;
}
.brand__tag {
  font-family: var(--font-display); font-weight: 600; font-size: 0.68rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-primary);
  margin-top: 5px; padding-left: 0.14em; white-space: nowrap;
}
.brand__slogan {
  font-family: var(--font-display); font-weight: 400; font-size: 0.62rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text);
  margin-top: 3px; padding-left: 0.14em; white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav__links { display: flex; align-items: center; gap: var(--space-5); list-style: none; }
.nav__link {
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500;
  letter-spacing: 0.04em; color: var(--color-text-muted); position: relative; padding: 0.25rem 0;
  white-space: nowrap;
}
/* Tighten spacing for nav on mid-width screens */
@media (max-width: 1200px) {
  .nav__links { gap: var(--space-3); }
  .nav__link { font-size: 0.80rem; letter-spacing: 0.01em; }
  .header__actions .btn--primary { padding: 0.6rem 1rem; font-size: 0.76rem; }
}
@media (max-width: 1020px) {
  .nav__links { gap: var(--space-2); }
  .nav__link { font-size: 0.74rem; letter-spacing: 0; }
  .header__actions .btn--primary { padding: 0.55rem 0.85rem; font-size: 0.72rem; }
}
.nav__link:hover, .nav__link[aria-current='page'] { color: var(--color-text); }
.nav__link::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--color-primary); transition: width var(--transition-interactive);
}
.nav__link:hover::after, .nav__link[aria-current='page']::after { width: 100%; }

/* ---- Desktop dropdown ("Learn") ---- */
.nav__dropdown { position: relative; display: flex; align-items: center; }
.nav__dropdown-toggle {
  /* Inherits .nav__link typography (incl. responsive sizes); only reset the
     button chrome and lay out the caret. Do NOT set font-size here or it
     breaks the responsive shrink the <a> tabs use. */
  background: none; border: 0; cursor: pointer; margin: 0;
  display: inline-flex; align-items: center; gap: 4px;
  /* Anchors render inline (box ~= glyph height); a flex button uses full
     line-height and ends up taller. Tighten line-height so the button box
     matches the <a> tabs' height. */
  line-height: 1.2;
}
.nav__dropdown-toggle .nav__caret { width: 0.7em; height: 0.7em; display: block; }
.nav__dropdown-toggle.nav__link--active { color: var(--color-text); }
.nav__caret { transition: transform var(--transition-interactive); flex: 0 0 auto; }
.nav__dropdown:hover .nav__caret,
.nav__dropdown.open .nav__caret { transform: rotate(180deg); }
.nav__dropdown-menu {
  list-style: none; margin: 0; padding: 6px;
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(-6px);
  min-width: 210px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--transition-interactive), transform var(--transition-interactive), visibility var(--transition-interactive);
  z-index: 60;
}
/* small hover bridge so the menu doesn't close in the gap */
.nav__dropdown::after {
  content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 14px;
}
.nav__dropdown:hover .nav__dropdown-menu,
.nav__dropdown.open .nav__dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav__dropdown-link {
  display: block; padding: 9px 12px; border-radius: 8px;
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.02em; color: var(--color-text-muted); white-space: nowrap;
  transition: background var(--transition-interactive), color var(--transition-interactive);
}
.nav__dropdown-link:hover { background: var(--color-bg-subtle, rgba(0,0,0,0.05)); color: var(--color-text); }
.nav__dropdown-link--active { color: var(--color-primary); font-weight: 700; }

.header__actions { display: flex; align-items: center; gap: var(--space-3); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); color: var(--color-text-muted);
}
.theme-toggle:hover { color: var(--color-primary); border-color: var(--color-primary); }

.nav-toggle { display: none; width: 38px; height: 38px; align-items: center; justify-content: center; color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--radius-md); }

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav-toggle { display: inline-flex; }
  .header__actions .btn--primary { display: none; } /* CTA lives in mobile menu */
  .header__inner.nav-open + .mobile-nav,
  .mobile-nav.open { display: block; }
}
@media (max-width: 520px) {
  .brand__tag { display: block; font-size: 0.52rem; letter-spacing: 0.04em; white-space: nowrap; }
  .brand__slogan { display: block; font-size: 0.5rem; letter-spacing: 0.04em; white-space: nowrap; }
  .brand__name { font-size: 1.1rem; letter-spacing: 0.2em; }
  .header__inner { gap: var(--space-3); }
}
@media (max-width: 380px) {
  .brand__tag { font-size: 0.48rem; letter-spacing: 0.02em; }
  .brand__slogan { font-size: 0.46rem; letter-spacing: 0.02em; }
}

.mobile-nav {
  display: none; border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface); padding: var(--space-4) var(--space-6) var(--space-8);
}
.mobile-nav ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.mobile-nav a {
  display: block; padding: var(--space-3) 0; font-family: var(--font-display);
  font-weight: 500; letter-spacing: 0.04em; color: var(--color-text);
  border-bottom: 1px solid var(--color-divider);
}
.mobile-nav a:hover { color: var(--color-primary); }
.mobile-nav .btn { margin-top: var(--space-4); width: 100%; }
/* keep the primary CTA text white in the drawer (override .mobile-nav a color) */
.mobile-nav a.btn--primary,
.mobile-nav a.btn--primary:hover { color: #fff; }

/* ---- Mobile accordion group ("Learn") ---- */
.mobile-nav__group-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--color-divider);
  cursor: pointer; padding: var(--space-3) 0; text-align: left;
  font-family: var(--font-display); font-weight: 500; letter-spacing: 0.04em;
  color: var(--color-text); font-size: 1rem;
}
.mobile-nav__group-toggle .nav__caret { transition: transform var(--transition-interactive); }
.mobile-nav__group.open .mobile-nav__group-toggle .nav__caret { transform: rotate(180deg); }
.mobile-nav__submenu {
  overflow: hidden; max-height: 0; padding-left: var(--space-4);
  transition: max-height var(--transition-interactive);
}
.mobile-nav__group.open .mobile-nav__submenu { max-height: 320px; }
.mobile-nav__submenu a { font-size: 0.92rem; color: var(--color-text-muted); }
.mobile-nav__submenu a:hover { color: var(--color-primary); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--color-divider); background: var(--color-surface); padding-block: var(--space-16) var(--space-8); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: var(--space-10); margin-bottom: var(--space-12); }
.footer__col h4 { font-family: var(--font-display); font-size: var(--text-xs); letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-text-faint); margin-bottom: var(--space-4); font-weight: 600; }
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.footer__col a { font-size: var(--text-sm); color: var(--color-text-muted); }
.footer__col a:hover { color: var(--color-primary); }
.footer__blurb { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-4); max-width: 32ch; }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-top: var(--space-6); border-top: 1px solid var(--color-divider); font-size: var(--text-xs); color: var(--color-text-faint); }
.footer__bottom .disclaimer { max-width: 60ch; }
/* A11y: in light mode, footer headers + legal use faint gray that fails WCAG AA
   on the light surface (~2.7:1). Bump to the muted token (~6.3:1) in light mode only. */
[data-theme='light'] .footer__col h4,
[data-theme='light'] .footer__bottom { color: var(--color-text-muted); }

@media (max-width: 760px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 460px) { .footer__grid { grid-template-columns: 1fr; } }

/* ============================================================
   DECOR — grid backdrop, radar
   ============================================================ */
.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 78%);
}
@media (max-width: 768px) {
  .grid-bg { display: none; }
}
.glow-red {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, var(--color-primary-glow), transparent 70%);
  filter: blur(40px);
}

/* ── Social Icons ── */
.footer__social { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-5); }
.footer__social a { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; color: var(--color-text-muted); border: 1px solid var(--color-divider); transition: color 0.18s, border-color 0.18s, background 0.18s; }
.footer__social a:hover { color: var(--color-primary); border-color: var(--color-primary); background: var(--color-primary-faint); }
.footer__social svg { width: 16px; height: 16px; fill: currentColor; }

/* ── Tier Deliverables ── */
.tier__deliverables { margin-top:var(--space-5); padding-top:var(--space-5); border-top:1px solid var(--color-divider); }
.tier__deliverables-label { font-size:var(--text-xs); font-weight:700; text-transform:uppercase; letter-spacing:0.1em; color:var(--color-text-faint); margin-bottom:var(--space-3); }
.tier__deliverables ul { list-style:none; display:flex; flex-direction:column; gap:var(--space-2); }
.tier__deliverables li { font-size:var(--text-sm); color:var(--color-text-muted); padding-left:var(--space-4); position:relative; }
.tier__deliverables li::before { content:'→'; position:absolute; left:0; color:var(--color-primary); font-weight:700; }
.tier__deliverables + .btn,
.tier__deliverables + a { margin-top:var(--space-6) !important; display:inline-block; }
