:root {
  --bg: #ffffff;
  --ink: #0b1b33;
  --dark-bg: #000000;
  --dark-ink: #e8edf4;
  --muted: rgba(232, 237, 244, 0.72);
  --nav-bg: rgba(0, 0, 0, 0.78);
  --border: rgba(232, 237, 244, 0.14);
  --pad: 1.5rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", SegoeUI, "Helvetica Neue", Arial, sans-serif;
}

body.dark {
  background: var(--dark-bg);
  color: var(--dark-ink);
}

body.site-hidden #siteNav,
body.site-hidden #siteContent {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.site-ready #siteNav,
body.site-ready #siteContent {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 700ms ease;
}

#intro {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 9999;
  opacity: 1;
}

#introCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

#themeSlide {
  position: fixed;
  inset: 0;
  background: #000000;
  transform: translateY(-100%);
  z-index: 9998;
  pointer-events: none;
}

/* NAV */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: 100%;
  margin: 0;
  padding: 1.1rem var(--pad) 0.9rem;
  display: grid;
  grid-template-rows: auto auto;
  gap: 0.65rem;
}

.nav-name {
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-ink);
}

.nav-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  font-size: 0.9rem;
}

.nav-links a:hover {
  color: var(--dark-ink);
}

/* MAIN */
.content {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000000;
}

/* OPTIMIZED STAR FIELD */
.stars {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background-repeat: repeat;
  will-change: transform, opacity;
}

.stars-small {
  opacity: 0.75;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.75) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(120,160,255,0.55) 0 1px, transparent 1.4px);
  background-size: 90px 90px, 150px 150px;
  background-position: 0 0, 40px 70px;
  animation: starDrift 42s linear infinite;
}

.stars-medium {
  opacity: 0.85;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.95) 0 1.3px, transparent 2px),
    radial-gradient(circle, rgba(170,210,255,0.75) 0 1.2px, transparent 1.9px);
  background-size: 170px 170px, 260px 260px;
  background-position: 45px 85px, 120px 40px;
  animation: starRush2D 3.8s linear infinite;
}

.stars-large {
  opacity: 0.7;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.95) 0 1.8px, transparent 2.8px),
    radial-gradient(circle, rgba(120,175,255,0.8) 0 1.4px, transparent 2.3px);
  background-size: 320px 320px, 430px 430px;
  background-position: 140px 180px, 260px 90px;
  animation: starRush2D 4.6s linear infinite;
  animation-delay: -2.2s;
}

@keyframes starDrift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-180px, 220px, 0);
  }
}

@keyframes starRush2D {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }

  15% {
    opacity: 0.75;
  }

  100% {
    opacity: 0;
    transform: scale(2.15);
  }
}

.twinkle-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #ffffff;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 0 8px rgba(255,255,255,0.8),
    0 0 16px rgba(120,170,255,0.55);
  animation: shimmer 2.8s ease-in-out infinite;
  z-index: 2;
}

.twinkle-star::before,
.twinkle-star::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(180, 215, 255, 0.7);
  transform: translate(-50%, -50%);
}

.twinkle-star::before {
  width: 24px;
  height: 1px;
}

.twinkle-star::after {
  width: 1px;
  height: 24px;
}

.star-a {
  left: 12%;
  top: 28%;
  animation-delay: 0s;
}

.star-b {
  left: 72%;
  top: 22%;
  animation-delay: 0.7s;
}

.star-c {
  left: 86%;
  top: 69%;
  animation-delay: 1.3s;
}

.star-d {
  left: 36%;
  top: 76%;
  animation-delay: 1.9s;
}

@keyframes shimmer {
  0%, 100% {
    opacity: 0.25;
    transform: scale(0.85);
  }

  50% {
    opacity: 0.95;
    transform: scale(1.15);
  }
}

