/*
 * BM Studio website (REL-04). One stylesheet for every page, no build step, no scripts.
 * Colors come from packages/design-tokens/src/color.ts (app `colors.light` / `colors.dark` and the
 * `sky` night gradient); fonts are the app's Fredoka (display) and Figtree (text), self-hosted
 * under the SIL OFL 1.1 (licences next to the font files).
 *
 * The night-sky bands (header, hero, footer) stay dark in both themes, like the game's HOME screen;
 * the content between them follows the system light or dark setting.
 */

@font-face {
  font-family: 'Fredoka';
  src: url('/assets/fonts/fredoka_semibold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Figtree';
  src: url('/assets/fonts/figtree_medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Figtree';
  src: url('/assets/fonts/figtree_bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* colors.light */
  --canvas: #e8edf4;
  --surface: #f8fafd;
  --sunk: #dee5ee;
  --text: #172033;
  --text-2: #5a6477;
  --line: #cbd3df;
  --accent: #2f5bea;
  --on-accent: #ffffff;
  --link: #1e44c4;
  --accent-tonal: rgba(47, 91, 234, 0.12);
  --gold-text: #7a5400;
  --shadow: 0 1px 2px rgba(23, 32, 51, 0.06), 0 12px 32px -12px rgba(23, 32, 51, 0.22);

  /* colors.dark.sky: the night bands use the dark sky in both themes, as the game's HOME does. */
  --sky-top: #070b16;
  --sky-mid: #0e1428;
  --sky-low: #1a2347;
  --star: #fff6e0;
  --gold: #f4be46;
  --gold-deep: #e0a52a;
  --on-gold: #2a1d00;
  --on-sky: #e7ecf5;
  --on-sky-2: #b9c3d9;
  --sky-line: rgba(231, 236, 245, 0.14);
  --sky-chip: rgba(231, 236, 245, 0.08);

  --font-display: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --font-text: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 28px;
  --measure: 44rem;
  --page: 74rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);
  --section: clamp(3.5rem, 2rem + 6vw, 7rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* colors.dark */
    --canvas: #0e131e;
    --surface: #161d2b;
    --sunk: #1b2333;
    --text: #e7ecf5;
    --text-2: #9aa4b6;
    --line: #283246;
    --accent: #7090ff;
    --on-accent: #0b1020;
    --link: #a7bbff;
    --accent-tonal: rgba(112, 144, 255, 0.12);
    --gold-text: #f4be46;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--sky-top);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--gold);
  color: var(--on-gold);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.75rem;
  scroll-margin-top: 1rem;
}

h3 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.5rem;
  scroll-margin-top: 1rem;
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-inline-start: 1.4rem;
}

li + li {
  margin-top: 0.35rem;
}

strong,
b {
  font-weight: 700;
}

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sky :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--gold);
}

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--sunk);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
}

.skip:focus {
  top: 1rem;
}

/* ---------- Night sky band ---------- */

.sky {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--on-sky);
  background:
    radial-gradient(1.5px 1.5px at 12% 22%, var(--star) 98%, transparent),
    radial-gradient(1px 1px at 27% 68%, rgba(255, 246, 224, 0.7) 98%, transparent),
    radial-gradient(2px 2px at 41% 12%, var(--star) 98%, transparent),
    radial-gradient(1px 1px at 58% 88%, rgba(255, 246, 224, 0.6) 98%, transparent),
    radial-gradient(1.5px 1.5px at 72% 8%, var(--star) 98%, transparent),
    radial-gradient(1px 1px at 86% 52%, rgba(255, 246, 224, 0.7) 98%, transparent),
    radial-gradient(1px 1px at 4% 46%, rgba(255, 246, 224, 0.7) 98%, transparent),
    radial-gradient(2.5px 2.5px at 93% 24%, var(--gold) 98%, transparent),
    radial-gradient(1px 1px at 6% 84%, rgba(255, 246, 224, 0.6) 98%, transparent),
    radial-gradient(1px 1px at 48% 56%, rgba(255, 246, 224, 0.5) 98%, transparent),
    radial-gradient(120% 70% at 75% 110%, rgba(47, 91, 234, 0.28), transparent 70%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-low) 100%);
}

