/* ==========================================================================
   valkyre.ai — Valkyre Design System (VDS) v1.0
   Dependency-free. Tokens documented in STYLE-GUIDE.md at the repo root.
   ========================================================================== */

/* ---- Design tokens --------------------------------------------------- */
:root {
  /* Color — core neutrals ("night steel") */
  --vds-night:          #070b12;   /* page background */
  --vds-surface:        #0d141f;   /* section alternate background */
  --vds-surface-raised: #121b29;   /* cards, panels */
  --vds-border:         rgba(148, 170, 199, 0.14);
  --vds-border-strong:  rgba(148, 170, 199, 0.28);

  /* Color — text */
  --vds-text:           #edf1f7;
  --vds-text-muted:     #8fa0b5;
  --vds-text-faint:     #5c6b80;

  /* Color — brand accents */
  --vds-gold:           #e3b458;   /* primary action, emphasis */
  --vds-gold-deep:      #b8893a;
  --vds-aurora:         #37d3b4;   /* links, live signals, success */
  --vds-aurora-dim:     rgba(55, 211, 180, 0.12);

  /* Color — team semantics */
  --vds-red-team:       #f0596d;
  --vds-blue-team:      #58a6ff;
  --vds-purple-team:    #a78bfa;

  /* Typography */
  --vds-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
                   Roboto, "Helvetica Neue", Arial, sans-serif;
  --vds-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
                   "Liberation Mono", monospace;

  /* Fluid type scale (min → max across 360–1280px viewports) */
  --vds-fs-xs:   0.8125rem;
  --vds-fs-sm:   0.9375rem;
  --vds-fs-base: 1.0625rem;
  --vds-fs-lg:   clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --vds-fs-xl:   clamp(1.375rem, 1.15rem + 1.1vw, 1.875rem);
  --vds-fs-2xl:  clamp(1.75rem, 1.4rem + 1.8vw, 2.625rem);
  --vds-fs-hero: clamp(2.375rem, 1.7rem + 3.4vw, 4.25rem);

  /* Spacing scale (8px base) */
  --vds-s1: 0.5rem;
  --vds-s2: 1rem;
  --vds-s3: 1.5rem;
  --vds-s4: 2rem;
  --vds-s5: 3rem;
  --vds-s6: 4.5rem;
  --vds-s7: 7rem;

  /* Shape & elevation */
  --vds-radius:     10px;
  --vds-radius-lg:  16px;
  --vds-shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
                     0 20px 40px -24px rgba(0, 0, 0, 0.6);

  /* Layout */
  --vds-content-max: 72rem;
  --vds-nav-height: 4.25rem;

  color-scheme: dark;
}

/* ---- Reset / base ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--vds-nav-height) + 1rem);
}

body {
  margin: 0;
  background: var(--vds-night);
  color: var(--vds-text);
  font-family: var(--vds-font-sans);
  font-size: var(--vds-fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 var(--vds-s2);
  font-weight: 700;
  text-wrap: balance;
}

p { margin: 0 0 var(--vds-s2); }

a { color: var(--vds-aurora); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: rgba(227, 180, 88, 0.3); }

:focus-visible {
  outline: 2px solid var(--vds-aurora);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ---- Utility ----------------------------------------------------------- */
