/* ==========================================================================
   MAXHOSTY — DESIGN TOKENS & BASE  ("Nebula" palette)
   Ink navy surfaces · electric indigo → cyan brand gradient · mint / pink /
   amber as small supporting accents. Dark is the hero look; light mirrors it.
   Fonts are loaded with <link> in index.html (faster than @import).
   ========================================================================== */

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* ---- Light tokens (root default) --------------------------------------- */
:root {
  --bg: #f6f7fc;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-hover: #eef0fb;
  --border: rgba(12, 18, 48, 0.1);
  --border-strong: rgba(12, 18, 48, 0.2);
  --fg: #0b1020;
  --fg-muted: #4b5578;
  --fg-faint: #7c85a6;

  --accent: #5b47f5;            /* indigo  — primary brand */
  --accent-2: #0e7490;          /* cyan    — secondary brand */
  --accent-fg: #ffffff;
  --accent-soft: rgba(91, 71, 245, 0.12);
  --grad-brand: linear-gradient(120deg, #5b47f5 0%, #0e7490 100%);
  --grad-text: linear-gradient(100deg, #5b47f5, #0e7490 40%, #db2777 75%, #5b47f5);

  --status-good: #059669;
  --shadow-glow: 0 24px 80px -24px rgba(91, 71, 245, 0.35);
  --shadow-card: 0 18px 40px -22px rgba(20, 24, 60, 0.28);
  --grid-line: rgba(12, 18, 48, 0.05);

  --aurora-1: rgba(91, 71, 245, 0.2);
  --aurora-2: rgba(14, 165, 200, 0.18);
  --aurora-3: rgba(219, 39, 119, 0.12);
  --spotlight: rgba(91, 71, 245, 0.1);
  --net-dot: 91, 71, 245;

  --hue-teal: #059669;
  --hue-violet: #5b47f5;
  --hue-rose: #db2777;
  --hue-amber: #d97706;
  --hue-cyan: #0e7490;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

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

  color-scheme: light;
}

/* ---- Dark tokens ----------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060913;
    --bg-elevated: #0a0f1f;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-solid: #0e1428;
    --surface-hover: rgba(255, 255, 255, 0.075);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.18);
    --fg: #eef1ff;
    --fg-muted: #9ba4c4;
    --fg-faint: #5f6889;

    --accent: #7c6cff;
    --accent-2: #22d3ee;
    --accent-fg: #060913;
    --accent-soft: rgba(124, 108, 255, 0.18);
    --grad-brand: linear-gradient(120deg, #7c6cff 0%, #22d3ee 100%);
    --grad-text: linear-gradient(100deg, #9d8fff, #22d3ee 40%, #2df2b5 70%, #9d8fff);

    --status-good: #2df2b5;
    --shadow-glow: 0 30px 100px -30px rgba(124, 108, 255, 0.55);
    --shadow-card: 0 24px 50px -24px rgba(0, 0, 0, 0.7);
    --grid-line: rgba(255, 255, 255, 0.04);

    --aurora-1: rgba(124, 108, 255, 0.34);
    --aurora-2: rgba(34, 211, 238, 0.22);
    --aurora-3: rgba(255, 92, 168, 0.16);
    --spotlight: rgba(124, 108, 255, 0.16);
    --net-dot: 157, 143, 255;

    --hue-teal: #2df2b5;
    --hue-violet: #9d8fff;
    --hue-rose: #ff5ca8;
    --hue-amber: #ffb84d;
    --hue-cyan: #22d3ee;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #060913;
  --bg-elevated: #0a0f1f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-solid: #0e1428;
  --surface-hover: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --fg: #eef1ff;
  --fg-muted: #9ba4c4;
  --fg-faint: #5f6889;

  --accent: #7c6cff;
  --accent-2: #22d3ee;
  --accent-fg: #060913;
  --accent-soft: rgba(124, 108, 255, 0.18);
  --grad-brand: linear-gradient(120deg, #7c6cff 0%, #22d3ee 100%);
  --grad-text: linear-gradient(100deg, #9d8fff, #22d3ee 40%, #2df2b5 70%, #9d8fff);

  --status-good: #2df2b5;
  --shadow-glow: 0 30px 100px -30px rgba(124, 108, 255, 0.55);
  --shadow-card: 0 24px 50px -24px rgba(0, 0, 0, 0.7);
  --grid-line: rgba(255, 255, 255, 0.04);

  --aurora-1: rgba(124, 108, 255, 0.34);
  --aurora-2: rgba(34, 211, 238, 0.22);
  --aurora-3: rgba(255, 92, 168, 0.16);
  --spotlight: rgba(124, 108, 255, 0.16);
  --net-dot: 157, 143, 255;

  --hue-teal: #2df2b5;
  --hue-violet: #9d8fff;
  --hue-rose: #ff5ca8;
  --hue-amber: #ffb84d;
  --hue-cyan: #22d3ee;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f7fc;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-hover: #eef0fb;
  --border: rgba(12, 18, 48, 0.1);
  --border-strong: rgba(12, 18, 48, 0.2);
  --fg: #0b1020;
  --fg-muted: #4b5578;
  --fg-faint: #7c85a6;

  --accent: #5b47f5;
  --accent-2: #0e7490;
  --accent-fg: #ffffff;
  --accent-soft: rgba(91, 71, 245, 0.12);
  --grad-brand: linear-gradient(120deg, #5b47f5 0%, #0e7490 100%);
  --grad-text: linear-gradient(100deg, #5b47f5, #0e7490 40%, #db2777 75%, #5b47f5);

  --status-good: #059669;
  --shadow-glow: 0 24px 80px -24px rgba(91, 71, 245, 0.35);
  --shadow-card: 0 18px 40px -22px rgba(20, 24, 60, 0.28);
  --grid-line: rgba(12, 18, 48, 0.05);

  --aurora-1: rgba(91, 71, 245, 0.2);
  --aurora-2: rgba(14, 165, 200, 0.18);
  --aurora-3: rgba(219, 39, 119, 0.12);
  --spotlight: rgba(91, 71, 245, 0.1);
  --net-dot: 91, 71, 245;

  --hue-teal: #059669;
  --hue-violet: #5b47f5;
  --hue-rose: #db2777;
  --hue-amber: #d97706;
  --hue-cyan: #0e7490;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -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; }
code { font-family: var(--font-mono); font-size: 0.9em; }

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

.font-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--grad-brand);
}

.h1 { font-size: clamp(2.5rem, 5.6vw + 1rem, 4.7rem); letter-spacing: -0.035em; }
.h2 { font-size: clamp(1.8rem, 3.2vw + 1rem, 2.9rem); }
.h3 { font-size: clamp(1.15rem, 0.8vw + 1rem, 1.4rem); }

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

.grad-text {
  background: var(--grad-text);
  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, 116px); }

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

.section-head {
  max-width: 660px;
  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;
}
.visually-hidden:focus {
  position: fixed; top: 12px; left: 12px; width: auto; height: auto; margin: 0;
  clip: auto; padding: 10px 16px; background: var(--fg); color: var(--bg);
  border-radius: var(--radius-sm); z-index: 400;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

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

/* ---- Background system ----------------------------------------------------- */
.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: radial-gradient(ellipse 80% 70% at 50% 30%, black, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black, transparent 85%);
  pointer-events: none;
}

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

.aurora-field { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

.aurora-blob {
  position: absolute;
  width: 46vw; height: 46vw;
  max-width: 640px; max-height: 640px;
  border-radius: 50%;
  opacity: 0.9;
  will-change: transform;
}
.aurora-blob.a1 { top: -16%; left: -8%; background: radial-gradient(circle, var(--aurora-1), transparent 68%); }
.aurora-blob.a2 { top: 4%; right: -12%; background: radial-gradient(circle, var(--aurora-2), transparent 68%); }
.aurora-blob.a3 { bottom: -26%; left: 24%; background: radial-gradient(circle, var(--aurora-3), transparent 68%); }

#net-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.spotlight {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(460px 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; }

/* Page-wide soft cursor glow (desktop only, injected by JS) */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 380px; height: 380px;
  margin: -190px 0 0 -190px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--spotlight), transparent 70%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  will-change: transform;
}
.cursor-glow.is-on { opacity: 0.9; }

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

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

.btn-accent {
  background: var(--grad-brand);
  background-size: 160% 100%;
  color: var(--accent-fg);
  box-shadow: 0 10px 30px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-accent:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 16px 40px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px var(--accent);
}

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

.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-block { width: 100%; }

::selection { background: var(--accent-soft); color: var(--fg); }

/* ---- Slim scrollbar ---------------------------------------------------- */
html { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
