@font-face {
  font-family: "MD";
  src: url("fonts/MD.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Font1";
  src: url("fonts/Font1.ttf") format("opentype");
  font-display: swap;
}

:root {
  --bg: #000000;
  --ink: #f5f5f5;
  --muted: #8e8e8e;
  --line: rgba(255, 255, 255, 0.22);
  --ink-soft: #d6d6d6;
  --ink-dim: #a8a8a8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #000000;
}

html.story-mode {
  overflow: hidden;
}

body.story-mode {
  overflow: hidden;
}

body {
  position: relative;
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  font-weight: 400;
}

p {
  font-family: "Font1", "Segoe UI", "Helvetica Neue", sans-serif;
}

body:not(.story-mode) {
  overflow: hidden;
}

.bg-nonagon-wrap {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
}

.bg-nonagon {
  width: min(84vw, 920px);
  opacity: 0.1;
  filter: brightness(0) invert(1);
  animation: spinNonagon 100s linear infinite;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
  display: block;
  padding: 1.5rem 0;
}

.gate,
.bio {
  width: min(860px, 100%);
  text-align: center;
  margin-inline: auto;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
}

.bio-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.12);
}

.hero-name {
  margin: 0;
  font-family: "MD", "Impact", sans-serif;
  font-size: clamp(4rem, 22vw, 16rem);
  line-height: 0.88;
  letter-spacing: 0.04em;
  font-weight: 400;
  color: var(--ink);
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.28),
    0 0 46px rgba(255, 255, 255, 0.2),
    0 0 96px rgba(255, 255, 255, 0.12);
  animation: titleGlow 5.8s ease-in-out infinite;
}

.proceed-btn {
  margin-top: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #000000;
  width: 72px;
  height: 72px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
  animation: buttonBreath 2.4s ease-in-out infinite;
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid var(--ink);
  margin-left: 2px;
}

.proceed-btn:hover,
.proceed-btn:focus-visible {
  transform: translateY(-2px);
  background: #0f0f0f;
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.07);
}

.bio {
  max-width: 760px;
  padding: 0;
  background: transparent;
  margin-bottom: 3rem;
}

.scroll-step {
  width: min(860px, 100%);
  margin: 0;
  display: grid;
  place-items: center;
  align-content: center;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  text-align: center;
  opacity: 0;
  filter: none;
  transition: opacity 420ms ease;
  pointer-events: none;
}

.scroll-step.is-current {
  opacity: 1;
  filter: none;
  pointer-events: auto;
}

.section-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--muted);
}

.scroll-step h2 {
  margin: 0.6rem 0 0;
  font-size: clamp(1.9rem, 6vw, 4rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #d8d8d8 58%, #a5a5a5 100%);
  background-clip: text;
  -webkit-background-clip: text;
  text-shadow:
    0 0 28px rgba(255, 255, 255, 0.15),
    0 10px 28px rgba(0, 0, 0, 0.55);
}

.scroll-step p {
  margin: 0.8rem auto 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
  letter-spacing: 0.01em;
  line-height: 1.8;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.7),
    0 0 14px rgba(255, 255, 255, 0.08);
}

.project-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.project-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.03);
}

.project-item h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 500;
}

.project-item p {
  margin-top: 0.5rem;
  line-height: 1.6;
}

.profile-pic-wrap {
  width: 248px;
  height: 248px;
  margin: 0 auto 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  background: #0e0e0e;
}

.profile-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-pic-wrap,
.bio-label,
#bioText,
.bio-note {
  opacity: 0;
  transform: none;
}

.bio.is-active .profile-pic-wrap,
.bio.is-active .bio-label,
.bio.is-active #bioText,
.bio.is-active .bio-note {
  opacity: 1;
  transform: none;
  transition: opacity 420ms ease;
}

.bio.is-active .bio-label {
  transition-delay: 90ms;
}

.bio.is-active #bioText {
  transition-delay: 180ms;
}

.bio.is-active .bio-note {
  transition-delay: 240ms;
}

.bio p {
  margin: 0.7rem 0 0;
  max-width: 56ch;
  margin-inline: auto;
  color: var(--ink-soft);
  line-height: 1.7;
  text-align: center;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.72),
    0 0 14px rgba(255, 255, 255, 0.08);
}

#bioText {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

.bio-note {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--ink-dim);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.ascii-signature {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f2f2f2;
  font-family: "Consolas", "Courier New", monospace;
  font-size: clamp(10px, 1.45vw, 20px);
  line-height: 1.02;
  letter-spacing: 0;
  text-align: left;
  font-variant-ligatures: none;
  tab-size: 2;
  display: inline-block;
  white-space: pre;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 1rem);
  overflow: hidden;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.18),
    0 2px 10px rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.ascii-signature:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.65);
  outline-offset: 8px;
}

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.55rem;
  padding: 0.75rem;
}

.game-close {
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: #000000;
  color: #f5f5f5;
  padding: 0.38rem 0.62rem;
  font-family: "MD", "Impact", sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.game-frame {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #000000;
}

#signatureSection {
  width: 100%;
  left: 0;
  top: 0;
  transform: none;
  min-height: 100vh;
  padding-inline: 1rem;
}

.hidden {
  display: none;
}

.fade-in {
  animation: fadeIn 420ms ease forwards;
}

.fade-out {
  animation: fadeOut 280ms ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes spinNonagon {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes titleGlow {
  0%,
  100% {
    text-shadow:
      0 0 18px rgba(255, 255, 255, 0.25),
      0 0 44px rgba(255, 255, 255, 0.18),
      0 0 92px rgba(255, 255, 255, 0.1);
  }

  50% {
    text-shadow:
      0 0 26px rgba(255, 255, 255, 0.36),
      0 0 68px rgba(255, 255, 255, 0.25),
      0 0 130px rgba(255, 255, 255, 0.16);
  }
}

@keyframes buttonBreath {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.04);
  }

  50% {
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.12);
  }
}

@media (max-width: 680px) {
  .hero-name {
    font-size: clamp(3.2rem, 16vw, 6.2rem);
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .ascii-signature {
    font-size: clamp(8px, 2.4vw, 13px);
    line-height: 1.01;
  }
}
