/* ==========================================================
   Adrien Trevino: shared site styles
   Neon glow, outer space, 8-bit. Reused by every page.
   ========================================================== */

:root {
  /* Space */
  --void: #05030f;
  --deep: #0c0826;
  --panel: rgba(12, 8, 38, 0.78);

  /* Text */
  --ink: #eeebff;
  --ink-dim: #b9b2e6;

  /* Neon */
  --cyan: #2de2ff;
  --magenta: #ff2bd6;
  --green: #39ff88;
  --violet: #a855ff;
  --yellow: #ffe94a;
  --orange: #ff8a3d;

  /* Type */
  --font-pixel: "Press Start 2P", "Courier New", monospace;
  --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Soft nebula clouds behind the stars */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 15% 10%, rgba(168, 85, 255, 0.2), transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 65%, rgba(255, 43, 214, 0.13), transparent 70%),
    radial-gradient(ellipse 70% 40% at 45% 105%, rgba(45, 226, 255, 0.12), transparent 70%);
}

.starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

:focus-visible {
  outline: 2px dashed var(--yellow);
  outline-offset: 5px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--deep);
  color: var(--yellow);
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ----------------------------------------------------------
   Pixel box: a glowing 8-bit border with notched corners.
   Set --c on the element to change its color.
   ---------------------------------------------------------- */
.pixel-box {
  --pb: 3px;
  box-shadow:
    0 calc(var(--pb) * -1) 0 0 var(--c, var(--cyan)),
    0 var(--pb) 0 0 var(--c, var(--cyan)),
    calc(var(--pb) * -1) 0 0 0 var(--c, var(--cyan)),
    var(--pb) 0 0 0 var(--c, var(--cyan)),
    0 0 var(--glow, 22px) 3px color-mix(in srgb, var(--c, var(--cyan)) 55%, transparent),
    0 0 calc(var(--glow, 22px) * 2.5) 4px color-mix(in srgb, var(--c, var(--cyan)) 18%, transparent),
    inset 0 0 18px color-mix(in srgb, var(--c, var(--cyan)) 12%, transparent);
}

/* Pixel-art canvases (drawn tiny by js/planets.js, scaled up crisp) */
.pixel-art {
  display: block;
  width: calc(var(--art-w, 24) * var(--scale, 3px));
  height: auto;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* ----------------------------------------------------------
   Sound controls
   ---------------------------------------------------------- */
.sound {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
}

.sound__button {
  --c: var(--ink-dim);
  --glow: 10px;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  background: rgba(12, 8, 38, 0.85);
  color: var(--ink-dim);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.sound__button svg { width: 26px; height: 26px; }
.sound__button.is-on { --c: var(--cyan); --glow: 22px; color: var(--cyan); }
.sound__button:hover { background: rgba(45, 226, 255, 0.12); }
.sound__button.is-on .icon-off,
.sound__button:not(.is-on) .icon-on { display: none; }

.sound__panel {
  --c: var(--magenta);
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  width: 15.5rem;
  padding: 1rem 1.15rem 0.6rem;
  background: rgba(10, 6, 30, 0.95);
}
.sound__panel[hidden] { display: none; }

.sound__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: #fff;
  text-shadow: 0 0 6px var(--magenta), 0 0 16px var(--magenta);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  font-weight: 500;
}
.switch-row + .switch-row { border-top: 1px dashed rgba(185, 178, 230, 0.22); }
.switch-row--sub { padding-left: 0.75rem; transition: opacity 0.2s; }
.sound__panel.is-master-off .switch-row--sub { opacity: 0.5; }

.switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 24px;
  padding: 0;
  border: 0;
  background: #1b1440;
  cursor: pointer;
  box-shadow:
    0 -2px 0 0 #4a3f86, 0 2px 0 0 #4a3f86,
    -2px 0 0 0 #4a3f86, 2px 0 0 0 #4a3f86;
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  background: var(--ink-dim);
  transition: transform 0.15s steps(3, end), background-color 0.15s;
}
.switch[aria-checked="true"] {
  background: rgba(57, 255, 136, 0.22);
  box-shadow:
    0 -2px 0 0 var(--green), 0 2px 0 0 var(--green),
    -2px 0 0 0 var(--green), 2px 0 0 0 var(--green),
    0 0 14px 1px rgba(57, 255, 136, 0.45);
}
.switch[aria-checked="true"]::after {
  transform: translateX(24px);
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ----------------------------------------------------------
   Hero
   ---------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6rem 1.25rem 7rem;
  overflow: hidden;
  text-align: center;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__name {
  margin: 0;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(1.6rem, 6.4vw, 4.75rem);
  line-height: 1.35;
  color: #f5fdff;
  text-shadow:
    0.125em 0.125em 0 rgba(255, 43, 214, 0.85),
    0 0 4px #fff,
    0 0 12px var(--cyan),
    0 0 28px var(--cyan),
    0 0 60px rgba(45, 226, 255, 0.55);
  animation: power-on 1.5s steps(1, end) both;
}

.hero__tagline {
  max-width: 42ch;
  margin: 1.75rem auto 0;
  font-size: clamp(1.05rem, 2.3vw, 1.45rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-shadow: 0 0 10px rgba(255, 43, 214, 0.75), 0 0 26px rgba(255, 43, 214, 0.45);
  animation: fade-in 0.9s ease-out 1.5s both;
}

.hero__planet {
  position: absolute;
  pointer-events: none;
}
.hero__planet--giant {
  --scale: clamp(2.4px, 0.78vw, 4.4px);
  right: -9vw;
  bottom: 6vh;
  filter: drop-shadow(0 0 6px var(--violet)) drop-shadow(0 0 30px rgba(168, 85, 255, 0.55));
  animation: float 12s ease-in-out infinite;
}
.hero__planet--moon {
  --scale: clamp(2.5px, 0.55vw, 4px);
  top: 14vh;
  left: 8vw;
  filter: drop-shadow(0 0 5px var(--cyan)) drop-shadow(0 0 18px rgba(45, 226, 255, 0.55));
  animation: float 9s ease-in-out -3s infinite;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  translate: -50% 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--cyan);
  filter: drop-shadow(0 0 6px var(--cyan));
  animation: bob 1.6s steps(4, end) infinite, fade-in 0.8s ease-out 2.2s both;
}
.scroll-cue svg { width: 28px; height: auto; }

/* ----------------------------------------------------------
   Sections
   ---------------------------------------------------------- */
.section {
  padding: clamp(4rem, 10vw, 7.5rem) 1.25rem;
}

.section-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(1rem, 2.6vw, 1.45rem);
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 0 6px var(--title-glow, var(--magenta)), 0 0 20px var(--title-glow, var(--magenta));
}

