/* Mochahub Studios. One stylesheet for every page.
   The look is Ember's: a pop-up book at night. Night paper and glacier blues from the key art, cut-paper
   pieces with a dark outline and a white paper edge, and the game's own heading face (Lilita One).
   The header, heroes and footer are always night; the reading sections are frost paper by day and
   deep night by night, following the system. */

@font-face {
  font-family: Literata;
  src: url("/fonts/literata-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Lilita One";
  src: url("/fonts/lilita-one-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Ember's paper, sampled from the key art and the sprites */
  --night: #112645;
  --night-deep: #0b1a33;
  --night-raised: #1a3358;
  --ice: #a9d4ec;
  --glacier: #5d9bba;
  --paper: #fbf5e6;
  --outline: #12203d;
  --ember: #f0691f;
  --flame: #ffb23f;
  --gold: #ffd36b;
  --mist: #b9c9dd;

  /* Reading sections: frost paper */
  --bg: #e8f1f7;
  --bg-raised: #f5f9fc;
  --text: #13213e;
  --muted: #475877;
  --rule: #c3d5e3;
  --link: #b5450c;
  --focus: #b5450c;

  /* Paper ridges between sections */
  --ridge-back: #5d9bba;
  --ridge-mid: #9ccbe6;
  --ridge-edge: rgba(255, 255, 255, 0.95);
  --rise-back: #6f9cc0;
  --rise-mid: #31578a;

  --display: "Lilita One", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  --serif: Literata, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 5vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1730;
    --bg-raised: #13244a;
    --text: #e9f0f7;
    --muted: #a6b6cd;
    --rule: #233a62;
    --link: #ffb23f;
    --focus: #ffb23f;
    --ridge-back: #2a4c78;
    --ridge-mid: #1b3561;
    --ridge-edge: rgba(233, 243, 250, 0.55);
    --rise-back: #2a4c78;
    --rise-mid: #1b3561;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
}

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

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
ol,
ul,
figure {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--outline);
  font-family: var(--sans);
}
.skip:focus {
  top: 12px;
}

.wrap {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.narrow {
  max-width: 720px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 15px;
}

/* Night paper: a deep blue with a little fibre in it. */
.night {
  --focus: var(--flame);
  position: relative;
  background-color: var(--night);
  background-image: url("/media/paper-grain.webp");
  background-blend-mode: soft-light;
  color: var(--paper);
}

/* ---------------------------------------------------------------- header and footer */

.site-header {
  --focus: var(--flame);
  position: relative;
  z-index: 5;
  background-color: var(--night);
  background-image: url("/media/paper-grain.webp");
  background-blend-mode: soft-light;
  color: var(--paper);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 28px;
  padding-block: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.mark {
  flex: none;
}
.mark-rim {
  fill: none;
  stroke: #c9a867;
  stroke-width: 5.4;
  stroke-linejoin: round;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 12px;
  border-radius: 999px;
  color: var(--mist);
  text-decoration: none;
}
.nav a:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.07);
}
.nav a[aria-current="page"] {
  color: var(--outline);
  background: var(--flame);
}
@media (max-width: 560px) {
  .nav {
    margin-inline: -12px;
  }
}

.site-footer {
  --focus: var(--flame);
  margin-top: clamp(48px, 8vw, 96px);
  background-color: var(--night);
  background-image: url("/media/paper-grain.webp");
  background-blend-mode: soft-light;
  color: var(--mist);
}
.site-footer .ridge {
  --ridge-above: var(--bg);
  --ridge-below: var(--night);
  --ridge-back: var(--rise-back);
  --ridge-mid: var(--rise-mid);
  margin-bottom: -1px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 64px;
  padding-block: 28px 48px;
  font-family: var(--sans);
  font-size: 15px;
}
.footer-brand {
  flex: 1 1 260px;
  color: var(--paper);
}
.footer-brand .legal {
  margin-top: 10px;
  color: var(--mist);
}
.address {
  display: block;
}
.footer-nav {
  flex: 0 1 220px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.footer-head {
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--paper);
}
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
}
.footer-nav a:hover,
.footer-nav a[aria-current="page"] {
  color: var(--paper);
  text-decoration: underline;
}

/* ---------------------------------------------------------------- paper ridges */

