/* Wyldring website. The game's palette, its own 5x7 pixel font for headings
   (fonts/wyldring-pixel.woff, built by game/tools/build_site_font.mjs) and
   notched pixel panels. Pixel-font sizes are multiples of 8px so every font
   pixel lands on whole screen pixels. */
@font-face {
  font-family: "Wyldring Pixel";
  src: url("fonts/wyldring-pixel.woff") format("woff");
  font-display: swap;
}

:root {
  --ink: #130e22;
  --bg: #1a1430;
  --bg-2: #211a3c;
  --panel: #2b2547;
  --panel-hi: #3d3566;
  --panel-lo: #221d3d;
  --cream: #fff1d6;
  --text: #ece5f8;
  --muted: #b7aed6;
  --gold: #ffd45a;
  --gold-lo: #c98a14;
  --moss: #a6e04a;
  --moss-lo: #5f9a24;
  --teal: #7ee8c8;
  --pink: #ff8ec0;
  --px: 4px;
  --wrap: 1180px;
  --pixel: "Wyldring Pixel", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --notch: polygon(var(--px) 0, calc(100% - var(--px)) 0, 100% var(--px), 100% calc(100% - var(--px)),
    calc(100% - var(--px)) 100%, var(--px) 100%, 0 calc(100% - var(--px)), 0 var(--px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--gold); color: var(--ink); font-weight: 700; }
.skip:focus { top: 12px; }

/* Headings: the game's pixel font, chunky ink drop shadow. */
h1, h2, h3, .pixel {
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: 40px; color: var(--cream); text-shadow: 0 var(--px) 0 var(--ink); }
h2 { font-size: 32px; color: var(--gold); text-shadow: 0 var(--px) 0 var(--ink); }
h3 { font-size: 24px; color: var(--cream); text-shadow: 0 3px 0 var(--ink); }
p { margin: 0 0 1em; }
.lede { font-size: 19px; color: var(--text); }
.muted { color: var(--muted); }
.eyebrow { display: inline-block; font-family: var(--pixel); font-size: 16px; color: var(--teal); margin-bottom: 14px; }

/* Pixel panel: notched corners, ink border, a lit top row and a shaded bottom row. */
.panel {
  background: var(--panel);
  border: var(--px) solid var(--ink);
  box-shadow: inset 0 var(--px) 0 var(--panel-hi), inset 0 calc(-1 * var(--px)) 0 var(--panel-lo);
  clip-path: var(--notch);
}

/* Buttons: pixel label, chunky lip. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 20px 14px;
  font: 16px/1 var(--pixel); color: var(--ink); background: var(--gold); text-decoration: none;
  border: var(--px) solid var(--ink);
  box-shadow: inset 0 calc(-1 * var(--px)) 0 var(--gold-lo), inset 0 var(--px) 0 #fff3c4;
  clip-path: var(--notch);
  cursor: pointer; transition: transform .08s ease, filter .08s ease;
}
.btn:hover { color: var(--ink); filter: brightness(1.08); transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn.moss { background: var(--moss); box-shadow: inset 0 calc(-1 * var(--px)) 0 var(--moss-lo), inset 0 var(--px) 0 #e2ffaa; }
.btn.ghost { background: var(--panel-hi); color: var(--cream); box-shadow: inset 0 calc(-1 * var(--px)) 0 var(--panel), inset 0 var(--px) 0 #5a4d94; }
.btn.ghost:hover { color: var(--cream); }
.btn[aria-disabled="true"] { cursor: default; transform: none; filter: saturate(.85); }
.btn svg { width: 20px; height: 20px; flex: none; shape-rendering: crispEdges; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(19, 14, 34, .9);
  backdrop-filter: blur(8px);
  border-bottom: var(--px) solid var(--ink);
}
.top .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: block; flex: none; }
.brand img { height: 44px; width: auto; image-rendering: pixelated; }
.top nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.top nav a:not(.btn) { color: var(--cream); text-decoration: none; font: 16px/1 var(--pixel); padding: 8px 0; }
.top nav a:not(.btn):hover { color: var(--gold); }
.top .btn { min-height: 40px; padding: 8px 14px 10px; }

/* Hero: gameplay looping full-bleed behind the pitch, faded into the page (the still shows until it plays). */
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: min(88vh, 860px); display: grid; align-items: center; border-bottom: var(--px) solid var(--ink); }
.hero-bg { position: absolute; inset: 0; z-index: -2; background: var(--bg); }
.hero-bg img, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.hero-bg img { opacity: .75; transition: opacity 1.2s ease; }
.hero-bg:has(.hero-video.on) img { opacity: 0; }
.hero-video { opacity: 0; transition: opacity 1.2s ease; filter: saturate(1.1); }
.hero-video.on { opacity: .7; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(19, 14, 34, .9) 0%, rgba(19, 14, 34, .72) 34%, rgba(19, 14, 34, .25) 68%, rgba(19, 14, 34, .15) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(26, 20, 48, 0) 30%),
    linear-gradient(180deg, rgba(19, 14, 34, .6) 0%, rgba(19, 14, 34, 0) 18%);
}
.hero .wrap { padding: 64px 0 80px; }
.hero .pitch { max-width: 640px; }
.hero .logo { width: 462px; max-width: 100%; margin: 0 0 18px -6px; image-rendering: pixelated; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .35)); }
.hero h1 { max-width: 15ch; }
.hero .lede { max-width: 34em; }
.hero .cta { margin: 26px 0 18px; }
/* Home page: one logo. The hero carries the big logo, so the header drops its small one
   and centres the nav; the hero pitch is a centred column over a centred vignette.
   (Pages without a hero, like the press kit, keep the header logo.) */
