/*
 * The Milestone & Muster pages' one stylesheet: the game page, Progression and Versions.
 * One dark ground, one gold accent and the road's green for small marks; nothing else is colored
 * but the pictures. The ground, lines and words are the game's own dark ramp, so the page and the
 * screenshots on it read as one product. Barlow is the game's own face (SIL Open Font License, /fonts/OFL.txt).
 */

@font-face {
  font-family: "Barlow";
  src: url("/fonts/barlow-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/fonts/barlow-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #0c0e11;
  --ink-2: #15181d;
  --line: #232830;
  --cream: #eceef1;
  --mist: #9aa3ad;
  --gold: #ffc233;
  --gold-deep: #a86a00;
  --grass: #3fa757;
  --body: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", "Barlow", sans-serif;
  --wrap: 1080px;
  --gutter: clamp(16px, 4vw, 40px);
  --gap: clamp(40px, 6vw, 72px);
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 400 1.0625rem/1.55 var(--body);
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}
h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 30;
  background: var(--gold);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
}
.skip:focus {
  top: 8px;
}

/* Type: three display sizes, body, and one small size. */
.display {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}
.d1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 0.95;
}
.d2 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
}
.d3 {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.1;
}
.lede {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  line-height: 1.5;
  max-width: 36em;
}
.soft {
  color: var(--mist);
}
.small {
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 12px;
  font: 600 1.05rem/1.2 var(--body);
  text-decoration: none;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--gold-deep);
}
.btn-gold:hover {
  background: #ffd05c;
}

/*
 * The stores' own badges, as their owners give them: never restyled, cropped or shadowed, both at
 * one height (40 px is Apple's least), the App Store's first, and nothing nearer than a quarter of
 * that height.
 */
.badges {
  --badge: 52px;
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--badge) / 4 + 3px);
  align-items: center;
  margin-top: 24px;
}
.badges a {
  display: block;
}
.badges img {
  height: var(--badge);
  width: auto;
  max-width: none;
}
.under {
  margin-top: 12px;
}

/* Top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ink);
  border-bottom: 2px solid var(--line);
}
.bar .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 700 1.35rem/1 var(--display);
  text-transform: uppercase;
  white-space: nowrap;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.bar nav {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.bar nav ul {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}
.bar nav a {
  display: block;
  padding: 18px 10px 16px;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  font-weight: 600;
  color: var(--mist);
  white-space: nowrap;
}
.bar nav a:hover,
.bar nav a[aria-current="page"] {
  color: var(--cream);
}
.bar nav a[aria-current="page"] {
  border-bottom-color: var(--gold);
}
.bar .btn {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 1rem;
  box-shadow: 0 3px 0 var(--gold-deep);
}
@media (max-width: 760px) {
  /* phones: the page links take a row of their own under the name and the store button */
  html {
    scroll-padding-top: 112px;
  }
  .bar .wrap {
    flex-wrap: wrap;
    gap: 0 12px;
    padding-top: 8px;
  }
  .brand {
    flex: 1;
    min-width: 0;
  }
  .bar nav {
    order: 3;
    flex: 0 0 100%;
  }
  .bar nav ul {
    justify-content: space-between;
  }
  .bar nav a {
    padding: 10px 2px 8px;
    font-size: 0.98rem;
  }
}
@media (max-width: 400px) {
  .brand span {
    display: none;
  }
}

/* Sections: every one is the same band, parted by the same line. */
.sec {
  padding-block: var(--gap);
  border-top: 2px solid var(--line);
}
.sec > .wrap > .lede,
.sec > .wrap > .d2 + p {
  margin-top: 12px;
}
.head {
  padding-block: clamp(36px, 6vw, 64px) clamp(28px, 4vw, 40px);
}
.head .lede {
  margin-top: 12px;
}

