/* ---------- Theme tokens ---------- */
:root {
  color-scheme: dark light;

  --bg-0: #03040a;
  --bg-1: #060818;
  --ink: #e9ecff;
  --ink-dim: #9aa3c7;
  --cyan: #4ad8ff;
  --violet: #8a5cff;
  --magenta: #ff5cc8;
  --gold: #ffd28a;
  --line: rgba(154, 163, 199, 0.18);
  --glass: rgba(20, 26, 56, 0.45);
  --section-y: clamp(48px, 7vw, 96px);

  --glow-1: rgba(138, 92, 255, 0.35);
  --glow-2: rgba(74, 216, 255, 0.22);
  --glow-3: rgba(255, 92, 200, 0.18);
  --bg-grad-top: #03040a;
  --bg-grad-mid: #06081a;
  --bg-grad-bot: #02030a;

  --star-color: 255, 255, 255;
  --star-opacity: 0.7;

  --surface-1: rgba(20, 26, 56, 0.55);
  --surface-2: rgba(10, 14, 36, 0.40);
  --cta-fade-1: rgba(20, 26, 56, 0.55);
  --cta-fade-2: rgba(8, 10, 28, 0.55);
  --header-fade-1: rgba(3, 4, 10, 0.72);
  --header-fade-2: rgba(3, 4, 10, 0.20);

  --on-accent: #03040a;

  /* v2: grain + numeral ghost */
  --grain-blend: overlay;
  --grain-opacity: 0.08;
  --numeral-opacity: 0.15;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Kicker accent: needs darker shades for light backgrounds */
  --kicker-ink:   var(--cyan);
  --kicker-slash: var(--violet);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-0: #f6f7fb;
    --bg-1: #eef0f7;
    --ink: #0c1024;
    --ink-dim: #5b6280;
    --line: rgba(12, 16, 36, 0.14);
    --glass: rgba(255, 255, 255, 0.55);

    --glow-1: rgba(138, 92, 255, 0.18);
    --glow-2: rgba(74, 216, 255, 0.14);
    --glow-3: rgba(255, 92, 200, 0.10);
    --bg-grad-top: #f6f7fb;
    --bg-grad-mid: #eef0f7;
    --bg-grad-bot: #f6f7fb;

    --star-color: 12, 16, 36;
    --star-opacity: 0.55;

    --surface-1: rgba(255, 255, 255, 0.65);
    --surface-2: rgba(240, 242, 250, 0.55);
    --cta-fade-1: rgba(255, 255, 255, 0.65);
    --cta-fade-2: rgba(240, 242, 250, 0.65);
    --header-fade-1: rgba(246, 247, 251, 0.78);
    --header-fade-2: rgba(246, 247, 251, 0.30);

    --grain-blend: multiply;
    --grain-opacity: 0.06;
    --numeral-opacity: 0.07;

    --kicker-ink:   #1e7ea3;
    --kicker-slash: #5a3fbd;
  }
}

[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f6f7fb;
  --bg-1: #eef0f7;
  --ink: #0c1024;
  --ink-dim: #5b6280;
  --line: rgba(12, 16, 36, 0.14);
  --glass: rgba(255, 255, 255, 0.55);

  --glow-1: rgba(138, 92, 255, 0.18);
  --glow-2: rgba(74, 216, 255, 0.14);
  --glow-3: rgba(255, 92, 200, 0.10);
  --bg-grad-top: #f6f7fb;
  --bg-grad-mid: #eef0f7;
  --bg-grad-bot: #f6f7fb;

  --star-color: 12, 16, 36;
  --star-opacity: 0.55;

  --surface-1: rgba(255, 255, 255, 0.65);
  --surface-2: rgba(240, 242, 250, 0.55);
  --cta-fade-1: rgba(255, 255, 255, 0.65);
  --cta-fade-2: rgba(240, 242, 250, 0.65);
  --header-fade-1: rgba(246, 247, 251, 0.78);
  --header-fade-2: rgba(246, 247, 251, 0.30);

  --grain-blend: multiply;
  --grain-opacity: 0.06;
  --numeral-opacity: 0.07;

  --kicker-ink:   #1e7ea3;
  --kicker-slash: #5a3fbd;
}