body:has(.hero) .top .brand { display: none; }
body:has(.hero) .top .wrap { justify-content: center; }
body:has(.hero) .top nav { margin-left: 0; }
.hero .wrap { text-align: center; }
.hero .pitch { max-width: 780px; margin-inline: auto; }
.hero .logo { width: 560px; margin: 0 auto 22px; }
.hero h1 { max-width: 18ch; margin-inline: auto; }
.hero .lede { margin-inline: auto; }
.hero .cta { justify-content: center; }
.hero::before {
  background:
    radial-gradient(ellipse 70% 75% at 50% 48%, rgba(19, 14, 34, .82) 0%, rgba(19, 14, 34, .62) 45%, rgba(19, 14, 34, .3) 80%, rgba(19, 14, 34, .2) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(26, 20, 48, 0) 30%),
    linear-gradient(180deg, rgba(19, 14, 34, .6) 0%, rgba(19, 14, 34, 0) 18%);
}
.status { display: inline-flex; align-items: center; gap: 10px; font: 16px/1.3 var(--pixel); color: var(--teal); }
.status::before { content: ""; width: 10px; height: 10px; background: var(--teal); box-shadow: 0 0 12px var(--teal); animation: blink 1.6s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status::before { animation: none; } .hero-video { transition: none; } }

.vid-toggle {
  position: absolute; right: 16px; bottom: 16px; z-index: 1; width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center; border: var(--px) solid var(--ink); background: rgba(19, 14, 34, .75); color: var(--cream); cursor: pointer;
}
.vid-toggle svg { width: 18px; height: 18px; shape-rendering: crispEdges; }
.vid-toggle .i-play { display: none; }
.vid-toggle[aria-pressed="false"] .i-play { display: block; }
.vid-toggle[aria-pressed="false"] .i-pause { display: none; }