/* Game page: hero */
.hero-art {
  position: relative;
}
.hero-art img {
  width: 100%;
  height: clamp(220px, 40vw, 58vh);
  object-fit: cover;
  object-position: 40% 50%;
}
.hero-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(rgb(12 14 17 / 0), var(--ink));
}
.hero-body {
  position: relative;
  margin-top: clamp(-64px, -5vw, -24px);
  padding-bottom: var(--gap);
}
.tagline {
  font-size: clamp(3rem, 10.5vw, 6.25rem);
  line-height: 0.95;
  color: var(--gold);
  text-shadow: 0 4px 0 rgb(0 0 0 / 0.35);
}
.tagline span {
  white-space: nowrap;
}
.hero-body .lede {
  margin-top: 16px;
}
.elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin-top: 16px;
}
.elsewhere a {
  display: inline-block;
  padding: 10px 0;
  font-weight: 600;
}
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: clamp(28px, 4vw, 44px);
}
.facts strong {
  display: block;
  font: 700 clamp(1.3rem, 2.4vw, 1.6rem) / 1.05 var(--display);
  text-transform: uppercase;
}
.facts span {
  display: block;
  margin-top: 4px;
  color: var(--mist);
  font-size: 0.95rem;
  line-height: 1.4;
}
@media (max-width: 620px) {
  .facts {
    grid-template-columns: 1fr;
  }
}

/* Game page: the film beside the factions */
.film-row {
  display: grid;
  grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
  gap: clamp(24px, 6vw, 72px);
  align-items: center;
}
.film {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 3px solid var(--line);
  border-radius: 22px;
  background: #000;
}
.rows {
  margin-top: 20px;
  border-top: 2px solid var(--line);
  max-width: 36em;
}
.rows li {
  display: grid;
  grid-template-columns: 7em 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 2px solid var(--line);
  color: var(--mist);
}
.rows b {
  font-weight: 600;
  color: var(--cream);
}
@media (max-width: 680px) {
  .film-row {
    grid-template-columns: 1fr;
  }
  .film {
    max-width: 270px;
  }
}

/* Game page: four features in one row */
.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2.4vw, 28px);
  margin-top: clamp(24px, 4vw, 36px);
}
.features img,
.shots img {
  width: 100%;
  border: 3px solid var(--line);
  border-radius: 20px;
}
.features h3 {
  margin-top: 16px;
}
.features .news {
  margin-top: 8px;
}
.marks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 28px;
  margin-top: clamp(28px, 4vw, 40px);
  padding-top: 24px;
  border-top: 2px solid var(--line);
}
.marks li,
.news li,
.help ul li {
  position: relative;
  padding: 4px 0 4px 24px;
}
.marks li::before,
.news li::before,
.help ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 8px;
  background: var(--grass);
}
@media (max-width: 860px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  /* phones: pictures in a row become a strip to swipe through */
  .features,
  .shots {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 8px;
    gap: 16px;
  }
  .features > li {
    flex: 0 0 66%;
    scroll-snap-align: center;
  }
  .shots img {
    flex: 0 0 62%;
    width: 62%;
    scroll-snap-align: center;
  }
}

/* Game page: the doors to the other pages */
.doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}
.doors a {
  display: block;
  padding: 24px;
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
}
.doors a:hover {
  border-color: var(--gold);
}
.doors b {
  display: block;
  font: 700 1.9rem/1 var(--display);
  text-transform: uppercase;
  color: var(--gold);
}
.doors span {
  display: block;
  margin-top: 8px;
  color: var(--mist);
}

/* Support and privacy */
.help .wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(32px, 6vw, 72px);
}
.help p,
.help ul {
  margin-top: 12px;
  color: var(--mist);
}
.help a {
  font-weight: 600;
  color: var(--cream);
}

