/* THEME VARIABLES
   -------------------------------------------------- */

/* Default (used for Automatic when system is light) – soft neutral light */
:root {
  --bg-gradient: radial-gradient(circle at top, #f7f9ff, #dde3f5, #b7c4f0);

  --text-main: #1f2433;
  --text-soft: #4d5570;
  --card-text: #555b7a;
  --heading: #151c2f;
  --link-color: #2f4ca8;

  --accent-1: #7aa7ff;
  --accent-2: #c28dff;

  --nav-bg: rgba(249,250,255,0.9);
  --nav-border: rgba(255,255,255,1);
  --nav-shadow: 0 10px 24px rgba(22, 30, 75, 0.22);

  --glass-bg: rgba(255,255,255,0.9);
  --glass-border: rgba(255,255,255,1);
  --glass-shadow-main: 0 14px 26px rgba(21, 28, 70, 0.18);

  --chip-border: rgba(122, 167, 255, 0.85);
  --chip-bg: rgba(255,255,255,0.9);

  --card-hover-bg: rgba(255,255,255,0.98);
  --footer-text: rgba(40, 48, 80, 0.9);
}

/* Automatic dark mode when user prefers dark (only when theme = Automatic) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-gradient: radial-gradient(circle at top, #050714, #111322, #161932);

    --text-main: #f3f1ff;
    --text-soft: #b6b0ff;
    --card-text: #dde0ff;
    --heading: #ffffff;
    --link-color: #c7b5ff;

    --accent-1: #f2a6ff;
    --accent-2: #92b5ff;

    --nav-bg: rgba(10,10,24,0.95);
    --nav-border: rgba(166,150,255,0.65);
    --nav-shadow: 0 12px 30px rgba(0,0,0,0.85);

    --glass-bg: rgba(15,17,38,0.94);
    --glass-border: rgba(169,157,255,0.7);
    --glass-shadow-main: 0 18px 32px rgba(0,0,0,0.75);

    --chip-border: rgba(175,163,255,0.9);
    --chip-bg: rgba(255,255,255,0.08);

    --card-hover-bg: rgba(36, 38, 82, 0.98);
    --footer-text: rgba(200,193,255,0.85);
  }
}

/* Explicit Light theme (overrides Automatic) – clean neutral */
[data-theme="light"] {
  --bg-gradient: radial-gradient(circle at top, #f7f9ff, #dde3f5, #b7c4f0);

  --text-main: #1f2433;
  --text-soft: #4d5570;
  --card-text: #555b7a;
  --heading: #151c2f;
  --link-color: #2f4ca8;

  --accent-1: #7aa7ff;
  --accent-2: #c28dff;

  --nav-bg: rgba(249,250,255,0.9);
  --nav-border: rgba(255,255,255,1);
  --nav-shadow: 0 10px 24px rgba(22, 30, 75, 0.22);

  --glass-bg: rgba(255,255,255,0.9);
  --glass-border: rgba(255,255,255,1);
  --glass-shadow-main: 0 14px 26px rgba(21, 28, 70, 0.18);

  --chip-border: rgba(122, 167, 255, 0.85);
  --chip-bg: rgba(255,255,255,0.9);

  --card-hover-bg: rgba(255,255,255,0.98);
  --footer-text: rgba(40, 48, 80, 0.9);
}

/* Explicit Dark theme (overrides Automatic) */
[data-theme="dark"] {
  --bg-gradient: radial-gradient(circle at top, #050714, #111322, #161932);

  --text-main: #f3f1ff;
  --text-soft: #b6b0ff;
  --card-text: #dde0ff;
  --heading: #ffffff;
  --link-color: #c7b5ff;

  --accent-1: #f2a6ff;
  --accent-2: #92b5ff;

  --nav-bg: rgba(10,10,24,0.95);
  --nav-border: rgba(166,150,255,0.65);
  --nav-shadow: 0 12px 30px rgba(0,0,0,0.85);

  --glass-bg: rgba(15,17,38,0.94);
  --glass-border: rgba(169,157,255,0.7);
  --glass-shadow-main: 0 18px 32px rgba(0,0,0,0.75);

  --chip-border: rgba(175,163,255,0.9);
  --chip-bg: rgba(255,255,255,0.08);

  --card-hover-bg: rgba(36, 38, 82, 0.98);
  --footer-text: rgba(200,193,255,0.85);
}

/* Purple "Luneveil" theme – your current one */
[data-theme="luneveil"] {
  --bg-gradient: radial-gradient(circle at top, #f9f0ff, #d4b6ff, #8a5eff);

  --text-main: #23152f;
  --text-soft: #4b2e7f;
  --card-text: #51307f;
  --heading: #2e123d;
  --link-color: #4b1a88;

  --accent-1: #ffb7fa;
  --accent-2: #c1a4ff;

  --nav-bg: rgba(254,248,255,0.9);
  --nav-border: rgba(255,255,255,0.96);
  --nav-shadow: 0 12px 28px rgba(67,23,114,0.4);

  --glass-bg: rgba(254,248,255,0.86);
  --glass-border: rgba(255,255,255,0.98);
  --glass-shadow-main: 0 18px 34px rgba(59,19,103,0.45);

  --chip-border: rgba(175,117,255,0.9);
  --chip-bg: rgba(255,255,255,0.9);

  --card-hover-bg: rgba(255,248,255,0.98);
  --footer-text: rgba(55,23,92,0.9);
}

/* RESET & BASICS
   -------------------------------------------------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  background: var(--bg-gradient);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  overflow-x: hidden;
}

/* global links */
a {
  color: var(--link-color);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* BACKGROUND LAYERS – stars only */
.stars-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 10% 20%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 80% 30%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 30% 70%, rgba(255,255,255,0.75), transparent),
    radial-gradient(2px 2px at 60% 85%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1.5px 1.5px at 50% 40%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 20% 90%, rgba(255,255,255,0.6), transparent);
  opacity: 0.55;
  animation: twinkle 7s ease-in-out infinite alternate;
  z-index: -3;
}

.orbit {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  top: 40%;
  left: 78%;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: orbitRotate 45s linear infinite;
  pointer-events: none;
  z-index: -1;
}

.orbit-moon {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff7ff, #f5d5ff 45%, #c7b4ff 100%);
  box-shadow:
    0 0 10px rgba(255, 240, 255, 0.85),
    0 0 20px rgba(188, 160, 255, 0.6);
  top: 50%;
  left: 50%;
  transform: translate(160px, -50%);
}

/* LAYOUT */
.page-shell {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem 3.5rem;
}

/* NAV
   -------------------------------------------------- */

.nav {
  position: sticky;
  top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  z-index: 5;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  text-transform: lowercase;
  letter-spacing: 0.16em;
  color: var(--heading);
}

.nav-logo {
  font-size: 1.1rem;
}

.nav-name {
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.nav-links a {
  color: var(--link-color);
  text-decoration: none;
  position: relative;
  padding-bottom: 0.1rem;
  opacity: 0.85;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.1rem;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 0.2s ease-out;
}

.nav-links a:hover {
  opacity: 1;
}
.nav-links a:hover::after {
  width: 100%;
}

/* Theme selector */
.nav-theme {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.nav-theme label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-theme select {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(180, 170, 255, 0.8);
  background: var(--nav-bg); /* follows theme */
  color: var(--text-main);
  outline: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--link-color);
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.nav-toggle span + span {
  margin-top: 5px;
}

.nav-toggle--open span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-toggle--open span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* GLASS UTILITY */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow:
    var(--glass-shadow-main),
    0 0 0 1px rgba(255,255,255,0.3) inset;
}

/* HERO
   -------------------------------------------------- */

.hero {
  padding-top: 2.4rem;
}

.hero-card {
  position: relative;
  max-width: 650px;
  padding: 2.1rem 2.3rem 2.2rem;
}

.hero-moon {
  position: absolute;
  top: -26px;
  right: -18px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #fff7ff, #f7d3ff 40%, #f1b5ff 60%, #bba8ff 90%);
  box-shadow:
    0 0 16px rgba(255, 220, 255, 0.8),
    0 0 30px rgba(206, 159, 255, 0.6);
  opacity: 0.95;
  animation: moonFloat 5s ease-in-out infinite alternate;
}

.hero-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  opacity: 0.9;
  margin-bottom: 0.45rem;
}

.hero-title {
  font-size: clamp(2.3rem, 4vw, 2.8rem);
  letter-spacing: 0.16em;
  text-transform: lowercase;
  margin-bottom: 0.6rem;
  color: var(--heading);
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.65),
    0 0 12px rgba(147, 117, 255, 0.55);
  animation: glow 3.2s ease-in-out infinite alternate;
}

.hero-text {
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--card-text);
  max-width: 32rem;
  margin-bottom: 1.5rem;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  background: var(--chip-bg);
  color: var(--link-color);
  cursor: pointer;
  transition:
    background 0.15s ease-out,
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

.chip:hover {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(40, 10, 90, 0.25);
}

/* SECTIONS */
.section {
  padding: 3rem 0 1.4rem;
}

.section-header {
  margin-bottom: 1.6rem;
}

.section-header h2 {
  font-size: 1.25rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--heading);
  margin-bottom: 0.35rem;
}

.section-header p {
  font-size: 0.93rem;
  color: var(--text-soft);
}

/* ABOUT */
.about-card {
  padding: 1.5rem 1.6rem 1.6rem;
}

.about-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr);
  gap: 1.3rem;
  margin-top: 1rem;
}

