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

:root {
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Google Sans', sans-serif;
  background: #06060e;
}

/* ── WebGL canvas background ── */
#glCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Center layout ── */
.center {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.4rem;
}

/* Backdrop behind text — prevents WebGL streaks killing contrast */
.center::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(0,0,0,0.45) 0%, transparent 100%);
  pointer-events: none;
}

/* ── Name ── */
.name {
  font-size: clamp(2.6rem, 10vw, 4.5rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 1s var(--ease) 0.3s forwards;
  white-space: nowrap;
  cursor: default;
  will-change: transform;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Typewriter ── */
.typewriter {
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.70);
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.7s forwards;
  height: 1.6em;
  display: flex;
  align-items: center;
  gap: 2px;
}

.tw-cursor {
  display: inline-block;
  color: #ff0d8c;
  font-weight: 400;
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Contact ── */
.contact {
  font-size: clamp(0.8rem, 3vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  opacity: 0;
  animation: fadeUp 1s var(--ease) 1.2s forwards;
  transition: color 0.35s ease, letter-spacing 0.35s ease;
  position: relative;
  border-radius: 2px;
}

.contact::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, #ff0d8c, #bf7fff);
  transition: width 0.4s var(--ease);
}

.contact:hover {
  color: #ffffff;
  letter-spacing: 0.22em;
}

.contact:hover::after {
  width: 100%;
}

/* Keyboard focus — visible outline for keyboard nav */
.contact:focus-visible {
  outline: 2px solid #ff0d8c;
  outline-offset: 6px;
  color: #ffffff;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .name,
  .typewriter,
  .contact {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .tw-cursor {
    animation: none;
    opacity: 1;
  }

  #glCanvas {
    display: none;
  }

  html, body {
    background: #0d0d1a;
  }
}

/* ── High contrast mode ── */
@media (prefers-contrast: more) {
  html, body {
    background: #000000;
  }

  #glCanvas {
    display: none;
  }

  .center::before {
    display: none;
  }

  .name {
    color: #ffffff;
    text-shadow: none;
  }

  .typewriter {
    color: #ffffff;
  }

  .tw-cursor {
    color: #ff80c0;
  }

  .contact {
    color: #ffffff;
    text-decoration: underline;
  }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .center {
    gap: 1.6rem;
    padding: 0 1.5rem;
  }

  .name {
    font-size: clamp(2.4rem, 13vw, 3.2rem);
    letter-spacing: 0.08em;
    white-space: normal;
    text-align: center;
  }

  .typewriter {
    letter-spacing: 0.22em;
  }

  .contact {
    letter-spacing: 0.1em;
  }
}
