@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}

:root {
  --ink: #f4ecff;
  --void: #0a0614;
  --panel: rgba(16, 8, 28, 0.6);
  --accent1: #ff8fd8;
  --accent2: #8f9bff;
  --accent3: #8fffe6;
  --gold: #ffd9a0;
  --font-display: "Space Grotesk", "Trebuchet MS", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0; background: var(--void); color: var(--ink);
  font-family: var(--font-mono);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2 { font-family: var(--font-display); margin: 0; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  background: var(--ink); color: var(--void); padding: 10px 16px;
}
.skip-link:focus { left: 0; }

/* ---------- fixed backdrop layers ---------- */
/* positive-only z-index stack: a negative z-index child paints behind its
   stacking-context ancestor's own background for HIT-TESTING purposes (clicks
   resolved to <body> instead of the canvas beneath it), even though it still
   paints visibly, so the whole backdrop stack stays on a small positive scale */
#scene {
  position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; display: block;
  background: radial-gradient(120% 90% at 75% 30%, #2a1a4a 0%, #140a26 45%, #08040f 100%);
}
#water {
  position: fixed; left: 0; right: 0; bottom: 0; height: 24vh; z-index: 2;
  display: block; width: 100%;
}
#vignette {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 40%, transparent 40%, rgba(4, 2, 10, 0.55) 100%);
}
#grain {
  position: fixed; inset: 0; z-index: 850; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- custom cursor ---------- */
@media (pointer: fine) {
  body.cursor-ready, body.cursor-ready a, body.cursor-ready button { cursor: none; }
}
#cursorStar {
  position: fixed; top: 0; left: 0; width: 14px; height: 14px; z-index: 9998;
  transform: translate(-999px, -999px);
  pointer-events: none;
  background: radial-gradient(circle, #fff 0%, var(--accent1) 45%, transparent 75%);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
}
.spark {
  position: fixed; top: 0; left: 0; z-index: 9997; border-radius: 50%; pointer-events: none;
  background: var(--accent2);
}

/* ---------- topline / rail ---------- */
.topline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 36px);
}
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--accent1), var(--accent2), var(--accent3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand sup { font-size: 9px; opacity: 0.7; }
.ca-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px; padding: 7px 14px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.05em; color: var(--ink); cursor: pointer; backdrop-filter: blur(8px);
  transition: border-color 0.2s;
}
.ca-pill span:first-child { opacity: 0.55; }
.ca-pill:hover { border-color: var(--accent1); }
.ca-pill.is-copied { border-color: var(--accent3); color: var(--accent3); }

.rail {
  position: fixed; left: clamp(14px, 3vw, 34px); top: 50%; transform: translateY(-50%); z-index: 400;
  display: flex; flex-direction: column; gap: 18px;
}
.rail a {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.5;
  transition: opacity 0.2s;
}
.rail a span {
  width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink); flex: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.rail a:hover, .rail a.is-active { opacity: 1; }
.rail a.is-active span { background: var(--accent1); box-shadow: 0 0 8px var(--accent1); }
@media (max-width: 720px) { .rail a span + * { display: none; } }
@media (max-width: 520px) { .rail { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em;
  padding: 13px 26px; border-radius: 999px; text-decoration: none; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.2s;
}
.btn-primary {
  background: linear-gradient(120deg, var(--accent1), var(--accent2));
  color: #17092a; font-weight: 500;
  box-shadow: 0 10px 30px -10px var(--accent1);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--ink); border-color: rgba(255,255,255,0.22); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--accent1); }
