/* Wilderwake website. Colours are the game's own (Chalkwake palette and the HUD's
   Deep Instrument plates). Pixel art is always shown at whole-number scales. */

@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/AlegreyaSans-Medium.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #17161b;
  --night-2: #1f1d23;
  --plum: #2e2a2f;
  --page: #121716;
  --plate: #1c2221;
  --header: #3a4240;
  --line: #63886f;
  --edge: #445752;
  --paper: #fffcf2;
  --dim: #b4c0ba;
  --quiet: #82968d;
  --wake: #9cdc7c;
  --teal: #55dfc0;
  --teal-2: #2bb2a0;
  --teal-deep: #1c656c;
  --gold: #e8be60;
  --crystal: #b666f6;
  --crystal-soft: #d2a6ff;
  --crystal-deep: #1d1426;
  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.splash-page {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.splash-page main,
.splash-page .hero {
  height: 100%;
  min-height: 0;
}

.splash-page .hero-inner {
  margin-inline: auto;
  padding-block: clamp(24px, 5vh, 56px);
}

.splash-page .cta-row {
  justify-content: flex-start;
  align-items: center;
}

@media (max-height: 640px) {
  .splash-page .wordmark { font-size: clamp(46px, 12vh, 92px); }
  .splash-page .tagline { margin-top: 10px; }
  .splash-page .hero-sub { margin-block: 10px 16px; line-height: 1.35; }
  .splash-page .platform-note { margin-top: 10px; }
}

img, video, canvas { display: block; max-width: 100%; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--wake); text-underline-offset: 3px; }
a:hover { color: var(--paper); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.wrap { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- The game's panel: two-pixel line, stepped cut corners ---------- */
.plate, .btn, .tab, .card, .faq details, .fact, .shot {
  border: 12px solid transparent;
  border-image: url("../img/ui/plate.png") 12 fill / 12px / 0 stretch;
  image-rendering: pixelated;
}
.plate-soft { border-image-source: url("../img/ui/plate-soft.png"); }
.plate-crystal { border-image-source: url("../img/ui/plate-crystal.png"); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 2px 12px;
  min-height: 52px;
  color: var(--paper);
  font: inherit; font-size: 17px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; background: none;
  transition: transform .08s steps(2);
}
.btn:hover { color: var(--paper); border-image-source: url("../img/ui/plate-soft.png"); }
.btn:active { transform: translateY(2px); }
.btn-primary { border-image-source: url("../img/ui/plate-cta.png"); }
.btn-primary:hover { border-image-source: url("../img/ui/plate-cta-hover.png"); }
.btn-small { min-height: 44px; font-size: 15px; padding: 0 8px; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .2s, box-shadow .2s;
}
.site-header.scrolled { background: rgba(18, 23, 22, .94); box-shadow: 0 2px 0 var(--edge); }
.site-header .bar { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand {
  font-size: 24px; letter-spacing: .06em; text-decoration: none; color: var(--paper);
  text-shadow: 0 2px 0 #000;
}
.brand span { color: var(--wake); }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a:not(.btn) {
  color: var(--dim); text-decoration: none; font-size: 15px; letter-spacing: .12em; text-transform: uppercase;
}
.nav a:not(.btn):hover { color: var(--paper); }
.menu-toggle { display: none; margin-left: auto; }
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 72px; left: var(--gutter); right: var(--gutter);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px;
    background: var(--plate); box-shadow: 0 0 0 2px var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 12px 4px; border-bottom: 2px solid var(--edge); }
  .nav .btn { margin-top: 12px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: clamp(560px, 100vh, 1000px); min-height: clamp(560px, 100svh, 1000px);
  display: flex; align-items: center; overflow: hidden; isolation: isolate;
}
.hero video, .hero .poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 72% 78%; z-index: -2;
  image-rendering: pixelated;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(18, 17, 22, .72) 0%, rgba(18, 17, 22, .35) 45%, rgba(18, 17, 22, 0) 70%),
    linear-gradient(0deg, var(--night) 0%, rgba(23, 22, 27, 0) 22%);
}
.hero-inner { padding-block: 120px 120px; }
.wordmark {
  margin: 0; line-height: .95; font-weight: 500;
  font-size: clamp(54px, 10.5vw, 148px); letter-spacing: .035em; color: var(--paper);
  text-shadow:
    -3px -3px 0 #141817, 3px -3px 0 #141817, -3px 3px 0 #141817, 3px 3px 0 #141817,
    0 -3px 0 #141817, 0 3px 0 #141817, -3px 0 0 #141817, 3px 0 0 #141817,
    6px 8px 0 rgba(0, 0, 0, .55);
}
.wordmark span { color: var(--wake); }
.tagline {
  margin: 18px 0 0; font-size: clamp(24px, 3.2vw, 38px); line-height: 1.15;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .7);
}
.hero-sub {
  max-width: 34em; margin: 16px 0 30px; color: var(--dim); font-size: clamp(17px, 1.6vw, 21px);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .8);
}
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.platform-note {
  margin-top: 18px; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim);
  text-shadow: 0 2px 0 #000;
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  color: var(--dim); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.scroll-cue i {
  width: 12px; height: 12px; border-right: 4px solid var(--wake); border-bottom: 4px solid var(--wake);
  transform: rotate(45deg); animation: cue 1.6s steps(4) infinite;
}
@keyframes cue { 50% { translate: 0 6px; } }

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding-block: clamp(72px, 10vw, 128px); }
.section-alt { background: var(--night-2); }
.kicker {
  margin: 0 0 10px; color: var(--wake); font-size: 15px; letter-spacing: .22em; text-transform: uppercase;
}
h2 {
  margin: 0 0 20px; font-weight: 600; line-height: 1.05;
  font-size: clamp(34px, 5vw, 58px); letter-spacing: .02em;
}
h3 { margin: 0 0 8px; font-size: 24px; font-weight: 600; line-height: 1.15; }
.lead { font-size: clamp(19px, 2vw, 23px); color: var(--dim); max-width: 38em; }
.lead + .lead { margin-top: 0; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* ---------- Pitch ---------- */
.pitch { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.pitch-art { position: relative; display: flex; justify-content: center; align-items: flex-end; min-height: 320px; }
.pitch-art .glow {
  position: absolute; bottom: 10px; width: 260px; height: 60px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(85, 223, 192, .28), rgba(85, 223, 192, 0));
}
.pitch-art .drone { position: absolute; left: calc(50% + 70px); bottom: 250px; }
@media (max-width: 800px) {
  .pitch { grid-template-columns: 1fr; }
  .pitch-art { order: -1; min-height: 300px; }
}

/* ---------- A few locals ---------- */
.locals { padding-block: clamp(44px, 6vw, 72px); }
.locals-row {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 28px clamp(28px, 6vw, 72px);
}
.locals-row li { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.locals-row span { color: var(--quiet); font-size: 14px; letter-spacing: .16em; text-transform: uppercase; }

/* ---------- Sprites ---------- */
.sprite {
  display: inline-block; background-repeat: no-repeat; image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.sprite.flip { transform: scaleX(-1); }

/* ---------- Wake it up (bloom canvas) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 18px; }
.tab {
  border-image-source: url("../img/ui/plate-soft.png");
  padding: 0 10px; min-height: 48px; display: inline-flex; align-items: center;
  font: inherit; font-size: 16px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); background: none; cursor: pointer;
}
.tab:hover { color: var(--paper); }
.tab[aria-selected="true"] { border-image-source: url("../img/ui/plate.png"); color: var(--wake); }
.tab.locked { color: var(--quiet); cursor: help; }
.bloom-frame { padding: 0; overflow: hidden; }
.bloom-stage { position: relative; aspect-ratio: 16 / 9; background: #000; }
.bloom-stage canvas {
  width: 100%; height: 100%; image-rendering: pixelated;
  cursor: url("../img/ui/cursor-fruit.png") 16 16, crosshair; touch-action: manipulation;
}
.bloom-hint {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  padding: 8px 16px; font-size: 16px; letter-spacing: .08em; pointer-events: none;
  background: rgba(18, 23, 22, .9); box-shadow: 0 0 0 2px var(--edge); white-space: nowrap;
  transition: opacity .4s;
}
.bloom-hint img { display: inline-block; vertical-align: -6px; margin-right: 6px; }
.bloom-hint.gone { opacity: 0; }
.locked-panel {
  position: absolute; inset: 0; display: none; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 60%, #2a1f36 0%, #0d0b10 70%);
}
.locked-panel.show { display: grid; }
.locked-panel p { max-width: 24em; color: var(--dim); }
.locked-panel .q { font-size: 96px; line-height: 1; color: var(--crystal-soft); text-shadow: 0 0 24px rgba(182, 102, 246, .6); }
.bloom-meta { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-start; justify-content: space-between; margin-top: 18px; }
.bloom-meta h3 { margin: 0; }
.bloom-meta p { margin: 4px 0 0; color: var(--dim); max-width: 36em; }
.bloom-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Feature cards ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.card { padding: 6px 12px 14px; min-width: 0; }
.features > *, .cast > *, .gallery > *, .guide > *, .pitch > * { min-width: 0; }
.card .art {
  height: 200px; display: flex; align-items: flex-end; justify-content: center; gap: 8px;
  margin: 0 -12px 16px; padding-bottom: 10px; overflow: hidden;
  background: linear-gradient(180deg, #232b2a 0%, #1a2120 100%);
  box-shadow: inset 0 -4px 0 var(--edge);
}
.card .art.img { padding: 0; align-items: stretch; }
.card .art.img img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.card p { margin: 0; color: var(--dim); font-size: 18px; }
@media (max-width: 980px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .features { grid-template-columns: 1fr; } }

/* ---------- Creatures ---------- */
.parade {
  position: relative; height: 300px; margin-top: 40px; overflow: hidden;
  background: linear-gradient(180deg, rgba(23, 22, 27, 0) 0%, rgba(42, 60, 70, .35) 100%);
}
.parade .ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 148px;
  background: url("../img/ui/ground-verdas.png") repeat-x left bottom / auto 148px;
  image-rendering: pixelated;
}
.parade .walker { position: absolute; left: 0; will-change: transform; }
.guide {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-flow: dense; gap: 14px; margin-top: 36px;
}
.guide figure {
  margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center;
  background: var(--plate); box-shadow: inset 0 0 0 2px var(--edge);
}
.guide figure.tall { grid-row: span 2; }
.guide figure.tall .stage { height: auto; flex: 1; min-height: 300px; }
.guide .stage { height: 150px; width: 100%; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; overflow: hidden; }
.guide figcaption {
  width: 100%; text-align: center; padding: 8px 6px 10px; font-size: 15px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim); box-shadow: inset 0 2px 0 var(--edge);
}
.guide-note { margin-top: 18px; color: var(--quiet); font-size: 16px; }

/* ---------- The crystal ---------- */
.crystal-section {
  background:
    radial-gradient(ellipse at 50% 120%, rgba(182, 102, 246, .22), rgba(182, 102, 246, 0) 60%),
    var(--crystal-deep);
}
.crystal-section .kicker { color: var(--crystal-soft); }
.lineup {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 18px 28px;
  margin-top: 40px; padding: 24px 12px 0;
}
.lineup img { image-rendering: pixelated; max-width: 100%; height: auto; min-width: 0; }
.card .art img { max-width: 100%; height: auto; min-width: 0; }
.lineup .bob { animation: bob 2.4s steps(2) infinite; }
.lineup .bob:nth-child(2n) { animation-delay: -.8s; }
.lineup .bob:nth-child(3n) { animation-delay: -1.6s; }
@keyframes bob { 50% { translate: 0 -2px; } }
.floor { height: 4px; background: #4a3560; margin-top: 0; box-shadow: 0 4px 0 #2b2038; }

/* ---------- Characters ---------- */
.cast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.cast .card .art { height: 230px; }
@media (max-width: 980px) { .cast { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cast { grid-template-columns: 1fr; } }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 36px; }
.shot { padding: 0; cursor: zoom-in; background: none; display: block; width: 100%; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; }
.gallery .wide { grid-column: span 2; grid-row: span 2; }
.gallery .banner { grid-column: 1 / -1; }
.gallery .banner img { aspect-ratio: 21 / 9; object-position: 50% 70%; }
@media (max-width: 860px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery .wide { grid-column: span 2; grid-row: auto; }
}
.lightbox {
  position: fixed; inset: 0; z-index: 90; display: none; place-items: center;
  background: rgba(8, 9, 10, .94); padding: 24px;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: min(1920px, 100%); max-height: calc(100vh - 120px); image-rendering: pixelated; box-shadow: 0 0 0 4px var(--line); }
.lightbox .lb-bar { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.lightbox .caption { text-align: center; color: var(--dim); margin-top: 10px; }

/* ---------- Trailer ---------- */
.trailer { position: relative; aspect-ratio: 16 / 9; margin-top: 32px; padding: 0; overflow: hidden; }
.trailer button.play {
  position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer;
  background: #000 url("../img/hero-poster.png") center / cover no-repeat; image-rendering: pixelated;
}
.trailer button.play span {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
}
.trailer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Wishlist band ---------- */
.wishlist {
  text-align: center;
  background: none;
}
.wishlist h2 { text-shadow: 0 4px 0 rgba(0, 0, 0, .7); }
.wishlist .lead { color: var(--paper); text-shadow: 0 2px 0 #000; }
.wishlist .cta-row { justify-content: center; margin-top: 26px; }
.steam-widget { margin: 28px auto 0; max-width: 646px; }
.steam-widget iframe { width: 100%; height: 190px; border: 0; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; margin-top: 32px; max-width: 860px; }
.faq details { padding: 4px 12px; border-image-source: url("../img/ui/plate-soft.png"); }
.faq summary {
  cursor: pointer; list-style: none; padding: 10px 0; font-size: 21px; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--wake); font-size: 26px; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 12px; color: var(--dim); }

/* ---------- Footer ---------- */
.site-footer { padding-block: 48px 64px; background: none; box-shadow: inset 0 2px 0 var(--edge); color: var(--quiet); font-size: 16px; }
.site-footer .row { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--dim); }

/* ---------- Press kit ---------- */
.press-hero { padding-top: 140px; padding-bottom: 40px; background: var(--night-2); }
.press-grid { display: grid; grid-template-columns: 320px 1fr; gap: 40px; align-items: start; }
.fact { padding: 4px 12px 12px; position: sticky; top: 96px; }
.fact dl { margin: 0; }
.fact dt { color: var(--wake); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; margin-top: 14px; }
.fact dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.press-body h2 { font-size: 34px; margin-top: 48px; }
.press-body h2:first-child { margin-top: 0; }
.press-body ul { padding-left: 1.1em; color: var(--dim); }
.press-body li { margin: 6px 0; }
.press-body p { color: var(--dim); }
.press-images { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.press-images a { display: block; box-shadow: 0 0 0 2px var(--edge); }
.press-images a:hover { box-shadow: 0 0 0 2px var(--wake); }
.press-images img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; }
.press-images .logo-tile { background: var(--plate); display: grid; place-items: center; aspect-ratio: 16 / 9; padding: 18px; }
.press-images .logo-tile img { aspect-ratio: auto; object-fit: contain; width: 80%; }
@media (max-width: 860px) {
  .press-grid { grid-template-columns: 1fr; }
  .fact { position: static; }
  .press-images { grid-template-columns: 1fr; }
}

/* ---------- 404 ---------- */
.lost { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.lost .lead { margin-inline: auto; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; translate: 0 16px; transition: opacity .6s, translate .6s; }
.reveal.in { opacity: 1; translate: 0 0; }
.no-js .reveal { opacity: 1; translate: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; translate: none; transition: none; }
  .scroll-cue i, .lineup .bob { animation: none; }
}
