/* Emberfall website.
 *
 * The game's own look: smoked glass cut at the corners, a brass hairline set
 * inside the edge, bone lettering, ember glow on whatever is live. The
 * palette is src/game/HudStyle.h's. Headings are the game's 5x8 lettering,
 * sized in whole multiples of 8px so every pixel of it lands on a pixel. */

@font-face { font-family: "Emberfall Pixel"; src: url("/fonts/emberfall-pixel.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Alegreya Sans"; src: url("/fonts/alegreya-sans-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/fonts/alegreya-sans-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/fonts/alegreya-sans-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/fonts/alegreya-sans-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0b0a0d;
  --bg-2: #121016;
  --glass: rgba(15, 14, 17, 0.93);
  --glass-lo: #08080a;
  --glass-hi: #1c1a1e;
  --ink: #ded8c7;
  --ink-hot: #fff6de;
  --ink-dim: #9a948a;
  --ink-faint: #6d6a64;
  --brass: #c79a4d;
  --brass-lo: #6b4f26;
  --brass-hi: #f5cc7a;
  --ember: #fa7a2e;
  --ember-lo: #853310;
  --ember-glow: rgba(242, 107, 36, 0.45);
  --danger: #c2382a;
  --cham: 12px;
  --wrap: 1180px;
  --pixel: "Emberfall Pixel", ui-monospace, monospace;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 19px/1.62 var(--sans);
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--brass-hi); text-decoration-color: rgba(245, 204, 122, 0.4); text-underline-offset: 3px; }
a:hover { color: var(--ink-hot); text-decoration-color: var(--ember); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
::selection { background: var(--ember-lo); color: var(--ink-hot); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--glass-hi); padding: 8px 14px; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.muted { color: var(--ink-dim); }

/* ---- the game's lettering ---- */
.pixel, h1, h2, .logo, .btn, .kicker, .tag, .coming, .site-nav, .news-meta, .dl-os, .stat b {
  font-family: var(--pixel);
  font-weight: 400;
  letter-spacing: 0;
  font-synthesis: none;
  -webkit-font-smoothing: none;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; color: var(--ink-hot); text-wrap: balance; }
h1 { font-size: 48px; }
h2 { font-size: 32px; }
h3 { font-family: var(--sans); font-weight: 700; font-size: 22px; color: var(--brass-hi); }
.title-xl { font-size: 64px; }
p { margin: 0 0 1em; max-width: 68ch; }
.kicker { font-size: 16px; color: var(--ember); text-transform: uppercase; margin: 0 0 16px; }
.kicker a { color: inherit; text-decoration: none; }
.lede { font-size: 23px; line-height: 1.5; color: var(--ink); max-width: 60ch; }
.prose ul { padding-left: 1.1em; max-width: 68ch; }
.prose li { margin: 0.3em 0; }
.prose li::marker { color: var(--brass); }
.prose h3 { margin-top: 1.6em; }

/* ---- panels: glass cut at the corners with a brass hairline inside ---- */
.panel {
  --c: var(--cham);
  position: relative;
  isolation: isolate;
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)),
                     calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  background: var(--brass-lo);
}
.panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: inherit;
  background: var(--glass);
}

