/* =============================================================
   Juoni Games — site.css
   Design tokens + page layout. All colors live ONLY here;
   ship.css reads the same tokens, so recoloring is one edit.
   ============================================================= */

:root {
  /* Palette: logo blue (#779EB1, hue ~200°) and its warm
     complement, the reference gray #44413F (hue ~24°). */
  --bg:            #181211;  /* logo hue at the darkness of #44413F */
  --bg-warm:       #64513F;  /* reference warm gray, used as a corner glow */
  --accent:        #779EB1;  /* logo blue: ship, links, headings */
  --accent-strong: #A9C6D3;  /* hover / highlights */
  --flame:         #F2B370;  /* ship exhaust */
  --flame-hot:     #FFF0D6;  /* exhaust core */
  --text:          #E6E9EA;
  --muted:         #A8B0B4;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page-max: 60rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* Grain overlay strength (0 = off). Dithers the background gradients so
     8-bit banding disappears; 0.10-0.20 is usually enough. */
  --grain: .14;
}

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

html {
  color-scheme: dark;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 400 1.05rem/1.6 var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    /* faint blue glow behind the logo */
    radial-gradient(70vw 55vh at 50% 20%,
      color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    /* warm complementary glow from the lower-right */
    radial-gradient(45vw 35vh at 100% 100%,
      color-mix(in srgb, var(--bg-warm) 20%, transparent), transparent 72%),
    /* base image, bottom layer (3840×2160); --bg shows through until it loads */
    url("../assets/img/basegalaxy.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: auto, auto, cover;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Film grain over the background gradients (SVG noise, no JS). overlay keeps
   the average brightness unchanged; only the band edges get broken up. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='256' height='256'><filter id='n' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch' seed='7'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>") 0 0 / 256px 256px;
}

/* ---- Layering (see ship.css): .hit = 0, .ship = 1, page = 2 ----
   Page wrappers let the pointer fall through to the hover grid so the
   ship keeps tracking over plain text; only interactive elements catch it. */
.site-header, main, .site-footer {
  position: relative;
  z-index: 2;
  pointer-events: none;
  width: min(100% - 2 * var(--gutter), var(--page-max));
  margin-inline: auto;
  text-align: center;
}
a, button, input, select, textarea, summary, [tabindex] { pointer-events: auto; }

/* ---- Header ---- */
.site-header { padding-block: clamp(2rem, 8vh, 5rem) 1rem; }
.logo { display: inline-block; }
.logo img {
  display: block;
  width: min(22rem, 70vw);
  height: auto;
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 25%, transparent));
}

nav {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2rem);
}
nav a {
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .85rem;
  padding: .35rem .2rem;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
nav a:hover, nav a:focus-visible {
  color: var(--accent-strong);
  border-bottom-color: currentColor;
}
nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ---- Main ---- */
main {
  flex: 1;
  padding-block: clamp(1.5rem, 6vh, 4rem);
}
h1 {
  margin: 0 0 .5rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent-strong);
}
.lede {
  margin: 0 auto;
  max-width: 36rem;
  font-size: 1.15rem;
  color: var(--muted);
}
main a { color: var(--accent); }
main a:hover { color: var(--accent-strong); }

/* ---- Footer ---- */
.site-footer {
  padding-block: 1.5rem;
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--muted);
}