.ridge {
  --ridge-above: var(--night);
  --ridge-below: var(--bg);
  display: block;
  width: 100%;
  height: clamp(40px, 6.5vw, 88px);
  background: var(--ridge-above);
}
.ridge-back {
  fill: var(--ridge-back);
}
.ridge-mid {
  fill: var(--ridge-mid);
}
.ridge-front {
  fill: var(--ridge-below);
}
.ridge-edge {
  fill: none;
  stroke: var(--ridge-edge);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
/* From a reading section up into night paper. */
.rise .ridge {
  --ridge-above: var(--bg);
  --ridge-below: var(--night);
  --ridge-back: var(--rise-back);
  --ridge-mid: var(--rise-mid);
}

/* ---------------------------------------------------------------- type and buttons */

.wordmark img {
  width: clamp(240px, 30vw, 400px);
  /* The 1050 file's shape, whichever srcset file loads: the 720 copy is 720×430, a hair off 1050×627, and
     Safari would otherwise move everything below it by a fraction of a pixel. */
  aspect-ratio: 1050 / 627;
  filter: drop-shadow(0 10px 18px rgba(4, 10, 26, 0.45));
}
.presents {
  margin-bottom: 6px;
  font-family: var(--display);
  font-size: clamp(17px, 1.6vw, 20px);
  letter-spacing: 0.02em;
  color: var(--ice);
}
/* The game's sticker lettering: cream paper with a dark outline. */
.tagline {
  margin-top: 18px;
  font-family: var(--display);
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.06;
  letter-spacing: 0.005em;
  color: var(--paper);
  -webkit-text-stroke: 0.16em var(--outline);
  paint-order: stroke fill;
  text-shadow: 0 0.09em 0 var(--outline);
  text-wrap: balance;
}
.hero-lead {
  max-width: 31rem;
  margin-top: 18px;
  font-size: clamp(18px, 1.7vw, 21px);
  line-height: 1.55;
  color: #dbe6f2;
  text-wrap: pretty;
}
.section-title {
  font-family: var(--display);
  font-size: clamp(32px, 4.4vw, 50px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
.section-lead {
  max-width: 38rem;
  margin-top: 14px;
  font-size: clamp(18px, 1.8vw, 21px);
  color: var(--muted);
  text-wrap: pretty;
}
.night .section-lead {
  color: #cfdbea;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 28px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 3px solid var(--outline);
  border-radius: 999px;
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.015em;
  line-height: 1;
  text-decoration: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.button:hover {
  transform: translateY(-2px);
}
.button:active {
  transform: translateY(2px);
}
@media (prefers-reduced-motion: reduce) {
  .button,
  .button:hover,
  .button:active {
    transform: none;
    transition: none;
  }
}
/* The game's buttons: amber paper, a dark outline, and a white paper edge around that. */
.button-flame {
  background: var(--flame);
  color: var(--outline);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.45),
    0 0 0 3px var(--paper),
    0 10px 20px rgba(3, 9, 24, 0.35);
}
.button-ghost {
  border-color: rgba(251, 245, 230, 0.6);
  color: var(--paper);
}
.button-ghost:hover {
  border-color: var(--paper);
  background: rgba(255, 255, 255, 0.06);
}
.button-ink {
  background: var(--outline);
  color: var(--paper);
  box-shadow: 0 4px 0 rgba(18, 32, 61, 0.25);
}
.button-line {
  border-color: var(--rule);
  border-width: 2px;
  color: var(--text);
}
.button-line:hover {
  border-color: var(--muted);
}
.button-gold {
  border: 0;
  background: #e2b062;
  color: #131925;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.store-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 24px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: #dbe6f2;
}
.soon {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--outline);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 3px var(--outline);
}
/* Store buttons for a store that isn't open yet. They ship hidden (site.js shows them), and .button's own
   display would otherwise beat the hidden attribute. */
.store-soon[hidden],
.store-links[hidden],
.store-status[hidden] {
  display: none;
}

/* The sign-up box a store button opens while that store isn't open yet: a paper card over the dimmed page. */
.waitlist {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  margin: auto;
  padding: 28px 24px 24px;
  font-family: var(--sans);
}
.waitlist::backdrop {
  background: rgba(6, 14, 30, 0.72);
}
.waitlist h2 {
  margin: 0 0 10px;
  text-align: center;
  text-wrap: balance;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.waitlist h2:focus {
  outline: none;
}
.waitlist p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.45;
}
.waitlist label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 700;
}
.waitlist input[type="email"] {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-bottom: 16px;
  padding: 0 14px;
  border: 3px solid var(--outline);
  border-radius: 12px;
  background: #fff;
  color: var(--outline);
  font: inherit;
  font-size: 17px;
}
.waitlist input[type="email"]:focus-visible {
  outline: 3px solid #b5450c;
  outline-offset: 2px;
}
.waitlist .button {
  width: 100%;
  padding-inline: 16px;
}
@media (max-width: 359px) {
  .waitlist .button {
    font-size: 17px;
  }
}
.waitlist .button:disabled {
  opacity: 0.6;
  cursor: progress;
}
/* Seven keepers cheer as the box opens, lanterns up: the Keeper in the middle and a little taller, the three on
   the left turned to face it. They share one height, as in the game, overlap a little, and hop one after another
   from the middle out, then stand still. */
.waitlist-keepers {
  --h: min(72px, 14.5vw);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin: 18px 0 14px;
}
.waitlist-keepers img {
  position: relative;
  width: auto;
  height: var(--h);
  margin-left: calc(var(--h) * -0.22);
  animation: keeper-hop 0.7s 2 both;
}
.waitlist-keepers img:first-child {
  margin-left: 0;
}
.waitlist-keepers .flip {
  scale: -1 1;
}
.waitlist-keepers .middle {
  z-index: 3;
  height: calc(var(--h) * 1.2);
  animation-delay: 0.1s;
}
.waitlist-keepers img:nth-child(3),
.waitlist-keepers img:nth-child(5) {
  z-index: 2;
  animation-delay: 0.2s;
}
.waitlist-keepers img:nth-child(2),
.waitlist-keepers img:nth-child(6) {
  z-index: 1;
  animation-delay: 0.3s;
}
.waitlist-keepers img:nth-child(1),
.waitlist-keepers img:nth-child(7) {
  animation-delay: 0.4s;
}
@keyframes keeper-hop {
  0% { translate: 0 0; animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  38% { translate: 0 -12%; animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
  70%, 100% { translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .waitlist-keepers img {
    animation: none;
  }
}
.waitlist-form > p:first-of-type,
.waitlist-done p {
  text-align: center;
}
.waitlist a {
  color: #b5450c;
}
.waitlist-error {
  color: #a3260b;
  font-weight: 700;
}
.waitlist-error[hidden],
.waitlist-form[hidden],
.waitlist-done[hidden] {
  display: none;
}
.waitlist-done .button {
  margin: 4px 0 0;
}
.waitlist-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--outline);
  cursor: pointer;
}
.waitlist-close:hover {
  background: rgba(18, 32, 61, 0.08);
}
.waitlist-close:focus-visible {
  outline: 3px solid #b5450c;
}
/* Kept for bots that fill every field; people never see it. */
.waitlist-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.store-links {
  margin-top: 24px;
}

/* ---------------------------------------------------------------- the home hero: a pop-up valley */

.home-hero {
  overflow: hidden;
  padding-top: clamp(36px, 6vw, 72px);
}
.home-hero-copy {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.home-hero-copy .wordmark img {
  margin-inline: auto;
}
.home-hero-copy .hero-lead {
  margin-inline: auto;
}
.home-hero-copy .actions {
  justify-content: center;
}

/* The valley is one fixed-shape stage, so every paper piece can be placed in percent of it. On narrow
   screens the stage keeps a minimum width and is cropped around the camp and the fortress. */
.diorama {
  position: relative;
  margin-top: clamp(-110px, -6vw, -36px);
}
.diorama-stage {
  position: relative;
  width: max(100%, 820px);
  aspect-ratio: 2400 / 1029;
  margin-left: 50%;
  transform: translateX(-44%);
}
@media (min-width: 821px) {
  .diorama-stage {
    transform: translateX(-50%);
  }
}
.diorama-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* The sky at the top of the picture melts into the night paper behind the words. */
.diorama-bg {
  -webkit-mask-image: linear-gradient(transparent, #000 30%);
  mask-image: linear-gradient(transparent, #000 30%);
}
/* The ridge rises over the picture's snowy foreground, as the next page of the pop-up. */
.home-hero > .ridge,
.ember-hero > .ridge {
  position: relative;
  z-index: 3;
  height: clamp(40px, 5vw, 64px);
  margin-top: calc(-0.56 * clamp(40px, 5vw, 64px));
  background: transparent;
}

/* Wide screens: the words on the left, the valley on the right, and the whole hero no taller than the
   window. The stage keeps its shape (so the pieces stay put) and is cropped at the window's right edge. */
@media (min-width: 1100px) {
  .home-hero {
    --stage-h: min(clamp(470px, 44vw, 640px), calc(100svh - 120px));
    --stage-w: calc(var(--stage-h) * 2.3324);
    position: relative;
    padding-top: 0;
  }
  .home-hero-copy {
    justify-content: center;
    align-items: flex-start;
    min-height: calc(var(--stage-h) * 0.95);
    padding-block: 32px 56px;
    text-align: left;
  }
  .home-hero-copy > * {
    max-width: 27rem;
  }
  .home-hero-copy .wordmark img {
    width: clamp(240px, 22vw, 320px);
    margin-inline: 0;
  }
  .home-hero-copy .tagline {
    font-size: clamp(32px, 3.2vw, 44px);
  }
  .home-hero-copy .hero-lead {
    margin-inline: 0;
  }
  .home-hero-copy .actions {
    justify-content: flex-start;
  }
  .diorama {
    position: absolute;
    top: 0;
    right: calc(max(0px, (100% - 1160px) / 2) - var(--stage-w) * var(--shift, 0.3));
    width: var(--stage-w);
    height: var(--stage-h);
    margin: 0;
  }
  .diorama-stage {
    width: 100%;
    height: 100%;
    margin: 0;
    transform: none;
  }
  .diorama-bg {
    -webkit-mask-image: linear-gradient(90deg, transparent 2%, #000 20%), linear-gradient(transparent, #000 16%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 2%, #000 20%), linear-gradient(transparent, #000 16%);
    mask-composite: intersect;
  }
  .home-hero > .ridge {
    margin-top: calc(var(--stage-h) * -0.06);
  }
  .ember-hero > .ridge {
    position: absolute;
    bottom: 0;
    left: 0;
    margin: 0;
  }
  /* A soft dark wash behind the words, so the mountains behind them stay quiet. */
  .home-hero-copy::before,
  .ember-hero-copy::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: calc(var(--gutter) - 22rem);
    width: 52rem;
    background: radial-gradient(closest-side, rgba(13, 29, 55, 0.78), rgba(13, 29, 55, 0));
    pointer-events: none;
  }
}
@media (min-width: 1300px) {
  .home-hero {
    --shift: 0.34;
  }
}
.piece {
  position: absolute;
  z-index: 2;
  width: auto;
  max-width: none;
  filter: drop-shadow(0 6px 6px rgba(5, 12, 30, 0.35));
}
.piece-old-keeper {
  left: 22.6%;
  bottom: 6%;
  height: 15.5%;
}
.piece-fire {
  left: 29.4%;
  bottom: 5.2%;
  height: 11%;
}
.piece-keeper {
  left: 34.8%;
  bottom: 5.8%;
  height: 15%;
}
.beacon {
  position: absolute;
  z-index: 2;
  aspect-ratio: 383 / 525;
  filter: drop-shadow(0 6px 6px rgba(5, 12, 30, 0.35));
}
.beacon img {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: auto;
  max-width: none;
  transform: translateX(-50%);
}
.beacon .lit {
  height: 100%;
}
.beacon .cold {
  height: 84%;
  opacity: 0;
}
.beacon-1 {
  left: 42.6%;
  bottom: 8%;
  height: 12%;
}
.beacon-2 {
  left: 49.6%;
  bottom: 11.6%;
  height: 10.4%;
}
.beacon-3 {
  left: 55.6%;
  bottom: 15.2%;
  height: 8.8%;
}
.beacon-great {
  left: 61.65%;
  bottom: 60.6%;
  height: 17%;
}
/* Paper rays fanned behind the Great Beacon, like the store header's. */
.rays {
  position: absolute;
  z-index: 1;
  left: 64.3%;
  top: 27%;
  width: 120%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 3deg, rgba(255, 224, 160, 0.17) 0deg 7deg, rgba(255, 224, 160, 0) 7deg 18deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 6%, rgba(0, 0, 0, 0.55) 30%, transparent 62%);
  mask-image: radial-gradient(closest-side, #000 6%, rgba(0, 0, 0, 0.55) 30%, transparent 62%);
  pointer-events: none;
}

/* The one moment of motion: the beacons catch one after another up the road, then the rays open behind
   the Great Beacon. Without motion (or before the stylesheet's animations run) every beacon is simply lit. */
@media (prefers-reduced-motion: no-preference) {
  .diorama .beacon .lit {
    animation: catch 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  }
  .diorama .beacon .cold {
    animation: go-out 0.15s linear both;
  }
  .diorama .beacon-1 img {
    animation-delay: 0.6s;
  }
  .diorama .beacon-2 img {
    animation-delay: 1s;
  }
  .diorama .beacon-3 img {
    animation-delay: 1.4s;
  }
  .diorama .beacon-great img {
    animation-delay: 1.9s;
  }
  .diorama .rays {
    animation: rays-open 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 2s both;
  }
}
@keyframes catch {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.6);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}
@keyframes go-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes rays-open {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-24deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0) scale(1);
  }
}

/* ---------------------------------------------------------------- the Ember page hero */

.ember-hero {
  overflow: hidden;
}
.ember-hero-stage {
  position: relative;
}
.ember-hero-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ember-hero-copy {
  position: relative;
  z-index: 2;
  padding-block: clamp(36px, 6vw, 72px) 28px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}
.text-link svg {
  flex: none;
}
/* Narrow: the words first, then the picture below them, its sky melting into the night. */
.ember-hero-stage {
  aspect-ratio: 4 / 5;
}
.ember-hero-stage img {
  object-position: 50% 100%;
}
.ember-hero-stage::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 30%;
  background: linear-gradient(var(--night), rgba(17, 38, 69, 0));
}
.ember-hero-copy {
  order: -1;
}
.ember-hero {
  display: flex;
  flex-direction: column;
}
@media (min-width: 700px) {
  .ember-hero-stage {
    aspect-ratio: 16 / 9;
  }
  .ember-hero-stage img {
    object-position: 62% 100%;
  }
}
/* Wide: the words sit in the sky over the keeper's head. */
@media (min-width: 1100px) {
  .ember-hero {
    --art-h: min(clamp(560px, 46vw, 760px), calc(100svh - 80px));
    display: block;
    position: relative;
    min-height: calc(var(--art-h) + clamp(40px, 5vw, 64px) * 0.44);
  }
  .ember-hero .wordmark img {
    width: clamp(240px, 22vw, 340px);
  }
  .ember-hero .tagline {
    font-size: clamp(32px, 3.2vw, 44px);
  }
  /* The picture keeps its own shape, anchored past the right edge, so the keeper always stands just to
     the right of the words. */
  .ember-hero-stage {
    position: absolute;
    top: 0;
    right: calc(max(0px, (100% - 1160px) / 2) - var(--art-h) * 2 * 0.27);
    width: calc(var(--art-h) * 2);
    height: var(--art-h);
    aspect-ratio: auto;
  }
  .ember-hero-stage img {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%);
    mask-image: linear-gradient(90deg, transparent, #000 18%);
  }
  .ember-hero-stage::before {
    display: none;
  }
  .ember-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: var(--art-h);
    padding-block: 32px 48px;
  }
  .ember-hero-copy > * {
    max-width: 27rem;
  }
}

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

