/* Falak Games — shared styles */
:root {
  --bg: #0d0b1e;
  --panel: #141130;
  --panel-2: #0a0818;
  --line: #2a2450;
  --text: #eae6ff;
  --muted: #9d97c9;
  --yellow: #ffd93d;
  --gold: #ffd93d;
  --magenta: #ff6bd6;
  --cyan: #4de1ff;
  --green: #58e38a;
  --red: #ff5470;
  --shadow: #060414;
  --nav-bg: rgba(13, 11, 30, 0.88);
  --ad-text: #c9c3e6;
  --h1-ghost: rgba(255, 107, 214, 0.25);
  --panel-drop: rgba(0, 0, 0, 0.5);
  --ghost-fill: transparent;
  --font-pixel: "Press Start 2P", monospace;
  --font-body: "VT323", monospace;
}

/* light-sky palette */
body[data-sky="day"] {
  --bg: #8ec9ee;
  --panel: #fffdf6;
  --panel-2: #e2ebf7;
  --line: #c2d2e4;
  --text: #1d2b45;
  --muted: #3e4d66;
  --yellow: #ffd93d;
  --gold: #8f5c00;
  --magenta: #d6459f;
  --cyan: #0e7aa8;
  --green: #17743d;
  --red: #d63657;
  --shadow: #223252;
  --nav-bg: rgba(255, 253, 246, 0.86);
  --ad-text: #3a4a66;
  --h1-ghost: rgba(255, 170, 40, 0.3);
  --panel-drop: rgba(34, 50, 82, 0.35);
  --ghost-fill: rgba(255, 253, 246, 0.75);
}

* { box-sizing: border-box; }

/* the hidden attribute must always win over display rules */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 21px;
  line-height: 1.45;
  overflow-x: hidden;
}

/* CRT scanlines + vignette; day keeps scanlines but drops the heavy night vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.14) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 10%, transparent 60%, rgba(0, 0, 0, 0.35) 100%);
}
body[data-sky="day"]::after {
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 10%, transparent 80%, rgba(0, 0, 0, 0.1) 100%);
}

canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

/* starfield */
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#stars i {
  position: absolute;
  width: var(--s, 2px);
  height: var(--s, 2px);
  background: #cfd8ff;
  opacity: 0.25;
  animation: twinkle var(--t, 3s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.85; }
}

main { position: relative; z-index: 1; padding-bottom: 88px; }

/* ---------- nav ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 28px;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.logo canvas { width: 26px; height: 26px; }
.logo b { color: var(--gold); }
nav .links {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
nav .links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 22px;
  letter-spacing: 0.04em;
}
nav .links a:hover { color: var(--cyan); text-shadow: 0 0 8px rgba(77, 225, 255, 0.6); }
nav .links a.active { color: var(--gold); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--shadow);
  background: var(--yellow);
  border: 0;
  padding: 13px 18px;
  cursor: pointer;
  box-shadow: 0 5px 0 #b8951a, 0 5px 0 2px var(--shadow);
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b8951a, 0 1px 0 2px var(--shadow); }
.btn.ghost {
  color: var(--cyan);
  background: var(--ghost-fill);
  border: 2px solid var(--cyan);
  box-shadow: 0 5px 0 rgba(77, 225, 255, 0.25), 0 5px 0 2px var(--shadow);
}
.btn.small { font-size: 10px; padding: 10px 14px; }
.btn.magenta { background: var(--magenta); box-shadow: 0 5px 0 #b23a96, 0 5px 0 2px var(--shadow); color: #2b0323; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.6); }
.btn[disabled]:active { transform: none; }

/* ---------- hero ---------- */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 90px 28px 60px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}
.kicker {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--green);
  letter-spacing: 0.08em;
  border: 2px solid var(--line);
  background: var(--panel);
  padding: 9px 12px;
  margin-bottom: 26px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
