/* ==========================================================================
   MS HOST — DESIGN TOKENS & BASE
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap");

/* ---- Light tokens (the root default / fallback) ------------------------ */
:root {
  --bg: #fbfbfa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f4f4f3;
  --border: rgba(10, 10, 12, 0.1);
  --border-strong: rgba(10, 10, 12, 0.18);
  --fg: #14151a;
  --fg-muted: #55585f;
  --fg-faint: #8b8e94;
  --accent: #b3823a;
  --accent-fg: #ffffff;
  --accent-soft: rgba(179, 130, 58, 0.1);
  --status-good: #16a34a;
  --shadow-glow: 0 0 40px rgba(179, 130, 58, 0.08);
  --grid-line: rgba(10, 10, 12, 0.05);

  /* Aurora accents — used only for the ambient background field and rare
     decorative glow, never for text/UI chrome (that stays --accent). */
  --aurora-1: rgba(124, 108, 240, 0.16);
  --aurora-2: rgba(56, 200, 176, 0.14);
  --aurora-3: rgba(224, 114, 154, 0.12);
  --spotlight: rgba(179, 130, 58, 0.06);

  /* Decorative-only palette — feature icons, category glows, gradient
     text. Never used for body text or anything that needs to stay
     legible/consistent across themes. */
  --hue-teal: #2fb8a6;
  --hue-violet: #7c6cf0;
  --hue-rose: #d6698f;
  --hue-amber: #b3823a;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --container-w: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

/* ---- Dark tokens, applied when the OS prefers dark and no explicit
        choice has been made ---------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07080a;
    --bg-elevated: #0d0f12;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.065);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.17);
    --fg: #f2f3f5;
    --fg-muted: #9aa0a8;
    --fg-faint: #666b72;
    --accent: #d8a857;
    --accent-fg: #14110a;
    --accent-soft: rgba(216, 168, 87, 0.14);
    --status-good: #4ade80;
    --shadow-glow: 0 0 70px rgba(216, 168, 87, 0.09);
    --grid-line: rgba(255, 255, 255, 0.045);
    --aurora-1: rgba(124, 108, 240, 0.28);
    --aurora-2: rgba(56, 200, 176, 0.22);
    --aurora-3: rgba(224, 114, 154, 0.2);
    --spotlight: rgba(216, 168, 87, 0.09);
    --hue-teal: #4fd6c2;
    --hue-violet: #9c8cf7;
    --hue-rose: #e693ae;
    --hue-amber: #d8a857;
    color-scheme: dark;
  }
}

/* ---- Explicit user choice always wins ----------------------------------- */
:root[data-theme="dark"] {
  --bg: #07080a;
  --bg-elevated: #0d0f12;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.065);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);
  --fg: #f2f3f5;
  --fg-muted: #9aa0a8;
  --fg-faint: #666b72;
  --accent: #d8a857;
  --accent-fg: #14110a;
  --accent-soft: rgba(216, 168, 87, 0.14);
  --status-good: #4ade80;
  --shadow-glow: 0 0 70px rgba(216, 168, 87, 0.09);
  --grid-line: rgba(255, 255, 255, 0.045);
  --aurora-1: rgba(124, 108, 240, 0.28);
  --aurora-2: rgba(56, 200, 176, 0.22);
  --aurora-3: rgba(224, 114, 154, 0.2);
  --spotlight: rgba(216, 168, 87, 0.09);
  --hue-teal: #4fd6c2;
  --hue-violet: #9c8cf7;
  --hue-rose: #e693ae;
  --hue-amber: #d8a857;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fbfbfa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f4f4f3;
  --border: rgba(10, 10, 12, 0.1);
  --border-strong: rgba(10, 10, 12, 0.18);
  --fg: #14151a;
  --fg-muted: #55585f;
  --fg-faint: #8b8e94;
  --accent: #b3823a;
  --accent-fg: #ffffff;
  --accent-soft: rgba(179, 130, 58, 0.1);
  --status-good: #16a34a;
  --shadow-glow: 0 0 40px rgba(179, 130, 58, 0.08);
  --grid-line: rgba(10, 10, 12, 0.05);
  --aurora-1: rgba(124, 108, 240, 0.16);
  --aurora-2: rgba(56, 200, 176, 0.14);
  --aurora-3: rgba(224, 114, 154, 0.12);
  --spotlight: rgba(179, 130, 58, 0.06);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
  overflow-x: hidden;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

/* ---- Typography ------------------------------------------------------- */
h1,
h2,
h3,
h4,
.font-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.08;
  text-wrap: balance;
}

.font-mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.h1 {
  font-size: clamp(2.4rem, 5.4vw + 1rem, 4.4rem);
}

.h2 {
  font-size: clamp(1.8rem, 3.2vw + 1rem, 2.85rem);
}

.h3 {
  font-size: clamp(1.25rem, 1vw + 1rem, 1.55rem);
}

.body-lg {
  font-size: clamp(1.05rem, 0.4vw + 1rem, 1.2rem);
  color: var(--fg-muted);
  max-width: 62ch;
}

/* Decorative gradient text — used sparingly on one word per headline,
   never for body copy or anything that needs guaranteed contrast. The
   gradient itself drifts slowly (see animations.css); reduced-motion
   freezes it at a fixed position via the blanket rule there. */
.grad-text {
  background: linear-gradient(
    100deg,
    var(--hue-violet),
    var(--hue-teal) 45%,
    var(--hue-amber) 75%,
    var(--hue-violet)
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.text-faint {
  color: var(--fg-faint);
}

/* ---- Layout helpers ----------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 20px;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 32px;
  }
}

.section {
  position: relative;
  padding-block: clamp(64px, 9vw, 112px);
}

.section-tint {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(32px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

/* ---- Focus states — always visible, never suppressed -------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Surfaces ------------------------------------------------------------ */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ---- Background system ---------------------------------------------------
   A quiet grid + one soft radial glow, positioned once behind the hero and
   reused at low opacity behind a couple of later sections. Never distracting. */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
}

.bg-glow {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 640px;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-soft), transparent 65%);
  pointer-events: none;
  filter: blur(10px);
}