.about-col h3 {
  font-size: 1.02rem;
  margin-bottom: 0.45rem;
  color: var(--heading);
}

.about-list {
  list-style: disc;
  margin-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--card-text);
  line-height: 1.6;
}

/* PANELS (Esports, Coding, etc.) */
.panel-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.panel {
  padding: 1.2rem 1.3rem 1.3rem;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    background 0.15s ease-out;
}

.panel h3 {
  font-size: 1.02rem;
  margin-bottom: 0.35rem;
  color: var(--heading);
}

.panel-text {
  font-size: 0.9rem;
  color: var(--card-text);
  line-height: 1.6;
}

.panel-text.small {
  font-size: 0.82rem;
}

.panel:hover {
  transform: translateY(-2px);
  background: var(--card-hover-bg);
  box-shadow: 0 16px 30px rgba(35, 12, 80, 0.25);
}

/* STREAM CARD */
.stream-card {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.1fr);
  gap: 1.3rem;
  padding: 1.3rem 1.4rem;
}

.stream-main h3 {
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
  color: var(--heading);
}

.stream-side h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}

.stream-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(172, 150, 250, 0.9);
  font-size: 0.84rem;
  color: var(--link-color);
  margin-bottom: 0.4rem;
}

/* LINKS */
.links-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.link-card {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: inherit;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    background 0.15s ease-out;
}

