/* Base: reset, typography, shared components (nav, footer, buttons, HUD labels).
   Used by every page. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }   /* clear the fixed 64px nav on anchor jumps */
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; font-weight: 750; }
p { margin: 0; }
button { font: inherit; color: inherit; }

::selection { background: var(--magenta); color: var(--starlight); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 1rem; top: -4rem; z-index: 100;
  padding: 0.6rem 1rem; border-radius: 10px;
  background: var(--starlight); color: var(--midnight); font-weight: 700; text-decoration: none;
  transition: top var(--fast) var(--ease);
}
.skip-link:focus { top: 1rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

/* HUD label — the mono "mission control" readout */
.hud {
  font-family: var(--font-mono);
  font-size: var(--fs-hud);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
}
.hud .accent { color: var(--cyan); }
.hud .accent-m { color: var(--magenta); }

/* Four-point pixel star, used as a bullet/ornament */
.px-star {
  display: inline-block; width: 7px; height: 7px; flex: none;
  background:
    linear-gradient(currentColor, currentColor) center / 1px 7px no-repeat,
    linear-gradient(currentColor, currentColor) center / 7px 1px no-repeat,
    linear-gradient(currentColor, currentColor) center / 3px 3px no-repeat;
  color: var(--cyan);
  image-rendering: pixelated;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background var(--med) var(--ease), border-color var(--med) var(--ease), backdrop-filter var(--med);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgb(2 8 23 / 0.78);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav__brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.nav__brand img { width: 38px; height: auto; }
.nav__brand .hud { color: var(--text); letter-spacing: 0.3em; font-size: 0.78rem; transition: opacity var(--med); }
.nav:not(.is-scrolled) .nav__brand .hud { opacity: 0; }
.nav__links { display: flex; align-items: center; gap: clamp(0.25rem, 2vw, 1.25rem); }
.nav__link {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; color: var(--text-2);
  padding: 0.5rem 0.6rem; border-radius: 8px;
  transition: color var(--fast) var(--ease);
}
.nav__link:hover { color: var(--text); }

.sound-toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line); cursor: pointer;
  color: var(--text-2);
  transition: color var(--fast), border-color var(--fast);
}
.sound-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.sound-toggle svg { width: 18px; height: 18px; image-rendering: pixelated; }
.sound-toggle .waves { display: none; }
.sound-toggle[aria-pressed="true"] { color: var(--cyan); border-color: rgb(0 245 251 / 0.4); }
.sound-toggle[aria-pressed="true"] .waves { display: inline; }
.sound-toggle[aria-pressed="true"] .mute { display: none; }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  border-top: 1px solid var(--line);
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(180deg, rgb(6 15 45 / 0.35), rgb(2 8 23 / 0.9));
}
.footer__grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .footer__grid { grid-template-columns: auto 1fr auto auto; column-gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
}
.footer__mark { width: 44px; cursor: default; -webkit-tap-highlight-color: transparent; user-select: none; }
.footer__col { display: grid; gap: 0.6rem; align-content: start; }
.footer__col a { text-decoration: none; color: var(--text-2); transition: color var(--fast); width: fit-content; }
.footer__col a:hover { color: var(--cyan); }
.footer__mail { font-size: 1.15rem; font-weight: 650; color: var(--text) !important; }
.socials { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.footer__col .social { display: inline-flex; align-items: center; gap: 0.6rem; }
.social svg { width: 16px; height: 16px; flex: none; image-rendering: pixelated; }
.footer__bottom {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; align-items: center;
}
.sky { display: inline-flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.sky__moon { width: 18px; height: 18px; image-rendering: pixelated; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.3rem; border-radius: 12px;
  background: var(--starlight); color: var(--midnight);
  font-weight: 700; text-decoration: none;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: -3px 0 0 var(--cyan), 3px 0 0 var(--magenta); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
