/* Mercy's Wake: the website. The game's palette (Art/palette.hex), its pixel fonts at whole-pixel sizes, and its own
   nine-slice frames and buttons (Resources/Art/UI) drawn at twice their size. Mobile first. */

@font-face { font-family: "Silkscreen"; src: url("/fonts/Silkscreen-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("/fonts/Silkscreen-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Pixel Operator"; src: url("/fonts/PixelOperator8.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --void: #0d0b0e;
  --soot: #1a1618;
  --charcoal: #2a2426;
  --iron: #3b3336;
  --text: #d9d0c4;
  --muted: #b4a89f;
  --candle: #f2d68a;
  --brass: #e0b05a;
  --dull-brass: #c98c52;
  --ember: #e0603c;
  --rust: #cf7a45;
  --lumen: #c48ad8;
  --tech: #a8f0f0;
  --display: "Silkscreen", "Courier New", monospace;
  --body: "Pixel Operator", "Courier New", monospace;
  --wrap: 1120px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--void); color: var(--text); scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font: 16px/1.6 var(--body);
  background: var(--void);
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: optimizeSpeed;
  overflow-x: hidden;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: var(--candle); text-underline-offset: 3px; }
a:hover { color: #fff3c9; }
em { color: var(--candle); font-style: normal; }
strong { color: var(--candle); font-weight: 400; }
:focus-visible { outline: 3px solid var(--candle); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--candle); line-height: 1.15; letter-spacing: 0.02em; margin: 0 0 16px; text-wrap: balance; }
h2 { font-size: 24px; }
h3 { font-size: 16px; }
@media (min-width: 720px) { h2 { font-size: 32px; } }
p { margin: 0 0 16px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.intro { max-width: 68ch; color: var(--muted); font-size: 16px; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--candle); color: var(--void); font-family: var(--display); text-decoration: none; }
.skip:focus { top: 8px; }