.section {
  padding-block: clamp(56px, 8vw, 104px);
}
.section-head {
  margin-bottom: clamp(32px, 4vw, 48px);
}
.night.section {
  padding-block: clamp(56px, 8vw, 104px);
}
.rise + .night.section,
.ridge + .section {
  padding-top: clamp(32px, 5vw, 64px);
}

/* Paper cards: cream paper, a dark outline, and a white edge around that, like every sprite. */
.paper {
  position: relative;
  border: 3px solid var(--outline);
  border-radius: 18px;
  background: var(--paper);
  color: var(--outline);
  box-shadow:
    0 0 0 5px #fff,
    0 14px 28px rgba(9, 22, 48, 0.18);
}
@media (prefers-color-scheme: dark) {
  .paper {
    box-shadow:
      0 0 0 5px #e9eef4,
      0 16px 30px rgba(0, 0, 0, 0.45);
  }
}

/* How a room plays: a real sequence, so it's numbered. */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 40px 32px;
  margin-top: clamp(36px, 5vw, 56px);
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  padding: 0 26px 28px;
}
.step:nth-child(1) {
  rotate: -1.2deg;
}
.step:nth-child(2) {
  rotate: 0.8deg;
}
.step:nth-child(3) {
  rotate: -0.6deg;
}
.step-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  /* 170 px, a little less on phones under about 370 px, where the keeper and the frostling side by side were
     wider than the screen */
  height: min(170px, 46vw);
  margin-top: -44px;
}
.step-art img {
  width: auto;
  max-height: 100%;
  filter: drop-shadow(0 8px 8px rgba(5, 12, 30, 0.25));
}
.step-art img + img {
  margin-left: -18px;
}
.step h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 18px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.1;
}
.step h3::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 3px solid var(--outline);
  border-radius: 50%;
  background: var(--flame);
  font-size: 20px;
  line-height: 1;
  translate: 0 -2px;
}
.step p {
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.6;
}