.sky a {
  color: var(--on-sky);
}

.bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem 1.5rem;
  flex-wrap: wrap;
  min-height: 4.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-inline-end: auto;
}

.brand svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--gold);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--on-sky-2);
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.nav a:hover {
  color: var(--on-sky);
  background: var(--sky-chip);
}

.nav a[aria-current='page'] {
  color: var(--on-sky);
  background: var(--sky-chip);
  box-shadow: inset 0 0 0 1px var(--sky-line);
}

/* Constellation drawn behind the hero: lines and stars as plain vector geometry. */
.constellation {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  color: var(--on-sky);
  pointer-events: none;
}

.constellation .lines {
  stroke: currentColor;
  stroke-opacity: 0.16;
  stroke-width: 1.2;
  fill: none;
  stroke-dasharray: 1400;
  stroke-dashoffset: 0;
  animation: draw 2.4s var(--ease-out) both 0.2s;
}

.constellation .stars circle {
  fill: var(--star);
  animation: twinkle 4s ease-in-out infinite alternate;
}

.constellation .stars circle:nth-child(3n) {
  animation-delay: 1.3s;
}

.constellation .stars circle:nth-child(3n + 1) {
  animation-delay: 2.1s;
}

.constellation .stars .lit {
  fill: var(--gold);
}

@keyframes draw {
  from {
    stroke-dashoffset: 1400;
  }
}

@keyframes twinkle {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.45;
  }
}

/* The marketing hero ends in a soft horizon arc that the page content rises out of. */
.horizon::after {
  content: '';
  position: absolute;
  left: -15%;
  right: -15%;
  bottom: -1px;
  z-index: 1;
  height: clamp(1.5rem, 4vw, 3.5rem);
  background: var(--canvas);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  box-shadow: 0 -1px 0 0 rgba(112, 144, 255, 0.35);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 2.5rem clamp(2rem, 5vw, 5rem);
  padding-top: clamp(1.5rem, 1rem + 3vw, 4rem);
  padding-bottom: clamp(3rem, 2rem + 5vw, 6rem);
}

.hero h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

.hero h1 em,
.hook em {
  font-style: normal;
  color: var(--gold);
}

.lead {
  max-width: 34rem;
  color: var(--on-sky-2);
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
  margin: 0 0 2rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.actions li + li {
  margin-top: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  text-decoration: none;
  transition:
    transform 180ms var(--ease-out),
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.button svg {
  width: 1.1rem;
  height: 1.1rem;
}

.button:active {
  transform: scale(0.97);
}

.sky .button.primary,
.button.primary {
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: 0 8px 24px -8px rgba(244, 190, 70, 0.55);
}

.button.primary:hover {
  background: var(--gold-deep);
  transform: translateY(-1px);
}

.sky .button.ghost {
  color: var(--on-sky);
  box-shadow: inset 0 0 0 1.5px var(--sky-line);
}

.sky .button.ghost:hover {
  background: var(--sky-chip);
}

/* Video frames */

.media {
  position: relative;
  justify-self: center;
  width: 100%;
  animation: rise 900ms var(--ease-out) both 0.15s;
}

.media::before {
  content: '';
  position: absolute;
  inset: 12% -8% -4%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(112, 144, 255, 0.35), transparent);
  filter: blur(20px);
}

.story {
  max-width: 22rem;
}

.story video,
.story img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--sky-mid);
  box-shadow:
    0 0 0 1px var(--sky-line),
    0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

.phone {
  max-width: 18rem;
  margin-top: 1rem;
}

.phone video,
.phone img {
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 1242;
  object-fit: cover;
  border-radius: 2.1rem;
  background: var(--sky-mid);
  box-shadow:
    0 0 0 6px #141a2b,
    0 0 0 7px var(--sky-line),
    0 50px 90px -30px rgba(0, 0, 0, 0.85);
}

/* Reduced motion: the loop is swapped for its poster frame (the <source media> query already
   stops loading the video in browsers that support it). */
.still {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
}

/* ---------- Game lockup and store placeholders ---------- */

.lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.lockup img {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.1rem;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.7);
}