/* ---- buttons ---- */
.btn {
  --c: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px 12px;
  font-size: 16px;
  text-transform: uppercase;
  color: var(--ink-hot);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  position: relative;
  isolation: isolate;
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)),
                     calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  background: var(--brass);
  transition: background 0.15s, color 0.15s;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(#34302e, #161415);
  transition: background 0.15s;
}
.btn:hover { background: var(--brass-hi); color: #fff; }
.btn:hover::before { background: linear-gradient(#54402a, #2f2416); }
.btn-primary { background: var(--ember); }
.btn-primary::before { background: linear-gradient(#a8471b, #6a2a0e); }
.btn-primary:hover { background: #ffb27a; }
.btn-primary:hover::before { background: linear-gradient(#cc5a22, #8a3712); }
.btn-small { padding: 10px 16px 8px; font-size: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.link-arrow { font-family: var(--pixel); font-size: 16px; color: var(--brass-hi); text-transform: uppercase; }
.link-arrow::after { content: " \2192"; }

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 10, 13, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(107, 79, 38, 0.6);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo {
  font-size: 32px;
  color: var(--brass-hi);
  text-decoration: none;
  text-shadow: 3px 3px 0 #000, 0 0 18px var(--ember-glow);
}
.logo:hover { color: var(--ink-hot); }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 16px; text-transform: uppercase; }
.site-nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.site-nav li { position: relative; }
.site-nav ul a { color: var(--ink-dim); text-decoration: none; padding: 22px 0; display: block; }
.site-nav ul a:hover, .site-nav ul a.active { color: var(--ink-hot); }
.site-nav ul a.active { box-shadow: inset 0 -2px 0 var(--ember); }
.site-nav .sub {
  position: absolute;
  top: 100%;
  left: -18px;
  display: none;
  min-width: 220px;
  padding: 10px 0;
  flex-direction: column;
}
.site-nav .sub a { padding: 10px 20px; color: var(--ink); text-transform: none; font-size: 16px; }
.site-nav .sub a:hover { color: var(--ink-hot); background: rgba(133, 51, 16, 0.4); }
.has-sub:hover .sub, .has-sub:focus-within .sub { display: flex; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 3px; background: var(--brass-hi); margin: 4px 0; }

/* ---- hero ---- */
.hero {
  position: relative;
  min-height: min(92vh, 900px);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}
.hero-media, .hero video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 10, 13, 0.55) 0%, rgba(11, 10, 13, 0) 30%, rgba(11, 10, 13, 0.25) 55%, var(--bg) 100%),
    radial-gradient(ellipse at 30% 110%, rgba(133, 51, 16, 0.45), transparent 60%);
}
.hero-inner { padding: 120px 0 80px; }
.hero-title {
  font-size: clamp(64px, 12vw, 128px);
  line-height: 1;
  color: var(--brass-hi);
  margin: 0 0 20px;
  text-shadow: 6px 6px 0 #000, 0 0 40px rgba(250, 122, 46, 0.55);
}
.hero-tagline { font-size: clamp(21px, 2.4vw, 27px); max-width: 34ch; color: var(--ink-hot); text-shadow: 0 2px 12px #000; }
.sparks { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

/* ---- page heads for inner pages ---- */
.page-head { position: relative; padding: 140px 0 60px; overflow: hidden; isolation: isolate; }
.page-head .hero-media { opacity: 0.55; }
.page-head::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(11, 10, 13, 0.4), var(--bg) 92%);
}
.page-head-short { padding: 72px 0 24px; }
.page-head-short::after { display: none; }

/* ---- sections ---- */
section { position: relative; }
.section { padding: 96px 0; }
.section-tight { padding: 56px 0; }
.section-dark { background: var(--bg-2); border-block: 1px solid rgba(107, 79, 38, 0.35); }
.section-head { margin-bottom: 40px; }

/* A picture and its words side by side, alternating down the page. */
.feature { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.feature + .feature { margin-top: 96px; }
.feature.flip > :first-child { order: 2; }
.feature h2 { font-size: 32px; }
.shot { margin: 0; }
.shot img, .shot video, .frame img, .frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
}
.shot { position: relative; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6)); }
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--brass);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px,
                     0 14px, 1px 14px, 1px calc(100% - 14px), 14px calc(100% - 1px), calc(100% - 14px) calc(100% - 1px), calc(100% - 1px) calc(100% - 14px), calc(100% - 1px) 14px, calc(100% - 14px) 1px, 14px 1px, 1px 14px, 0 14px);
  opacity: 0.7;
}
/* A picture that keeps its own shape: the launcher's window is not 16:9. */
.shot.natural img { aspect-ratio: auto; object-fit: contain; }
.shot figcaption { margin-top: 12px; font-size: 16px; color: var(--ink-dim); }

