:root {
  color-scheme: dark;
  --text: #e8f1ff;
  --muted: #b8c6dc;
  --panel-border: rgba(127, 179, 255, 0.18);
  --border: rgba(168, 195, 255, 0.28);
  --accent: #7fb3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Sora", sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
  background-attachment: fixed;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 56px;
}

.content {
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-align: center;
  padding: 28px 22px 26px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(12, 20, 32, 0.75), rgba(10, 16, 26, 0.55));
  border: 1px solid var(--panel-border);
  box-shadow:
    0 20px 50px rgba(5, 10, 18, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

body.is-loaded .content {
  opacity: 1;
  transform: translateY(0);
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.avatar-wrap {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  padding: 6px;
  background: radial-gradient(circle at top, rgba(127, 179, 255, 0.4), rgba(19, 30, 48, 0.2));
  box-shadow:
    0 0 0 2px rgba(127, 179, 255, 0.2),
    0 12px 36px rgba(14, 25, 40, 0.6),
    0 0 32px rgba(127, 179, 255, 0.45);
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 2.3rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 22px rgba(4, 10, 18, 0.6);
}

.tagline {
  margin: 0;
  font-size: 0.98rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.easter-egg {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(127, 179, 255, 0.7);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

body.show-egg .easter-egg {
  opacity: 1;
  transform: translateY(0);
}

.links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.link-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  background: linear-gradient(135deg, rgba(18, 28, 44, 0.85), rgba(12, 20, 32, 0.85));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow:
    0 14px 30px rgba(8, 15, 24, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  opacity: 0;
  transform: translateY(10px);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    background 0.35s ease,
    opacity 0.6s ease;
  transition-delay: var(--delay, 0s);
}

.link-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(127, 179, 255, 0.14), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

body.is-loaded .link-card {
  opacity: 1;
  transform: translateY(0);
}

.link-card img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 6px 12px rgba(6, 12, 20, 0.6));
  transition: transform 0.35s ease;
}

.icon-dot {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background:
    conic-gradient(from 40deg, #ff6f91, #ffc75f, #f9f871, #8cffc1, #7afcff, #7aa2ff, #c77dff, #ff6f91);
  box-shadow:
    0 8px 16px rgba(8, 15, 24, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.link-title {
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
}

.link-cta {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.link-card:hover,
.link-card:focus-visible {
  background: linear-gradient(135deg, rgba(22, 34, 53, 0.9), rgba(14, 22, 36, 0.9));
  border-color: rgba(127, 179, 255, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(7, 14, 24, 0.55);
}

.link-card:hover::after,
.link-card:focus-visible::after {
  opacity: 1;
}

.link-card:hover img,
.link-card:focus-visible img {
  transform: scale(1.06);
}

.link-toggle:hover .icon-dot,
.link-toggle:focus-visible .icon-dot {
  transform: scale(1.06);
}

.link-card:focus-visible {
  outline: 2px solid rgba(127, 179, 255, 0.5);
  outline-offset: 2px;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 10;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 16, 0.75);
  backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  width: min(900px, 92vw);
  background: rgba(8, 12, 20, 0.85);
  border: 1px solid rgba(127, 179, 255, 0.35);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(4, 8, 14, 0.7);
  padding: 18px;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 1px solid rgba(127, 179, 255, 0.4);
  background: rgba(18, 28, 44, 0.9);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}

.modal-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.modal-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

html.rainbow-mode {
  animation: rainbowShift 1.2s linear infinite;
}

html.rainbow-mode .content {
  border-color: rgba(255, 255, 255, 0.3);
}

html.rainbow-mode .link-card {
  border-color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, rgba(20, 30, 46, 0.85), rgba(12, 18, 30, 0.85));
}

html.rainbow-mode #stars {
  animation-duration: 2.6s;
}

html.rainbow-mode #stars2 {
  animation-duration: 5.2s;
}

html.rainbow-mode #stars3 {
  animation-duration: 7.8s;
}

#rainbow-toggle .link-title {
  font-family: "Orbitron", "Sora", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.1;
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .page {
    padding: 36px 16px 40px;
  }

  .content {
    gap: 22px;
    padding: 22px 16px 20px;
  }

  .avatar-wrap {
    width: 110px;
    height: 110px;
  }

  .link-card {
    grid-template-columns: 32px 1fr auto;
    padding: 12px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@keyframes rainbowShift {
  0% {
    filter: hue-rotate(0deg) saturate(1.15);
  }
  50% {
    filter: hue-rotate(180deg) saturate(1.4);
  }
  100% {
    filter: hue-rotate(360deg) saturate(1.15);
  }
}