/* Screenshots: a row of cards to scroll through sideways. */
.shots {
  overflow: hidden;
}
.shot-scroller {
  margin-top: clamp(28px, 4vw, 44px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.shot-strip {
  display: flex;
  gap: clamp(18px, 2.4vw, 30px);
  width: max-content;
  margin: 0;
  padding: 18px max(var(--gutter), calc((100vw - 1160px) / 2 + var(--gutter))) 36px;
  list-style: none;
}
.shot-strip li {
  scroll-snap-align: start;
  flex: none;
  width: clamp(200px, 22vw, 270px);
}
.shot-strip li:nth-child(odd) {
  rotate: -1.4deg;
}
.shot-strip li:nth-child(even) {
  rotate: 1.2deg;
  translate: 0 14px;
}
.shot-strip img {
  width: 100%;
  aspect-ratio: 660 / 1434;
  border: 3px solid var(--outline);
  border-radius: 16px;
  background: var(--night);
  box-shadow:
    0 0 0 5px #fff,
    0 16px 26px rgba(9, 22, 48, 0.22);
}
.scroll-hint {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
}

/* The trailer, upright in a paper phone. */
.trailer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 40px 64px;
}
.trailer-copy {
  flex: 1 1 320px;
  max-width: 30rem;
}
.trailer-copy p {
  margin-top: 16px;
  color: #d4e0ee;
}
.trailer-copy .fireflies {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}
.trailer-copy .fireflies img {
  width: 64px;
}
.trailer-copy .fireflies img:nth-child(2) {
  width: 46px;
  translate: 0 -22px;
}
/* A single iPhone, standing on its own: the same frame as the family's, at a fixed width. */
.device.device-solo {
  position: relative;
  flex: none;
  margin-inline: auto;
}
.trailer-grid .device.device-solo {
  --w: min(330px, 78vw);
  rotate: 2deg;
}
.device-phone video {
  display: block;
  width: 100%;
  aspect-ratio: 720 / 1280;
  border-radius: calc(var(--w) * 0.13);
  background: #0a142a;
}

/* What waits in the tower */
.foes {
  margin-top: clamp(36px, 5vw, 56px);
  padding: clamp(24px, 4vw, 40px);
}
.foes h3,
.bosses-head,
.trio h3 {
  font-family: var(--display);
  font-size: clamp(25px, 2.6vw, 31px);
  font-weight: 400;
  line-height: 1.1;
}
.foes > p {
  max-width: 40rem;
  margin-top: 10px;
  font-size: 17px;
}
.parade {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 124px), 1fr));
  gap: 24px 20px;
  margin-top: 28px;
  padding: 0;
  list-style: none;
}
.parade li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.parade img {
  width: auto;
  height: 112px;
  filter: drop-shadow(0 6px 6px rgba(5, 12, 30, 0.2));
}
.bosses-head {
  margin-top: clamp(56px, 7vw, 88px);
}
.bosses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 64px 28px;
  margin-top: 64px;
  padding: 0;
  list-style: none;
}
.boss {
  display: flex;
  flex-direction: column;
  padding: 0 24px 26px;
  border-radius: 22px;
  background: var(--night);
  background-image: url("/media/paper-grain.webp");
  background-blend-mode: soft-light;
  color: var(--paper);
  box-shadow:
    0 0 0 3px var(--outline),
    0 0 0 8px #fff,
    0 16px 30px rgba(9, 22, 48, 0.25);
}
@media (prefers-color-scheme: dark) {
  .boss {
    background-color: var(--night-raised);
    box-shadow:
      0 0 0 3px var(--outline),
      0 0 0 8px #e9eef4,
      0 16px 30px rgba(0, 0, 0, 0.45);
  }
}
.boss img {
  align-self: center;
  width: auto;
  height: 190px;
  margin-top: -36px;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.4));
}
/* Bosses past the first floor stay a secret: a frosted question mark stands in for the art. */
.boss-mark {
  display: grid;
  place-items: center;
  align-self: center;
  height: 190px;
  margin-top: -36px;
  font-family: var(--display);
  font-size: 176px;
  line-height: 1;
  color: var(--ice);
  -webkit-text-stroke: 0.09em var(--outline);
  paint-order: stroke fill;
  text-shadow:
    0 0.05em 0 var(--outline),
    0 0 0.35em rgba(169, 212, 236, 0.45);
  rotate: -6deg;
  user-select: none;
}
.boss-secret:last-child .boss-mark {
  rotate: 7deg;
}
.boss h4 {
  margin-top: 14px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  color: var(--gold);
}
.boss p {
  margin-top: 6px;
  font-size: 17px;
  color: #d8e3ef;
}
@media (min-width: 900px) {
  .bosses li:nth-child(2) {
    translate: 0 18px;
  }
}
/* Past the Glacier: the valley road, for a hint that the climb goes on. */
.valley-road {
  overflow: hidden;
  margin-top: clamp(72px, 9vw, 112px);
  border-radius: 22px;
  background-color: var(--night);
  background-image: url("/media/paper-grain.webp");
  background-blend-mode: soft-light;
  color: var(--paper);
  box-shadow:
    0 0 0 3px var(--outline),
    0 0 0 8px #fff,
    0 16px 30px rgba(9, 22, 48, 0.25);
}
@media (prefers-color-scheme: dark) {
  .valley-road {
    background-color: var(--night-raised);
    box-shadow:
      0 0 0 3px var(--outline),
      0 0 0 8px #e9eef4,
      0 16px 30px rgba(0, 0, 0, 0.45);
  }
}
.valley-road img {
  width: 100%;
  aspect-ratio: 1280 / 549;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}