/* Full-bleed pictures between sections. */
.band { position: relative; height: clamp(320px, 52vw, 620px); overflow: hidden; }
.band img, .band video { width: 100%; height: 100%; object-fit: cover; }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--bg), transparent 18%, transparent 75%, var(--bg)); }
.band-caption { position: absolute; left: 0; right: 0; bottom: 28px; z-index: 1; }
.band-caption p { font-family: var(--pixel); font-size: 24px; color: var(--ink-hot); text-shadow: 3px 3px 0 #000; margin: 0; }

/* Cards: the pillars, the news. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); transition: transform 0.2s; }
.card:hover { transform: translateY(-4px); color: var(--ink); }
.card:hover::before { background: linear-gradient(var(--glass-hi), var(--glass)); }
.card img { aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 20px 22px 24px; }
.card h3 { font-size: 24px; color: var(--ink-hot); margin-bottom: 8px; }
/* Five cards: three over two, not four and an orphan. */
.cards-5 { grid-template-columns: repeat(6, 1fr); }
.cards-5 > * { grid-column: span 2; }
.cards-5 > :nth-child(n+4) { grid-column: span 3; }
.cards-5 > :nth-child(n+4) img { aspect-ratio: 16 / 7; }
.card p { font-size: 17px; color: var(--ink-dim); margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.tile-text { padding: 26px 26px 22px; }
.tile-text h3 { margin-bottom: 6px; }
.tile-text p { font-size: 17px; color: var(--ink-dim); margin: 0; }

.stats { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 28px 0 0; padding: 0; list-style: none; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 32px; color: var(--brass-hi); line-height: 1.1; }
.stat span { font-size: 15px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.06em; }

.tag, .coming {
  display: inline-block;
  font-size: 16px;
  padding: 6px 10px 4px;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--brass);
  margin-bottom: 14px;
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
}
.coming { background: var(--ember); color: #1a0a03; }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; padding: 18px 22px 16px 70px; position: relative; }
.steps li::after {
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 16px;
  font: 32px var(--pixel);
  color: var(--ember);
}
.steps strong { color: var(--ink-hot); }

/* A quiet table, for things that are lists of facts. */
.facts { width: 100%; border-collapse: collapse; font-size: 17px; }
.facts th, .facts td { text-align: left; padding: 10px 14px; border-bottom: 1px solid rgba(107, 79, 38, 0.45); vertical-align: top; }
.facts th { font: 16px var(--pixel); color: var(--brass); text-transform: uppercase; }
.facts td:first-child { color: var(--ink-hot); white-space: nowrap; }

/* ---- downloads ---- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.dl-card { display: grid; gap: 6px; padding: 30px 30px 28px; text-decoration: none; color: var(--ink); }
.dl-card:hover::before { background: linear-gradient(#241b14, var(--glass)); }
.dl-os { font-size: 48px; color: var(--ember); line-height: 1; margin-bottom: 8px; }
.dl-name { font-size: 24px; font-weight: 700; color: var(--ink-hot); }
.dl-meta { color: var(--ink-dim); font-size: 16px; margin-bottom: 18px; }
.dl-card .btn { justify-self: start; }
.state { font-size: 18px; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%; vertical-align: 1px; }
.dot.live { background: #7ccf6e; box-shadow: 0 0 10px #7ccf6e; }
.dot.soon { background: var(--ember); box-shadow: 0 0 10px var(--ember); }

/* ---- news ---- */
.news-list { display: grid; gap: 18px; }
.news-card { display: grid; gap: 8px; padding: 26px 30px 24px; text-decoration: none; color: var(--ink); }
.news-card:hover::before { background: linear-gradient(var(--glass-hi), var(--glass)); }
.news-meta { font-size: 16px; color: var(--ember); text-transform: uppercase; }
.news-title { font-size: 26px; font-weight: 700; color: var(--ink-hot); }
.news-lede { color: var(--ink-dim); font-size: 17px; }
.release-notes h3 { font-family: var(--pixel); font-weight: 400; font-size: 24px; color: var(--ember); margin-top: 1.8em; }
.release-nav { display: flex; justify-content: space-between; margin-top: 64px; padding-top: 24px; border-top: 1px solid rgba(107, 79, 38, 0.5); font: 16px var(--pixel); text-transform: uppercase; }

/* ---- media ---- */
.trailer { padding: 6px; }
.trailer video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.gallery .tile { display: block; overflow: hidden; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }
.gallery img { aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.4s, filter 0.4s; filter: saturate(0.9); }
.gallery .tile:hover img { transform: scale(1.04); filter: saturate(1.1); }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(5, 4, 6, 0.94);
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 84vh; width: auto; }
.lightbox p { text-align: center; color: var(--ink-dim); margin: 14px auto 0; }
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: var(--brass-hi);
  font: 48px var(--pixel);
  cursor: pointer;
  padding: 16px;
}
.lightbox .lb-close { top: 8px; right: 16px; font-size: 32px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

.callout { padding: 34px 36px 30px; }
.callout h2 { margin-bottom: 12px; }
.cta-band { text-align: center; padding: 110px 0; position: relative; overflow: hidden; isolation: isolate; }
.cta-band .hero-media { opacity: 0.35; }
.cta-band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at center, rgba(11, 10, 13, 0.4), var(--bg) 75%); }
.cta-band p { margin-inline: auto; }
.cta-band .btn-row { justify-content: center; }

