/* =========================================================
   Kairoscope — shared design system
   Edit the tokens in :root to re-brand the whole template.
   ========================================================= */
:root {
  /* Brand */
  --blue: #4f8cff;
  --indigo: #6c63ff;
  --violet: #a25cff;
  --cyan: #38d4f5;
  --grad-start: #3a6feb;
  --grad-mid: #5b54f0;
  --grad-end: #8a45e6;
  --grad: linear-gradient(135deg, var(--grad-start) 0%, var(--grad-mid) 55%, var(--grad-end) 100%);
  --grad-text: linear-gradient(100deg, #7fb0ff 0%, #a9a3ff 50%, #d3a4ff 100%);

  /* Surfaces */
  --bg: #050a1c;
  --bg-2: #08102b;
  --surface: #0b1536;
  --surface-2: #111e49;
  --line: rgba(140, 160, 255, 0.16);
  --line-strong: rgba(140, 160, 255, 0.32);

  /* Text */
  --text: #eaeeff;
  --muted: #a3aed6;
  --faint: #8190c2;

  /* Status */
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;

  /* Shape + type */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 1px var(--line), 0 20px 70px -30px rgba(108, 99, 255, 0.55);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1200px;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-fill { fill: currentColor; stroke: none; }

:focus-visible { outline: 2px solid #9db8ff; outline-offset: 3px; border-radius: 6px; }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: #fff; color: #0b1536; padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.section { padding-block: clamp(64px, 9vw, 110px); position: relative; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(17, 30, 73, 0.35) 30%, rgba(17, 30, 73, 0.35) 70%, transparent); }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
.section-head p { margin-top: 16px; color: var(--muted); font-size: 1.08rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #a9b8ff;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--grad); }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.97rem; line-height: 1.2; white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px rgba(108, 99, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(138, 69, 230, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(170, 185, 255, 0.55); }
.btn-sm { padding: 9px 18px; font-size: 0.9rem; }
.btn-block { width: 100%; }

/* Cards, chips */
.card {
  background: linear-gradient(180deg, rgba(17, 30, 73, 0.75), rgba(11, 21, 54, 0.85));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; background: rgba(108, 99, 255, 0.16); color: #c4ccff; border: 1px solid rgba(140, 160, 255, 0.28);
}
.chip-demo { background: rgba(251, 191, 36, 0.1); color: #f6d27a; border-color: rgba(251, 191, 36, 0.3); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 0.85rem; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }

/* Segmented control / tabs */
.segmented {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(8, 16, 43, 0.9); border: 1px solid var(--line);
}
.segmented button {
  border: 0; background: transparent; padding: 8px 18px; border-radius: 999px;
  color: var(--muted); font-weight: 600; font-size: 0.9rem; transition: color 0.2s, background 0.2s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-selected="true"], .segmented button[aria-pressed="true"] {
  background: var(--grad); color: #fff; box-shadow: 0 6px 18px -8px rgba(108, 99, 255, 0.9);
}

/* Navigation */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-h);
  background: rgba(5, 10, 28, 0.72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent; transition: border-color 0.3s, background 0.3s;
}
.nav.scrolled { border-color: var(--line); background: rgba(5, 10, 28, 0.9); }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em; }
.logo-mark { width: 32px; height: 32px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 0.93rem; font-weight: 500; transition: color 0.2s, background 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.04);
}
.nav-toggle .icon { width: 22px; height: 22px; }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav-cta .btn-ghost { display: none; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 20px 20px; background: rgba(5, 10, 28, 0.97); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { padding: 14px 16px; font-size: 1.02rem; }
}

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 64px 0 32px; background: linear-gradient(180deg, transparent, rgba(8, 16, 43, 0.8)); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.footer-brand p { margin-top: 16px; color: var(--muted); max-width: 320px; font-size: 0.95rem; }
.footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: #b9c3ee; margin-bottom: 16px; }
.footer li + li { margin-top: 10px; }
.footer li a { color: var(--muted); font-size: 0.95rem; transition: color 0.2s; }
.footer li a:hover { color: var(--text); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--faint); font-size: 0.88rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300; transform: translate(-50%, 20px);
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; max-width: calc(100vw - 32px); font-size: 0.93rem;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

[hidden] { display: none !important; }

@media (max-width: 520px) { .nav-cta .btn-primary { display: none; } .logo { font-size: 1.1rem; } }