.valley-road-copy {
  max-width: 46rem;
  margin-top: clamp(-56px, -4vw, -16px);
  padding: 0 clamp(24px, 4vw, 44px) clamp(26px, 4vw, 40px);
  position: relative;
}
.valley-road-copy h3 {
  font-family: var(--display);
  font-size: clamp(25px, 2.6vw, 31px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--gold);
}
.valley-road-copy p {
  margin-top: 10px;
  font-size: 17px;
  color: #d8e3ef;
}
.trio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 40px 48px;
  margin-top: clamp(72px, 9vw, 112px);
}
.trio article {
  display: flex;
  flex-direction: column;
}
.trio .sprites {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 104px;
  margin-bottom: 18px;
}
.trio .sprites img {
  width: auto;
  height: 100%;
  filter: drop-shadow(0 6px 6px rgba(5, 12, 30, 0.22));
}
.trio .sprites img.small {
  height: 72%;
}
.trio p {
  margin-top: 10px;
  font-size: 17px;
  color: var(--muted);
}

/* Support */
.support-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 72px;
}
.support-copy {
  flex: 1 1 300px;
}
.support-copy > p {
  margin-top: 14px;
  color: var(--muted);
}
.faq {
  flex: 1.4 1 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.faq details {
  border: 2px solid var(--rule);
  border-radius: 16px;
  background: var(--bg-raised);
}
.faq details[open] {
  border-color: var(--muted);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 20px;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  rotate: 45deg;
  translate: 0 -3px;
  transition: rotate 0.15s ease;
}
.faq details[open] summary::after {
  rotate: 225deg;
  translate: 0 3px;
}
.faq details p {
  padding: 0 20px 18px;
  font-size: 17px;
  color: var(--muted);
}
.faq a,
.doc a,
.contact a:not(.big) {
  color: var(--link);
}

/* Copy buttons */
.email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 18px;
}
.big {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  font-size: clamp(22px, 2.6vw, 28px);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  text-decoration-thickness: 2px;
  user-select: text;
}
.copy,
.duo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.copy[hidden] {
  display: none;
}
.duo-toggle[hidden] {
  display: none;
}
.copy:hover,
.duo-toggle:hover {
  border-color: var(--muted);
}

/* ---------------------------------------------------------------- home: the studio and its games */

.studio-intro {
  max-width: 44rem;
}
.games {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin-top: clamp(40px, 5vw, 64px);
}
.game-ember {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}
.game-ember-copy {
  padding: clamp(26px, 4vw, 44px);
}
.game-ember-head {
  display: flex;
  align-items: center;
  gap: 18px;
}
.app-icon {
  flex: none;
  width: 84px;
  height: 84px;
  border: 3px solid var(--outline);
  border-radius: 22px;
}
.game-ember h3 {
  font-family: var(--display);
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 400;
  line-height: 1.05;
}
.game-ember .genre {
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: #5b6a86;
}
.game-ember-copy > p {
  max-width: 32rem;
  margin-top: 18px;
  font-size: 18px;
}
.game-ember .status {
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  color: #a63f0a;
}
.game-ember .button {
  margin-top: 24px;
}
.game-ember .button-flame {
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.45),
    0 4px 0 var(--outline);
}
@media (min-width: 820px) {
  .game-ember {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.game-ember-devices {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 4vw, 40px) clamp(20px, 3vw, 32px);
  background-color: var(--night);
  background-image: url("/media/paper-grain.webp");
  background-blend-mode: soft-light;
}

/* Perpetua keeps its own colours: an ink-blue night, vellum and gold. */
.perpetua {
  --focus: #e2b062;
  background: #131925;
  color: #ece3d0;
}
.perpetua-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px 64px;
  padding-block: clamp(56px, 8vw, 104px);
}
.perpetua-copy {
  flex: 1 1 320px;
  min-width: 0;
}
.perpetua-status {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: #9aa3b5;
}
.perpetua-title {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: #e2b062;
}
.perpetua-line {
  margin-top: 12px;
  font-style: italic;
  font-size: 19px;
  color: #b59b62;
}
.perpetua-lead {
  max-width: 28rem;
  margin-top: 18px;
  font-size: 19px;
}
.perpetua .small {
  margin-top: 18px;
  color: #9aa3b5;
}
.perpetua-art {
  flex: 1.2 1 380px;
  min-width: 0;
}
.perpetua-art img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: 50% 30%;
  border: 1px solid #2c3548;
  border-radius: 10px;
}
.perpetua-trailer {
  padding-bottom: clamp(56px, 8vw, 104px);
}
.perpetua-trailer h3 {
  margin-bottom: 16px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}
.perpetua video,
.press-video :not(.device) > video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #2c3548;
  border-radius: 10px;
  background: #0b0f17;
}