/* About me */
.about {
  --c: var(--violet);
  --title-glow: var(--magenta);
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 3rem);
  background: var(--panel);
  backdrop-filter: blur(4px);
}
.about p {
  max-width: 62ch;
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.75;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  background: rgba(5, 3, 15, 0.7);
  color: var(--c);
  font-family: var(--font-pixel);
  font-size: 0.66rem;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.social a:hover,
.social a:focus-visible {
  --glow: 34px;
  background: color-mix(in srgb, var(--c) 16%, rgba(5, 3, 15, 0.7));
  color: #fff;
  text-shadow: 0 0 8px var(--c);
}
.social svg { flex: none; width: 20px; height: auto; }

/* ----------------------------------------------------------
   Planet map navigation
   ---------------------------------------------------------- */
.system {
  --title-glow: var(--cyan);
  padding-bottom: clamp(5rem, 12vw, 9rem);
  text-align: center;
}
.system__intro {
  max-width: 40ch;
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
  color: var(--ink-dim);
}

.orbit-map {
  container-type: inline-size;
  position: relative;
  width: min(calc(100vw - 10rem), 760px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.core {
  --scale: 0.46cqi;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  translate: -50% -50%;
  display: grid;
  place-items: center;
}
.core__art { animation: pulse 3.5s ease-in-out infinite; }
.core__label {
  position: absolute;
  font-family: var(--font-pixel);
  font-size: clamp(0.8rem, 2.2cqi, 1.2rem);
  color: #2a0b3d;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  aspect-ratio: 1;
  border: 2px dashed color-mix(in srgb, var(--ring-c) 42%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 16px color-mix(in srgb, var(--ring-c) 16%, transparent),
    inset 0 0 16px color-mix(in srgb, var(--ring-c) 10%, transparent);
  pointer-events: none;
  animation: orbit var(--dur) linear infinite;
}
.ring--inner  { width: 42%; --dur: 70s;  --ring-c: var(--cyan); }
.ring--middle { width: 70%; --dur: 110s; --ring-c: var(--violet); }
.ring--outer  { width: 98%; --dur: 160s; --ring-c: var(--magenta); }

.orbiter {
  position: absolute;
  inset: 0;
  rotate: var(--start);
}
.orbiter__body {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% -50%;
  rotate: calc(var(--start) * -1);
}
.counter-spin {
  animation: orbit var(--dur) linear infinite reverse;
}

/* Hovering or focusing any planet pauses the whole system */
.orbit-map:has(.planet:hover, .planet:focus-visible) :is(.ring, .counter-spin) {
  animation-play-state: paused;
}

.planet {
  --scale: 0.46cqi;
  position: relative;
  display: block;
  color: var(--ink);
  text-decoration: none;
  pointer-events: auto;
}
.planet:focus-visible { outline: none; }

.planet__art {
  filter:
    drop-shadow(0 0 3px var(--pc))
    drop-shadow(0 0 12px color-mix(in srgb, var(--pc) 65%, transparent));
  transition: scale 0.25s steps(4, end), filter 0.25s;
}
.planet__label {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 50%;
  translate: -50% 0;
  width: 10rem;
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  line-height: 1.7;
  text-align: center;
  text-shadow: 0 0 8px color-mix(in srgb, var(--pc) 70%, transparent);
  transition: color 0.2s, text-shadow 0.2s;
}

.planet:hover .planet__art,
.planet:focus-visible .planet__art {
  scale: 1.18;
  filter:
    drop-shadow(0 0 4px #fff)
    drop-shadow(0 0 10px var(--pc))
    drop-shadow(0 0 28px var(--pc));
}
.planet:focus-visible .planet__art {
  outline: 2px dashed var(--pc);
  outline-offset: 8px;
}
.planet:hover .planet__label,
.planet:focus-visible .planet__label {
  color: #fff;
  text-shadow: 0 0 6px var(--pc), 0 0 16px var(--pc);
}

/* ----------------------------------------------------------
   Easter eggs
   ---------------------------------------------------------- */
.ufo {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 80px;
  padding: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 0 5px var(--green)) drop-shadow(0 0 16px rgba(57, 255, 136, 0.55));
}
.ufo[hidden] { display: none; }
.ufo svg { display: block; width: 100%; height: auto; }
.ufo__light { animation: blink 0.8s steps(1, end) infinite; }
.ufo__light--b { animation-delay: 0.4s; }

.toast {
  --c: var(--green);
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 60;
  translate: -50% 0;
  width: max-content;
  max-width: min(90vw, 26rem);
  padding: 0.95rem 1.2rem;
  background: rgba(10, 6, 30, 0.95);
  font-size: 0.98rem;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.toast.is-visible { opacity: 1; }

.warp-flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(57, 255, 136, 0.5), rgba(168, 85, 255, 0.35) 45%, transparent 75%);
}
.warp-flash.is-active { animation: warp 0.9s ease-out; }

.secret {
  max-width: min(92vw, 30rem);
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: var(--ink);
}
.secret::backdrop {
  background: rgba(5, 3, 15, 0.72);
  backdrop-filter: blur(3px);
}
.secret__inner {
  --c: var(--green);
  padding: 2.25rem 1.75rem;
  background: rgba(10, 6, 30, 0.96);
  text-align: center;
}
.secret__title {
  margin: 0 0 1rem;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #eafff2;
  text-shadow: 0 0 6px var(--green), 0 0 22px var(--green);
}
.secret p { margin: 0 0 1.75rem; }
.secret__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}
.secret form { margin: 0; }

.btn {
  display: inline-block;
  padding: 0.9rem 1.1rem;
  border: 0;
  background: rgba(5, 3, 15, 0.8);
  color: var(--c);
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover,
.btn:focus-visible {
  --glow: 32px;
  background: color-mix(in srgb, var(--c) 18%, rgba(5, 3, 15, 0.8));
  color: #fff;
  text-shadow: 0 0 8px var(--c);
}

/* ----------------------------------------------------------
   Animations
   ---------------------------------------------------------- */
@keyframes power-on {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  12%  { opacity: 0.15; }
  20%  { opacity: 1; }
  26%  { opacity: 0.35; }
  30%  { opacity: 1; }
  64%  { opacity: 0.6; }
  68%  { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
@keyframes bob { 0%, 100% { translate: -50% 0; } 50% { translate: -50% 8px; } }
@keyframes orbit { to { rotate: 360deg; } }
@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 8px var(--yellow)) drop-shadow(0 0 26px var(--orange)); }
  50%      { filter: drop-shadow(0 0 12px var(--yellow)) drop-shadow(0 0 46px var(--orange)); }
}
@keyframes warp { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
@keyframes blink { 50% { opacity: 0.2; } }

/* ----------------------------------------------------------
   Phones: the orbit becomes a vertical list of planets
   ---------------------------------------------------------- */
@media (max-width: 640px) {
  .hero__planet--giant { right: -36vw; bottom: 13vh; }
  .hero__planet--moon { top: 11vh; left: 6vw; }

  .orbit-map {
    container-type: normal;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    width: 100%;
    max-width: 22rem;
    aspect-ratio: auto;
  }
  .core {
    --scale: 2.5px;
    position: relative;
    top: auto;
    left: auto;
    translate: none;
    align-self: center;
    margin-bottom: 0.75rem;
  }
  .core__label { font-size: 0.9rem; }

  .ring, .orbiter, .orbiter__body, .counter-spin { display: contents; }

  .planet {
    --scale: 2.2px;
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    align-items: center;
    gap: 0.75rem;
    min-height: 5.5rem;
    padding: 0.9rem 1rem;
    background: var(--panel);
    box-shadow:
      0 -3px 0 0 var(--pc), 0 3px 0 0 var(--pc),
      -3px 0 0 0 var(--pc), 3px 0 0 0 var(--pc),
      0 0 18px 2px color-mix(in srgb, var(--pc) 30%, transparent);
  }
  .planet__art { justify-self: center; }
  .planet__label {
    position: static;
    translate: none;
    width: auto;
    font-size: 0.62rem;
    text-align: left;
  }
  .planet:hover .planet__art,
  .planet:focus-visible .planet__art { scale: 1.1; }
}

/* ----------------------------------------------------------
   Respect "reduce motion": everything stays put but still glows
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