/* The game's frames and buttons: nine-slice pieces at twice their pixel size. */
.frame {
  border: 32px solid transparent;
  border-image: url("/assets/ui/window.png") 16 fill / 32px / 0 round;
  image-rendering: pixelated;
  background-clip: padding-box;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 8px 22px;
  font: 700 16px/1 var(--display); letter-spacing: 0.04em; color: var(--text); text-decoration: none; text-transform: uppercase;
  border: 8px solid transparent;
  border-image: url("/assets/ui/button_normal.png") 4 fill / 8px / 0 stretch;
  image-rendering: pixelated;
  background: none; cursor: pointer;
  text-shadow: 2px 2px 0 var(--void);
}
.btn:hover { border-image-source: url("/assets/ui/button_hover.png"); color: #fff; }
.btn:active { border-image-source: url("/assets/ui/button_pressed.png"); }
.btn-primary { border-image-source: url("/assets/ui/button_selected.png"); color: var(--candle); }
.btn-primary:hover { border-image-source: url("/assets/ui/button_hover.png"); color: #fff3c9; }
.btn-small { min-height: 40px; padding: 4px 12px; font-size: 16px; }
.btn-big { min-height: 64px; padding: 12px 32px; font-size: 24px; }

/* The bar along the top. */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 8px var(--gutter); padding-top: max(8px, env(safe-area-inset-top));
  background: linear-gradient(rgba(13, 11, 14, 0.92), rgba(13, 11, 14, 0.78));
  border-bottom: 2px solid var(--iron);
  backdrop-filter: blur(3px);
}
.brand { font: 700 16px/1 var(--display); color: var(--candle); text-decoration: none; letter-spacing: 0.06em; margin-right: auto; white-space: nowrap; padding: 12px 0; }
.bar nav { display: none; }
.bar nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.bar nav a { font: 400 16px/1 var(--display); color: var(--text); text-decoration: none; padding: 12px 0; }
.bar nav a:hover { color: var(--candle); }
.music { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; min-width: 40px; padding: 0 10px; background: none; border: 2px solid var(--iron); color: var(--muted); font: 400 16px/1 var(--display); cursor: pointer; }
.music:hover, .music[aria-pressed="true"] { color: var(--candle); border-color: var(--dull-brass); }
.note { width: 12px; height: 14px; background: currentColor; clip-path: polygon(40% 0, 100% 0, 100% 25%, 60% 25%, 60% 80%, 45% 100%, 0 100%, 0 70%, 40% 70%); }
.music-label { display: none; }
@media (min-width: 900px) {
  .bar nav { display: block; margin-right: 8px; }
  .brand { margin-right: 32px; }
  .bar { gap: 16px; }
  .bar nav { margin-right: auto; }
  .music-label { display: inline; }
}

/* The hero: the key art, alive. */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.art, .art img, .glows, .ash, .shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.art { z-index: -1; }
.art img { object-fit: cover; object-position: 30% 50%; image-rendering: pixelated; }
.glows { pointer-events: none; }
.glow { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255, 214, 138, 0.55) 0%, rgba(255, 170, 80, 0.22) 38%, rgba(255, 140, 60, 0) 70%); mix-blend-mode: screen; will-change: opacity; }
.ash { pointer-events: none; }
.shade { background: linear-gradient(180deg, rgba(13, 11, 14, 0.4) 0%, rgba(13, 11, 14, 0.1) 14%, rgba(13, 11, 14, 0.72) 36%, rgba(13, 11, 14, 0.9) 64%, var(--void) 100%); }
.hero-text { position: relative; width: min(var(--wrap), 100% - 2 * var(--gutter)); margin: 0 auto; padding: 120px 0 96px; }
.kicker { font: 400 16px/1 var(--display); color: var(--lumen); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 12px; text-shadow: 2px 2px 0 var(--void); }
h1 { font-size: 48px; margin-bottom: 20px; text-transform: uppercase; text-shadow: 0 0 24px rgba(242, 214, 138, 0.35), 4px 4px 0 var(--void), -2px -2px 0 var(--void), 2px -2px 0 var(--void), -2px 2px 0 var(--void); }
.lede { max-width: 56ch; font-size: 16px; color: var(--text); text-shadow: 2px 2px 0 var(--void); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 16px; }
.fine { font-size: 16px; color: var(--muted); text-shadow: 2px 2px 0 var(--void); }
.down { position: absolute; left: 50%; bottom: 20px; width: 48px; height: 48px; margin-left: -24px; display: grid; place-items: center; }
.down span { width: 16px; height: 16px; border-right: 4px solid var(--candle); border-bottom: 4px solid var(--candle); transform: rotate(45deg); opacity: 0.8; }
@media (prefers-reduced-motion: no-preference) { .down span { animation: bob 2.4s steps(6) infinite; } }
@keyframes bob { 50% { transform: translateY(6px) rotate(45deg); } }
@media (min-width: 720px) {
  h1 { font-size: 64px; }
  .hero { align-items: center; }
  .hero-text { padding: 96px 0; }
  .shade { background: linear-gradient(90deg, rgba(13, 11, 14, 0.88) 0%, rgba(13, 11, 14, 0.55) 38%, rgba(13, 11, 14, 0) 62%), linear-gradient(180deg, rgba(13, 11, 14, 0) 70%, var(--void) 100%); }
  .art img { object-position: 50% 50%; }
  .hero-text { padding-right: 30%; }
}
@media (min-width: 1100px) { h1 { font-size: 96px; } .lede { font-size: 16px; } }