.faq details { padding: 18px 24px 8px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink-hot); font-size: 20px; list-style: none; padding-bottom: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; font-family: var(--pixel); color: var(--ember); margin-right: 12px; }
.faq details[open] summary::before { content: "-"; }
code, kbd {
  font: 15px ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--glass-hi);
  border: 1px solid rgba(107, 79, 38, 0.6);
  padding: 1px 6px;
  color: var(--ink-hot);
}

/* ---- footer ---- */
.site-footer { margin-top: 40px; border-top: 1px solid rgba(107, 79, 38, 0.5); background: var(--glass-lo); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 56px 0 36px; }
.footer-grid h2 { font-size: 16px; color: var(--brass); text-transform: uppercase; margin-bottom: 12px; }
.footer-grid nav a { display: block; color: var(--ink-dim); text-decoration: none; font-size: 17px; padding: 3px 0; }
.footer-grid nav a:hover { color: var(--ink-hot); }
.logo-footer { font-size: 32px; display: inline-block; margin-bottom: 10px; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 18px 0 28px; border-top: 1px solid rgba(107, 79, 38, 0.3); font-size: 15px; }

/* Only hidden when the script is there to show it again. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.seen { opacity: 1; transform: none; }
.shot-mode .reveal { transition: none; }

/* ---- narrow screens ---- */
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--brass-lo);
    padding: 8px 16px 20px;
    display: none;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { padding: 14px 0; }
  .site-nav .sub { position: static; display: flex; background: none; clip-path: none; padding: 0 0 8px 14px; }
  .site-nav .sub::before { display: none; }
  .site-nav .btn { margin-top: 12px; justify-content: center; }
  .feature, .grid-2, .grid-3, .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .cards-5 { grid-template-columns: 1fr 1fr; }
  .cards-5 > *, .cards-5 > :nth-child(n+4) { grid-column: auto; }
  .feature.flip > :first-child { order: 0; }
  .feature + .feature { margin-top: 72px; }
  .section { padding: 64px 0; }
  h1, .title-xl { font-size: 40px; }
  h2, .feature h2 { font-size: 24px; }
  .page-head { padding: 96px 0 40px; }
}
@media (max-width: 520px) {
  .cards-5 { grid-template-columns: 1fr; }
  body { font-size: 18px; }
  .hero-title { font-size: 40px; }
  .logo { font-size: 24px; }
  .gallery { grid-template-columns: 1fr; }
  .facts td:first-child { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .gallery img { transition: none; }
}