/* Fact strip */
.facts-strip { background: var(--bg-2); border-bottom: var(--px) solid var(--ink); }
.facts-strip ul { list-style: none; margin: 0 auto; padding: 22px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.facts-strip li { display: flex; gap: 14px; align-items: center; }
.facts-strip b { font: 32px/1 var(--pixel); color: var(--gold); text-shadow: 0 3px 0 var(--ink); min-width: 2ch; text-align: center; }
.facts-strip span { font-size: 15px; line-height: 1.35; color: var(--text); }

section { padding: 88px 0; }
.section-head { max-width: 760px; margin-bottom: 40px; }
.alt { background: var(--bg-2); border-block: var(--px) solid var(--ink); }

/* Screenshots everywhere: ink frame, a little lift. */
.shot { display: block; position: relative; margin: 0; border: var(--px) solid var(--ink); background: var(--ink); box-shadow: 0 10px 0 rgba(0, 0, 0, .28); }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.shot .cap { position: absolute; left: 10px; bottom: 10px; padding: 6px 10px 7px; background: rgba(19, 14, 34, .85); font: 16px/1 var(--pixel); color: var(--cream); }

/* The world */
.world { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.rings { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 10px; }
.rings li { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; padding: 12px 16px; }
.rings b { font: 16px/1.2 var(--pixel); }
.rings li:nth-child(1) b { color: var(--moss); }
.rings li:nth-child(2) b { color: var(--gold); }
.rings li:nth-child(3) b { color: var(--pink); }
.rings li:nth-child(4) b { color: var(--teal); }
.rings span { font-size: 15.5px; line-height: 1.45; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 56px; }
.duo .panel { padding: 24px 24px 20px; }
.duo h3 { font-size: 24px; }
.gloom h3 { color: var(--teal); }
.radiant h3 { color: var(--gold); }
.duo p { margin: 0; font-size: 16px; }

/* Feature rows: big shot + words, alternating sides. */
.feature { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.feature + .feature { margin-top: 80px; }
.feature:nth-child(even) .media { order: 2; }
.feature h3 { font-size: 32px; color: var(--gold); text-shadow: 0 var(--px) 0 var(--ink); }
.feature .tag { display: inline-block; font: 16px/1 var(--pixel); color: var(--teal); margin-bottom: 12px; }
.feature ul { margin: 0; padding: 0; list-style: none; }
.feature li { position: relative; padding-left: 22px; margin: .35em 0; }
.feature li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; background: var(--moss); }
.media.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.media.pair .shot:first-child:nth-last-child(3) { grid-column: span 2; }

/* Play your way */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; }
.mode { padding: 28px 28px 24px; }
.mode .pixel { font-size: 16px; margin-bottom: 8px; }
.mode h3 { font-size: 32px; }
.mode.play h3 { color: var(--moss); }
.mode.official h3 { color: var(--teal); }
.mode p:last-child { margin-bottom: 0; }
.party { margin-top: 40px; }
.party img { aspect-ratio: 21 / 9; object-position: 50% 62%; }
@media (max-width: 560px) { .party img { aspect-ratio: 16 / 9; } }
.note-line { margin-top: 18px; font-size: 15px; color: var(--muted); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.gallery a { position: relative; grid-column: span 4; display: block; border: var(--px) solid var(--ink); background: var(--ink); overflow: hidden; }
.gallery a.big { grid-column: span 8; grid-row: span 2; }
.gallery a.half { grid-column: span 6; }
.gallery img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .3s ease, filter .3s ease; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.035); filter: brightness(1.08); }
.gallery a::after { content: attr(data-title); position: absolute; left: 8px; bottom: 8px; padding: 5px 8px 6px; background: rgba(19, 14, 34, .85); color: var(--cream); font: 16px/1 var(--pixel); opacity: 0; transform: translateY(6px); transition: .2s ease; pointer-events: none; }
.gallery a:hover::after, .gallery a:focus-visible::after { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .gallery img, .gallery a::after { transition: none; } }

/* Lightbox (a <dialog>) */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(10, 7, 20, .95); color: var(--cream); }
.lightbox::backdrop { background: rgba(10, 7, 20, .8); }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: 56px 64px 8px; }
.lb-stage picture, .lb-stage img { max-width: 100%; max-height: 100%; }
.lb-stage img { width: auto; height: auto; max-height: calc(100vh - 140px); border: var(--px) solid var(--ink); }
.lb-bar { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 12px 16px 20px; text-align: center; }
.lb-cap { font: 16px/1.4 var(--pixel); min-width: 0; }
.lb-count { font: 16px/1 var(--pixel); color: var(--muted); }
.lb-btn { width: 52px; height: 52px; display: grid; place-items: center; padding: 0; background: var(--panel); color: var(--cream); border: var(--px) solid var(--ink); clip-path: var(--notch); cursor: pointer; }
.lb-btn:hover { background: var(--panel-hi); }
.lb-btn svg { width: 20px; height: 20px; shape-rendering: crispEdges; }
.lb-close { position: absolute; top: 12px; right: 12px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }

/* Follow + sign-up */
.join { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
.join .panel { padding: 30px; }
.join h2 { font-size: 32px; }
form.signup { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
form.signup label { flex-basis: 100%; font: 16px/1 var(--pixel); color: var(--muted); }
form.signup input {
  flex: 1 1 220px; min-width: 0; min-height: 52px; padding: 12px 14px; font: 16px var(--sans);
  color: var(--cream); background: var(--bg); border: var(--px) solid var(--ink);
}
form.signup input:focus { border-color: var(--teal); outline: none; }
.note { font-size: 14px; color: var(--muted); margin-top: 10px; flex-basis: 100%; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Footer */
footer { padding: 40px 0 52px; border-top: var(--px) solid var(--ink); background: var(--ink); color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; }
footer img { height: 40px; width: auto; image-rendering: pixelated; }
footer nav { display: flex; gap: 22px; flex-wrap: wrap; margin-left: auto; }
footer a { color: var(--muted); text-decoration: none; font: 16px/1 var(--pixel); }
footer a:hover { color: var(--gold); }

/* Text pages (press kit, privacy) */
.page { padding: 56px 0 80px; }
.page h1 { font-size: 40px; color: var(--gold); }
.page h2 { font-size: 24px; margin-top: 1.8em; color: var(--teal); text-shadow: 0 3px 0 var(--ink); }
.page .intro { max-width: 760px; }
.factsheet { display: grid; grid-template-columns: 180px 1fr; gap: 8px 20px; padding: 24px; margin: 22px 0 8px; }
.factsheet dt { font: 16px/1.4 var(--pixel); color: var(--muted); }
.factsheet dd { margin: 0; }
.page ul { padding-left: 1.2em; }
.page li { margin: .3em 0; }
.downloads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.downloads.logos { grid-template-columns: repeat(4, 1fr); }
.downloads .dl { border: var(--px) solid var(--ink); background: var(--ink); }
.downloads .dl > a { display: block; }
.downloads img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.downloads .logo-tile img { object-fit: contain; padding: 18px; background: var(--panel); image-rendering: pixelated; }
.downloads span { display: block; padding: 8px 10px 9px; font-size: 14px; color: var(--muted); background: var(--panel); }
.downloads span a { color: var(--teal); }
.downloads span b { display: block; font: 16px/1.3 var(--pixel); color: var(--cream); }
.press-grid { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; }
.press-side { position: sticky; top: 88px; display: grid; gap: 16px; }
.press-side .panel { padding: 20px; }

/* Phone and tablet */
@media (max-width: 1000px) {
  .hero { min-height: 0; }
  .hero .wrap { padding: 40px 0 72px; }
  .hero::before { background: linear-gradient(180deg, rgba(19, 14, 34, .2) 0%, rgba(19, 14, 34, .55) 22%, rgba(19, 14, 34, .88) 48%, var(--bg) 100%); }
  .facts-strip ul { grid-template-columns: 1fr 1fr; }
  .world, .feature, .join, .press-grid { grid-template-columns: 1fr; gap: 28px; }
  .feature:nth-child(even) .media { order: 0; }
  .press-side { position: static; }
  .gallery a, .gallery a.half { grid-column: span 6; }
  .gallery a.big { grid-column: span 12; grid-row: auto; }
}
@media (max-width: 760px) {
  .top nav a:not(.btn) { display: none; }
  .modes, .duo { grid-template-columns: 1fr; }
  .downloads, .downloads.logos { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  h1, .page h1 { font-size: 32px; }
  h2, .feature h3, .mode h3, .join h2 { font-size: 24px; }
  h3 { font-size: 16px; }
  .duo h3 { font-size: 16px; }
  .lede { font-size: 17px; }
  section { padding: 60px 0; }
  .hero .logo { width: 100%; }
  .cta .btn { flex: 1 1 100%; }
  .facts-strip ul { grid-template-columns: 1fr; gap: 12px; }
  .rings li { grid-template-columns: 1fr; gap: 4px; }
  .gallery { gap: 10px; }
  .gallery a, .gallery a.half, .gallery a.big { grid-column: span 12; }
  .gallery a::after { opacity: 1; transform: none; }
  .media.pair { grid-template-columns: 1fr; }
  .media.pair .shot:first-child:nth-last-child(3) { grid-column: auto; }
  .factsheet { grid-template-columns: 1fr; gap: 2px; }
  .factsheet dd { margin-bottom: 10px; }
  .downloads, .downloads.logos { grid-template-columns: 1fr; }
  .lb-stage { padding: 56px 8px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .lb-bar { padding-inline: 70px; }
  .brand img { height: 36px; }
}