h1 {
  font-family: var(--font-pixel);
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1.35;
  margin: 0 0 18px;
  color: var(--text);
  text-shadow: 4px 4px 0 var(--shadow), 8px 8px 0 var(--h1-ghost);
}
h1 .accent { color: var(--gold); }
h1 .cursor::after {
  content: "▮";
  color: var(--cyan);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.hero .lede,
.page-hero .lede {
  font-size: 26px;
  color: var(--muted);
  margin: 0 0 30px;
  max-width: 46ch;
}
.hero .cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; align-items: center; }
.cta .open-note {
  font-size: 22px;
  color: var(--cyan);
  text-decoration: none;
}
.cta .open-note:hover { color: var(--gold); }

/* inner-page hero (join us) */
.page-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 80px 28px 46px;
  text-align: center;
}
.page-hero .lede { margin-left: auto; margin-right: auto; }
.page-hero .cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-art { position: relative; height: 380px; }
.hero-art .planet-wrap {
  position: absolute;
  top: 40px;
  right: 20px;
  width: 230px;
  height: 230px;
}
.hero-art .planet-wrap > canvas { width: 100%; height: 100%; }
.hero-art .orbit {
  position: absolute;
  inset: 0;
  animation: spin 9s linear infinite;
}
.hero-art .orbit canvas {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 16px;
  height: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero-art .falcon {
  position: absolute;
  left: 8%;
  bottom: 24px;
  width: 128px;
  height: 128px;
  animation: float 3.2s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ---------- sections ---------- */
section { max-width: 1100px; margin: 0 auto; padding: 72px 28px 0; }

.sec-head { margin-bottom: 34px; }
.sec-head h2 {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 2.4vw, 22px);
  margin: 0 0 10px;
  color: var(--text);
  text-shadow: 3px 3px 0 var(--shadow);
}
.sec-head h2::before { content: "◆ "; color: var(--cyan); }
.sec-head p { margin: 0; color: var(--muted); font-size: 22px; }

/* games grid */
.games {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.card {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 7px 7px 0 var(--shadow);
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 10px 10px 0 var(--shadow);
  border-color: var(--cyan);
}
.card .cover { display: block; width: 100%; height: auto; background: var(--panel-2); }
.card .body { padding: 18px 20px 22px; }
.card h3 {
  font-family: var(--font-pixel);
  font-size: 14px;
  margin: 0 0 8px;
  color: var(--text);
}
.card .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tag {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 6px 8px;
  border: 2px solid var(--line);
  color: var(--muted);
}
.tag.out { color: #0d2818; background: var(--green); border-color: var(--green); }
body[data-sky="day"] .tag.out { color: #eaf7ee; }
.tag.demo { color: #04222e; background: var(--cyan); border-color: var(--cyan); }
.tag.wish { color: #2b0323; background: var(--magenta); border-color: var(--magenta); }
.card p.desc { margin: 12px 0 0; color: var(--muted); font-size: 20px; }

/* ---------- quest board — live embedded recruiting panel ---------- */
.questboard {
  filter: drop-shadow(9px 10px 0 var(--panel-drop));
  background: var(--line);
  padding: 2px;
  clip-path: polygon(
    0 14px, 14px 0, calc(100% - 14px) 0, 100% 14px,
    100% calc(100% - 14px), calc(100% - 14px) 100%,
    14px 100%, 0 calc(100% - 14px)
  );
}
.qb-inner {
  background: var(--panel);
  clip-path: polygon(
    0 13px, 13px 0, calc(100% - 13px) 0, 100% 13px,
    100% calc(100% - 13px), calc(100% - 13px) 100%,
    13px 100%, 0 calc(100% - 13px)
  );
  overflow: hidden;
}
.qb-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 18px 14px;
}
.qb-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.qb-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}
.qb-live i {
  width: 8px;
  height: 8px;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(88, 227, 138, 0.25);
}
.qb-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 21px;
}
.qb-foot a { color: var(--gold); text-decoration: none; }
.qb-foot a:hover { text-shadow: 0 0 8px rgba(255, 217, 61, 0.5); }

/* the quest scroll: the job ad rendered as native themed content */
.scroll-body {
  direction: rtl;
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.95;
  color: var(--ad-text);
}
.scroll-section { padding: 28px 38px 24px; }
.scroll-section + .scroll-section { border-top: 2px dashed var(--line); }
.scroll-h {
  margin: 0 0 16px;
  font-weight: 700;
  font-size: 23px;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
}
.scroll-h::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--yellow);
  flex: none;
}
.scroll-p { margin: 0 0 14px; }
.scroll-p:last-child { margin-bottom: 0; }
.scroll-body b { font-weight: 700; color: var(--text); }
.scroll-list { list-style: none; margin: 0 0 8px; padding: 0; }
.scroll-list li { padding: 5px 0; }
.scroll-list li::before { content: "◂ "; color: var(--cyan); }
.fact-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-top: 2px solid var(--line);
}
.fact {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--cyan);
  border: 2px solid var(--line);
  background: var(--panel-2);
  padding: 10px 12px;
}
.apply-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-top: 2px solid var(--line);
  scroll-margin-top: 90px;
}
.apply-row .btn {
  font-size: 14px;
  padding: 16px 22px;
}
/* falcon hovering idle beside the apply button */
.falcon-chat { position: relative; flex: none; }
/* when the apply row scrolls out of view she pins to the viewport corner */
.falcon-chat.detached {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 40;
}
.hover-falcon {
  width: 84px;
  height: 84px;
  flex: none;
  animation: float 3.2s ease-in-out infinite;
}
.bubble {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  width: min(300px, 62vw);
  background: #fff;
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 10px 14px;
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.8;
  /* the bubble stays white in both themes, so the text is pinned dark */
  color: var(--shadow);
  white-space: pre-line;
  text-align: right;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.25s ease;
  animation: bubble-glow 2.4s ease-in-out infinite;
}
.bubble:hover { border-color: var(--yellow); }
.bubble.pop { animation: bubble-pop 0.28s ease, bubble-glow 2.4s ease-in-out infinite; }
.bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 22px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: rotate(45deg);
}
/* soft yellow pulse so the bubble asks for clicks */
@keyframes bubble-glow {
  0%, 100% { box-shadow: 4px 4px 0 var(--shadow), 0 0 0 0 rgba(255, 217, 61, 0); }
  50% { box-shadow: 4px 4px 0 var(--shadow), 0 0 16px 3px rgba(255, 217, 61, 0.55); }
}
/* quick squish when clicked */
@keyframes bubble-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
.form-note {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
  color: var(--muted);
}
.qb-live.soon { color: var(--magenta); }
.qb-live.soon i { background: var(--magenta); box-shadow: 0 0 0 2px rgba(255, 107, 214, 0.25); }

