/* =========================================================
   Smaller than the Sky: site styles
   Tweak the look here: every color, font and size lives in :root.
   ========================================================= */
:root {
  /* brand colors (same as the logo) */
  --navy: #01224B;          /* logo background */
  --night: #000A1A;         /* deep sky at the top of the page */
  --line: #F0F6F8;          /* jar line / main text */
  --firefly: #C3EB37;       /* accent: links, highlights */
  --muted: #A9B8CC;         /* secondary text (passes contrast on navy) */
  --rule: rgba(240, 246, 248, 0.14);

  /* type: system fonts only, so no third-party font requests (better privacy, faster) */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

  --measure: 36rem;         /* comfortable reading width */
  color-scheme: dark;
}

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

/* the page "canvas" shows in phone overscroll and behind Safari's bottom bar:
   match it to the color at the BOTTOM of each page so no different-colored bar appears */
html { background: var(--navy); }
html:has(body.has-intro) { background: #011D40; }   /* bottom of the homepage's dark veil */

body {
  margin: 0;
  min-height: 100vh;
  color: var(--line);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  /* night up top, fading to the logo's navy near the bottom, with a static firefly sky */
  background:
    url("assets/sky.svg") center top / cover no-repeat fixed,
    linear-gradient(to bottom, var(--night) 0%, #00142F 45%, var(--navy) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--firefly); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--firefly); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--navy); padding: .5rem 1rem; z-index: 10; }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 max(1.25rem, env(safe-area-inset-left)) 0 max(1.25rem, env(safe-area-inset-right));
}

/* ---------- header (inner pages) ---------- */
.site-head {
  display: flex; align-items: center; gap: .75rem;
  padding-top: 1.5rem; padding-bottom: 1rem;
}
.site-head a { display: flex; align-items: center; gap: .6rem; color: var(--line); text-decoration: none; min-height: 44px; }
.site-head img { width: 28px; height: auto; }
.site-head span { font-family: var(--serif); font-size: 1.1rem; }

/* ---------- hero ---------- */
.hero {
  min-height: 88vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 1.25rem;
  padding: 3rem 0 2rem;
}
.hero img { width: min(42vw, 180px); height: auto; }
h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; text-wrap: balance; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); letter-spacing: .01em; }
.tagline { margin: 0; color: var(--muted); font-size: 1.15rem; max-width: 26rem; }
.scroll-cue { margin-top: 1.5rem; color: var(--muted); font-size: .9rem; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- sections ---------- */
section { padding: 3.5rem 0; border-top: 1px solid var(--rule); }
section h2 { font-size: 1.75rem; margin-bottom: 1rem; }
p { margin: 0 0 1rem; }
blockquote {
  margin: 1.5rem 0; padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--firefly);
  font-family: var(--serif); font-size: 1.35rem; line-height: 1.4;
}
blockquote cite { display: block; margin-top: .5rem; font-family: var(--sans); font-size: .9rem; font-style: normal; color: var(--muted); }

/* ---------- legal pages ---------- */
.doc { padding: 1rem 0 3rem; }
.doc h1 { font-size: 2.2rem; margin: 1rem 0 .25rem; }
.doc h2 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
.doc .meta { color: var(--muted); font-size: .95rem; }
.doc ul { padding-left: 1.25rem; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 max(2.5rem, env(safe-area-inset-bottom));
  color: var(--muted); font-size: .9rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center;
}
footer a { color: var(--muted); display: inline-flex; min-height: 44px; align-items: center; }

