/* RusmelGames - site styles.
   Colours come from the Chainstorm palette (docs/mockups/stormcaller-palette.md in the game project).
   To re-skin the site, change the tokens in :root; the header toy has its own copy in assets/js/storm.js. */

@font-face {
  font-family: "Fusion Pixel";
  src: url("../fonts/fusion-pixel-12px-proportional-latin-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #070912;          /* hud_bg */
  --surface: #0d1120;
  --line: #222a48;        /* cloud_rim */
  --frame: #5a6680;       /* hud_frame: outlines, 3.45:1 on bg */
  --text: #d6deea;
  --text-strong: #eef4ff; /* bolt_light */
  --muted: #8f9bb1;       /* a step above hud_sec, 6.9:1 on bg */
  --accent: #9eb0f6;      /* bolt_glow: the lightning blue */
  --accent-ink: #070912;
  --spark: #fff2c4;       /* pop: Sparks */
  --spark-shade: #c89848; /* orb_shade */
  --amber: #ffc878;       /* warm_text */
  --focus: #a8f07a;       /* cursor lime: focus is where the input lands */
  --halo: #05060c;
  --sky: #10142a;

  --pixel: "Fusion Pixel", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 60rem;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--text-strong); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--pixel);
  font-weight: 400;
  color: var(--text-strong);
  line-height: 1.1;
  margin: 0;
}

/* The pixel font is drawn on a 12 px grid: keep its sizes at whole multiples of 12 px. */
h2 { font-size: 36px; margin-bottom: 1.25rem; }
h3 { font-size: 24px; }

p { margin: 0 0 1rem; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1rem;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-ink);
}
.skip:focus { top: 1rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- hero */

.hero-title {
  text-align: center;
  padding-block: 2.5rem 1.5rem;
}

.wordmark {
  font-size: 36px;
  letter-spacing: 1px;
  text-shadow: 3px 3px 0 var(--line);
}

.tagline {
  margin: 0.75rem 0 0;
  font-family: var(--pixel);
  font-size: 24px;
  line-height: 1.2;
  color: var(--accent);
}

/* The strip is 80 cells tall; the toy reads this height to pick a whole-number scale (2x, 3x, 4x). */
.stage {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--sky);
  border-block: 2px solid var(--line);
}

.storm {
  display: block;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.storm.is-live { cursor: crosshair; }
.storm.is-live.has-reticle { cursor: none; }
.storm:focus-visible { outline-offset: -4px; }

.sparks {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  padding: 2px 10px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 2px solid var(--line);
  font-family: var(--pixel);
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
}
.sparks b { font-weight: 400; color: var(--spark); min-width: 1ch; }
.orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--spark) 62%, var(--spark-shade) 62%);
  box-shadow: 0 0 0 2px var(--halo);
}
.sparks.is-bump .orb { transform: scale(1.35); }

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-block: 1.25rem 0;
}
.hero-meta {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.hint { margin: 0; color: var(--muted); font-size: 0.9375rem; }

/* ---------------------------------------------------------------- buttons */

.btn {
  position: relative;
  display: inline-block;
  padding: 10px 20px 12px;
  border: 2px solid var(--frame);
  background: var(--surface);
  color: var(--text-strong);
  font-family: var(--pixel);
  font-size: 24px;
  line-height: 1.1;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--halo);
}
.btn:hover { border-color: var(--accent); color: var(--text-strong); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--halo); }

.btn-primary {
  background: var(--accent);
  border-color: var(--text-strong);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--text-strong); color: var(--accent-ink); }

.toggle {
  padding: 4px 10px 6px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.toggle:hover { border-color: var(--frame); color: var(--text); }
.toggle [data-effects-state] { color: var(--text-strong); }

/* The crackle: two small arcs that jump at the button's corners while it is hovered or focused.
   Comfort: small, at most two blips a second, and only when effects are on (the toggle and the
   browser's reduced-motion setting both turn it off). */
.btn::before,
.btn::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 14px;
  background: var(--text-strong);
  clip-path: polygon(0 45%, 50% 0, 40% 38%, 100% 28%, 34% 100%, 46% 58%);
  opacity: 0;
  pointer-events: none;
}
.btn::before { left: -10px; top: -9px; }
.btn::after { right: -10px; bottom: -9px; transform: rotate(180deg); }

[data-effects="on"] .btn:hover,
[data-effects="on"] .btn:focus-visible {
  box-shadow: 4px 4px 0 var(--halo), 0 0 14px rgba(158, 176, 246, 0.45);
}
[data-effects="on"] .btn:hover::before,
[data-effects="on"] .btn:focus-visible::before { animation: crackle 1.1s steps(1, end) infinite; }
[data-effects="on"] .btn:hover::after,
[data-effects="on"] .btn:focus-visible::after { animation: crackle 1.1s steps(1, end) 0.35s infinite; }

@keyframes crackle {
  0%   { opacity: 0.9; }
  9%   { opacity: 0; }
  52%  { opacity: 0.55; }
  58%  { opacity: 0; }
  100% { opacity: 0; }
}

/* ---------------------------------------------------------------- sections */

