@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;700;900&family=Rubik:wght@400;500;700&display=swap');

:root {
  --blue: #0057b7;
  --gold: #ffd700;
  --cyan: #00e5ff;
  --magenta: #ff2fd0;
  --acid: #b6ff00;
  --ink: #05010f;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; }
body {
  font-family: 'Rubik', system-ui, sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

canvas#c { position: fixed; inset: 0; display: block; z-index: 0; }

/* overlay text laid over the 3D */
.hud { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.hud .pin { position: absolute; pointer-events: none; }

.title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(0,0,0,0.6), 0 0 60px var(--magenta);
  mix-blend-mode: screen;
}

.kicker {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: clamp(0.6rem, 1.4vw, 0.95rem);
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255,215,0,0.5);
}

.sub {
  font-weight: 500;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 0 20px rgba(0,0,0,0.7);
  max-width: 42ch;
}

/* seed hint — a whispered instruction */
.hint {
  position: fixed; bottom: 22px; left: 0; right: 0; z-index: 2;
  text-align: center; pointer-events: none;
  font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: rgba(255,215,0,0.55);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 0%,100%{opacity:0.35} 50%{opacity:0.85} }

/* page transition wash */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, var(--gold), var(--magenta) 45%, var(--ink) 80%);
  opacity: 0; transition: opacity 0.5s ease;
}
body.leaving::after { opacity: 1; }
body.entering::after { opacity: 1; animation: fadeIn 0.7s ease forwards; }
@keyframes fadeIn { to { opacity: 0; } }

/* ---- biography overlay (the hidden reveal) ---- */
.bio {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,1,15,0.86);
  backdrop-filter: blur(14px) saturate(1.3);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.5s ease;
  padding: 5vh 6vw;
}
.bio.open { opacity: 1; visibility: visible; }
.bio-card {
  max-width: 760px; max-height: 88vh; overflow-y: auto;
  transform: translateY(24px) scale(0.98); transition: transform 0.5s cubic-bezier(.2,.9,.2,1);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 18px; padding: clamp(1.6rem, 4vw, 3rem);
  background: linear-gradient(160deg, rgba(0,87,183,0.22), rgba(255,47,208,0.10));
  box-shadow: 0 0 80px rgba(255,47,208,0.25), inset 0 0 60px rgba(0,229,255,0.06);
}
.bio.open .bio-card { transform: translateY(0) scale(1); }
.bio h1 {
  font-family: 'Unbounded', sans-serif; font-weight: 900;
  font-size: clamp(1.8rem, 5vw, 3rem); margin: 0 0 0.2em;
  background: linear-gradient(90deg, var(--cyan), var(--gold), var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bio .role { font-family:'Unbounded'; color: var(--gold); letter-spacing:0.12em; text-transform:uppercase; font-size:0.8rem; margin-bottom:1.4rem; }
.bio p { line-height: 1.6; color: rgba(255,255,255,0.9); margin: 0 0 1rem; }
.bio p strong { color: var(--cyan); font-weight: 700; }
.bio .foot { margin-top: 1.6rem; font-size: 0.8rem; color: rgba(255,255,255,0.5); }
.bio .foot a { color: var(--gold); text-decoration: none; border-bottom: 1px dotted rgba(255,215,0,0.4); }
.bio-close {
  position: absolute; top: 24px; right: 28px; z-index: 101;
  pointer-events: auto; cursor: pointer;
  font-family:'Unbounded'; font-size: 1.4rem; color: var(--gold);
  background: none; border: none; opacity: 0.7;
}
.bio-close:hover { opacity: 1; }

/* WebGL-failure fallback */
.fallback {
  position: fixed; inset: 0; z-index: 3; display: none;
  align-items: center; justify-content: center; text-align: center; padding: 8vw;
  background: linear-gradient(135deg, var(--blue), var(--magenta), var(--ink));
  background-size: 300% 300%; animation: drift 12s ease infinite;
}
@keyframes drift { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
body.nowebgl .fallback { display: flex; }
body.nowebgl canvas#c { display: none; }

@media (prefers-reduced-motion: reduce) {
  .hint, .fallback { animation: none; }
}

/* phones: keep HUD text inside the viewport and readable */
@media (max-width: 680px) {
  .hud .pin { max-width: 88vw; }
  .sub { max-width: 88vw !important; font-size: 1rem; line-height: 1.4; }
  .kicker { letter-spacing: 0.22em; }
  .hint {
    letter-spacing: 0.14em; font-size: 0.6rem; line-height: 1.5;
    padding: 0 16px; bottom: 14px;
  }
  .bio { padding: 4vh 5vw; }
  .bio-card { padding: 1.5rem; border-radius: 14px; }
  .bio-close { top: 14px; right: 18px; }
}