.btn-text { background: none; color: var(--ink); opacity: 0.7; text-decoration: underline; text-underline-offset: 4px; }
.btn-text:hover { opacity: 1; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- hero ---------- */
main { position: relative; z-index: 4; pointer-events: none; }
main > section { pointer-events: auto; }
.scene-section {
  min-height: 145vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px 20px 40px; position: relative;
  pointer-events: none;
}
.scene-section .hero-actions, .scene-section .ca-pill { pointer-events: auto; }
.eyebrow {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.6; margin: 0 0 18px;
}
.ticker {
  font-size: clamp(56px, 13vw, 132px); font-weight: 700; letter-spacing: -0.01em;
  background: linear-gradient(100deg, var(--accent1), var(--accent2) 45%, var(--accent3) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px rgba(143, 155, 255, 0.35);
  position: relative;
}
.ticker::after {
  content: "$TOEKOEN"; position: absolute; inset: 0; z-index: -1;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 143, 216, 0.35);
  transform: translate(2px, 0);
}
.sub { font-size: 14px; letter-spacing: 0.08em; opacity: 0.75; margin: 10px 0 22px; }
.hero-bullets {
  display: flex; gap: 22px; flex-wrap: wrap; justify-content: center;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.toes-aligned { margin-top: 34px; font-size: 11px; letter-spacing: 0.1em; opacity: 0.55; }
.toes-aligned b { color: var(--accent3); font-weight: 500; }
.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.45;
  animation: cueFloat 2.4s ease-in-out infinite;
}
@keyframes cueFloat {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.3; }
  50% { transform: translate(-50%, 8px); opacity: 0.6; }
}

/* ---------- shared content sections ---------- */
.content-section {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 90px 20px; position: relative;
}
.section-title {
  font-size: clamp(30px, 5vw, 50px); margin: 0 0 12px;
  background: linear-gradient(100deg, var(--ink), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-sub { font-size: 13px; letter-spacing: 0.04em; opacity: 0.65; max-width: 50ch; margin: 0 auto 40px; }

/* ---------- prophecy terminal ---------- */
.terminal {
  width: min(90vw, 620px); text-align: left; background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 4px; padding: 30px 28px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.7);
}
.terminal-line {
  font-size: 14px; line-height: 1.7; margin: 0 0 6px; min-height: 1.7em; white-space: pre-wrap;
}
.terminal-cursor { display: inline-block; opacity: 0; animation: blink 1s steps(1) infinite; margin: 0; }
.terminal-cursor.is-on { opacity: 1; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- ascension ritual ---------- */
.ritual-rig { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 20px; }
.ritual-btn {
  position: relative; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.12), rgba(10,4,20,0.5));
  border: 1px solid rgba(255,255,255,0.2); color: var(--ink);
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em;
  cursor: pointer; backdrop-filter: blur(6px);
  transition: transform 0.15s var(--ease);
}
.ritual-btn:active { transform: scale(0.97); }
.ritual-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ritual-ring-track { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 3; }
.ritual-ring-fill {
  fill: none; stroke: var(--accent1); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 339.3; stroke-dashoffset: 339.3; transition: stroke-dashoffset 0.05s linear;
}
.ritual-msg { font-size: 12px; letter-spacing: 0.08em; min-height: 1.4em; opacity: 0.85; }
.ritual-msg.is-fail { color: #ff8f8f; }
.ritual-msg.is-success { color: var(--accent3); }

.toe-id-card { width: min(90vw, 320px); text-align: center; margin-top: 10px; }
.toe-id-card[hidden] { display: none; }
#idCanvas { width: 100%; aspect-ratio: 1/1; border-radius: 6px; border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7); }
.toe-id-name { font-family: var(--font-display); font-size: 18px; margin: 16px 0 2px; }
.toe-id-class { font-size: 11px; letter-spacing: 0.08em; opacity: 0.7; margin: 0 0 16px; text-transform: uppercase; }
.toe-id-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- toenomics orbit ---------- */
.toenomics-orbit { position: relative; width: min(90vw, 620px); aspect-ratio: 1/1; margin: 0 auto 30px; }
.toenomics-sun {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--accent1) 60%, transparent 100%);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 12px; color: #1a0a2a;
  box-shadow: 0 0 40px var(--accent1);
}
.toenomics-planet {
  position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  background: none; border: none; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  /* static resting position (also the animation's true starting point) so a
     planet still sits on its own orbit, not collapsed at the center, when the
     animation is disabled (prefers-reduced-motion) */
  transform: rotate(var(--angle, 0deg)) translateX(var(--r)) rotate(calc(var(--angle, 0deg) * -1));
  animation: orbitspin var(--dur) linear infinite;
  animation-delay: calc(var(--angle, 0deg) / 360deg * var(--dur) * -1);
}
@keyframes orbitspin { from { transform: rotate(0deg) translateX(var(--r)) rotate(0deg); } to { transform: rotate(360deg) translateX(var(--r)) rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) {
  .toenomics-planet { animation: none; }
}
.planet-dot {
  display: block; width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #fff, var(--accent2) 60%, transparent 100%);
  box-shadow: 0 0 16px rgba(143, 155, 255, 0.6);
  transition: transform 0.2s var(--ease);
}
.toenomics-planet:hover .planet-dot, .toenomics-planet.is-active .planet-dot { transform: scale(1.35); }
.toenomics-orbit::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, transparent calc(120px - 1px), rgba(255,255,255,0.14) calc(120px), transparent calc(120px + 1px)),
    radial-gradient(circle, transparent calc(170px - 1px), rgba(255,255,255,0.1) calc(170px), transparent calc(170px + 1px)),
    radial-gradient(circle, transparent calc(220px - 1px), rgba(255,255,255,0.08) calc(220px), transparent calc(220px + 1px)),
    radial-gradient(circle, transparent calc(270px - 1px), rgba(255,255,255,0.06) calc(270px), transparent calc(270px + 1px));
  pointer-events: none;
}
.toenomics-detail {
  background: var(--panel); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px; padding: 14px 26px; display: inline-flex; gap: 14px; align-items: baseline;
}
.toenomics-detail-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; margin: 0; }
.toenomics-detail-value { font-family: var(--font-display); font-size: 18px; color: var(--accent3); margin: 0; }

