/* ── Krytz · Web · Shared Design System ─────────────────────────────────
   Colors, type, components.
   Source-of-truth: client/src/index.css ("Warm Cream Executive Palette").
   Navy primary + gold CTA on warm cream — aligned with the shipped app.
   Supersedes the stale purple palette in docs/13_brand_guidelines.md.
   ──────────────────────────────────────────────────────────────────────── */

:root {
  /* Surfaces — warm cream */
  --bg:         #FAF8F5;   /* page background (app: --bg-primary) */
  --bg-2:       #FFFFFF;   /* elevated surface (app: --bg-secondary) */
  --bg-3:       #F3F0EC;   /* inset zones    (app: --bg-tertiary) */
  --surface:    #FFFFFF;
  --surface-2:  #F3F0EC;

  /* Ink — navy-family */
  --ink:        #1B2A4A;   /* primary text   (app: --text-primary)   */
  --ink-2:      #6B7B99;   /* secondary text (app: --text-secondary) */
  --ink-3:      #9DAABE;   /* tertiary text  (app: --text-tertiary)  */
  --ink-4:      #C5CCD8;   /* hint / disabled                         */

  /* Lines */
  --line:       rgba(27,42,74,0.07);
  --line-2:     rgba(27,42,74,0.12);
  --line-3:     rgba(27,42,74,0.22);

  /* Brand — navy + gold (var names kept for backwards-compat) */
  --g:          #1B2A4A;   /* primary brand / accent (app: --accent-primary) */
  --g-deep:     #2C3E6B;   /* hover / pressed        (app: --accent-hover)   */
  --g-mid:      #C8A45A;   /* gold mid — used in gradients & accents          */
  --g-soft:     #E8EBF1;   /* navy-tinted soft surface                        */
  --g-soft-2:   #F1F3F7;   /* even softer                                     */
  --g-glow:     rgba(27, 42, 74, 0.08);

  /* Gold (premium CTA + key sparkles)                                       */
  --gold:       #C8A45A;
  --gold-hover: #D4B46C;
  --gold-soft:  rgba(200, 164, 90, 0.12);
  --gold-glow:  rgba(200, 164, 90, 0.20);
  --gold-gradient: linear-gradient(135deg, #C8A45A, #D4B46C);

  /* Status — match app's muted executive palette */
  --action:     #D4574B;
  --action-soft:rgba(212, 87, 75, 0.10);
  --waiting:    #D49B4B;
  --waiting-soft:rgba(212, 155, 75, 0.10);
  --done:       #4B9B6B;
  --done-soft:  rgba(75, 155, 107, 0.10);
  --info:       #5B8EC9;
  --info-soft:  rgba(91, 142, 201, 0.10);
  --memory:     #4B7BD4;
  --memory-soft:rgba(75, 123, 212, 0.10);

  /* Radii */
  --r-1: 8px;
  --r-2: 12px;
  --r-3: 16px;
  --r-4: 22px;
  --r-5: 28px;

  /* Spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
  --s-9: 56px; --s-10: 72px; --s-11: 96px; --s-12: 128px;

  /* Type */
  --font:  'DM Sans', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  'DM Mono', ui-monospace, "SF Mono", Menlo, monospace;

  /* Type scale */
  --t-11: 11px;
  --t-12: 12px;
  --t-13: 13px;
  --t-14: 14px;
  --t-15: 15px;
  --t-16: 16px;
  --t-18: 18px;
  --t-22: 22px;
  --t-28: 28px;
  --t-36: 36px;
  --t-48: 48px;
  --t-64: 64px;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(27, 42, 74,0.04);
  --sh-2: 0 4px 16px rgba(27, 42, 74,0.06), 0 1px 2px rgba(27, 42, 74,0.04);
  --sh-3: 0 12px 36px rgba(27, 42, 74,0.10), 0 2px 6px rgba(27, 42, 74,0.04);
  --sh-4: 0 24px 64px rgba(27, 42, 74,0.14), 0 4px 12px rgba(27, 42, 74,0.06);
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  /* NOTE: don't set scroll-behavior: smooth here.
     Lenis (smooth-scroll.js) drives smooth scroll itself; the CSS smooth
     behavior fights Lenis's programmatic scrollTo and pins the page at 0.
     Native fallback (when Lenis is disabled — touch / reduced motion) uses
     `window.scrollTo({ behavior: 'smooth' })` which is opt-in per call. */
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
/* Lenis canonical CSS — keeps native smooth-scroll from fighting Lenis,
   ensures heights stay auto, and lets [data-lenis-prevent] regions
   (terminal, command palette, modals) keep their own scroll. */
html.lenis, html.lenis body { height: auto; }
html.lenis.lenis-smooth { scroll-behavior: auto !important; }
html.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
html.lenis.lenis-stopped { overflow: clip; }
html.lenis.lenis-smooth iframe { pointer-events: none; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-16);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: transparent; cursor: pointer; }
img { display: block; max-width: 100%; }
input, textarea { font: inherit; color: inherit; }
::selection { background: var(--gold-soft); color: var(--ink); }

/* ── Layout helpers ──────────────────────────────────────────────────── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.wrap-tight { max-width: 960px; margin: 0 auto; padding: 0 28px; }
.row { display: flex; align-items: center; gap: var(--s-4); }
.col { display: flex; flex-direction: column; gap: var(--s-4); }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.spacer-sm { height: var(--s-6); }
.spacer-md { height: var(--s-9); }
.spacer-lg { height: var(--s-11); }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(250,248,245,0.82);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.logo-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
}
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo-text { font-size: var(--t-18); }
.logo-text .sparkle { color: var(--g); margin-left: 2px; }

.nav-links { display: flex; gap: var(--s-7); align-items: center; }
.nav-links a,
.nav-links .nav-link {
  font-size: var(--t-14); color: var(--ink-2);
  font-weight: 400;
  transition: color 120ms ease-out;
}
.nav-links a:hover,
.nav-links .nav-link:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--ink); font-weight: 500; }

/* ── Submenu (desktop dropdown) ──────────────────────────────────── */
.nav-item { position: relative; }
.nav-item .nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; background: transparent; border: 0;
  font-family: inherit; cursor: pointer;
  line-height: 1;
  letter-spacing: -0.005em;
}
.nav-item .nav-caret {
  transition: transform 200ms cubic-bezier(0.2, 0.7, 0.3, 1);
  opacity: 0.7;
}
.nav-item.is-open .nav-link { color: var(--ink); }
.nav-item.is-open .nav-caret { transform: rotate(180deg); }

