/* Mapes Plays: single-page site styles. Mobile first; wider layouts in min-width queries. */

@font-face {
  font-family: "Chakra Petch";
  src: url("/fonts/chakra-petch-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("/fonts/chakra-petch-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-next-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --graphite: #1d1f22;
  --gunmetal: #2a2e34;
  --steel: #565e69;
  --gold: #f2b705;
  --gold-hover: #ffc61a;
  --paper: #fcfbf9;

  --bg: var(--paper);
  --surface: #f3f0e9;
  --ink: var(--graphite);
  --muted: var(--steel);
  --line: #d8d3c8;
  --accent-text: #7d5a00;
  --status-live: #b22f1c;
  --band-bg: var(--gunmetal);
  --band-ink: #eeebe4;
  --band-muted: #c3c7cc;

  --font-head: "Chakra Petch", "Arial Narrow", Arial, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", Verdana, sans-serif;

  --radius: 6px;
  --gutter: 1rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141518;
    --surface: #1e2024;
    --ink: #eeebe4;
    --muted: #a3a9b1;
    --line: #34383e;
    --accent-text: #f5c02a;
    --status-live: #ff7a63;
    --band-bg: #23262b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141518;
  --surface: #1e2024;
  --ink: #eeebe4;
  --muted: #a3a9b1;
  --line: #34383e;
  --accent-text: #f5c02a;
  --status-live: #ff7a63;
  --band-bg: #23262b;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

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

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }

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

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--gold);
  color: var(--graphite);
  font-weight: 700;
  border-radius: var(--radius);
}
.skip:focus { top: 0.75rem; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); }

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding-block: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  margin-right: auto;
}
.brand__mark { width: 2.25rem; height: 2.25rem; fill: var(--gold); }
.brand__play { fill: var(--graphite); }
.brand__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3125rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.site-nav { order: 3; flex-basis: 100%; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding-block: 0.25rem;
  font-family: var(--font-head);
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { text-decoration: underline; text-decoration-color: var(--gold); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.theme-toggle__moon { fill: currentColor; stroke: none; }
:root[data-theme="dark"] .theme-toggle__moon,
:root:not([data-theme="dark"]) .theme-toggle__sun { display: none; }

/* ---------- Shared bits ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: transform 120ms ease, border-bottom-width 120ms ease;
}
.btn--primary {
  background: var(--gold);
  color: var(--graphite);
  border: 2px solid var(--graphite);
  border-bottom-width: 5px;
}
.btn--primary:hover { background: var(--gold-hover); }
.btn--primary:active { transform: translateY(3px); border-bottom-width: 2px; }
.btn--secondary {
  border: 2px solid var(--ink);
  color: var(--ink);
}
.btn--secondary:hover { background: var(--surface); }

.label {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--accent-text);
}
.label--live { color: var(--status-live); }
.label--live::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.375rem;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.05em;
}

.section { padding-block: 3.5rem 1rem; }

.section__head {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.section__head h2 { font-size: clamp(1.875rem, 6vw, 2.75rem); }
.section__head p { color: var(--muted); max-width: 38rem; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  gap: 2.5rem;
  padding-block: 2.5rem 1.5rem;
}

.hero h1 {
  font-size: clamp(2.75rem, 12vw, 5.25rem);
  line-height: 0.98;
  max-width: 11ch;
}

.lede {
  margin-top: 1.25rem;
  font-size: 1.1875rem;
  max-width: 34rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.facts {
  display: grid;
  gap: 0;
  margin: 2rem 0 0;
  border-top: 1px solid var(--line);
  max-width: 34rem;
}
.facts div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--muted);
}
.facts dd { margin: 0; }

.feature { align-self: start; }
.feature__link {
  display: block;
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.feature__thumb {
  display: block;
  border-bottom: 2px solid var(--ink);
  background: var(--gold);
}
.feature__thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.feature__body { display: grid; gap: 0.5rem; padding: 1rem 1.125rem 1.25rem; }
.feature__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.feature__link:hover .feature__title { text-decoration: underline; text-decoration-color: var(--gold); }
.feature__text { color: var(--muted); }

/* ---------- Videos ---------- */
.videos {
  display: grid;
  gap: 1.75rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.video a {
  display: grid;
  gap: 0.375rem;
  height: 100%;
  text-decoration: none;
}
.video img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 0.375rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.video__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.video--big .video__title { font-size: clamp(1.25rem, 3vw, 1.625rem); }
.video a:hover .video__title { text-decoration: underline; text-decoration-color: var(--gold); }
.video__date { font-size: 0.9375rem; color: var(--muted); }

.video--more a {
  align-content: end;
  min-height: 10rem;
  padding: 1.25rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--graphite);
}
.video--more .video__title { font-size: 1.5rem; }
.video--more a:hover .video__title { text-decoration-color: var(--graphite); }
.video__more-text { font-size: 0.9375rem; }

/* ---------- What we play ---------- */
.shelf { border-top: 2px solid var(--ink); }
.shelf__row {
  display: grid;
  gap: 0.5rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.shelf__row h3 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
.shelf__row p { max-width: 38rem; }
.more {
  justify-self: start;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--accent-text);
}
.more::after { content: " \2192"; }

/* ---------- About ---------- */
.about {
  display: grid;
  gap: 2rem;
  padding-bottom: 3.5rem;
}
.about__story { display: grid; gap: 1rem; max-width: 38rem; }
.about__story h2 { font-size: clamp(1.875rem, 6vw, 2.75rem); margin-bottom: 0.5rem; }

.rules {
  align-self: start;
  padding: 1.25rem 1.25rem 1.5rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
}
.rules h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.rules ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}
.rules li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  padding-block: 0.5rem;
  border-top: 1px dashed var(--line);
}
.rules li::before {
  content: counter(rule);
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--accent-text);
}