/* Sections. */
section { padding: 72px 0; position: relative; }
@media (min-width: 720px) { section { padding: 112px 0; } }
.world { background: var(--void); }
.two { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .two { grid-template-columns: 5fr 6fr; gap: 56px; } }
.copy p { max-width: 60ch; }
.pull { font: 700 16px/1.4 var(--display); color: var(--candle); letter-spacing: 0.04em; margin-top: 24px; }
.film { margin: 0; }
.film video { width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
.film figcaption { font-size: 16px; color: var(--muted); padding-top: 12px; }

.life { background: url("/assets/ui/panel.png") repeat; background-size: 64px 64px; image-rendering: pixelated; }
.life::before { content: ""; position: absolute; inset: 0; background: rgba(13, 11, 14, 0.62); }
.life .wrap { position: relative; }
.cards { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { display: flex; flex-direction: column; gap: 8px; padding: 24px; background: linear-gradient(160deg, var(--charcoal), var(--void) 70%); border: 2px solid var(--iron); }
.card:hover { border-color: var(--dull-brass); }
.card .slot { width: 88px; height: 88px; display: grid; place-items: center; margin-bottom: 8px; border: 8px solid transparent; border-image: url("/assets/ui/slot_normal.png") 4 fill / 8px / 0 stretch; image-rendering: pixelated; }
.card img { width: 64px; height: 64px; image-rendering: pixelated; filter: drop-shadow(0 0 10px rgba(242, 214, 138, 0.25)); }
.card p { margin: 0; color: var(--text); }

.places { background: var(--void); padding-bottom: 72px; }
.gallery { list-style: none; margin: 32px 0 0; padding: 0 var(--gutter) 16px; display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-color: var(--iron) transparent; }
.gallery li { scroll-snap-align: center; }
.shot { display: block; position: relative; width: 100%; padding: 0; border: 2px solid var(--iron); background: #000; cursor: zoom-in; overflow: hidden; }
.shot:hover { border-color: var(--dull-brass); }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; }
@media (prefers-reduced-motion: no-preference) { .shot img { transition: transform 0.6s ease; } .shot:hover img { transform: scale(1.04); } }
.shot-cap { position: absolute; inset: auto 0 0 0; padding: 32px 12px 10px; text-align: left; background: linear-gradient(transparent, rgba(13, 11, 14, 0.92)); }
.shot-cap b { display: block; font: 700 16px/1.2 var(--display); color: var(--candle); }
.shot-cap span { display: block; font: 16px/1.3 var(--body); color: var(--text); }
@media (min-width: 900px) {
  .gallery { width: min(1400px, 100% - 2 * var(--gutter)); margin: 32px auto 0; padding: 0; grid-auto-flow: row dense; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .gallery li:first-child { grid-column: span 2; grid-row: span 2; }
  .gallery li:first-child .shot img { aspect-ratio: auto; height: 100%; }
  .gallery li:first-child .shot { height: 100%; }
}

.rings { background: linear-gradient(180deg, var(--void), var(--soot)); }
.ringlist { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 860px) { .ringlist { grid-template-columns: repeat(3, 1fr); } }
.ring { padding: 24px; background: var(--soot); border: 2px solid var(--iron); border-top: 8px solid var(--brass); }
.ring.frontier { border-top-color: var(--rust); }
.ring.wastes { border-top-color: var(--ember); }
.ring p { margin: 0; }
.tag { display: inline-block; font: 400 16px/1 var(--display); padding: 6px 8px; margin-right: 8px; background: var(--brass); color: var(--void); vertical-align: 2px; }
.frontier .tag { background: var(--rust); }
.wastes .tag { background: var(--ember); }

.news { background: var(--soot); }
.newslist { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 900px) { .newslist { grid-template-columns: repeat(3, 1fr); } }
.entry { padding: 20px; background: var(--void); border: 2px solid var(--iron); }
.entry h3 { font-size: 16px; }
.entry .when { display: block; font: 400 16px/1 var(--display); color: var(--lumen); margin-bottom: 8px; }
.entry ul { margin: 0; padding-left: 18px; }
.entry li { margin-bottom: 8px; }
.entry li::marker { color: var(--dull-brass); }

.download { background: radial-gradient(ellipse at 50% 0%, rgba(196, 138, 216, 0.12), transparent 60%), var(--void); }
.panel { max-width: 760px; margin: 0 auto; text-align: center; padding: 8px; }
.panel p { color: var(--text); }
.panel .btn-big { margin: 16px 0 24px; }
.facts { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; color: var(--muted); }
.facts li::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; background: var(--dull-brass); vertical-align: 2px; }
details { text-align: left; max-width: 60ch; margin: 0 auto; background: var(--void); border: 2px solid var(--iron); padding: 0 16px; }
summary { cursor: pointer; padding: 14px 0; font: 400 16px/1.3 var(--display); color: var(--candle); }
details p { margin-bottom: 16px; }

.foot { padding: 48px 0 calc(48px + env(safe-area-inset-bottom)); border-top: 2px solid var(--iron); color: var(--muted); }
.foot p { margin: 0 0 8px; }
.brand-small { font: 700 16px/1 var(--display); color: var(--candle); letter-spacing: 0.06em; margin-bottom: 16px !important; }

/* The screenshot viewer. */
.lightbox { width: min(1600px, 100vw); max-width: 100vw; max-height: 100dvh; margin: auto; padding: 16px; background: rgba(13, 11, 14, 0.97); border: 2px solid var(--iron); color: var(--text); }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.85); }
.lightbox figure { margin: 0; }
.lightbox img { width: 100%; height: auto; max-height: calc(100dvh - 180px); object-fit: contain; image-rendering: pixelated; }
.lightbox figcaption { padding: 12px 0 0; }
.lightbox figcaption b { font: 700 16px/1.2 var(--display); color: var(--candle); display: block; }
.lb-controls { display: flex; justify-content: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .btn, .frame { border: 2px solid ButtonText; border-image: none; } }