[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-0); color: var(--ink); }
body {
  font-family: "Inter", "Helvetica Neue", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  isolation: isolate;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--ink); }

/* ---------- Background stack ----------
   Layering from back to front:
     -3 .bg            base linear gradient + star field
     -2 .orb           three drifting glow blobs (animated)
     -1 .grain         SVG noise grain
     -1 canvas.fx      particle constellation field
      0 main content
*/
.bg {
  position: fixed; inset: 0; z-index: -3;
  background: linear-gradient(180deg, var(--bg-grad-top) 0%, var(--bg-grad-mid) 50%, var(--bg-grad-bot) 100%);
}
/* Star field - uses a mask of SVG circles so dots render as crisp solid
   shapes whose colour comes from background-color (theme-aware via
   --star-color / --star-opacity). No mix-blend-mode means consistent
   rendering in Firefox + Safari + Chromium. */
.bg::after {
  content: "";
  position: absolute; inset: 0;
  background-color: rgba(var(--star-color), var(--star-opacity));
  --star-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'><g fill='white'><circle cx='42' cy='78' r='1'/><circle cx='128' cy='40' r='1.4'/><circle cx='208' cy='150' r='1'/><circle cx='298' cy='62' r='1.2'/><circle cx='362' cy='128' r='1'/><circle cx='452' cy='88' r='1.6'/><circle cx='520' cy='40' r='1'/><circle cx='568' cy='180' r='1.2'/><circle cx='74' cy='220' r='1.2'/><circle cx='180' cy='268' r='1'/><circle cx='262' cy='210' r='1.6'/><circle cx='340' cy='282' r='1'/><circle cx='418' cy='232' r='1.2'/><circle cx='498' cy='298' r='1'/><circle cx='30' cy='358' r='1'/><circle cx='120' cy='402' r='1.4'/><circle cx='222' cy='378' r='1'/><circle cx='302' cy='446' r='1.2'/><circle cx='402' cy='382' r='1'/><circle cx='478' cy='438' r='1.6'/><circle cx='556' cy='382' r='1'/><circle cx='82' cy='520' r='1.2'/><circle cx='162' cy='488' r='1'/><circle cx='258' cy='562' r='1.4'/><circle cx='358' cy='512' r='1'/><circle cx='440' cy='568' r='1.2'/><circle cx='530' cy='510' r='1'/></g></svg>");
  -webkit-mask-image: var(--star-mask); mask-image: var(--star-mask);
  -webkit-mask-repeat: repeat;          mask-repeat: repeat;
  -webkit-mask-size: 850px 850px;       mask-size: 850px 850px;
}

/* Drifting glow blobs */
.orb {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform;
}
.orb-1 {
  width: 60vmax; height: 60vmax;
  top: -20vmax; left: -15vmax;
  background: var(--glow-1);
  animation: drift1 50s ease-in-out infinite alternate;
}
.orb-2 {
  width: 50vmax; height: 50vmax;
  top: -10vmax; right: -20vmax;
  background: var(--glow-2);
  animation: drift2 70s ease-in-out infinite alternate;
}
.orb-3 {
  width: 55vmax; height: 55vmax;
  bottom: -25vmax; right: 20%;
  background: var(--glow-3);
  animation: drift3 90s ease-in-out infinite alternate;
}
@keyframes drift1 {
  0%   { transform: translate3d(0, 0, 0)         scale(1); }
  100% { transform: translate3d(20vw, 15vh, 0)   scale(1.1); }
}
@keyframes drift2 {
  0%   { transform: translate3d(0, 0, 0)         scale(1.05); }
  100% { transform: translate3d(-15vw, 20vh, 0)  scale(0.95); }
}
@keyframes drift3 {
  0%   { transform: translate3d(0, 0, 0)         scale(0.95); }
  100% { transform: translate3d(15vw, -20vh, 0)  scale(1.1); }
}

