:root {
  --bg: #05040a;
  --bg-2: #0b0a12;
  --line: #2a2640;
  --text: #ede9fe;
  --muted: #a6a1bf;
  --lilac: #a78bfa;
  --teal: #5eead4;
  --amber: #fdba74;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1160px;
  --sans: ui-sans-serif, system-ui, -apple-system, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
svg { display: block; }
h1, h2, h3, p { margin: 0; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.sr, .skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { z-index: 30; top: 76px; left: 16px; width: auto; height: auto; clip: auto; padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 500; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 999px; }

/* nav */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; border-bottom: 1px solid transparent; transition: background .3s, border-color .3s, backdrop-filter .3s; }
.nav::before { content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none; background: linear-gradient(rgb(5 4 10 / .88), transparent); transition: opacity .3s; }
.nav.solid { background: rgb(5 4 10 / .78); border-color: var(--line); backdrop-filter: blur(14px); }
.nav.solid::before { opacity: 0; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; font-size: 18px; }
.brand svg { width: 34px; height: 34px; }
.links { display: flex; align-items: center; gap: 28px; font-size: 15px; color: #cfcae6; }
.links a:hover { color: #fff; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px;
  font: 500 15px var(--sans); color: var(--bg); background: var(--text); border: 1px solid var(--text);
  transition: transform .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); background: #fff; }

/* hero */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 112px var(--gutter) 72px;
}
#field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 200px; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }
.stage { position: relative; width: clamp(200px, 30vw, 300px); aspect-ratio: 1; margin-bottom: 36px; z-index: 1; }
.halo {
  position: absolute; inset: -30%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 20%, var(--lilac) 38%, var(--teal) 52%, var(--amber) 66%, transparent 82%);
  filter: blur(46px); opacity: .34; animation: spin 22s linear infinite;
}
.stage::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: #000; box-shadow: 0 0 0 1px #000, 0 0 60px 20px #000; }
.stage svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.eye { transform-box: fill-box; transform-origin: center; }
.hero .eye { animation: wake 1.3s .5s cubic-bezier(.2, .8, .2, 1) both; }
.blink { transform-box: fill-box; transform-origin: center; animation: blink 6s 3s infinite; }
.pupil { transition: transform .12s linear; }
.copy { position: relative; z-index: 1; }
.copy::before {
  content: ""; position: absolute; z-index: -1; inset: -48px -12vw -40px;
  background: radial-gradient(ellipse at center, rgb(5 4 10 / .92) 35%, transparent 72%);
}
h1 { font: 600 clamp(46px, 8.4vw, 104px)/.98 var(--sans); letter-spacing: -.045em; }
h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--lilac), var(--teal) 55%, var(--amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { max-width: 520px; margin: 24px auto 0; font-size: clamp(18px, 2vw, 21px); color: #bdb8d6; text-wrap: balance; }
.cta { margin-top: 34px; }

/* sections */
section { position: relative; padding: clamp(56px, 6.5vw, 88px) 0; }
h2 { font: 600 clamp(32px, 5vw, 58px)/1.05 var(--sans); letter-spacing: -.035em; max-width: 20ch; text-wrap: balance; }

/* unfold */
.split { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(36px, 6vw, 88px); align-items: center; }
.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 22px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); font: 500 14px var(--mono); color: var(--teal); }
.steps b { display: block; font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.steps span { color: var(--muted); font-size: 16px; }
.tree { position: relative; aspect-ratio: 1.02; border: 1px solid var(--line); border-radius: 28px; background: var(--bg-2); overflow: hidden; }
.tree::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 0, rgb(167 139 250 / .16), transparent 55%); }
.tree svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.tree .lines path { fill: none; stroke: #4a4470; stroke-width: .4; stroke-linecap: round; }
.node { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); }
.node svg { width: 100%; height: 100%; overflow: visible; }
.js .tree .lines path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s var(--d, 0s) ease-out; }
.js .tree.in .lines path { stroke-dashoffset: 0; }
.js .node { transform: translate(-50%, -50%) scale(.2); opacity: 0; transition: transform .7s var(--d, 0s) cubic-bezier(.2, 1.3, .3, 1), opacity .5s var(--d, 0s); }
.js .tree.in .node { transform: translate(-50%, -50%) scale(1); opacity: 1; }

/* castes */
.castes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 52px; }
.caste { padding: 22px 18px 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg-2); transition: border-color .3s; }
.caste:hover { border-color: var(--c); }
.caste svg { width: 100%; max-width: 132px; margin: 0 auto 18px; overflow: visible; }
.caste h3 { font: 600 19px var(--sans); letter-spacing: -.01em; }
.caste p { margin-top: 8px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }

/* dial */
.dial-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 72px); margin-top: 48px; align-items: center; }
.swarm { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.slot { aspect-ratio: 1; border-radius: 16px; display: grid; place-items: center; }
.slot svg { width: 86%; transition: opacity .4s, transform .5s cubic-bezier(.2, 1.4, .3, 1); }
.js .slot svg { opacity: 0; transform: scale(.4); }
.js .slot.on svg { opacity: 1; transform: scale(1); }
html:not(.js) .readout { display: none; }
.readout h3 { font: 600 clamp(32px, 4.2vw, 48px)/1.1 var(--sans); letter-spacing: -.03em; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 28px 0 12px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--amber), var(--lilac), var(--teal)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--amber), var(--lilac), var(--teal)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #000; border: 5px solid var(--text); box-shadow: 0 0 0 6px rgb(237 233 254 / .12); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #000; border: 5px solid var(--text); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--teal); }
input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--teal); }

/* closing */
.closing { text-align: center; padding-bottom: clamp(80px, 12vw, 150px); overflow: hidden; }
.closing h2 { margin-inline: auto; max-width: 14ch; font-size: clamp(40px, 7vw, 88px); }
.closing p { margin-top: 18px; color: var(--muted); font-size: 18px; }
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }

/* reveal (only when JS is on, so the page is complete without it) */
.js .rv { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--d, 0s), transform .8s var(--d, 0s) cubic-bezier(.2, .8, .2, 1); }
.js .rv.in { opacity: 1; transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wake { from { transform: scaleY(.04); opacity: .4; } to { transform: scaleY(1); opacity: 1; } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.08); } }

@media (max-width: 980px) {
  .split, .dial-grid { grid-template-columns: 1fr; }
  .dial-grid .readout { order: -1; }
  .castes { grid-template-columns: repeat(2, 1fr); }
  .castes .caste:last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .links { gap: 20px; }
  .castes { grid-template-columns: 1fr; gap: 10px; }
  .caste { display: grid; grid-template-columns: 64px 1fr; column-gap: 16px; align-items: center; padding: 16px; }
  .caste svg { grid-row: 1 / 3; width: 64px; margin: 0; }
    .caste p { margin-top: 4px; }
  .swarm { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #field { display: none; }
  .js .rv { opacity: 1; transform: none; }
  .js .node { opacity: 1; transform: translate(-50%, -50%); }
  .js .tree .lines path { stroke-dashoffset: 0; }
  .js .slot.on svg { opacity: 1; transform: none; }
}