/* Contact and the press kit */
.columns {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 48px 72px;
}
.contact {
  flex: 3 1 400px;
  min-width: 0;
}
.contact > p {
  max-width: 34rem;
  margin-top: 14px;
  color: var(--muted);
}
.press-card {
  flex: 2 1 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  text-decoration: none;
  rotate: 1deg;
}
.press-card-title {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1.1;
}
.press-card-text {
  font-size: 17px;
  color: #3d4c68;
}
.press-card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  color: #a63f0a;
}
.press-card:hover .press-card-link {
  text-decoration: underline;
}

/* ---------------------------------------------------------------- privacy, terms */

.doc-hero {
  padding-top: clamp(28px, 5vw, 56px);
}
.doc-hero h1 {
  margin-top: 22px;
  font-family: var(--display);
  font-size: clamp(40px, 6.5vw, 64px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.005em;
  color: var(--paper);
  -webkit-text-stroke: 0.14em var(--outline);
  paint-order: stroke fill;
  text-shadow: 0 0.08em 0 var(--outline);
  text-wrap: balance;
}
.doc-date {
  margin-top: 12px;
  padding-bottom: clamp(28px, 4vw, 44px);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--mist);
}
.doc-date a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.doc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
}
.doc-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid rgba(185, 201, 221, 0.35);
  border-radius: 999px;
  color: var(--mist);
  text-decoration: none;
}
.doc-tabs a:hover {
  border-color: var(--mist);
  color: var(--paper);
}
.doc-tabs a[aria-current="page"] {
  border-color: var(--flame);
  background: var(--flame);
  color: var(--outline);
}
.doc-tabs-home::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: url("/media/ember/icon-256.webp") center / cover;
}
.doc {
  padding-block: clamp(36px, 5vw, 56px) clamp(24px, 4vw, 48px);
}
.doc .lead {
  margin-bottom: 18px;
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.55;
}
.doc > p {
  margin-top: 14px;
}
.doc section {
  margin-top: 36px;
  padding-top: 30px;
  border-top: 2px dashed var(--rule);
}
.doc h2 {
  margin-bottom: 10px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.005em;
}
.doc section p + p,
.doc section ul + p,
.doc section ol + p,
.doc section p + ul,
.doc section p + ol {
  margin-top: 14px;
}
.doc ul,
.doc ol {
  padding-left: 1.4em;
}
.doc li + li {
  margin-top: 8px;
}
.doc ul li::marker {
  color: var(--ember);
  content: "◆  ";
  font-size: 0.75em;
}
.doc strong {
  font-weight: 600;
}
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* The licence notices (/ember/licenses): one card per library, its names folded away. */
.doc ul.notices {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}
.doc ul.notices > li {
  margin: 0;
  padding: 16px 20px;
  border: 2px solid var(--rule);
  border-radius: 16px;
  background: var(--bg-raised);
}
.doc ul.notices > li::marker {
  content: none;
}
.doc ul.notices h3 {
  margin-bottom: 6px;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.2;
}
.doc ul.notices p {
  overflow-wrap: anywhere;
}
.doc ul.notices details {
  margin-top: 10px;
}
.doc ul.notices summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted);
}
.doc ul.notice-names {
  margin-top: 6px;
  font-size: 15px;
  color: var(--muted);
}
.doc ul.notice-names li + li {
  margin-top: 4px;
}

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

.press-hero {
  padding-block: clamp(40px, 6vw, 72px) clamp(28px, 4vw, 44px);
}
.press-hero h1 {
  font-family: var(--display);
  font-size: clamp(44px, 7vw, 76px);
  font-weight: 400;
  line-height: 1;
  color: var(--paper);
  -webkit-text-stroke: 0.14em var(--outline);
  paint-order: stroke fill;
  text-shadow: 0 0.08em 0 var(--outline);
}
.press-hero .hero-lead {
  max-width: 36rem;
}
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
}
.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid rgba(185, 201, 221, 0.35);
  border-radius: 999px;
  color: var(--mist);
  text-decoration: none;
}
.toc a:hover {
  border-color: var(--mist);
  color: var(--paper);
}
.press-section {
  padding-block: clamp(44px, 6vw, 72px);
}
.press-section + .press-section {
  border-top: 2px dashed var(--rule);
}
.press-game-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-bottom: clamp(28px, 4vw, 40px);
}
.press-game-head .app-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}
.press-game-head .perpetua-icon {
  border-color: #2c3548;
}
.sub {
  margin-bottom: 16px;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.15;
}
.intro {
  max-width: 42rem;
  margin-bottom: 24px;
  color: var(--muted);
}
.two-up {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 64px;
}
.two-up > * {
  flex: 1 1 340px;
  min-width: 0;
}
.two-up + .two-up,
.two-up + .sub,
.grid + .sub,
.grid + .grid,
.two-up + .grid {
  margin-top: 48px;
}
.wide-first > :first-child {
  flex-grow: 1.5;
}
.facts {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  font-size: 16px;
  border-bottom: 1px solid var(--rule);
}
.facts dt,
.facts dd {
  padding-block: 12px;
  border-top: 1px solid var(--rule);
  overflow-wrap: anywhere;
}
.facts dt {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
/* A taller hit area for links in the table, without taller rows. */
.facts dd a {
  display: inline-block;
  padding-block: 13px;
  margin-block: -13px;
  color: var(--link);
}
@media (max-width: 480px) {
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .facts dt {
    padding-bottom: 0;
  }
  .facts dd {
    padding-top: 2px;
    border-top: 0;
  }
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.panel {
  padding: clamp(20px, 3vw, 28px);
  border: 2px solid var(--rule);
  border-radius: 16px;
  background: var(--bg-raised);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
}
.panel-head .muted {
  font-weight: 400;
}
.prose-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 18px;
  line-height: 1.65;
}
.features {
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--rule);
}
.features li {
  padding-block: 14px;
  border-top: 1px solid var(--rule);
}
.features strong {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
}
.features span {
  font-size: 16px;
  color: var(--muted);
}
.press-video {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 32px 48px;
}
.press-video > :first-child:not(.device) {
  flex: 1 1 420px;
}
.press-videos {
  max-width: 34rem;
  margin: 48px auto 0;
}
.press-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 3vw, 24px);
}
.press-video-item {
  font-family: var(--sans);
}
.press-video-item h4 {
  margin: 0 0 8px;
  font-size: 16px;
}
.press-video-item video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 2;
  object-fit: contain;
  border-radius: 8px;
  background: #0b0f17;
}
.press-video-item > a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
}
.press-video-item p {
  color: var(--muted);
  font-size: 13px;
}
.press-videos > p {
  margin-top: 16px;
}
.downloads {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 20px;
}
.download {
  flex: 0 1 360px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 22px;
  border: 2px solid var(--rule);
  border-radius: 14px;
  background: var(--bg-raised);
  font-family: var(--sans);
  font-size: 15px;
  text-decoration: none;
}
.download:hover {
  border-color: var(--muted);
}
.download strong {
  display: block;
}
.download .muted {
  font-size: 14px;
}
.download svg {
  flex: none;
  color: var(--link);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 24px;
  padding: 0;
  list-style: none;
}
.grid a {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--sans);
  font-size: 15px;
  text-decoration: none;
}
.grid a:hover span {
  text-decoration: underline;
}
.grid img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--night);
}
.grid-tall,
.grid-square,
.grid-shots {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
}
.grid-shots {
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 160px), 1fr));
}
.grid-tall img {
  aspect-ratio: 585 / 1024;
}
.grid-shots img {
  aspect-ratio: 660 / 1434;
}
.grid-square img {
  aspect-ratio: 1;
}
.grid-mixed img {
  aspect-ratio: 4 / 5;
}
.grid-mixed .span-2 {
  grid-column: 1 / -1;
}
.grid-mixed .span-2 img,
.grid-wide img {
  aspect-ratio: 2 / 1;
}
.grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
}
.logos .tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  aspect-ratio: 16 / 10;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: 10px;
}
/* Logos sit inside the tile at their own shape: undo the photo grid's 16:9 crop and frame. */
.logos .tile img {
  width: auto;
  height: auto;
  max-width: 88%;
  max-height: 64%;
  aspect-ratio: auto;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: none;
}
.tile-light {
  background: #f4f3ef;
}
.tile-dark {
  background: #0e1219;
}
.tile-grey {
  background: #e9e8e3;
}
.tile-night {
  background: #131925;
}
.tile-ember {
  background: var(--night);
}
.logos .tile .tile-mark {
  height: 60%;
}
.logos .tile .tile-icon,
.logos .tile .tile-avatar {
  height: 56%;
  max-height: 128px;
  aspect-ratio: 1;
  border-radius: 22%;
}
.logos .tile .tile-avatar {
  border-radius: 50%;
}
.tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 15px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.grid .chips a {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--rule);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.grid .chips a:hover {
  border-color: var(--muted);
}
.logos + .intro {
  margin-top: 24px;
}
.contact-line {
  margin-top: 16px;
}