/* phones and tall screens get a portrait sky so the fireflies aren't cropped away */
@media (max-aspect-ratio: 4/5) {
  body {
    background:
      url("assets/sky-tall.svg") center top / cover no-repeat fixed,
      linear-gradient(to bottom, var(--night) 0%, #00142F 45%, var(--navy) 100%) fixed;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* =========================================================
   Video intro version (index-video.html)
   The intro plays full-screen, then its last frame (the firefly sky)
   stays behind the page as the background.
   ========================================================= */
body.has-intro { background: transparent; }   /* let the fixed intro layer show through */
.intro-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: #000A1A url("assets/intro-end.jpg") center / cover no-repeat;
}
.intro-bg video { width: 100%; height: 100%; object-fit: cover; display: block; }

.intro-hero {
  min-height: 100vh; min-height: 100lvh;   /* full screen even when Safari's address bar shrinks, so the next section never peeks in */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 1rem; padding: 2rem 1.25rem;
  position: relative; isolation: isolate;   /* keeps the glow layered just behind the words, above the video */
}
/* soft dark pool behind the words so they read over the busy sky.
   It fades in WITH the title, so it never shows as an oval over the intro animation. */
.intro-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 60% 32% at 50% 50%, rgba(0,10,26,.72), rgba(0,10,26,0) 70%);
  opacity: 0; transition: opacity 1.6s ease;
}
.revealed .intro-hero::before { opacity: 1; }
.intro-hero h1 { font-size: clamp(2.4rem, 8vw, 4.2rem); letter-spacing: .01em; }
.intro-hero .tagline { font-size: 1.2rem; color: #C9D4E2; }
.intro-hero > * { position: relative; opacity: 0; transform: translateY(8px); transition: opacity 1.6s ease, transform 1.6s ease; }
.intro-hero > .tagline { transition-delay: .5s; }
.intro-hero > .scroll-cue { transition-delay: 1.1s; }
.revealed .intro-hero > * { opacity: 1; transform: none; }

.skip-intro {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  min-height: 44px; min-width: 44px; padding: 0 1rem;
  font: inherit; font-size: .9rem; color: var(--muted);
  background: rgba(0,10,26,.45); border: 1px solid var(--rule); border-radius: 99px; cursor: pointer;
  transition: opacity .6s ease;
}
.skip-intro:hover { color: var(--line); }
.skip-intro:focus-visible { outline: 2px solid var(--firefly); outline-offset: 3px; }
.revealed .skip-intro { opacity: 0; pointer-events: none; }

/* during the intro, keep the sections below out of sight; they appear with the title */
.has-intro .below { opacity: 0; transition: opacity 1.2s ease; }
.revealed .below { opacity: 1; }

/* the rest of the page scrolls up over the sky on a gentle dark veil, so text stays easy to read */
.below {
  background: linear-gradient(to bottom, rgba(0,10,26,0), rgba(0,14,33,.88) 140px, rgba(1,30,66,.94));
}

@media (prefers-reduced-motion: reduce) {
  .intro-hero > *, .intro-hero::before, .has-intro .below { transition: none; }
}

/* =========================================================
   Site navigation, project cards, buttons (added for the full layout)
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: max(.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) .5rem max(1.25rem, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(0,10,26,.85), rgba(0,10,26,0));
  transition: opacity 1.2s ease, background .4s ease;
}
.has-intro .nav { opacity: 0; pointer-events: none; }          /* hidden during the intro */
.revealed .nav { opacity: 1; pointer-events: auto; }
.nav.solid { background: rgba(0,10,26,.92); box-shadow: 0 1px 0 var(--rule); }
.nav .brand { display: flex; align-items: center; gap: .55rem; color: var(--line); text-decoration: none; min-height: 44px; }
.nav .brand img { width: 18px; height: auto; }
.nav .brand span { font-family: var(--serif); font-size: 1.05rem; }
.nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.nav ul a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: 0 .6rem; min-height: 44px; display: inline-flex; align-items: center; border-radius: 6px; }
.nav ul a:hover { color: var(--line); }
@media (max-width: 640px) {
  .nav .brand span { display: none; }                          /* phones: logo only, so the four links fit */
  .nav ul a { padding: 0 .4rem; font-size: .88rem; }
  .nav ul { gap: 0; }
}

/* section headings get room so the fixed nav doesn't cover them when jumping */
section[id] { scroll-margin-top: 4.5rem; }

/* project cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.card {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.25rem; border: 1px solid var(--rule); border-radius: 14px;
  background: rgba(0,10,26,.45); color: var(--line); text-decoration: none;
}
a.card:hover { border-color: rgba(195,235,55,.5); }
.card .thumb { aspect-ratio: 16 / 9; border-radius: 8px; background: var(--navy) url("assets/favicon.svg") center / 34% no-repeat; }
.card h3 { margin: .25rem 0 0; font-family: var(--serif); font-weight: 500; font-size: 1.25rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.tag { align-self: flex-start; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--firefly); border: 1px solid rgba(195,235,55,.4); border-radius: 99px; padding: .1rem .6rem; }

/* buttons */
.button {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; padding: 0 1.4rem;
  border-radius: 99px; background: var(--firefly); color: #0B1A05; font-weight: 600; text-decoration: none;
}
.button:hover { filter: brightness(1.08); text-decoration: none; }
.button.ghost { background: transparent; color: var(--line); border: 1px solid var(--rule); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

/* fact sheet (press page) */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 1rem 0 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }

/* real game art on cards: pixel art stays crisp when scaled */
.card .thumb.pixel { background-color: #000; background-size: contain; background-repeat: no-repeat; background-position: center; image-rendering: pixelated; }

/* section headers (pattern borrowed from lumicreative.com):
   small uppercase label above, header, then a short green dash with room before the text */
.eyebrow { margin: 0 0 .35rem; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--firefly); }
section h2::after {
  content: ""; display: block;
  width: 2.25rem; height: 2px; margin-top: .9rem; margin-bottom: 1.5rem;
  background: var(--firefly);   /* same color and 2px thickness as the quote line, no glow */
}
section h2 { margin-bottom: 0; }

/* cards: picture runs edge to edge across the top, text padded below */
.card { padding: 0 0 1.25rem; overflow: hidden; gap: .5rem; }
.card .thumb { border-radius: 0; }
.card > :not(.thumb) { margin-left: 1.25rem; margin-right: 1.25rem; }
.card .tag { margin-top: .5rem; }
