:root {
  --bg: #0e1a22;
  --bg-light: #142028;
  --teal: #82bdbd;
  --teal-glow: rgba(130, 189, 189, 0.07);
  --text: #e8f0f0;
  --text-muted: rgba(232, 240, 240, 0.4);
  --mono: "IBM Plex Mono", "Consolas", monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --mx: 50%;
  --my: 50%;
}

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

html,
body {
  width: 100%;
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, var(--bg-light), var(--bg) 72%);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Ambient glow (follows mouse) ── */

.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 60% 60% at var(--mx) var(--my),
    var(--teal-glow),
    transparent
  );
  transition: background 0.4s ease-out;
}

/* ── Layout ── */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 0;
}

/* ── Logo ── */

.logo {
  width: min(78vw, 440px);
  height: auto;
  margin-bottom: clamp(1.6rem, 3.5vw, 2.8rem);
}

.logo path {
  fill: var(--text);
  opacity: 0;
  animation: char-in 0.55s ease-out forwards;
}

.logo path:nth-child(1)  { animation-delay: 0.20s; }
.logo path:nth-child(2)  { animation-delay: 0.28s; }
.logo path:nth-child(3)  { animation-delay: 0.36s; }
.logo path:nth-child(4)  { animation-delay: 0.44s; }
.logo path:nth-child(5)  { animation-delay: 0.54s; }
.logo path:nth-child(6)  { animation-delay: 0.62s; }
.logo path:nth-child(7)  { animation-delay: 0.70s; }
.logo path:nth-child(8)  { animation-delay: 0.90s; }
.logo path:nth-child(9)  { animation-delay: 0.98s; }
.logo path:nth-child(10) { animation-delay: 1.06s; }

.logo path.accent {
  fill: var(--teal);
}

.logo.loaded path.accent {
  transition: filter 0.4s ease;
}

.logo.loaded:hover path.accent {
  filter: drop-shadow(0 0 14px rgba(130, 189, 189, 0.55));
}

@keyframes char-in {
  from {
    opacity: 0;
    filter: blur(8px);
  }
  to {
    opacity: 1;
    filter: blur(0px);
  }
}

/* ── Energy line ── */

.energy-line {
  width: min(64vw, 320px);
  height: 1px;
  background: rgba(130, 189, 189, 0.1);
  position: relative;
  overflow: hidden;
  margin-bottom: clamp(1.4rem, 3vw, 2.4rem);
  opacity: 0;
  animation: fade-up 0.7s ease-out 1.3s forwards;
}

.energy-line .pulse {
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  animation: energy-flow 3.5s ease-in-out 2.2s infinite;
}

@keyframes energy-flow {
  0%   { left: -30%; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* ── Status ── */

.status {
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1.2vw, 0.88rem);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(130, 189, 189, 0.65);
  opacity: 0;
  animation: fade-up 0.7s ease-out 1.6s forwards;
}

.cursor::after {
  content: "\2589";
  display: inline-block;
  margin-left: 2px;
  font-size: 0.9em;
  color: var(--teal);
  animation: blink 1.2s step-end infinite;
}

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

/* ── Footer ── */

.footer {
  padding: clamp(1.2rem, 2.5vw, 2rem);
  opacity: 0;
  animation: fade-up 0.7s ease-out 2.0s forwards;
}

.email {
  font-family: var(--mono);
  font-size: clamp(0.7rem, 1vw, 0.82rem);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  position: relative;
  padding: 0.4rem 0;
  transition: color 0.25s ease;
}

.email::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--teal);
  transition: width 0.35s ease;
}

.email:hover {
  color: var(--teal);
}

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

.email:focus-visible {
  outline: 1px solid var(--teal);
  outline-offset: 6px;
  border-radius: 2px;
}

/* ── Shared keyframes ── */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Accessibility ── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .logo path,
  .energy-line,
  .status,
  .footer {
    animation: none;
    opacity: 1;
    filter: none;
  }

  .energy-line .pulse {
    animation: none;
  }

  .cursor::after {
    animation: none;
  }

  .glow {
    transition: none;
  }
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .hero {
    padding: 1.5rem 1rem;
  }

  .logo {
    width: min(86vw, 340px);
    margin-bottom: 1.4rem;
  }

  .energy-line {
    width: min(56vw, 220px);
    margin-bottom: 1.2rem;
  }
}

@media (max-width: 380px) {
  .logo {
    width: 90vw;
  }
}