/* ---------------------------------------------------------------- 404 */

.lost {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-block: clamp(48px, 8vw, 96px) clamp(56px, 8vw, 104px);
}
.lost-art {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 28px;
}
.lost-art img {
  width: auto;
  height: 150px;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.35));
}
.lost-art img.lost-beacon {
  height: 120px;
}
.lost h1 {
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 64px);
  font-weight: 400;
  line-height: 1.02;
  color: var(--paper);
  -webkit-text-stroke: 0.14em var(--outline);
  paint-order: stroke fill;
  text-shadow: 0 0.08em 0 var(--outline);
}
.lost p {
  max-width: 30rem;
  margin-top: 16px;
  color: #d4e0ee;
}
.lost .actions {
  margin-top: 28px;
}

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 48px;
}
.section-head-row .sub {
  margin-bottom: 16px;
}
.press-features-head {
  margin-top: 32px;
}
.press-section .stack + div .facts {
  margin-top: 0;
}
.press-section > .two-up + .sub,
.press-section > .press-video + .sub,
.press-section > .grid + .logos {
  margin-top: 48px;
}
.press-section > .sub {
  margin-top: 48px;
}
.press-section .two-up + .sub {
  margin-top: 56px;
}

/* ---------------------------------------------------------------- devices: an iPad, an iPhone Duo and an iPhone */

/* The iPad and iPhone are drawn in CSS around the game's screens. The iPhone Duo is a live 3D model of the real
   phone (below), so no photo of anyone's product ships. Every size follows the device's width (--w), given in
   container units of the family around it. */
.family {
  container-type: inline-size;
  width: min(100%, 940px);
  margin-inline: auto;
  text-align: center;
}
.family-stage {
  position: relative;
  aspect-ratio: 100 / 55;
  text-align: start;
}
.device {
  position: absolute;
  width: var(--w);
  padding: calc(var(--w) * 0.035);
  background: #1b1d22;
  box-shadow:
    inset 0 0 0 calc(var(--w) * 0.006) #4a4e57,
    0 0 0 3px var(--outline),
    0 0 0 7px #fff,
    0 22px 40px rgba(3, 9, 24, 0.45);
}
.device img {
  width: 100%;
  background: var(--night);
}
.device-phone {
  border-radius: calc(var(--w) * 0.165);
}
.device-phone img {
  aspect-ratio: 600 / 1305;
  border-radius: calc(var(--w) * 0.13);
}
/* The island at the top of the screen. */
.device-phone::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: calc(var(--w) * 0.07);
  left: 50%;
  width: 30%;
  height: calc(var(--w) * 0.085);
  border-radius: 999px;
  background: #050608;
  transform: translateX(-50%);
}
/* The side button. */
.device-phone::after {
  content: "";
  position: absolute;
  top: 26%;
  right: calc(var(--w) * -0.018);
  width: calc(var(--w) * 0.018);
  height: 11%;
  border-radius: 0 3px 3px 0;
  background: #2a2d33;
}
.device-tablet {
  padding: calc(var(--w) * 0.032);
  border-radius: calc(var(--w) * 0.062);
}
.device-tablet img {
  aspect-ratio: 3 / 4;
  border-radius: calc(var(--w) * 0.03);
}
/* The front camera, centred in the top bezel. */
.device-tablet::before {
  content: "";
  position: absolute;
  top: calc(var(--w) * 0.013);
  left: 50%;
  width: calc(var(--w) * 0.008);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #3a3e46;
  transform: translateX(-50%);
}
.family .device-tablet {
  --w: 38cqw;
  left: 1.5cqw;
  bottom: 1.5cqw;
  rotate: -2deg;
}
.family .duo {
  --w: 46cqw;
  left: 32cqw;
  bottom: 3cqw;
  z-index: 2;
}
.family .device-phone {
  --w: 18.5cqw;
  right: 1.5cqw;
  bottom: 1.5cqw;
  z-index: 1;
  rotate: 4deg;
}
/* Narrow: the Duo gets a row of its own, the iPad and iPhone stand under it. */
@container (max-width: 559px) {
  .family-stage {
    aspect-ratio: 100 / 138;
  }
  .family .duo {
    --w: 88cqw;
    top: 2cqw;
    bottom: auto;
    left: 6cqw;
  }
  .family .device-tablet {
    --w: 46cqw;
    left: 6cqw;
    bottom: 2cqw;
  }
  .family .device-phone {
    --w: 23cqw;
    right: 8cqw;
    bottom: 2cqw;
  }
}

