:root {
  --bg: #0c0a22;
  --bg-deep: #08071a;
  --text: #f6f6f8;
  --accent: #e453ff;
  --accent-deep: #b026e6;
  --muted: rgba(255, 255, 255, 0.62);
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

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

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.stage {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 80% at 72% 42%, #1a1458 0%, transparent 58%),
    radial-gradient(ellipse 50% 60% at 18% 78%, #161038 0%, transparent 55%),
    var(--bg);
}

.bg,
.portrait,
.scrim,
.glow,
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
}

.orb-a {
  width: 42vw;
  height: 42vw;
  left: -8%;
  top: 18%;
  background: rgba(64, 40, 160, 0.28);
  animation: drift-a 22s var(--ease) infinite alternate;
}

.orb-b {
  width: 34vw;
  height: 34vw;
  right: 6%;
  top: 8%;
  background: rgba(170, 40, 160, 0.2);
  animation: drift-b 26s var(--ease) infinite alternate;
}

.orb-c {
  width: 22vw;
  height: 22vw;
  right: 2%;
  bottom: 0;
  background: rgba(50, 70, 220, 0.16);
  animation: drift-c 18s var(--ease) infinite alternate;
}

.portrait {
  z-index: 1;
  inset: auto;
  top: 2.5vh;
  left: clamp(360px, 38vw, 780px);
  height: 112vh;
  width: max-content;
}

.portrait img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  user-select: none;
}

.grade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 42% 52% at 36% 32%, rgba(255, 60, 150, 0.22), transparent 70%),
    radial-gradient(ellipse 36% 30% at 55% 70%, rgba(80, 90, 255, 0.16), transparent 72%);
  mix-blend-mode: screen;
  -webkit-mask-image: url("../assets/portrait-crop.png");
  mask-image: url("../assets/portrait-crop.png");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.scrim {
  z-index: 2;
  background: linear-gradient(
    90deg,
    rgba(12, 10, 34, 0.4) 0%,
    rgba(12, 10, 34, 0.1) 24%,
    transparent 42%
  );
}

.glow {
  z-index: 3;
  width: 460px;
  height: 460px;
  inset: auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 83, 255, 0.16), transparent 68%);
  mix-blend-mode: screen;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.6s linear;
}

.stage.is-ready .glow {
  opacity: 1;
}

main {
  position: relative;
  z-index: 4;
  min-height: 100dvh;
  width: min(860px, 70vw);
  display: grid;
  grid-template-rows: 1fr auto minmax(10vh, 1fr) auto;
  padding: 0 0 6.6vh 7.4vw;
}

h1 {
  grid-row: 2;
  align-self: end;
  max-width: 26em;
  font-family: Unbounded, Manrope, sans-serif;
  font-size: clamp(1.2rem, 1.85vw, 1.9rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.28;
  animation: rise 0.95s var(--ease) both;
}

h1 em {
  font-style: normal;
  font-weight: 700;
  background: linear-gradient(100deg, #ff7af5 0%, var(--accent) 42%, #a855f7 100%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s ease-in-out infinite;
}

.status {
  grid-row: 3;
  align-self: center;
  font-size: clamp(0.95rem, 1.15vw, 1.12rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(246, 246, 248, 0.9);
  animation: rise 0.95s 0.14s var(--ease) both;
}

.contacts {
  grid-row: 4;
  align-self: end;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(1.6rem, 2.8vw, 3.2rem);
  width: max-content;
  animation: rise 0.95s 0.28s var(--ease) both;
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-size: clamp(1.05rem, 1.4vw, 1.38rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: transform 0.35s var(--ease);
}

.contact svg {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  transition: color 0.35s var(--ease), filter 0.35s var(--ease);
}

.handle {
  margin-left: 0.35rem;
  color: var(--muted);
  font-weight: 400;
  transition: color 0.35s var(--ease);
}

.contact:hover,
.contact:focus-visible {
  transform: translateY(-3px);
}

.contact:hover svg,
.contact:focus-visible svg {
  color: var(--accent);
  filter: drop-shadow(0 0 10px rgba(228, 83, 255, 0.7));
}

.contact:hover .handle,
.contact:focus-visible .handle {
  color: #fff;
}

.contact:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
  border-radius: 6px;
}

.grain {
  z-index: 5;
  width: 100%;
  height: 100%;
  opacity: 0.07;
  mix-blend-mode: overlay;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes drift-a {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(6%, 8%, 0);
  }
}

@keyframes drift-b {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-7%, -5%, 0);
  }
}

@keyframes drift-c {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-8%, 10%, 0) scale(1.15);
  }
}

@media (max-width: 900px) {
  .portrait {
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: 64vh;
  }

  .portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 42% 12%;
  }

  .grade {
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-position: 42% 12%;
    mask-position: 42% 12%;
  }

  .scrim {
    background: linear-gradient(
      180deg,
      rgba(12, 10, 34, 0.05) 0%,
      rgba(12, 10, 34, 0.2) 30%,
      rgba(12, 10, 34, 0.88) 50%,
      var(--bg) 64%
    );
  }

  main {
    width: auto;
    padding: 0 6vw 5vh;
    grid-template-rows: 1fr auto auto auto;
  }

  h1 {
    max-width: 18em;
    font-size: clamp(1.05rem, 4.6vw, 1.45rem);
  }

  h1 br {
    display: none;
  }

  .status {
    align-self: start;
    margin-top: 2.4vh;
  }

  .contacts {
    width: auto;
    margin-top: 4.5vh;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
  }
}

@media (max-width: 520px) {
  .contact {
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