.link-card:hover {
  transform: translateY(-2px);
  background: var(--card-hover-bg);
  box-shadow: 0 16px 30px rgba(35, 12, 80, 0.25);
}

.link-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-soft);
}

.link-value {
  font-size: 0.94rem;
  color: var(--heading);
}

/* FOOTER */
.footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--footer-text);
}

/* ANIMATIONS
   -------------------------------------------------- */

@keyframes twinkle {
  0% { opacity: 0.4; }
  50% { opacity: 0.8; }
  100% { opacity: 0.5; }
}

@keyframes orbitRotate {
  0%   { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes moonFloat {
  0%   { transform: translateY(0px) translateX(0px); }
  100% { transform: translateY(-4px) translateX(2px); }
}

@keyframes glow {
  0% {
    text-shadow:
      0 0 4px rgba(255, 255, 255, 0.6),
      0 0 8px rgba(147, 117, 255, 0.4);
  }
  100% {
    text-shadow:
      0 0 8px rgba(255, 255, 255, 0.9),
      0 0 16px rgba(179, 143, 255, 0.75);
  }
}

/* RESPONSIVE
   -------------------------------------------------- */

@media (max-width: 900px) {
  .panel-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .stream-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .links-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .orbit {
    width: 280px;
    height: 280px;
    top: 18%;
    left: 80%;
  }
  .about-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .page-shell {
    padding-inline: 1rem;
  }

  .nav {
    padding-inline: 1rem;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 16px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--nav-border);
    box-shadow: var(--nav-shadow);
    flex-direction: column;
    gap: 0.6rem;
    display: none;
  }

  .nav-links.nav-links--open {
    display: flex;
  }

  .nav-right {
    gap: 0.4rem;
  }

  .nav-theme label {
    display: none; /* keep it compact on mobile */
  }

  .nav-theme select {
    padding-inline: 0.4rem;
  }

  .hero-card {
    padding: 2rem 1.6rem 1.7rem;
  }

  .orbit {
    display: none; /* cleaner mobile */
  }
}