/* ---------- Closing band ---------- */
.cta {
  background: var(--band-bg);
  color: var(--band-ink);
  border-top: 6px solid var(--gold);
}
.cta__inner {
  display: grid;
  gap: 1rem;
  justify-items: start;
  padding-block: 3rem 3.5rem;
}
.cta h2 { font-size: clamp(2rem, 7vw, 3.25rem); max-width: 14ch; }
.cta p { color: var(--band-muted); max-width: 34rem; margin-bottom: 0.5rem; }
.cta :focus-visible { outline-color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer__inner {
  display: grid;
  gap: 0.5rem;
  padding-block: 1.75rem 2.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- Motion (opt in only) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .feature__link,
  .video img {
    transition: transform 180ms cubic-bezier(.3, 1.6, .5, 1);
  }
  .feature__link { transform: rotate(-1.25deg); }
  .feature__link:hover { transform: rotate(0deg) translateY(-3px); }
  .video a:hover img { transform: rotate(-1deg) scale(1.02); }
  .video:nth-child(even) a:hover img { transform: rotate(1deg) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ---------- Wider screens ---------- */
@media (min-width: 40rem) {
  :root { --gutter: 2rem; }
  .videos { grid-template-columns: repeat(2, 1fr); }
  .video--big { grid-column: 1 / -1; }
}

@media (min-width: 48rem) {
  .site-nav { order: 0; flex-basis: auto; }
  .shelf__row {
    grid-template-columns: 14rem 1fr auto;
    align-items: baseline;
    gap: 2rem;
  }
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: 7fr 5fr;
    align-items: center;
    gap: 3.5rem;
    padding-block: 4.5rem 2.5rem;
  }
  .section__head {
    grid-template-columns: 5fr 7fr;
    align-items: end;
    gap: 2rem;
  }
  .videos { grid-template-columns: repeat(3, 1fr); }
  .video--big { grid-column: span 2; grid-row: span 2; }
  .about {
    grid-template-columns: 7fr 4fr;
    gap: 4rem;
  }
}

/* ---------- 404 page ---------- */
.notfound { display: grid; gap: 0.5rem; justify-items: start; padding-block: 4rem; }
.notfound h1 { font-size: clamp(2.5rem, 10vw, 4.5rem); max-width: 14ch; }
.notfound .theme-toggle { margin-top: 2rem; }
