/* Project Moon Pi — site styles */
/* Fonts are served from this site (no third-party requests). Both are variable fonts covering every weight used. */
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(/fonts/Orbitron-var.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/fonts/SpaceGrotesk-var.woff2) format("woff2"); }
:root {
  --bg: #05060f;
  --ink: #eef1ff;
  --muted: #9aa3c7;
  --red: #e4312b;
  --blue: #3a8dff;
  --glass: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.12);
  --display: "Orbitron", system-ui, sans-serif;
  --body: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, #0d1233 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--body);
  overflow-x: hidden;
}

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
/* The intro cover is black from the first frame (html.intro is set in <head>), then fades to reveal the page. */
#intro { position: fixed; inset: 0; z-index: 100; background: #000; display: none; transition: opacity 1.1s ease; }
html.intro #intro, #intro.fading { display: block; }
#intro.fading { opacity: 0; pointer-events: none; }

main { position: relative; z-index: 1; }
html.intro main, html.intro .footer { visibility: hidden; }

/* The hero waits for the intro, then rises in. */
html:not(.ready) .hero, html:not(.ready) .hero * { animation-play-state: paused !important; }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 48px 16px 64px;
}

.badge {
  position: relative;
  width: min(72vw, 380px); aspect-ratio: 1;
  border: 0; padding: 0; background: none; cursor: pointer;
  animation: appear 1.4s cubic-bezier(.2,.8,.2,1) both, float 7s 1.4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
/* The canvas is 632 px: the 512 px badge with 60 px of room for the starburst. Its black corners vanish with
   'screen' blending; a black disc behind keeps the badge itself solid. Badge centre (251, 253.5), radius 242.8. */
.badge-disc {
  position: absolute;
  left: calc((311 - 241.5) / 632 * 100%); top: calc((313.5 - 241.5) / 632 * 100%);
  width: calc(483 / 632 * 100%); aspect-ratio: 1;
  border-radius: 50%; background: #000;
  box-shadow: 0 0 60px 6px rgba(58, 141, 255, 0.28), 0 0 140px 30px rgba(228, 49, 43, 0.12);
}
#badge-canvas { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; }
.badge-still { display: none; }
.badge:focus-visible { outline: 2px solid var(--blue); outline-offset: 8px; border-radius: 50%; }

@keyframes appear { from { opacity: 0; scale: 0.82; filter: blur(10px); } }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

.title {
  margin: 28px 0 6px;
  font: 900 clamp(2.1rem, 7vw, 4.4rem)/1.05 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.title span {
  display: inline-block;
  background: linear-gradient(100deg, #fff 0%, #b9c8ff 30%, #fff 45%, #ff8a7a 60%, #fff 75%) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 9s linear infinite, rise 0.9s 0.5s cubic-bezier(.2,.8,.2,1) both;
}
.title span:nth-child(2) { animation-delay: -3s, 0.62s; }
.title span:nth-child(3) { animation-delay: -6s, 0.74s; }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } }

.tagline { margin: 0; color: var(--muted); font-size: clamp(1rem, 2.6vw, 1.2rem); animation: rise 0.9s 0.95s both; }
.status {
  margin: 28px 0 0; padding: 8px 18px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--glass);
  font-size: 0.92rem; color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px;
  animation: rise 0.9s 1.15s both;
}
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #39e58c; box-shadow: 0 0 0 0 rgba(57, 229, 140, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(57, 229, 140, 0); } 100% { box-shadow: 0 0 0 0 rgba(57, 229, 140, 0); } }

/* ---------- projects ---------- */
.projects { max-width: 1080px; margin: 0 auto; padding: 0 16px 96px; }
.projects h2 {
  font: 700 0.95rem var(--display); letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted); text-align: center; margin: 0 0 32px;
}
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card {
  --hue: 210;
  position: relative; overflow: hidden;
  padding: 26px 24px 24px;
  border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(160deg, hsla(var(--hue), 90%, 60%, 0.12), var(--glass) 55%);
  backdrop-filter: blur(6px);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), border-color 0.35s, box-shadow 0.35s;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), hsla(var(--hue), 100%, 70%, 0.18), transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.card:hover { transform: translateY(-6px); border-color: hsla(var(--hue), 90%, 70%, 0.5); box-shadow: 0 18px 50px -20px hsla(var(--hue), 90%, 60%, 0.6); }
.card:hover::before { opacity: 1; }
.card h3 { margin: 0 0 8px; font: 700 1.15rem var(--display); letter-spacing: 0.05em; color: hsl(var(--hue), 90%, 78%); }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.chip {
  display: inline-block; margin-top: 14px; padding: 3px 12px;
  border-radius: 999px; border: 1px solid hsla(var(--hue), 90%, 70%, 0.5);
  font: 600 0.72rem var(--display); letter-spacing: 0.12em; text-transform: uppercase;
  color: hsl(var(--hue), 90%, 80%);
}

.reveal { opacity: 0; transform: translateY(30px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.8,.2,1); }