.lockup h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem);
  line-height: 1.1;
  margin: 0;
}

.lockup p {
  margin: 0.25rem 0 0;
  color: var(--on-sky-2);
  font-weight: 700;
  font-size: 0.95rem;
}

.hook {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.stores li + li {
  margin-top: 0;
}

.store {
  display: inline-flex;
  align-items: center;
  min-height: 3.5rem;
  min-width: 11.5rem;
  padding: 0.45rem 1.1rem 0.45rem 0.9rem;
  border-radius: 14px;
  background: var(--text);
  color: var(--canvas);
  text-decoration: none;
  line-height: 1.2;
}

.store small {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.store b {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
}

.store[aria-disabled='true'] {
  background: var(--sunk);
  color: var(--text-2);
}

.sky .store[aria-disabled='true'] {
  background: var(--sky-chip);
  color: var(--on-sky);
  box-shadow: inset 0 0 0 1px var(--sky-line);
}

.sky .store small {
  color: var(--on-sky-2);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--on-sky-2);
  font-size: 0.95rem;
  font-weight: 700;
}

.facts li + li {
  margin-top: 0;
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.facts svg {
  width: 0.8rem;
  height: 0.8rem;
  color: var(--gold);
}

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

.section {
  padding-top: var(--section);
  padding-bottom: 0;
}

.section:last-child {
  padding-bottom: var(--section);
}

/* The horizon arc already separates the hero, so the first section starts closer to it. */
.marketing > .section:first-child {
  padding-top: clamp(2rem, 1rem + 4vw, 4.5rem);
}

.section-head {
  max-width: 42rem;
  margin: 0 0 clamp(2rem, 1.5rem + 2vw, 3rem);
}

.section-head h2 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
}

.section-head p {
  color: var(--text-2);
  font-size: 1.12rem;
  margin: 0;
}

/* Featured game (home) */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature .lockup h3 {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  line-height: 1.1;
  margin: 0;
}

.feature .lockup h3 a {
  color: inherit;
  text-decoration: none;
}

.feature .lockup h3 a:hover {
  text-decoration: underline;
}

.feature .lockup p {
  color: var(--gold-text);
}

.feature > div > p {
  color: var(--text-2);
}

.feature .button.primary {
  margin-top: 0.5rem;
}

.fan {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.5rem, 1.5vw, 1rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fan li + li {
  margin-top: 0;
}

.fan li:nth-child(2) {
  transform: translateY(-1.5rem);
}

.fan img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 18px 36px -18px rgba(7, 11, 22, 0.6);
}

/* Principles (home) */

.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem clamp(2rem, 5vw, 5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.principles li + li {
  margin-top: 0;
}

.principles li {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.principles h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
  font-size: 1.4rem;
}

.principles h3 svg {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--gold-text);
}

.principles p {
  margin: 0;
  color: var(--text-2);
  max-width: 34rem;
}

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
  gap: 2.5rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.studio-facts {
  margin: 0;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.studio-facts div + div {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.studio-facts dt {
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 700;
}

.studio-facts dd {
  margin: 0.15rem 0 0;
  font-weight: 700;
}

/* Trailer (game page) */

.trailer {
  margin: 0;
}

.trailer video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  background: var(--sky-top);
  box-shadow: var(--shadow);
}

.trailer figcaption {
  margin-top: 0.85rem;
  color: var(--text-2);
  font-size: 0.95rem;
}

/* Mechanics (game page): the in-game zoom bubbles from the store screenshots. */

.mechanics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mechanics li + li {
  margin-top: 0;
}

.mechanics img {
  width: 100%;
  max-width: 9.5rem;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow:
    0 0 0 5px var(--surface),
    0 0 0 6px var(--line),
    0 18px 32px -16px rgba(7, 11, 22, 0.55);
  margin: 0 0 1.25rem;
}

.mechanics h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.mechanics p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.98rem;
}

/* Screenshot rail (game page): native horizontal scroll with snap points, no script. */

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(13rem, 58vw, 16.5rem);
  gap: 1.25rem;
  margin: 0;
  padding: 0.5rem var(--gutter) 1.5rem;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.rail:focus-visible {
  outline-offset: -3px;
}

.rail li + li {
  margin-top: 0;
}

.rail li {
  scroll-snap-align: start;
}

.rail img {
  width: 100%;
  height: auto;
  border-radius: 1.25rem;
  box-shadow: 0 18px 36px -20px rgba(7, 11, 22, 0.65);
}

.rail-wrap {
  max-width: var(--page);
  margin: 0 auto;
}

.hint {
  margin: 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

/* Feature rows (game page): editorial rows, not cards. */

.rows {
  margin: 0;
  border-top: 1px solid var(--line);
}

.rows div {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.5rem 3rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.rows dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  line-height: 1.2;
}

.rows dd {
  margin: 0;
  color: var(--text-2);
}

.details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem clamp(2rem, 6vw, 6rem);
}

.details ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.details li {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}

.details li svg {
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  color: var(--gold-text);
  transform: translateY(0.1rem);
}

.details h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);
  letter-spacing: -0.02em;
}