/* role buttons on the join page */
#quests .sec-head { margin-bottom: 26px; }
/* the no-matching-role teaser rides the fold: the vh-based margin keeps a
   constant ~70px peek (title visible) on any desktop viewport height */
#general { margin-top: clamp(24px, calc(100vh - 714px), 640px); }
.role-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 900px;
  margin: 0 auto 24px;
}
.role-btn {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font: inherit;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 26px 30px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.15s ease;
}
.role-btn:hover {
  transform: translate(-2px, -2px);
  border-color: var(--cyan);
  box-shadow: 8px 8px 0 var(--shadow);
}
.role-btn canvas { width: 52px; height: 52px; flex: none; }
.role-btn.soon canvas { opacity: 0.45; filter: grayscale(0.7); }
.role-btn h3 {
  font-family: var(--font-pixel);
  font-size: 16px;
  margin: 0;
  line-height: 1.6;
}
.role-btn .meta { display: flex; align-items: center; gap: 8px; }
.role-btn .go { margin-left: auto; flex: none; }
.role-btn .go.soon {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.role-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
/* the clickable role breathes (cosine) to signal itself; sticks to the last hovered card */
.role-btn.pulse { animation: role-breathe 2.4s ease-in-out infinite; }
@keyframes role-breathe {
  0%, 100% { scale: 1; }
  50% { scale: 1.02; }
}

/* role page heading */
.role-head {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 28px 30px;
}
.role-head .kicker { margin-bottom: 18px; }
.role-head h1 { margin-bottom: 0; }
.role-head .meta { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* placeholder shown when a role's scroll isn't live yet */
.scroll-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 84px 24px;
}
.scroll-placeholder canvas { width: 88px; height: 70px; }
.scroll-placeholder h4 {
  font-family: var(--font-pixel);
  font-size: 13px;
  margin: 0;
  color: var(--text);
}
.scroll-placeholder p {
  margin: 0;
  color: var(--muted);
  font-size: 21px;
  max-width: 48ch;
}

/* ---------- hiring teaser (home) ---------- */
.teaser {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  background: var(--panel-2);
  border: 2px solid var(--line);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 22px 30px;
}
.teaser canvas { width: 84px; height: 84px; flex: none; }
.teaser h3 {
  font-family: var(--font-pixel);
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--yellow);
  text-shadow: 2px 2px 0 var(--shadow);
}
body[data-sky="day"] .teaser h3 { color: var(--gold); }
.teaser p { margin: 0 0 12px; color: var(--muted); font-size: 22px; max-width: 52ch; }
.teaser .cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---------- about ---------- */
.about {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: center;
}
.about .art { position: relative; text-align: center; }
.about .art canvas { width: 200px; height: 200px; }
.about .art .badge-n {
  position: absolute;
  right: 12%;
  bottom: 6%;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--shadow);
  background: var(--yellow);
  padding: 6px 8px;
  animation: pulse 2s ease-in-out infinite;
}
.about p { color: var(--muted); font-size: 22px; margin: 0 0 16px; }
.about p b { color: var(--text); }
.team-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
}
.team-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 18px 22px;
}
.team-card canvas { width: 44px; height: 44px; flex: none; }
.team-card .role-icon { width: 40px; height: 40px; margin-left: auto; opacity: 0.85; }
.team-card h3 {
  font-family: var(--font-pixel);
  font-size: 13px;
  margin: 0 0 6px;
  line-height: 1.6;
}
.team-card p { margin: 0; color: var(--muted); font-size: 20px; }
.team-card a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.team-card a:hover { text-shadow: 0 0 8px rgba(77, 225, 255, 0.6); }
/* steam games shipped by S */
.shipped { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.shipped a {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--cyan);
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 7px 9px;
  text-decoration: none;
}
.shipped a:hover { border-color: var(--cyan); text-shadow: none; }
.team-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 20px;
}
.scroll-lead {
  margin: 0;
  padding: 24px 34px 0;
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--muted);
}
.scroll-lead a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.scroll-lead a:hover { text-shadow: 0 0 8px rgba(77, 225, 255, 0.6); }