/* SVG noise grain overlay */
.grain {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* Particle constellation canvas */
canvas.fx {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Disable heavy motion when user prefers reduced */
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  canvas.fx { display: none; }
}

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ---------- Sticky compact header ---------- */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, var(--header-fade-1), var(--header-fade-2));
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
}
header.is-visible { transform: translateY(0); opacity: 1; }
header > .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 18px; padding-bottom: 18px;
  padding-right: 76px;   /* leave room for the fixed theme toggle */
}

/* ---------- Brand hero banner ---------- */
.brand-hero {
  position: relative;
  text-align: center;
  overflow: visible;
  padding-bottom: 2em;
}
/* Orbital coordinate-system decoration behind the brand */
.orbit-deco {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(900px, 110%);
  aspect-ratio: 1 / 1;
  pointer-events: none;
  opacity: 0.35;
  z-index: 0;
  animation: orbitSpin 240s linear infinite;
}
@keyframes orbitSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .orbit-deco { animation: none; }
}
.brand-hero > .wrap { position: relative; z-index: 1; }
.brand-hero-mark { width: 72px; height: 72px; margin: 0 auto 18px; display: block; }
.brand-hero-name {
  font-size: clamp(54px, 9vw, 110px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
  background: linear-gradient(120deg, var(--cyan) 0%, var(--violet) 50%, var(--magenta) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.brand-hero-nav {
  margin-top: 36px;
  display: flex; justify-content: center; align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.brand-hero-nav a { color: var(--ink-dim); font-size: 17px; letter-spacing: 0.02em; }
.brand-hero-nav a:hover { color: var(--ink); }
.brand-hero-nav .btn { font-size: 15px; }
@media (max-width: 880px) {
  .brand-hero-nav { gap: 22px; margin-top: 26px; }
  .brand-hero-nav a { font-size: 15px; }
}

/* ---------- Brand mark (shared) ---------- */
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink);
  font-size: 17px;
}
.brand-mark { width: 30px; height: 30px; }

/* ---------- Nav ---------- */
nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; font-size: 14px; }
nav a { color: var(--ink-dim); }
nav a:hover { color: var(--ink); }

.btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(74, 216, 255, 0.4);
  background: linear-gradient(135deg, rgba(74, 216, 255, 0.12), rgba(138, 92, 255, 0.12));
  color: var(--ink);
  font-size: 14px; font-weight: 500;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(74, 216, 255, 0.9);
  box-shadow: 0 8px 30px rgba(74, 216, 255, 0.25);
  color: var(--ink);
}
.btn-ghost { background: transparent; }

/* Theme toggle - fixed at top-right, always visible */
.theme-toggle {
  position: fixed;
  top: 18px; right: 22px;
  z-index: 30;
  appearance: none;
  background: var(--header-fade-1);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  border-radius: 999px;
  width: 36px; height: 36px;
  padding: 0;
  display: inline-grid; place-items: center;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-dim); }
.theme-toggle svg { width: 18px; height: 18px; display: none; }
.theme-toggle[data-mode=""] .ti-auto,
.theme-toggle[data-mode="light"] .ti-light,
.theme-toggle[data-mode="dark"]  .ti-dark { display: block; }

/* ---------- Hero ---------- */
.hero { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}
.hero h1 {
  font-size: clamp(40px, 6.4vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 22px 0 22px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--cyan) 0%, var(--violet) 50%, var(--magenta) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero > .wrap > p {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink-dim);
  margin: 0 0 36px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Section scaffolding ---------- */
section {
  position: relative;
  padding: calc(var(--section-y) / 2) 0;
  overflow: hidden;          /* contains the ghosted numeral */
}
section { border-top: 1px solid var(--line); }

/* Diagonal accent at section dividers */
section::after {
  content: "";
  position: absolute;
  top: -1px; right: 6%;
  width: 120px; height: 2px;
  background: linear-gradient(95deg, transparent 0%, var(--cyan) 35%, var(--violet) 65%, transparent 100%);
  transform: skewX(-30deg);
  opacity: 0.7;
  pointer-events: none;
}

/* Scroll-triggered reveal on main sections */
main > section {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s ease;
}
main > section.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  main > section { opacity: 1; transform: none; transition: none; }
}