/* The iPhone Duo. site.js puts the real phone here: a live 3D model (src/duo3d/duo.js) on a canvas that
   reaches past the box on every side, so the turn and the folded phone have room (PAD_X and PAD_Y there). Its
   shadow is the same drop shadow the CSS Duo had. */
.duo-gl {
  position: absolute;
  top: -14%;
  left: -10%;
  width: 120%;
  height: 128%;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 18px 18px rgba(3, 9, 24, 0.32));
  transition: opacity 0.35s ease;
}
.duo.is-3d {
  filter: none;
}
.duo.is-3d .duo-gl {
  opacity: 1;
}
/* display, not visibility: the CSS Duo's faces set their own visibility (.duo-cover below), which would show
   them through a hidden .duo-body, and the folded model would have a paper cover behind it. */
.duo.is-3d .duo-body,
.duo.is-waiting .duo-body {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .duo-gl {
    transition: none;
  }
}

/* The CSS Duo, drawn as a book of two halves, for browsers without WebGL and for the moment before the model
   loads; it doesn't turn, it switches. Open, its inner screen spans both halves; folded, the left half lies over
   the right, and its outer screen faces you. The left half (the flap) is turned on the hinge in the middle: its
   front is the outer screen, its back the inner screen's left half. Without JavaScript it stays open. Safari
   flattens the flap, or shows a face it should hide, if anything from .duo-body down uses overflow, opacity,
   filter, mask or clip-path, or if a face's children carry transforms of their own: so the paper edge is borders
   on three sides of each half, and the shadow is a filter on .duo. */
.duo {
  --round: calc(var(--w) * 0.05);
  --bezel: calc(var(--w) * 0.019);
  position: absolute;
  width: var(--w);
  aspect-ratio: 1646 / 1190;
  perspective: calc(var(--w) * 2.4);
  filter: drop-shadow(0 18px 18px rgba(3, 9, 24, 0.32));
}
.duo-body {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.duo-half,
.duo-flap {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
}
.duo-half {
  transform: translateZ(-1px);
}
.duo-flap {
  transform-origin: 0 50%;
  transform: rotateY(-180deg);
  transform-style: preserve-3d;
}
.duo-cover,
.duo-page {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.duo-page {
  /* One pixel over the hinge, so no hairline shows in the bezel between the halves. */
  right: -1px;
  transform: rotateY(180deg);
}
/* Only the face that should show is visible, in case a browser draws the flap flat. */
.duo-cover {
  visibility: hidden;
}
.duo.is-closed .duo-cover {
  visibility: visible;
}
.duo.is-closed .duo-half,
.duo.is-closed .duo-page {
  visibility: hidden;
}
/* The white paper edge outside, the dark outline inside it, then the bezel: on every side but the hinge, where
   the inner screen's halves meet with nothing between them. The back face is turned once here and once more
   with the flap, so its picture reads the right way round. */
.duo-half,
.duo-cover,
.duo-page {
  border: 4px solid #fff;
  border-radius: var(--round);
}
.duo-rim {
  height: 100%;
  padding: var(--bezel);
  border: 3px solid var(--outline);
  border-radius: calc(var(--round) - 4px);
  background: #1b1d22;
}
.duo-half,
.duo-half .duo-rim {
  border-left-width: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.duo-half .duo-rim {
  padding-left: 0;
}
.duo-page,
.duo-page .duo-rim {
  border-right-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.duo-page .duo-rim {
  padding-right: 0;
}
.duo-cover .duo-rim {
  padding-inline: calc(var(--w) * 0.012);
}
.duo-screen {
  position: relative;
  height: 100%;
  border-radius: calc(var(--round) * 0.6);
  background: var(--night) url("/media/ember/screens/duo-open-camp.webp") no-repeat;
  background-size: 200% 100%;
}
.duo-half .duo-screen {
  background-position: 100% 50%;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.duo-page .duo-screen {
  background-position: 0 50%;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.duo-cover .duo-screen {
  background-image: url("/media/ember/screens/duo-closed-camp-2.webp");
  background-position: 50% 50%;
  background-size: cover;
}
.duo.is-closed .duo-body {
  transform: translateX(-25%);
}
.duo.is-closed .duo-flap {
  transform: rotateY(0deg);
}
.duo-toggle {
  margin-top: clamp(18px, 3vw, 28px);
}
.shots .family {
  margin-top: clamp(36px, 5vw, 56px);
}
.shots .shot-scroller {
  margin-top: clamp(48px, 6vw, 72px);
}

/* The 404 is night paper all the way down, so its footer needs no ridge. */
.page-lost .site-footer {
  margin-top: 0;
}
.page-lost .site-footer .ridge {
  display: none;
}
.page-lost .footer-inner {
  border-top: 1px solid rgba(185, 201, 221, 0.15);
}

/* Short windows (a laptop with a dock, a browser with toolbars): the art gets shorter with the window, so the
   words step down to stay inside it, and the hero still fits on one screen. */
@media (min-width: 1100px) and (max-height: 800px) {
  .home-hero-copy,
  .ember-hero-copy {
    padding-block: 24px 44px;
  }
  .home-hero-copy .wordmark img,
  .ember-hero .wordmark img {
    width: 210px;
  }
  .presents {
    font-size: 16px;
  }
  .home-hero-copy .tagline,
  .ember-hero .tagline {
    margin-top: 12px;
    font-size: 32px;
  }
  .home-hero-copy .hero-lead,
  .ember-hero .hero-lead {
    margin-top: 12px;
    font-size: 17px;
  }
  .home-hero-copy .actions {
    margin-top: 20px;
  }
  .ember-hero .store-status {
    margin-top: 16px;
  }
  .ember-hero .text-link {
    margin-top: 4px;
  }
}
@media (min-width: 1100px) and (max-height: 660px) {
  .home-hero-copy,
  .ember-hero-copy {
    padding-block: 16px 36px;
  }
  .home-hero-copy .wordmark img,
  .ember-hero .wordmark img {
    width: 180px;
  }
  .home-hero-copy .tagline,
  .ember-hero .tagline {
    font-size: 28px;
  }
  .home-hero-copy .hero-lead,
  .ember-hero .hero-lead {
    font-size: 16px;
    line-height: 1.5;
  }
  .home-hero-copy .button {
    min-height: 46px;
  }
}