/* ---------- shared menu bar (partials/nav.html) ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, calc((100vw - 1120px) / 2));
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.solid { background: rgba(5, 6, 15, 0.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom-color: var(--line); }
html.intro .nav { visibility: hidden; }
.nav-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 0.95rem var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.nav-brand img { border-radius: 50%; }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  color: var(--muted); text-decoration: none; font: 500 0.95rem var(--body);
  padding: 7px 14px; border-radius: 999px; transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--ink); background: var(--glass); }
.nav-links a[aria-current="page"] { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); cursor: pointer; padding: 12px 11px; flex-direction: column; justify-content: space-between; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
@media (max-width: 1020px) {
  .nav-brand span { font-size: 0.82rem; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 100%; left: 16px; right: 16px;
    flex-direction: column; gap: 2px; padding: 8px;
    background: rgba(8, 10, 24, 0.96); border: 1px solid var(--line); border-radius: 16px;
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 14px; }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ---------- shared footer (partials/footer.html) ---------- */
.footer { position: relative; z-index: 1; text-align: center; padding: 36px 16px 44px; border-top: 1px solid var(--line); background: rgba(5, 6, 15, 0.6); font-family: var(--body); color: var(--ink); }
.footer-badge img { border-radius: 50%; opacity: 0.95; transition: transform 0.4s; }
.footer-badge:hover img { transform: rotate(-12deg) scale(1.08); }
.credit { margin: 10px 0 8px; font: 500 0.95rem var(--display); letter-spacing: 0.08em; }
.footer-mail { margin: 0 0 14px; display: flex; justify-content: center; gap: 12px; color: var(--muted); }
.footer-mail a { color: #9cc2ff; text-decoration: none; font-weight: 600; }
.footer-mail a:hover { text-decoration: underline; }
.small { margin: 4px auto 0; max-width: 640px; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }

.card-link { display: block; color: inherit; text-decoration: none; margin: -26px -24px -24px; padding: 26px 24px 24px; border-radius: inherit; }
.card-link:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  #badge-canvas { display: none; }
  .badge-still { display: block; position: absolute; left: calc(60 / 632 * 100%); top: calc(60 / 632 * 100%); width: calc(512 / 632 * 100%); height: auto; border-radius: 50%; }
}

/* ---------- legal pages ---------- */
.legal { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 120px 16px 80px; }
.legal-kicker { margin: 0; font: 700 0.8rem var(--display); letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.legal h1 { margin: 8px 0 4px; font: 900 clamp(2rem, 6vw, 3rem)/1.1 var(--display); letter-spacing: 0.04em; }
.legal-date { margin: 0 0 32px; color: var(--muted); font-size: 0.9rem; }
.legal .lead-in { font-size: 1.15rem; color: var(--ink); padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); }
.legal h2 { margin: 36px 0 8px; font: 700 1.05rem var(--display); letter-spacing: 0.06em; color: #b9c8ff; }
.legal p { margin: 0 0 12px; color: #c9cfe8; }
.legal a { color: #9cc2ff; }
.legal-more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.legal-more a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); }
.legal-more a:hover { color: var(--ink); background: var(--glass); }
body.legal-page { background: radial-gradient(ellipse 120% 60% at 50% 0%, #0d1233 0%, var(--bg) 55%) fixed, var(--bg); }
.footer-legal { margin: 0 0 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 0.85rem; }
.footer-legal a { color: var(--muted); text-decoration: none; }
.footer-legal a:hover { color: var(--ink); text-decoration: underline; }
.legal ul { margin: 0 0 14px; padding-left: 22px; color: #c9cfe8; }
.legal li { margin: 0 0 6px; }

/* ---------- about / contact / support ---------- */
.about-badge { display: block; width: 180px; height: auto; margin: 0 0 24px; border-radius: 50%; box-shadow: 0 0 50px rgba(58, 141, 255, 0.35); }
.legal li b { color: var(--ink); }
.contact-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin: 24px 0 8px; }
.contact-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--glass); color: var(--ink); text-decoration: none; transition: transform 0.2s, border-color 0.2s; }
.contact-card:hover { transform: translateY(-3px); border-color: rgba(156, 194, 255, 0.6); }
.contact-card b { font: 700 1.2rem var(--display); letter-spacing: 0.04em; }
.contact-card span { color: var(--muted); }
.contact-card em { margin-top: 8px; font-style: normal; font-weight: 600; color: #9cc2ff; }
.guide-row { display: flex; flex-wrap: wrap; gap: 10px; }
.guide-row a { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: #9cc2ff; }
.guide-row a:hover { background: var(--glass); }
.legal details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0 0 10px; background: rgba(255, 255, 255, 0.02); }
.legal summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.legal details p { margin: 10px 0 2px; }
.status { max-width: calc(100% - 32px); text-align: left; }
.pulse { flex: none; }
.status a { margin-left: 6px; white-space: nowrap; color: #39e58c; font-weight: 600; text-decoration: none; }
.status a:hover, .status a:focus-visible { text-decoration: underline; }
.home-about { max-width: 760px; }
.home-about p { margin: 0 0 16px; color: var(--muted); line-height: 1.65; }
.home-about a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
