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

/* ===== BASE ===== */
html, body {
  height: 100%;
  background: #0c0d0f;
  color: #ededed;
  font-family: "Aptos", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== PAGE ENTRY ANIMATION ===== */
body {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

body.entered {
  opacity: 1;
  transform: translateY(0);
}

/* ===== FADE IN ===== */
body {
  opacity: 0;
  transition: opacity 0.8s ease;
}

body.loaded {
  opacity: 1;
}

/* ===== STAGE ===== */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10vh 8vw;
}

/* ===== CENTER ===== */
.center {
  text-align: center;
  transform: translateY(-1.5vh);
}

/* ===== NAME ===== */
.name-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 3.2rem;
}

.name {
  position: relative;
  font-size: 3.2rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  z-index: 2;
  background-image: linear-gradient(
    120deg,
    #dcdcdc 0%,
    #f5f5f5 25%,
    #ffffff 50%,
    #f5f5f5 75%,
    #dcdcdc 100%
  );
  background-size: 400% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: floatSheen 6.5s linear infinite;
}

.name .first,
.name .last {
  opacity: 1;
}

/* ===== MOTION FIELD (DESKTOP SAFE) ===== */
.name-motion {
  position: absolute;
  inset: -28%;
  background:
    radial-gradient(
      circle at 50% 55%,
      rgba(255,255,255,0.07),
      rgba(255,255,255,0.018),
      transparent 70%
    );
  filter: blur(70px);
  z-index: 1;
  animation: drift 26s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes drift {
  from { transform: translateX(-18px); }
  to   { transform: translateX(18px); }
}


@keyframes floatSheen {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ===== NAV ===== */
.nav {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.nav a {
  position: relative;
  font-size: 0.9rem;
  text-decoration: none;
  color: #b6b6b6;
  letter-spacing: 0.08em;
  padding-bottom: 6px;
  transition: color 0.25s ease;
}

/* CENTER OUT UNDERLINE */
.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0%;
  height: 1px;
  background: rgba(255,255,255,0.6);
  transition: width 0.28s ease 0.06s, left 0.28s ease 0.06s;
}

.nav a:hover {
  color: #ffffff;
}

.nav a:hover::after {
  width: 100%;
  left: 0;
}

/* ===== PAGE EXIT TRANSITION ===== */
.page-fade {
  position: fixed;
  inset: 0;
  background: #0c0d0f;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  z-index: 9999;
}

.page-fade.active {
  opacity: 1;
}

/* ===== FOOTER ===== */
.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.footer .copyright {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.3);
}

/* ===== GRAIN ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.008'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}


/* ===== MOBILE (SCALE, NOT REBUILD) ===== */
@media (max-width: 768px) {

  .stage {
    padding: 14vh 6vw;
  }

  .center {
    transform: translateY(-2vh);
  }

  .name-wrap {
    margin-bottom: 2.4rem;
  }

  .name {
    font-size: 2.2rem;
    letter-spacing: 0.11em;
    animation-duration: 10s;
  }

  /* Keep nav horizontal, just tighter */
  .nav {
    gap: 1.2rem;
  }

  .nav a {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
  }

  /* Reduce underline width feel on small screens */
  .nav a::after {
    height: 1px;
    background: rgba(255,255,255,0.5);
  }

  /* Footer spacing for phones */
  .footer {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  /* Calm motion further */
  .name-motion {
    inset: -45%;
    filter: blur(100px);
    animation: drift 48s linear infinite alternate;
  }
}