.container {
  max-width: var(--vds-content-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.eyebrow {
  display: inline-block;
  font-family: var(--vds-font-mono);
  font-size: var(--vds-fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vds-gold);
  margin-bottom: var(--vds-s2);
}

.lede {
  font-size: var(--vds-fs-lg);
  color: var(--vds-text-muted);
  max-width: 46rem;
}

.section { padding-block: var(--vds-s7); }
.section--alt { background: var(--vds-surface); border-block: 1px solid var(--vds-border); }
.section-head { max-width: 50rem; margin-bottom: var(--vds-s5); }
.section-head h2 { font-size: var(--vds-fs-2xl); }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.8em 1.5em;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: var(--vds-fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn--primary {
  background: linear-gradient(180deg, var(--vds-gold), var(--vds-gold-deep));
  color: #14100a;
  box-shadow: 0 8px 24px -10px rgba(227, 180, 88, 0.55);
}
.btn--primary:hover { box-shadow: 0 12px 28px -10px rgba(227, 180, 88, 0.7); }

.btn--ghost {
  border-color: var(--vds-border-strong);
  color: var(--vds-text);
  background: transparent;
}
.btn--ghost:hover { background: rgba(148, 170, 199, 0.08); }

/* ---- Navigation --------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--vds-nav-height);
  display: flex;
  align-items: center;
  background: rgba(7, 11, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--vds-border);
}
.nav .container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--vds-s3);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--vds-text);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand svg { width: 1.65rem; height: 1.65rem; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--vds-s3);
  font-size: var(--vds-fs-sm);
}
.nav-links a { color: var(--vds-text-muted); }
.nav-links a:hover { color: var(--vds-text); text-decoration: none; }
@media (max-width: 860px) { .nav-links .nav-link { display: none; } }

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--vds-s7) var(--vds-s6);
  background:
    radial-gradient(60rem 30rem at 75% -10%, rgba(55, 211, 180, 0.09), transparent 60%),
    radial-gradient(50rem 28rem at 10% 110%, rgba(227, 180, 88, 0.07), transparent 60%),
    var(--vds-night);
}
.hero::before {
  /* faint engineering grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 170, 199, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 170, 199, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(65rem 40rem at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(65rem 40rem at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 {
  font-size: var(--vds-fs-hero);
  max-width: 17ch;
  margin-bottom: var(--vds-s3);
}
.hero h1 .accent {
  background: linear-gradient(90deg, var(--vds-gold), var(--vds-aurora));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede { margin-bottom: var(--vds-s4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--vds-s2); margin-bottom: var(--vds-s5); }

.hero-proof {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1px;
  background: var(--vds-border);
  border: 1px solid var(--vds-border);
  border-radius: var(--vds-radius-lg);
  overflow: hidden;
}
.hero-proof > div { background: var(--vds-surface); padding: var(--vds-s3); }
.hero-proof strong {
  display: block;
  font-size: var(--vds-fs-xl);
  letter-spacing: -0.02em;
  color: var(--vds-text);
}
.hero-proof span { font-size: var(--vds-fs-sm); color: var(--vds-text-muted); }

/* ---- Card grids ----------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--vds-s3);
}
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); }

.card {
  background: var(--vds-surface-raised);
  border: 1px solid var(--vds-border);
  border-radius: var(--vds-radius-lg);
  padding: var(--vds-s4);
  box-shadow: var(--vds-shadow-card);
}
.card h3 { font-size: var(--vds-fs-lg); }
.card p { color: var(--vds-text-muted); font-size: var(--vds-fs-sm); margin: 0; }
.card p + p { margin-top: var(--vds-s2); }

.card--team { border-top: 3px solid var(--vds-border-strong); }
.card--red    { border-top-color: var(--vds-red-team); }
.card--blue   { border-top-color: var(--vds-blue-team); }
.card--purple { border-top-color: var(--vds-purple-team); }

.card-tag {
  display: inline-block;
  font-family: var(--vds-font-mono);
  font-size: var(--vds-fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--vds-text-faint);
  margin-bottom: var(--vds-s1);
}

/* ---- Lifecycle timeline ---------------------------------------------------- */
.lifecycle { counter-reset: step; display: grid; gap: var(--vds-s2); }
.lifecycle li {
  counter-increment: step;
  list-style: none;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--vds-s2);
  align-items: start;
  background: var(--vds-surface-raised);
  border: 1px solid var(--vds-border);
  border-radius: var(--vds-radius);
  padding: var(--vds-s3);
}
.lifecycle li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--vds-font-mono);
  font-size: var(--vds-fs-lg);
  font-weight: 700;
  color: var(--vds-gold);
  line-height: 1.3;
}
.lifecycle strong { display: block; margin-bottom: 0.25rem; }
.lifecycle p { margin: 0; color: var(--vds-text-muted); font-size: var(--vds-fs-sm); }
.lifecycle { padding-left: 0; margin: 0; }

/* ---- Split feature sections -------------------------------------------------- */
.split {
  display: grid;
  gap: var(--vds-s5);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 920px) { .split { grid-template-columns: 1fr 1fr; } }
.split h2 { font-size: var(--vds-fs-2xl); }
.split ul { padding-left: 1.2rem; color: var(--vds-text-muted); }
.split li { margin-bottom: 0.6rem; }
.split li::marker { color: var(--vds-aurora); }