.nav-sub {
  position: absolute;
  top: calc(100% + 18px);
  left: -16px;
  min-width: 340px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: 0 24px 64px -16px rgba(27, 42, 74, 0.18),
              0 2px 6px rgba(27, 42, 74, 0.06);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
  z-index: 60;
}
.nav-item.is-open .nav-sub {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Invisible hover bridge so cursor moving from button → menu doesn't gap-out */
.nav-sub::before {
  content: '';
  position: absolute;
  top: -18px; left: 0; right: 0; height: 18px;
}
.nav-sub a {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-2);
  color: var(--ink) !important;
  font-size: 14px;
  font-weight: 400;
  transition: background 140ms ease-out, transform 140ms ease-out;
}
.nav-sub a:hover {
  background: var(--bg-2);
  transform: translateX(2px);
}
.nav-sub .ns-glyph {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--bg-3);
  border-radius: 8px;
  color: var(--g);
  font-size: 13px;
  flex-shrink: 0;
  font-family: var(--mono);
}
.nav-sub a:hover .ns-glyph {
  background: var(--g-soft);
  color: var(--ink);
}
.nav-sub .ns-text {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.nav-sub .ns-text strong {
  font-weight: 500;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: -0.01em;
}
.nav-sub .ns-text em {
  font-style: normal;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.4;
}

.nav-cta { display: flex; gap: 10px; align-items: center; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: var(--t-14); font-weight: 500;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  transition: transform 100ms ease-out, background 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, box-shadow 120ms ease-out;
  line-height: 1; white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn:active { transform: scale(0.985); }
.btn-primary {
  background: var(--g);
  color: #FFFFFF;
  box-shadow: 0 8px 22px rgba(27,42,74,0.22), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { background: var(--g-deep); }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-2);
  box-shadow: var(--sh-1);
}
.btn-secondary:hover { border-color: var(--ink); }
.btn-ghost { color: var(--ink-2); padding: 10px 12px; }
.btn-ghost:hover { color: var(--ink); }
.btn-lg { padding: 14px 22px; font-size: var(--t-15); border-radius: var(--r-3); }
.btn-sm { padding: 8px 12px; font-size: var(--t-13); }

/* ── Pill / Eyebrow / Sections ──────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 8px;
  background: var(--g-soft);
  border: 1px solid var(--g-soft-2);
  border-radius: 999px;
  font-size: var(--t-12); color: var(--g-deep);
  font-weight: 500;
}
.pill .pdot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 3px var(--gold-glow); }
  50%     { box-shadow: 0 0 0 6px rgba(200, 164, 90, 0.05); }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: var(--t-11);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g);
  margin-bottom: var(--s-4);
}
.eyebrow::before {
  content: ''; width: 18px; height: 1px;
  background: currentColor; opacity: 0.55;
}

.sparkle-glyph {
  display: inline-block; width: 0.9em; height: 0.9em; vertical-align: -2px;
  color: var(--g); margin-left: 4px;
}

section { padding: var(--s-11) 0; position: relative; }

.h-display {
  font-size: clamp(40px, 5.5vw, 64px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.032em;
  color: var(--ink);
}
.h-section {
  font-size: clamp(28px, 3.8vw, 44px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
  max-width: 760px;
}
.h-3 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}
.h-4 {
  font-size: var(--t-22);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--ink);
}
.lede {
  font-size: var(--t-18);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 640px;
}
.lede-sm {
  font-size: var(--t-15);
  color: var(--ink-2);
  line-height: 1.55;
}

.h-display em, .h-section em, .h-3 em {
  font-style: normal;
  color: var(--g);
}

/* ── Card ────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--sh-1);
  padding: var(--s-6);
}
.card-lg { padding: var(--s-7); border-radius: var(--r-4); }

/* ── Phone frame (for screenshots) ──────────────────────────────────── */
.phone {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 853 / 1844;
  background: #0E1320;
  border-radius: 44px;
  padding: 9px;
  box-shadow:
    0 32px 80px rgba(27,42,74,0.20),
    0 8px 20px rgba(27,42,74,0.10),
    inset 0 0 0 1.5px #1F2A44;
  margin: 0 auto;
}
.phone::before {
  content: '';
  position: absolute;
  top: 18px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 26px;
  background: #0E1320;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}
.phone img {
  width: 100%; height: 100%;
  border-radius: 36px;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.phone.flat {
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 36px;
  padding: 0;
  box-shadow: var(--sh-3);
}
.phone.flat::before { display: none; }
.phone.flat img { border-radius: 35px; }

.phone-stack {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: var(--s-9) 0 var(--s-8);
  background: var(--bg-2);
}
.foot {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: var(--s-7);
}
.foot-brand { max-width: 280px; }
.foot-brand p {
  color: var(--ink-3);
  font-size: var(--t-13);
  margin-top: var(--s-4);
  line-height: 1.55;
}
.foot-col h5 {
  font-family: var(--mono);
  font-size: var(--t-11);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s-4);
  font-weight: 500;
}
.foot-col a {
  display: block;
  font-size: var(--t-13);
  color: var(--ink-2);
  padding: 4px 0;
  transition: color 120ms ease-out;
}
.foot-col a:hover { color: var(--ink); }
.foot-meta {
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: var(--t-11);
  color: var(--ink-4);
}

/* ── Tag / Chip ──────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: var(--t-11);
  letter-spacing: 0.04em;
  color: var(--ink-2);
  padding: 4px 9px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.chip.is-g { color: var(--g-deep); background: var(--g-soft); border-color: var(--g-soft-2); }
.chip.is-r { color: var(--action); background: var(--action-soft); border-color: rgba(216,73,58,0.18); }
.chip.is-o { color: var(--waiting); background: var(--waiting-soft); border-color: rgba(229,139,42,0.20); }
.chip.is-b { color: var(--info); background: var(--info-soft); border-color: rgba(74,143,191,0.20); }
.chip.is-m { color: var(--memory); background: var(--memory-soft); border-color: rgba(110,91,212,0.18); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-inner { height: 60px; }
}
@media (max-width: 980px) {
  section { padding: var(--s-9) 0; }
  .foot { grid-template-columns: 1fr 1fr; }
  .phone-stack { grid-template-columns: 1fr; gap: 36px; }
}

/* ── Footer SVG icon for nav ─────────────────────────────────────────── */
.sparkle-mark {
  width: 100%; height: 100%;
}