/* ---------- footer ---------- */
.site-footer { position: relative; z-index: 4; text-align: center; padding: 70px 20px 50px; }
.footer-line { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; margin: 0 0 18px; }
.footer-socials { display: flex; gap: 16px; justify-content: center; margin-bottom: 16px; }
.footer-socials a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.16);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.footer-socials a:hover { border-color: var(--accent1); transform: translateY(-3px); }
.footer-ca { font-size: 10px; opacity: 0.45; word-break: break-all; }

/* ---------- windows98 easter egg (deliberate style break) ---------- */
.win98-overlay {
  position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.win98-overlay[hidden] { display: none; }
.win98-window {
  width: min(94vw, 460px); background: #c0c0c0; color: #000;
  border: 2px solid #fff; border-right-color: #404040; border-bottom-color: #404040;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  font-family: Tahoma, Geneva, "MS Sans Serif", sans-serif;
}
.win98-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px; font-size: 13px; font-weight: 700;
}
.win98-titlebar button {
  width: 18px; height: 16px; background: #c0c0c0; border: 1px solid #fff; border-right-color: #404040; border-bottom-color: #404040;
  font-size: 12px; line-height: 1; cursor: pointer; color: #000;
}
.win98-body { padding: 14px 16px; }
.win98-heading { font-size: 12px; margin: 0 0 8px; }
.win98-filelist { list-style: none; margin: 0 0 14px; padding: 0; font-size: 12px; }
.win98-filelist li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dotted #888; }
.win98-filelist li span { opacity: 0.6; }
.win98-quote { font-size: 11px; font-style: italic; border-top: 1px solid #888; padding-top: 10px; margin: 0 0 10px; }
.win98-visitor { font-size: 11px; margin: 0; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue { animation: none; }
  .toenomics-planet { animation: none; }
  #grain { display: none; }
}