/* VISTA BASIC / DWM-STYLE WINDOW */
.dvd-window {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(310px, 39vw, 540px);
  height: clamp(160px, 22vw, 260px);
  z-index: 5;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity, filter;
  border: 1px solid #6f8faa;
  border-radius: 2px;
  background: linear-gradient(#d9ecfb, #b9d5ec);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.62) inset,
    0 0 18px rgba(120, 180, 255, 0.28),
    0 18px 55px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

body.site-ready .dvd-window {
  opacity: 1;
  transition: opacity 900ms ease;
}

.window-titlebar {
  height: 31px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 7px 0 9px;
  background:
    linear-gradient(
      to bottom,
      #d7e9f9 0%,
      #c4dcf1 45%,
      #a9c9e2 46%,
      #bed9ef 100%
    );
  border-bottom: 1px solid rgba(91, 126, 154, 0.68);
}

.window-title {
  height: 100%;
  flex: 1;
}

.window-controls {
  display: flex;
  gap: 4px;
  padding-top: 6px;
}

.window-btn {
  position: relative;
  width: 31px;
  height: 17px;
  border: 1px solid #6a8399;
  border-radius: 2px;
  background:
    linear-gradient(to bottom, #f4fbff 0%, #d6e9f8 47%, #b3d1e9 48%, #e9f5ff 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.6) inset,
    0 1px 1px rgba(0,0,0,0.15);
}

.window-btn::before,
.window-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
}

.window-btn.minimize::before {
  width: 9px;
  height: 2px;
  background: #34495c;
  transform: translate(-50%, 3px);
}

.window-btn.maximize::before {
  width: 9px;
  height: 7px;
  border: 1px solid #34495c;
  transform: translate(-50%, -50%);
}

.window-btn.close {
  border-color: #8b3b31;
  background:
    linear-gradient(to bottom, #ffcabf 0%, #e98b7c 45%, #c74435 46%, #e98070 100%);
}

.window-btn.close::before,
.window-btn.close::after {
  width: 11px;
  height: 2px;
  background: #ffffff;
  box-shadow: 0 0 1px rgba(0,0,0,0.45);
}

.window-btn.close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.window-btn.close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.window-body {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 31px;
  bottom: 6px;
  background: #000000;
  border: 1px solid #b6c4cf;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.85) inset,
    0 1px 4px rgba(0,0,0,0.12) inset;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.dvd-text {
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(1.65rem, 4.5vw, 4.1rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  white-space: nowrap;
  color: #33ccff;
  text-shadow:
    0 0 8px currentColor,
    0 0 16px currentColor;
  will-change: color;
}

@media (max-width: 640px) {
  .nav-inner {
    padding: 1rem 1rem 0.85rem;
  }

  .nav-name {
    font-size: 1.15rem;
  }

  .nav-links {
    gap: 0.85rem;
  }

  .nav-links a {
    font-size: 0.78rem;
  }

  .stars {
    inset: -35%;
  }

  .stars-small {
    opacity: 0.55;
    animation-duration: 55s;
  }

  .stars-medium {
    opacity: 0.65;
    animation-duration: 5.2s;
  }

  .stars-large {
    opacity: 0.45;
    animation-duration: 6.4s;
  }

  .twinkle-star::before {
    width: 18px;
  }

  .twinkle-star::after {
    height: 18px;
  }

  .dvd-window {
    width: min(88vw, 380px);
    height: 170px;
  }

  .dvd-text {
    font-size: clamp(1.35rem, 8vw, 2.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  #intro,
  #themeSlide {
    display: none;
  }

  body {
    overflow: auto;
  }

  body.dark {
    background: var(--dark-bg);
    color: var(--dark-ink);
  }

  body.site-hidden #siteNav,
  body.site-hidden #siteContent {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .stars,
  .twinkle-star {
    animation: none;
  }

  .stars-small,
  .stars-medium,
  .stars-large {
    opacity: 0.35;
    transform: none;
  }

  .dvd-window {
    position: static;
    margin: 38vh auto 0;
    opacity: 1;
    transform: none;
  }
}