/* Aurora field — three slow-drifting blurred blobs, "Aurora" mode's
   namesake effect. Purely ambient: sits behind content, never above it,
   and is skipped entirely under prefers-reduced-motion (see animations.css). */
.aurora-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aurora-blob {
  position: absolute;
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.9;
}

.aurora-blob.a1 {
  top: -14%;
  left: -6%;
  background: var(--aurora-1);
}
.aurora-blob.a2 {
  top: 6%;
  right: -12%;
  background: var(--aurora-2);
}
.aurora-blob.a3 {
  bottom: -22%;
  left: 22%;
  background: var(--aurora-3);
}

/* Floating glass particles — a handful of soft dots drifting slowly
   upward through the hero. Purely decorative, positioned inline per-dot
   in the markup so no JS/randomization is needed. */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particles span {
  position: absolute;
  bottom: -20px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0;
  animation: particle-rise 9s ease-in infinite;
}

/* Cursor spotlight — a soft light that follows the pointer on desktop,
   set via --mx/--my custom properties in main.js. Decorative only. */
.spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 20%),
    var(--spotlight),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.spotlight.is-active {
  opacity: 1;
}

/* ---- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
    border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn-primary,
.btn-accent {
  isolation: isolate;
}

.btn-primary::after,
.btn-accent::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 48%,
    transparent 66%
  );
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease);
}

.btn-primary:hover::after,
.btn-accent:hover::after {
  transform: translateX(120%);
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.35);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--fg);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--fg-faint);
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-fg);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -10px var(--accent-soft);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* ---- Scrollbar (kept subtle, not styled to death) ------------------------ */
::selection {
  background: var(--accent-soft);
  color: var(--fg);
}