/* Progression: the wave table */
.waves {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.waves thead th {
  padding: 0 16px 8px;
  font: 600 0.95rem/1.2 var(--body);
  color: var(--mist);
  border-bottom: 2px solid var(--line);
}
.waves tbody th,
.waves td {
  padding: 8px 16px;
  border-bottom: 2px solid var(--line);
  vertical-align: top;
}
.waves tbody th {
  width: 7.5em;
  font: 700 1.5rem/1.2 var(--display);
  color: var(--gold);
  white-space: nowrap;
}
.waves thead th:first-child,
.waves tbody th {
  padding-left: 0;
}
.waves td {
  width: 31%;
}
.fort th::after {
  content: "Stronghold";
  display: block;
  font: 600 0.8rem/1.2 var(--body);
  color: var(--mist);
}
.waves .note td {
  padding: 8px 16px;
  background: var(--ink-2);
  color: var(--cream);
  font-size: 0.95rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  padding: 2px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.waves + p {
  margin-top: 16px;
  max-width: 44em;
}
@media (max-width: 700px) {
  /* phones: each wave is a block, its number beside what opens */
  .waves thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .waves,
  .waves tbody,
  .waves td {
    display: block;
    width: auto;
  }
  .waves tr {
    display: grid;
    grid-template-columns: 5.2em 1fr;
    padding: 12px 0;
    border-bottom: 2px solid var(--line);
  }
  .waves tbody th {
    grid-row: 1 / span 3;
    width: auto;
    padding: 0;
    border: 0;
  }
  .waves td {
    grid-column: 2;
    display: grid;
    grid-template-columns: 4.6em 1fr;
    align-items: baseline;
    padding: 4px 0;
    border: 0;
  }
  .waves td:empty {
    display: none;
  }
  .waves td[data-th]::before {
    /* the column's name, short, beside what it holds */
    content: attr(data-th);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mist);
  }
  .waves .note {
    display: block;
  }
  .waves .note td {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
  }
}

/* Folds: one part open at a time on Progression, one version at a time on Versions. */
.fold {
  border-bottom: 2px solid var(--line);
}
.sec:has(.fold) {
  padding-top: 0;
}
.fold > summary {
  display: flex;
  align-items: baseline;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding: 20px 44px 20px 0;
  position: relative;
  cursor: pointer;
  list-style: none;
}
.fold > summary::-webkit-details-marker {
  display: none;
}
.fold > summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 16px;
  font: 600 2rem/1 var(--display);
  color: var(--gold);
}
.fold[open] > summary::after {
  content: "–";
}
.fold > summary:hover .d2 {
  color: var(--gold);
}
.fold > summary .soft {
  flex: 1 1 16em;
}
.fold-body {
  padding-bottom: clamp(28px, 4vw, 40px);
}

/* Progression: trees */
.branches {
  display: grid;
  gap: 28px clamp(16px, 3vw, 32px);
}
.branch > h4 small {
  display: block;
  font: 400 0.95rem/1.4 var(--body);
  text-transform: none;
  color: var(--mist);
  margin-top: 4px;
}
.nodes {
  margin: 16px 0 0 7px;
  border-left: 3px solid var(--line);
}
.nodes > li {
  position: relative;
  padding: 0 0 16px 22px;
}
.nodes > li:last-child {
  padding-bottom: 0;
}
.nodes > li::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 5px;
  width: 15px;
  height: 15px;
  background: var(--ink);
  border: 3px solid var(--gold);
  border-radius: 50%;
}
.gate {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
}
.nodes p {
  color: var(--mist);
  font-size: 0.95rem;
  line-height: 1.45;
  margin-top: 2px;
}
.nodes .chips {
  margin-top: 8px;
}
@media (min-width: 760px) {
  .branches {
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  }
}
.ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 clamp(16px, 3vw, 32px);
}
.ledger li {
  padding: 12px 0;
  border-top: 2px solid var(--line);
}
.ledger p {
  color: var(--mist);
  font-size: 0.95rem;
  line-height: 1.45;
  margin-top: 2px;
}

/* Versions */
.next {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(16px, 5vw, 56px);
  align-items: start;
}
.next .soft {
  margin-top: 8px;
}
.next .vno {
  color: var(--mist);
}
@media (max-width: 760px) {
  .next {
    grid-template-columns: 1fr;
  }
}
.vno {
  font: 700 2.5rem/1 var(--display);
  color: var(--gold);
  min-width: 1.6em;
}
.now {
  padding: 4px 12px;
  background: var(--gold);
  color: var(--ink);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.chapter {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}
.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 16px);
}
.news li {
  padding-block: 4px;
}
@media (max-width: 760px) {
  .chapter {
    grid-template-columns: 1fr;
  }
}

/* Footer */
footer {
  padding-block: 28px 44px;
  border-top: 2px solid var(--line);
  color: var(--mist);
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  align-items: center;
  justify-content: space-between;
}
footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}
footer a {
  display: inline-block;
  padding: 10px 0;
  font-weight: 600;
}
footer .credit {
  flex: 0 0 100%;
  max-width: 62em;
}