/* Terminal-style panel used as product visual */
.panel {
  background: var(--vds-surface-raised);
  border: 1px solid var(--vds-border-strong);
  border-radius: var(--vds-radius-lg);
  box-shadow: var(--vds-shadow-card);
  overflow: hidden;
  font-family: var(--vds-font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
}
.panel-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--vds-border);
  color: var(--vds-text-faint);
  font-size: var(--vds-fs-xs);
  letter-spacing: 0.08em;
}
.panel-bar .dots { display: flex; gap: 0.35rem; }
.panel-bar .dots i {
  width: 0.65rem; height: 0.65rem; border-radius: 50%;
  background: var(--vds-border-strong);
}
.panel-body { padding: var(--vds-s3); overflow-x: auto; }
.panel-body .ok    { color: var(--vds-aurora); }
.panel-body .warn  { color: var(--vds-gold); }
.panel-body .crit  { color: var(--vds-red-team); }
.panel-body .dim   { color: var(--vds-text-faint); }
.panel-body .key   { color: var(--vds-blue-team); }

/* ---- Einheri role cards ---------------------------------------------------- */
.roles { display: grid; gap: var(--vds-s2); grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.role {
  background: var(--vds-surface-raised);
  border: 1px solid var(--vds-border);
  border-radius: var(--vds-radius);
  padding: var(--vds-s3);
}
.role h4 { font-size: var(--vds-fs-base); margin-bottom: 0.4rem; }
.role p { margin: 0; font-size: var(--vds-fs-sm); color: var(--vds-text-muted); }

/* ---- Purple loop banner ------------------------------------------------------ */
.loop {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1rem;
  font-family: var(--vds-font-mono);
  font-size: var(--vds-fs-sm);
  font-weight: 600;
  color: var(--vds-text);
  text-align: center;
  padding: var(--vds-s3);
  border: 1px dashed var(--vds-border-strong);
  border-radius: var(--vds-radius-lg);
  background: var(--vds-aurora-dim);
}
.loop .arrow { color: var(--vds-aurora); }

/* ---- Trust principles -------------------------------------------------------- */
.principles { display: grid; gap: var(--vds-s3); grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.principle { border-left: 2px solid var(--vds-gold); padding-left: var(--vds-s2); }
.principle h3 { font-size: var(--vds-fs-base); margin-bottom: 0.35rem; }
.principle p { margin: 0; font-size: var(--vds-fs-sm); color: var(--vds-text-muted); }

/* ---- Audience checklist -------------------------------------------------------- */
.audience { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--vds-s2); max-width: 46rem; }
.audience li {
  position: relative;
  padding-left: 2rem;
  color: var(--vds-text-muted);
}
.audience li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.42em;
  width: 0.9rem; height: 0.55rem;
  border-left: 2px solid var(--vds-aurora);
  border-bottom: 2px solid var(--vds-aurora);
  transform: rotate(-45deg);
}

/* ---- Final CTA ------------------------------------------------------------------ */
.cta {
  text-align: center;
  padding-block: var(--vds-s7);
  background:
    radial-gradient(40rem 20rem at 50% 120%, rgba(227, 180, 88, 0.12), transparent 65%),
    var(--vds-surface);
  border-top: 1px solid var(--vds-border);
}
.cta h2 { font-size: var(--vds-fs-2xl); max-width: 24ch; margin-inline: auto; }
.cta .lede { margin-inline: auto; margin-bottom: var(--vds-s4); }

/* ---- Footer ---------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--vds-border);
  padding-block: var(--vds-s5);
  font-size: var(--vds-fs-sm);
  color: var(--vds-text-faint);
}
.footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vds-s3);
  align-items: center;
  justify-content: space-between;
}
.footer a { color: var(--vds-text-muted); }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; color: var(--vds-text-muted); font-weight: 600; }
.footer-brand svg { width: 1.25rem; height: 1.25rem; }

/* ---- Style-guide page helpers ----------------------------------------------------- */
.swatches { display: grid; gap: var(--vds-s2); grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.swatch {
  border: 1px solid var(--vds-border);
  border-radius: var(--vds-radius);
  overflow: hidden;
  font-size: var(--vds-fs-xs);
}
.swatch .chip { height: 4.5rem; }
.swatch .meta { padding: 0.75rem; background: var(--vds-surface-raised); }
.swatch .meta strong { display: block; color: var(--vds-text); }
.swatch .meta code { font-family: var(--vds-font-mono); color: var(--vds-text-muted); }

.type-specimen { border-bottom: 1px solid var(--vds-border); padding-block: var(--vds-s2); }
.type-specimen small {
  display: block;
  font-family: var(--vds-font-mono);
  color: var(--vds-text-faint);
  margin-bottom: 0.25rem;
}
