@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/SpaceGrotesk-var.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/Inter-var.woff2") format("woff2");
}

:root {
  --bg: #06080f;
  --bg-2: #0b0f1c;
  --fg: #eef0f7;
  --muted: #8d93ab;
  --line: rgba(255, 255, 255, 0.1);
  --violet: #8b5cf6;
  --violet-soft: #c4b5fd;
  --cyan: #22d3ee;
  --display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}
a { color: inherit; }
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 8px;
  font-weight: 600; text-decoration: none; transition: top .15s;
}
.skip:focus { top: 12px; }

/* ---------- atmosphere ---------- */
#field {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -2; display: block;
}
.glow {
  position: fixed; z-index: -3; pointer-events: none;
  width: 70vmax; height: 70vmax; border-radius: 50%;
  filter: blur(80px); opacity: .55; will-change: transform;
}
.glow-a {
  left: -20vmax; top: -30vmax;
  background: radial-gradient(closest-side, rgba(139, 92, 246, .55), rgba(139, 92, 246, 0));
  animation: drift-a 28s ease-in-out infinite alternate;
}
.glow-b {
  right: -25vmax; bottom: -30vmax;
  background: radial-gradient(closest-side, rgba(34, 211, 238, .40), rgba(34, 211, 238, 0));
  animation: drift-b 34s ease-in-out infinite alternate;
}
@keyframes drift-a { from { transform: translate3d(0,0,0) } to { transform: translate3d(12vmax, 8vmax, 0) } }
@keyframes drift-b { from { transform: translate3d(0,0,0) } to { transform: translate3d(-10vmax, -12vmax, 0) } }
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.mark { flex: none; filter: drop-shadow(0 0 14px rgba(139, 92, 246, .35)); }
.wordmark {
  font-family: var(--display); font-weight: 600; font-size: 1.1rem; letter-spacing: .01em;
}
.wordmark .labs { font-weight: 400; color: var(--muted); margin-left: .35em; }
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 13px 7px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(10, 13, 24, .55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: .78rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: #c9cde0;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(34, 211, 238, .7);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .7) }
  70% { box-shadow: 0 0 0 10px rgba(34, 211, 238, 0) }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0) }
}

/* ---------- hero ---------- */
.hero {
  flex: 1 0 auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(32px, 6vh, 72px);
  max-width: 1200px; width: 100%;
}
.eyebrow {
  margin: 0 0 18px; font-family: var(--display); font-weight: 500;
  font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: var(--violet-soft);
}
h1 {
  margin: 0; font-family: var(--display); font-weight: 600;
  font-size: clamp(2.5rem, 7.4vw, 5.9rem); line-height: 1; letter-spacing: -.03em;
  max-width: 14.5ch; text-wrap: balance;
}
.paren { font-size: .66em; font-weight: 400; color: rgba(196, 181, 253, .78); letter-spacing: -.01em; margin-left: .04em; }
.shimmer {
  background: linear-gradient(100deg, #c4b5fd 0%, #8b5cf6 38%, #22d3ee 72%, #c4b5fd 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0 } }
.lede {
  margin: 28px 0 0; max-width: 46ch; font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--muted); text-wrap: pretty;
}
.actions { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: 12px; text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: .005em;
  color: #0a0d18; background: linear-gradient(135deg, #dcd3ff, #a78bfa 45%, #67e8f9);
  box-shadow: 0 10px 40px -12px rgba(139, 92, 246, .7), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .18s ease, box-shadow .18s ease;
}
.cta svg { transition: transform .18s ease; }
.cta:hover, .cta:focus-visible { transform: translateY(-1px); box-shadow: 0 14px 48px -10px rgba(34, 211, 238, .6), inset 0 1px 0 rgba(255,255,255,.6); }
.cta:hover svg { transform: translateX(3px); }
.cta:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ---------- definition ---------- */
.definition {
  margin: 0 var(--gutter) clamp(28px, 5vh, 56px);
  max-width: 640px;
  padding: 20px 22px;
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.term { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.word { font-family: var(--display); font-weight: 600; font-size: 1.05rem; letter-spacing: .02em; }
.pos { font-size: .78rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.meaning { margin: 0; color: #b7bcd0; font-size: .95rem; }
.math { font-family: var(--display); white-space: nowrap; color: var(--fg); }
.math sup { font-size: .7em; }

/* ---------- footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 18px var(--gutter) 26px; font-size: .85rem; color: var(--muted);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal .9s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--d, 0s); }
@keyframes reveal { to { opacity: 1; transform: none } }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .glow-a, .glow-b, .dot, .shimmer { animation: none; }
  html { scroll-behavior: auto; }
}
@media (max-width: 640px) {
  .top { padding-top: 18px; }
  .wordmark { font-size: 1rem; }
  .pill { font-size: .7rem; padding: 6px 11px 6px 9px; }
  .hero {
    justify-content: flex-end; min-height: 80svh; padding-bottom: 28px;
    background: linear-gradient(180deg, rgba(6,8,15,0) 0%, rgba(6,8,15,0) 38%, rgba(6,8,15,.82) 56%, rgba(6,8,15,.92) 100%);
  }
  h1 { font-size: clamp(2.2rem, 11.2vw, 4.2rem); }
  .lede { margin-top: 18px; font-size: 1rem; }
  .actions { margin-top: 26px; }
  .cta { width: 100%; justify-content: center; }
  .definition { margin-top: 8px; }
}
@media (prefers-color-scheme: light) {
  /* The brand is dark-first; keep it dark but make sure nothing relies on the OS theme. */
  :root { color-scheme: dark; }
}