/* Ghosted display numeral behind each section's heading */
.section-num {
  position: absolute;
  top: 0; right: 15px;
  font-family: var(--mono);
  font-size: clamp(180px, 28vw, 360px);
  font-weight: 600;
  line-height: 0.85;
  letter-spacing: -0.05em;
  /* Alpha is baked into the gradient stops (not on `opacity:`) because
     Firefox can fail to render `background-clip: text` when an opacity
     declaration is set on the same element. */
  background: linear-gradient(135deg,
    rgba(74, 216, 255, var(--numeral-opacity)),
    rgba(138, 92, 255, var(--numeral-opacity)) 60%,
    rgba(255, 92, 200, var(--numeral-opacity)));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
section .wrap { position: relative; z-index: 1; }

.kicker {
  color: var(--kicker-ink);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  margin-bottom: 14px;
  display: inline-flex; align-items: center; gap: 10px;
}
.kicker::before {
  content: "//";
  color: var(--kicker-slash);
  font-weight: 500;
}
main h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.1; letter-spacing: -0.015em;
  margin: 0 0 16px; font-weight: 600;
}
main h2 + p { color: var(--ink-dim); font-size: 17px; margin: 0 0 48px; }

/* ---------- Card grids ---------- */
.cards  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tracks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

main article {
  position: relative;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
main article::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(74, 216, 255, 0.35), rgba(138, 92, 255, 0.15) 40%, transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  transition: background .3s ease;
}
main article:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 48px rgba(74, 216, 255, 0.12), 0 6px 20px rgba(138, 92, 255, 0.10);
  border-color: rgba(74, 216, 255, 0.25);
}
main article:hover::before {
  background: linear-gradient(135deg, rgba(74, 216, 255, 0.6), rgba(138, 92, 255, 0.4) 45%, rgba(255, 92, 200, 0.18) 75%);
}
.card-ico {
  width: 44px; height: 44px; margin-bottom: 18px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(74, 216, 255, 0.16), rgba(138, 92, 255, 0.16));
  border: 1px solid rgba(74, 216, 255, 0.25);
}
main article h3 { margin: 0 0 8px; font-size: 19px; font-weight: 600; letter-spacing: -0.005em; }
main article p  { margin: 0; color: var(--ink-dim); font-size: 15px; }

/* ---------- Contact / CTA band ---------- */
.cta-band {
  max-width: 100%;
  margin: 40px 0 0;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(800px 400px at 10% 0%, rgba(138, 92, 255, 0.3), transparent 60%),
    radial-gradient(700px 400px at 90% 100%, rgba(74, 216, 255, 0.25), transparent 60%),
    linear-gradient(180deg, var(--cta-fade-1), var(--cta-fade-2));
  padding: 60px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  flex-wrap: wrap;
}
.cta-band h3 {
  font-size: clamp(24px, 2.6vw, 34px); font-weight: 600;
  letter-spacing: -0.01em; margin: 0;
}
.cta-band p { color: var(--ink-dim); margin: 8px 0 0; }

/* ---------- Footer ---------- */
footer {
  padding: 70px 0 50px;
  color: var(--ink-dim);
  font-size: 14px;
  border-top: 1px solid var(--line);
  margin-top: 80px;
}
.foot-cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.foot-brand .brand { font-size: 18px; }
.foot-brand p { margin: 14px 0 0; max-width: 30ch; font-size: 13.5px; }
footer h5 {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
}
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
footer a { color: var(--ink-dim); }
footer a:hover { color: var(--ink); }
.foot-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
  padding-top: 28px;
  font-size: 13px;
  font-family: var(--mono);
  letter-spacing: 0.05em;
}
@media (max-width: 880px) {
  .foot-cols { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .cards  { grid-template-columns: 1fr; }
  .tracks { grid-template-columns: 1fr; }
  nav ul { display: none; }
  .section-num { right: 0; font-size: clamp(160px, 38vw, 280px); }
}
