/* CORPUS — 09/25 · void #060614 · ice #7DF9FF · violet #B39DFF · pink #FF6EC7 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --void: #060614;
  --ice: #7DF9FF;
  --violet: #B39DFF;
  --pink: #FF6EC7;
  --text: #EDEFFF;
  --dim: #8A90B8;
  --faint: #727BB5;
  --ease-out: cubic-bezier(.22, .61, .16, 1);
  --fa: var(--ice); /* active-formation accent, set from JS */
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(125, 249, 255, .25); color: var(--text); }

/* ---------- layers ---------- */

.bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(120vmax 80vmax at 78% 18%, rgba(179, 157, 255, .07), transparent 55%),
    radial-gradient(100vmax 90vmax at 18% 85%, rgba(125, 249, 255, .05), transparent 55%),
    radial-gradient(90vmax 70vmax at 55% 55%, rgba(255, 110, 199, .04), transparent 60%),
    var(--void);
}

#scene {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: none;
}

.vignette {
  position: fixed; inset: 0; z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 42%, transparent 52%, rgba(2, 2, 12, .6) 100%);
}

.ui { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.ui a, .ui button { pointer-events: auto; }

/* grain */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 4;
  pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  animation: grain 1.4s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

/* ---------- brand / meta ---------- */

.brand { position: absolute; top: 30px; left: 36px; }
.brand-name {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: .34em;
  margin-right: -.34em;
  background: linear-gradient(100deg, var(--ice) 0%, var(--violet) 55%, var(--pink) 110%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.brand-tag {
  margin-top: .35rem;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--dim);
}

.meta {
  position: absolute; top: 34px; right: 36px;
  text-align: right;
  font-size: .72rem;
  line-height: 1.6;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- stage copy ---------- */

.stage-copy {
  position: absolute;
  left: 36px; bottom: 138px;
  max-width: min(700px, 50vw);
}

.kicker {
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--fa); /* wears the active formation's accent */
  transition: color .9s var(--ease-out);
}
.kicker-dim { color: var(--faint); }

/* auto-cycle countdown: fills over the dwell, drains during the morph */
.cycle {
  width: min(240px, 40%);
  height: 2px;
  margin: .85rem 0 1.5rem;
  background: rgba(138, 144, 184, .18);
  border-radius: 1px;
  overflow: hidden;
}
.cycle i {
  display: block;
  height: 100%;
  background: var(--fa);
  transition: background .9s var(--ease-out);
  transform: scaleX(0);
  transform-origin: left;
}

.headlines, .decks { display: grid; }
.headline, .deck { grid-area: 1 / 1; }

.headline {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: clamp(1.9rem, .9rem + 2.75vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -.02em;
  color: var(--text);
  text-shadow: 0 0 36px rgba(125, 249, 255, .18);
  align-self: end;
  opacity: 0;
  transform: translateY(16px);
  filter: blur(7px);
  /* visibility rides the fade so inactive slides leave the accessibility
     tree — a screen reader hears one headline, not all four at once */
  visibility: hidden;
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out),
              filter .8s var(--ease-out), visibility .8s;
}
.headline.is-active {
  opacity: 1; transform: none; filter: none; visibility: visible; transition-delay: .2s;
  animation: hglow 8s ease-in-out infinite; /* the glow band breathes */
}
@keyframes hglow {
  0%, 100% { text-shadow: 0 0 34px rgba(125, 249, 255, .14); }
  40% { text-shadow: 0 0 48px rgba(179, 157, 255, .3); }
  70% { text-shadow: 0 0 42px rgba(255, 110, 199, .2); }
}

.decks { margin-top: 1.15rem; }
.deck {
  font-size: .95rem;
  line-height: 1.55;
  color: var(--dim);
  max-width: 42ch;
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  transition: opacity .7s var(--ease-out) .05s, transform .7s var(--ease-out) .05s,
              visibility .75s;
}
.deck.is-active { opacity: 1; transform: none; visibility: visible; transition-delay: .3s; }

.hint {
  margin-top: 1.6rem;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--faint);
  max-width: 52ch;
}
.hint-touch { display: none; }
@media (pointer: coarse) {
  .hint-more { display: none; }
  .hint-touch { display: inline; }
}
.hint-key {
  display: inline-block;
  padding: .1em .55em .14em;
  margin-right: .3em;
  border: 1px solid rgba(125, 249, 255, .35);
  border-radius: 4px;
  color: var(--ice);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  animation: keypulse 3.4s ease-in-out infinite;
}
@keyframes keypulse {
  0%, 100% { border-color: rgba(125, 249, 255, .3); box-shadow: 0 0 0 rgba(125, 249, 255, 0); }
  50% { border-color: rgba(125, 249, 255, .65); box-shadow: 0 0 14px rgba(125, 249, 255, .18); }
}

/* ---------- formation nav ---------- */

.formnav {
  position: absolute;
  right: 36px; top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.fbtn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .8rem;
  background: none; border: none;
  font: inherit;
  color: var(--dim);
  cursor: pointer;
  padding: .2rem 0;
}
.flab {
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .68;
  transform: translateX(6px);
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), color .4s;
  white-space: nowrap;
}
.flab b { font-weight: 600; color: var(--dim); margin-right: .35em; }
.fdot {
  position: relative;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid var(--dim);
  background: transparent;
  flex: none;
  transition: background .4s, border-color .4s, box-shadow .4s, transform .4s var(--ease-out);
}
.fbtn:hover .flab, .fbtn:focus-visible .flab { opacity: 1; transform: none; color: var(--text); }
.fbtn:hover .fdot {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  transform: scale(1.25);
}
.fbtn:active .fdot { transform: scale(.8); transition-duration: .12s; }
.fbtn.is-active .flab { opacity: 1; transform: none; color: var(--text); }
.fbtn.is-active .flab b { color: var(--accent); }
.fbtn.is-active .fdot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 30px color-mix(in srgb, var(--accent) 55%, transparent);
  transform: scale(1.3);
  animation: dotbreathe 3.2s ease-in-out infinite;
}
/* activation ping: an accent ring blooms off the dot the moment it takes over */
.fbtn.is-active .fdot::after {
  content: ""; position: absolute; inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ping .8s var(--ease-out) both;
}
@keyframes ping {
  from { transform: scale(1); opacity: .9; }
  to { transform: scale(3.4); opacity: 0; }
}
@keyframes dotbreathe {
  0%, 100% { box-shadow: 0 0 10px var(--accent), 0 0 22px color-mix(in srgb, var(--accent) 40%, transparent); }
  50% { box-shadow: 0 0 16px var(--accent), 0 0 38px color-mix(in srgb, var(--accent) 65%, transparent); }
}