/* ---------- footer ---------- */
footer {
  position: relative;
  z-index: 1;
  border-top: 2px solid var(--line);
  background: var(--panel-2);
  padding: 20px 28px 24px;
  text-align: center;
}
footer .socials { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
footer .socials a {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  border: 2px solid var(--line);
  padding: 8px 12px;
}
footer .socials a:hover { color: var(--gold); border-color: var(--gold); }
footer p { color: var(--muted); font-size: 18px; margin: 3px 0 0; }
footer .build {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-top: 10px;
}
footer .hearts { color: var(--red); }

/* ---------- sky: day/night cycle ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.sky-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 2.5s ease;
}
.sky-layer.night { background: linear-gradient(to bottom, #06051a 0%, #12102e 45%, #241c50 80%, #33265e 100%); }
.sky-layer.day { background: linear-gradient(to bottom, #3f9fe8 0%, #7ec4f0 55%, #c9e9ff 100%); }
body[data-sky="night"] .sky-layer.night { opacity: 1; }
body[data-sky="day"] .sky-layer.day { opacity: 1; }

/* stars fade out as the sun rises */
#stars { transition: opacity 2s ease; }
body[data-sky="day"] #stars { opacity: 0; }

/* drifting pixel clouds, gone by night */
.clouds {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 2s ease;
}
body[data-sky="day"] .clouds { opacity: 1; }
.cloud { position: absolute; animation: drift linear infinite; }

/* roaming falcon on the inner pages: flight path is driven by sprites.js */
.flyer {
  position: absolute;
  top: 0;
  left: 0;
  width: 76px;
  height: 76px;
  z-index: 0;
  pointer-events: none;
}
.cloud.c1 { top: 11%; width: 150px; animation-duration: 95s; animation-delay: -20s; }
.cloud.c2 { top: 29%; width: 100px; animation-duration: 140s; animation-delay: -80s; }
.cloud.c3 { top: 52%; width: 190px; animation-duration: 115s; animation-delay: -50s; }
@keyframes drift {
  from { transform: translateX(-220px); }
  to { transform: translateX(110vw); }
}

/* hero art: moon by night, sun by day; each with a small companion in orbit */
.hero-art .planet-wrap > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 1.6s ease;
}
.planet-wrap > canvas[data-sprite="moon-big"] { opacity: 0; }
body[data-sky="night"] .planet-wrap > canvas[data-sprite="moon-big"] { opacity: 1; }
.planet-wrap > canvas.sun {
  opacity: 0;
  inset: auto;
  left: 50%;
  top: 50%;
  /* 14px sprite grid with a 12px disc, scaled so the disc matches the 12px moon at 230px */
  width: 268px;
  height: 268px;
  transform: translate(-50%, -50%);
}
body[data-sky="day"] .planet-wrap > canvas.sun { opacity: 1; }
.hero-art .orbit {
  position: absolute;
  inset: 0;
  animation: spin 9s linear infinite;
  transition: opacity 1.6s ease;
}
.hero-art .orbit canvas {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 16px;
  height: 16px;
}
.orbit.orbit-moon { opacity: 0; }
body[data-sky="day"] .orbit.orbit-moon { opacity: 1; }
.orbit.orbit-planet {
  opacity: 0;
  animation-direction: reverse;
  animation-duration: 13s;
}
.orbit.orbit-planet canvas { width: 24px; height: 24px; }
body[data-sky="night"] .orbit.orbit-planet { opacity: 1; }