.details p {
  color: var(--text-2);
}

/* ---------- Legal and support documents ---------- */

main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

main.marketing {
  padding: 0;
}

.doc {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  padding-top: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  padding-bottom: 4rem;
}

.doc > header {
  margin-bottom: 1.5rem;
}

.doc h1 {
  font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.25rem);
  letter-spacing: -0.02em;
}

.meta {
  color: var(--text-2);
  margin: 0;
}

.toc {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.35rem;
  margin: 1.5rem 0 2rem;
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.toc ol {
  margin: 0;
}

.note {
  background: var(--accent-tonal);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: start;
  vertical-align: top;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  font-weight: 700;
  background: var(--sunk);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 1rem;
  margin: 0 0 0.75rem;
}

summary {
  cursor: pointer;
  min-height: 2.75rem;
  padding: 0.7rem 0;
  font-weight: 700;
}

details[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

/* ---------- Footer ---------- */

.site-footer {
  color: var(--on-sky-2);
  font-size: 0.95rem;
  background: linear-gradient(180deg, var(--sky-mid), var(--sky-top));
}

.site-footer a {
  color: var(--on-sky);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 2rem;
  padding-top: 3.5rem;
  padding-bottom: 2.5rem;
}

.footer-grid .brand {
  margin: 0 0 0.75rem;
  color: var(--on-sky);
}

.footer-grid > div > p {
  max-width: 20rem;
  margin: 0;
}

.footer-grid h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-text);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--on-sky-2);
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li + li {
  margin-top: 0;
}

.footer-grid ul a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 700;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--sky-line);
}

.footer-base p {
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 56rem) {
  .hero,
  .feature,
  .studio,
  .details {
    grid-template-columns: minmax(0, 1fr);
  }

  .media {
    justify-self: start;
  }

  .mechanics {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 40rem) {
  body {
    font-size: 1rem;
  }

  .bar {
    gap: 0;
  }

  .brand {
    font-size: 1.15rem;
  }

  .nav a {
    padding: 0 0.6rem;
    font-size: 0.92rem;
  }

  .media {
    justify-self: center;
  }

  .story {
    max-width: 17rem;
  }

  .phone {
    max-width: 15rem;
  }

  .principles,
  .rows div {
    grid-template-columns: minmax(0, 1fr);
  }

  .rows div {
    gap: 0.35rem;
    padding: 1.25rem 0;
  }

  .fan li:nth-child(2) {
    transform: translateY(-0.75rem);
  }

  .actions .button,
  .stores li,
  .stores .store {
    width: 100%;
  }

  .actions li {
    flex: 1 1 100%;
  }

  .mechanics {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .mechanics li {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 1.25rem;
    align-items: start;
  }

  .mechanics img {
    grid-row: 1 / span 2;
    margin: 0;
  }

  .mechanics h3 {
    align-self: end;
    margin-top: 0.6rem;
  }
}

@media (max-width: 24rem) {
  .nav a {
    padding: 0 0.45rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .motion {
    display: none;
  }

  .still {
    display: block;
  }
}

@media print {
  .sky,
  .site-footer,
  .skip,
  .toc,
  video {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