/* ---------- stats / footer ---------- */

.stats {
  position: absolute;
  left: 36px; bottom: 74px;
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.stats span { color: var(--dim); }

.site-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 36px 1.05rem;
  font-size: .74rem;
  letter-spacing: .05em;
  color: var(--dim);
  border-top: 1px solid rgba(138, 144, 184, .14);
  background: linear-gradient(rgba(6, 6, 20, 0), rgba(6, 6, 20, .82) 60%);
}
.foot-links { display: flex; gap: 1.6rem; }
.site-foot a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 249, 255, .35);
  padding-bottom: 1px;
  transition: color .3s, border-color .3s;
}
.site-foot a:hover { color: var(--ice); border-color: var(--ice); }

/* ---------- custom cursor ---------- */

.cursor {
  position: fixed; left: 0; top: 0; z-index: 5;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(125, 249, 255, .55);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: width .35s var(--ease-out), height .35s var(--ease-out),
              margin .35s var(--ease-out), border-color .35s, opacity .3s;
}
.cursor::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px;
  border-radius: 50%; background: var(--ice);
}
.cursor.is-on { opacity: 1; }
.cursor.is-link {
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-color: rgba(179, 157, 255, .8);
  background: rgba(179, 157, 255, .07);
}
.cursor.is-link::after { opacity: 0; }
.cursor.is-down {
  width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-color: var(--pink);
}
.cursor.is-down::after { background: var(--pink); }
/* charging ring while the well is held open */
.cursor.is-down::before {
  content: ""; position: absolute; inset: -7px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 110, 199, .55);
  animation: curspin 1.4s linear infinite;
}
@keyframes curspin { to { transform: rotate(360deg); } }
/* release flash: the shockwave leaves through the cursor */
.cursor.is-shock::before {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--ice);
  animation: curshock .55s var(--ease-out) both;
}
@keyframes curshock {
  from { transform: scale(.6); opacity: 1; }
  to { transform: scale(2.4); opacity: 0; }
}
@media (pointer: coarse) { .cursor { display: none; } #scene { cursor: auto; } }

/* ---------- entrances ---------- */

.rise { opacity: 0; animation: rise 1.1s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.formnav.rise { animation-name: rise-nav; }
@keyframes rise-nav {
  from { opacity: 0; transform: translateY(calc(-50% + 18px)); }
  to { opacity: 1; transform: translateY(-50%); }
}

/* ---------- focus ---------- */

:focus-visible {
  outline: 1.5px solid var(--ice);
  outline-offset: 4px;
  border-radius: 3px;
}

/* ---------- mobile ---------- */

@media (max-width: 760px) {
  .brand { top: 22px; left: 20px; }
  .brand-name { font-size: 1.15rem; }
  .meta { top: 24px; right: 20px; font-size: .62rem; }

  .stage-copy {
    left: 20px; right: 20px;
    bottom: 168px;
    max-width: none;
  }
  .headline { font-size: clamp(1.7rem, 7.2vw, 2.35rem); }
  .deck { font-size: .84rem; max-width: 34ch; }
  .hint { margin-top: 1.1rem; font-size: .72rem; max-width: 38ch; }
  .hint-more { display: none; }
  .cycle { width: min(180px, 46%); margin: .7rem 0 1.1rem; }

  .formnav {
    top: auto; bottom: 108px;
    right: auto; left: 20px;
    transform: none;
    flex-direction: row;
    gap: 1.35rem;
  }
  .formnav.rise { animation-name: rise; }
  .fbtn { flex-direction: row-reverse; gap: .5rem; }
  .flab { font-size: .62rem; letter-spacing: .12em; transform: none; }
  .flab b { display: none; }

  .stats { left: 20px; bottom: 62px; font-size: .58rem; letter-spacing: .14em; }

  .site-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    padding: .8rem 20px .9rem;
    font-size: .66rem;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .rise, .formnav.rise { animation: none; opacity: 1; }
  .formnav.rise { transform: translateY(-50%); }
  .cycle { display: none; } /* no auto-cycle under reduced motion */
  body::after { animation: none; }
  .headline.is-active, .hint-key, .fbtn.is-active .fdot,
  .fbtn.is-active .fdot::after, .cursor.is-down::before { animation: none; }
  .headline, .deck, .flab, .fdot, .cursor { transition-duration: .01s; }
  @media (max-width: 760px) { .formnav.rise { transform: none; } }
}