/* The film's words, for anyone who cannot hear or see it */
.transcript { margin-top: 16px; max-width: none; }
.transcript p { font-size: 16px; }

/* The 404 page */
.lost { min-height: 100vh; display: grid; place-items: center; padding: 32px var(--gutter); text-align: center; }
.lost .panel { max-width: 560px; }
.lost h1 { font-size: 32px; margin: 8px 0 16px; }
.lost p { margin: 0 0 24px; }

/* Narrow phones: keep the bar on one line. */
@media (max-width: 419px) {
  .bar { gap: 8px; }
  .brand { letter-spacing: 0; }
  .bar .btn-small { padding: 4px 8px; letter-spacing: 0; }
}
@media (max-width: 379px) { .music { display: none; } }
@media (max-width: 339px) { .bar .btn-small { display: none; } }

/* The world right now: live numbers from the game server. */
.pulse { margin: 8px 0 0; }
.pulse a { display: inline-flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text); text-decoration: none; text-shadow: 2px 2px 0 var(--void); }
.pulse a:hover .pulse-text { color: var(--candle); }
.dot { width: 10px; height: 10px; background: #7fd96a; box-shadow: 0 0 8px #7fd96a; }
@media (prefers-reduced-motion: no-preference) { .dot { animation: beat 2s steps(2) infinite; } }
@keyframes beat { 50% { opacity: 0.45; } }
.now { background: radial-gradient(ellipse at 50% 0%, rgba(196, 138, 216, 0.10), transparent 60%), var(--void); }
.now-updated { color: var(--muted); }
.now-grid { display: grid; gap: 16px; margin-top: 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .now-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .now-grid { grid-template-columns: repeat(3, 1fr); } }
.tile { padding: 20px; background: linear-gradient(160deg, var(--charcoal), var(--soot) 70%); border: 2px solid var(--iron); min-width: 0; }
.tile h3 { font-size: 16px; margin-bottom: 12px; }
.tile p { margin: 0 0 8px; }
.tile .sub { color: var(--muted); }
.tile .big { font: 700 48px/1 var(--display); color: var(--candle); margin: 4px 0 12px; text-shadow: 0 0 18px rgba(242, 214, 138, 0.3); }
.tile ul { list-style: none; margin: 0; padding: 0; }
.tile li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 2px solid var(--iron); }
.tile li:first-child { border-top: 0; }
.tile li b { font-weight: 400; color: var(--text); }
.tile li span { color: var(--muted); text-align: right; }
.tile .hot { color: var(--ember); }
.meter { height: 14px; margin: 8px 0 10px; background: var(--void); border: 2px solid var(--iron); }
.meter i { display: block; height: 100%; background: var(--candle); }
.meter.lumen i { background: var(--lumen); }
.meter.blood i { background: var(--ember); }
.tile.boss { border-color: var(--ember); }
.lamp { display: inline-block; width: 12px; height: 12px; margin-right: 10px; background: var(--iron); vertical-align: 0; }
.lamp.lit { background: var(--candle); box-shadow: 0 0 10px var(--candle); }

/* Terms and Privacy: long reading at a comfortable measure. */
.doc { width: min(72ch, 100% - 2 * var(--gutter)); margin: 0 auto; padding: 112px 0 64px; }
.doc h1 { font-size: 32px; margin-bottom: 24px; }
.doc h2 { font-size: 20px; margin: 40px 0 12px; }
.doc p, .doc li { color: var(--text); }
.doc ul { padding-left: 20px; margin: 0 0 16px; }
.doc li { margin-bottom: 10px; }
.doc li::marker { color: var(--dull-brass); }
.doc strong { color: var(--candle); font-weight: 400; }
.doc a, .foot a { color: var(--candle); }
.brand + .btn-small { margin-left: auto; }   /* pages without the nav (terms, privacy): Download to the right */