.section { padding-block: 3rem 0; }
.section:last-of-type { padding-bottom: 3rem; }

.card {
  display: grid;
  gap: 0;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--halo);
}
.card-media {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  background: var(--sky);
  border-bottom: 2px solid var(--line);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.slot-note {
  position: absolute;
  left: 8px;
  bottom: 8px;
  margin: 0;
  padding: 2px 8px 4px;
  background: var(--bg);
  border: 2px solid var(--line);
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 12px;
  line-height: 1.2;
}
.card-body { padding: 1.25rem; }
.card-body h3 { font-size: 36px; margin-bottom: 0.75rem; }
.tag {
  margin: 0 0 0.75rem;
  font-family: var(--pixel);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--amber);
}
.pitch { margin-bottom: 1.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.social {
  display: inline-block;
  padding: 6px 14px 8px;
  border: 2px solid var(--frame);
  color: var(--text-strong);
  font-family: var(--pixel);
  font-size: 24px;
  line-height: 1.1;
  text-decoration: none;
}
.social[href]:hover { border-color: var(--accent); color: var(--accent); }
/* A social link with no address yet (see assets/js/config.js). */
.social:not([href]) { border-color: var(--line); color: var(--muted); }
.social:not([href])::after { content: " - soon"; }

.newsletter {
  margin-top: 2rem;
  padding: 1.25rem;
  border: 2px solid var(--line);
  background: var(--surface);
}
.newsletter label { display: block; margin-bottom: 0.5rem; }
.newsletter-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.newsletter input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--frame);
  background: var(--bg);
  color: var(--text-strong);
  font: inherit;
}
.small { font-size: 0.875rem; color: var(--muted); }

.contact-mail {
  font-family: var(--pixel);
  font-size: 24px;
  overflow-wrap: anywhere;
}

.footer {
  margin-top: 3rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.footer p { margin-bottom: 0.5rem; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text-strong); }
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

/* ---------------------------------------------------------------- press kit */

.topbar {
  border-bottom: 2px solid var(--line);
  background: var(--sky);
}
.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.75rem;
}
.topbar-home {
  font-family: var(--pixel);
  font-size: 24px;
  color: var(--text-strong);
  text-decoration: none;
}
.topbar-home:hover { color: var(--accent); }
.topbar-note { margin: 0; font-family: var(--pixel); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

.press-head { padding-block: 2.5rem 0; }
.press-head h1 { font-size: 48px; }
.press-head .lede { margin: 0.75rem 0 1.25rem; max-width: 40rem; font-size: 1.1875rem; color: var(--text-strong); }

.prose { max-width: 42rem; }
.prose h3 { margin: 1.75rem 0 0.5rem; }
.prose h3:first-child { margin-top: 0; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.35rem; }

.facts {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  border: 2px solid var(--line);
  background: var(--surface);
}
.facts > div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 2px solid var(--line);
}
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text-strong); overflow-wrap: anywhere; }

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.slot {
  position: relative;
  margin: 0;
  background: var(--sky);
  border: 2px solid var(--line);
}
.slot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; }
.slot a { display: block; }
.slot a:hover img { outline: 2px solid var(--accent); outline-offset: -2px; }
.slot figcaption,
.slot-caption {
  padding: 0.5rem 0.75rem;
  border-top: 2px solid var(--line);
  background: var(--surface);
  font-size: 0.875rem;
  color: var(--muted);
}

.logo-slot {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  padding: 1rem;
  background:
    repeating-conic-gradient(var(--surface) 0% 25%, var(--sky) 0% 50%) 0 0 / 16px 16px;
  font-family: var(--pixel);
  font-size: 24px;
  color: var(--muted);
  text-align: center;
}
.logo-slot img { max-height: 100%; width: auto; aspect-ratio: auto; object-fit: contain; }

.trailer {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  max-width: 48rem;
  background: var(--sky);
  border: 2px solid var(--line);
  text-align: center;
}
.trailer p { margin: 0; padding: 1rem; font-family: var(--pixel); font-size: 24px; color: var(--muted); }
.trailer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------------------------------------------------------------- wider screens */

@media (min-width: 420px) {
  .wordmark { font-size: 48px; letter-spacing: 2px; text-shadow: 4px 4px 0 var(--line); }
}

@media (min-width: 560px) {
  .stage { height: 240px; }
  .sparks { top: 12px; right: 12px; }
  .facts > div { grid-template-columns: 11rem 1fr; }
}

@media (min-width: 760px) {
  .hero-title { padding-block: 3.5rem 2rem; }
  .wordmark { font-size: 72px; letter-spacing: 3px; text-shadow: 6px 6px 0 var(--line); }
  .tagline { font-size: 36px; }
  .press-head h1 { font-size: 72px; }
  .card { grid-template-columns: 1.25fr 1fr; }
  .card-media { aspect-ratio: auto; min-height: 100%; border-bottom: 0; border-right: 2px solid var(--line); }
  .card-media img { position: absolute; inset: 0; }
  .card-body { padding: 1.75rem; align-self: center; }
}

@media (min-width: 1400px) {
  .stage { height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
