/* Shared foundation for both the game and the written pages: design tokens,
   the reset, focus rings and the handful of components that appear on every
   page (the wordmark, buttons, keycaps).

   Everything here is safe on a normal scrolling document. The game's own
   fixed-viewport lockdown — no scrolling, no touch panning, no overscroll —
   lives in style.css, which only the game loads. Keeping the two apart is
   what stops an article page inheriting behaviour meant for a playfield. */

:root {
  --cyan:   #22e0ff;
  --magenta:#ff3d9e;
  --purple: #b45cff;
  --lime:   #35ee7a;
  --amber:  #ffc14d;
  --red:    #ff3d6e;
  --ink:    #06070f;
  --glass:  rgba(10, 14, 32, .72);
  --edge:   rgba(120, 200, 255, .28);
  --font-display: 'Orbitron', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-ui: 'Rajdhani', ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--ink);
  color: #dff2ff;
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* One visible focus ring for every control, so keyboard users can always see
   where they are. :focus-visible keeps it off mouse and touch presses. */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 8px;
}
.cta:focus-visible {
  outline-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(34, 224, 255, .45), 0 0 26px rgba(34, 224, 255, .5);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── logo ──────────────────────────────────────────────────────────── */
.logo {
  position: relative;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(46px, 13vw, 104px);
  letter-spacing: clamp(4px, 1.4vw, 14px);
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 6%, var(--cyan) 42%, var(--purple) 76%, var(--magenta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(60, 200, 255, .55)) drop-shadow(0 0 46px rgba(180, 92, 255, .45));
  animation: logo-pulse 3.6s ease-in-out infinite;
}
.logo::before,
.logo::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--magenta);
  opacity: .5;
  mix-blend-mode: screen;
  animation: glitch 4.5s steps(1) infinite;
}
.logo::after { color: var(--cyan); animation-delay: .22s; }

@keyframes logo-pulse {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(60, 200, 255, .45)) drop-shadow(0 0 40px rgba(180, 92, 255, .35)); }
  50%      { filter: drop-shadow(0 0 26px rgba(60, 200, 255, .75)) drop-shadow(0 0 66px rgba(255, 61, 158, .5)); }
}
@keyframes glitch {
  0%, 88%, 100% { transform: none; opacity: 0; }
  89% { transform: translate(-3px, 1px); opacity: .55; }
  91% { transform: translate(3px, -2px); opacity: .4; }
  93% { transform: translate(-2px, -1px); opacity: .5; }
  95% { transform: none; opacity: 0; }
}

/* ── buttons ───────────────────────────────────────────────────────── */
.cta {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(15px, 3.4vw, 20px);
  letter-spacing: .18em;
  color: #041018;
  padding: 15px 34px;
  min-width: 250px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(100deg, var(--cyan), #7ee8ff 30%, var(--purple) 72%, var(--magenta));
  background-size: 220% 100%;
  box-shadow: 0 0 26px rgba(80, 210, 255, .5), 0 10px 30px rgba(0, 0, 0, .5);
  transition: transform .12s ease, box-shadow .2s ease, background-position .5s ease;
  animation: sheen 6s linear infinite;
}
@keyframes sheen { 0% { background-position: 0% 50% } 100% { background-position: 220% 50% } }
.cta:hover  { transform: translateY(-2px) scale(1.02); box-shadow: 0 0 40px rgba(120, 220, 255, .75), 0 14px 34px rgba(0,0,0,.55); }
.cta:active { transform: translateY(1px) scale(.99); }

.cta.ghost {
  background: transparent;
  color: rgba(190, 225, 255, .8);
  border: 1px solid var(--edge);
  box-shadow: none;
  animation: none;
  font-size: clamp(12px, 2.8vw, 15px);
  padding: 11px 26px;
  min-width: 200px;
}
.cta.ghost:hover { color: #fff; border-color: rgba(140, 220, 255, .7); box-shadow: 0 0 22px rgba(80, 200, 255, .28); }

.cta.ghost.small {
  min-width: 0;
  padding: 9px 22px;
  font-size: clamp(11px, 2.4vw, 13px);
  letter-spacing: .2em;
}

kbd {
  font-family: var(--font-display);
  font-size: 10px;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid rgba(130, 190, 255, .3);
  background: rgba(120, 190, 255, .09);
  color: #cfe9ff;
  box-shadow: 0 2px 0 rgba(80, 150, 220, .22);
  white-space: nowrap;
}

/* ── site footer ───────────────────────────────────────────────────── */
/* Shared by the title screen and every written page, so the same set of
   links is one edit away from being consistent everywhere. */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
  margin-bottom: 16px;
}
.site-nav a {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-bottom: 0;
  text-decoration: none;
  color: rgba(160, 200, 245, .72);
}
.site-nav a:hover { color: #fff; }

.fineprint {
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(140, 180, 220, .5);
  max-width: 60ch;
  margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .logo, .logo::before, .logo::after, .cta { animation: none !important; }
}