/* sky mode toggle (nav) */
.sky-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 2px solid var(--line);
  cursor: pointer;
}
.sky-toggle:hover { border-color: var(--cyan); }
.sky-toggle canvas { display: none; width: 20px; height: 20px; }
body[data-sky="day"] .sky-toggle .i-sun { display: block; }
body[data-sky="night"] .sky-toggle .i-moon { display: block; }

/* smooth surface recolors between phases */
body,
nav,
.qb-inner,
.fact,
.kicker,
.tag,
.team-card,
footer,
.scroll-body {
  transition: background-color 1.4s ease, color 1.4s ease, border-color 1.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .cloud,
  #stars i,
  .hero-art .falcon,
  .hero-art .orbit,
  .kicker,
  .qb-live,
  .role-btn.pulse,
  .hover-falcon,
  .bubble {
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .hero-art { height: 300px; }
  .planet-wrap { transform: scale(0.75); transform-origin: top right; }
  .hero-art .falcon { width: 96px; height: 96px; left: 4%; }
  .games { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  nav { gap: 12px; padding: 12px 16px; }
  nav .btn { margin-left: auto; }
  /* h1 drops to 24px here; keep the shadow offsets proportional (desktop: 4/8 at 40px) */
  h1 { text-shadow: 2px 2px 0 var(--shadow), 4px 4px 0 var(--h1-ghost); }
  /* section h2 drops to 16px (desktop: 3px at 22px) */
  .sec-head h2 { text-shadow: 2px 2px 0 var(--shadow); }
  .logo { font-size: 11px; }
  .logo canvas { width: 22px; height: 22px; }
  .flyer { width: 52px; height: 52px; }
  .hover-falcon { width: 64px; height: 64px; }
  .bubble { font-size: 13px; }
  nav .btn.small { font-size: 9px; padding: 8px 10px; }
  .sky-toggle { flex: none; }
  nav .links { display: none; }
  /* keep the no-matching-role teaser title peeking at the mobile fold;
     the heart icon drops below the text so the title leads */
  #general { margin-top: 16px; }
  #general div { order: 1; }
  #general canvas { order: 2; width: 40px; height: 40px; }
  .page-hero .lede { font-size: 21px; margin-bottom: 20px; }
}
