/* Mio showcase. Colours come from src/brand/mio.json (accent #ed74ae and friends). No web fonts:
   the serif/mono stacks below are picked from what ships with Windows, macOS and Android. */

:root {
  --ink: #140e12;
  --ink-2: #1d151a;
  --faint: #39222f;
  --line: rgba(132, 88, 114, 0.5);
  --paper: #f6ecf1;
  --muted: #c9afbd;
  --pink: #ed74ae;
  --pink-bright: #ffbada;
  --pink-deep: #a8467a;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.nowrap { white-space: nowrap; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 1rem/1.6 var(--sans);
  overflow-x: hidden;
}

/* A little paper grain so the dark background doesn't look like a flat fill. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 1;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 3px solid var(--pink-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.75rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--pink);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { left: 0.75rem; }

.kicker {
  margin: 0 0 0.75rem;
  font: 500 0.85rem/1.2 var(--mono);
  letter-spacing: 0.04em;
  color: var(--pink);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  text-wrap: balance;
}

/* ---- buttons -------------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.8rem 1.35rem 0.75rem;
  border-radius: 6px;
  background: var(--pink);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--pink-deep);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--pink-deep); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--pink-deep); }
.btn-small { padding: 0.4rem 0.85rem 0.35rem; font-size: 0.92rem; box-shadow: 0 3px 0 var(--pink-deep); }
.btn-small:hover { box-shadow: 0 1px 0 var(--pink-deep); }
.btn-dark { background: var(--ink); color: var(--paper); box-shadow: 0 4px 0 #000; }
.btn-dark:hover { box-shadow: 0 2px 0 #000; }
.btn-dark:active { box-shadow: 0 0 0 #000; }

.link-arrow {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}
.link-arrow::after { content: " \2193"; color: var(--pink); }
.link-arrow:hover { color: var(--pink-bright); }

/* ---- header --------------------------------------------------------------------------------- */

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 700 1.45rem/1 var(--serif);
  text-decoration: none;
}
.brand img { border-radius: 8px; }
.top ul {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.top li a:not(.btn) {
  text-decoration: none;
  font-size: 0.95rem;
}
.top li a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--pink); text-underline-offset: 0.3em; }

main, .foot { position: relative; z-index: 2; }

/* ---- hero ----------------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(15rem, 1fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 6.5rem) var(--gutter) clamp(3rem, 7vw, 5.5rem);
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.35rem, 5.6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.scribble {
  white-space: nowrap;
  padding-bottom: 0.12em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9.5c22-5 41-4.6 63-1.4 19 2.8 33 2.9 52-.9 23-4.6 44-4 67 .2 20 3.6 39 3.4 59-.6 18-3.6 34-3.9 53-.8' fill='none' stroke='%23ed74ae' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 100% 0.32em no-repeat;
}
.lede {
  max-width: 35rem;
  margin: 1.6rem 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.18rem);
  color: var(--muted);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin: 2.25rem 0 0;
}

.spec {
  position: relative;
  padding: 3.6rem 1.6rem 1.4rem;
  border-radius: 6px;
  background: var(--pink);
  color: var(--ink);
  font-family: var(--mono);
  transform: rotate(1.6deg);
  box-shadow: 10px 10px 0 var(--faint);
}
.spec-logo {
  position: absolute;
  top: -2.6rem;
  left: 1.3rem;
  width: 96px;
  height: 96px;
  transform: rotate(-5deg);
  filter: drop-shadow(0 5px 0 rgba(20, 14, 18, 0.45));
}
.spec dl { margin: 0; }
.spec dl div {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0;
  font-size: 0.95rem;
}
.spec dt {
  display: flex;
  flex: 1;
  gap: 0.6rem;
}
.spec dt::after {
  content: "";
  flex: 1;
  border-bottom: 2px dotted rgba(20, 14, 18, 0.5);
  transform: translateY(-0.3em);
}
.spec dd {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
}
.spec-foot {
  margin: 0.9rem 0 0;
  padding-top: 0.8rem;
  border-top: 2px solid rgba(20, 14, 18, 0.85);
  font-size: 0.8rem;
}

/* ---- section scaffolding -------------------------------------------------------------------- */

.games-section, .getting, .heads-up {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
}
.section-head h2, .heads-up h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.1;
}
.section-head p:not(.kicker) {
  max-width: 38rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
}

/* ---- games ---------------------------------------------------------------------------------- */

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin: 2.25rem 0 1.25rem;
}
.search { display: grid; gap: 0.4rem; flex: 0 1 20rem; }
.search span { font: 0.8rem/1 var(--mono); color: var(--muted); }
.search input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ink-2);
  color: var(--paper);
  font: inherit;
}
.search input::placeholder { color: #9c8290; }
.search input:focus-visible { border-color: var(--pink); }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  font: 0.92rem/1.2 var(--sans);
  cursor: pointer;
}
.chip span { margin-left: 0.25rem; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.chip:hover { border-color: var(--pink); }
.chip[aria-pressed="true"] { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.chip[aria-pressed="true"] span { color: #5b3f4e; }
.count { margin: 0 0 0 auto; font: 0.85rem/1.2 var(--mono); color: var(--muted); }

.games {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.game article {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 12.5rem;
  gap: 0.5rem 1.5rem;
  padding: 1.75rem 0 1.6rem;
  border-bottom: 1px solid var(--line);
}
.game { scroll-margin-top: 1rem; }
.game-no { grid-column: 1; grid-row: 1 / span 2; }
.game-main { grid-column: 2; grid-row: 1; }
.game-meta { grid-column: 3; grid-row: 1; }
.game-menu { grid-column: 2 / 4; grid-row: 2; }
.game-no {
  margin: 0;
  padding-top: 0.5rem;
  font: 0.95rem/1 var(--mono);
  color: var(--pink);
}
.game h3 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  line-height: 1.15;
}
.game-blurb {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
}
.game-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  margin: 0;
  padding-top: 0.45rem;
  font: 0.82rem/1.3 var(--mono);
  text-align: right;
}
.tag {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.game-meta a { color: var(--muted); text-underline-offset: 0.25em; }
.game-meta a:hover { color: var(--pink-bright); }

.game-menu summary {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.3rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.game-menu summary::-webkit-details-marker { display: none; }
.game-menu summary::before {
  content: "+";
  display: inline-block;
  width: 1ch;
  font: 700 1.1rem/1 var(--mono);
  color: var(--pink);
}
.game-menu[open] summary::before { content: "\2212"; }
.game-menu summary span { font: 0.82rem/1 var(--mono); color: var(--muted); font-weight: 400; }
.game-menu summary:hover { color: var(--pink-bright); }

.pages {
  columns: 11.5rem;
  column-gap: 2rem;
  margin: 1rem 0 0.4rem;
  padding: 1.25rem 1.25rem 0.25rem;
  border-left: 2px solid var(--pink);
  background: var(--ink-2);
}
.pages section { break-inside: avoid; margin-bottom: 1.1rem; }
.pages h4 {
  margin: 0 0 0.35rem;
  font: 600 0.75rem/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink);
}
.pages ul { margin: 0; padding: 0; list-style: none; }
.pages li { padding: 0.08rem 0; font-size: 0.94rem; line-height: 1.45; }

.empty { margin: 1.5rem 0 0; color: var(--muted); }

/* ---- getting it ----------------------------------------------------------------------------- */

.getting-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(15rem, 1fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: 2.5rem;
}
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative;
  counter-increment: step;
  padding-left: 4.25rem;
  margin-bottom: 2.1rem;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -0.2rem;
  font: 700 2.4rem/1 var(--serif);
  color: var(--pink);
}
.steps h3 { margin: 0 0 0.35rem; font-size: 1.35rem; line-height: 1.25; }
.steps p { margin: 0; color: var(--muted); max-width: 36rem; }
.steps em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.05em 0.4em;
  border-radius: 4px;
  background: var(--faint);
  color: var(--pink-bright);
  white-space: nowrap;
}

.executors {
  padding: 1.4rem 1.5rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ink-2);
}
.executors h3 { margin: 0 0 0.6rem; font-size: 1.2rem; }
.executors ul { margin: 0; padding: 0; list-style: none; }
.executors li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line);
}
.executors li strong { font: 700 1.1rem/1.2 var(--serif); }
.executors li span { font: 0.8rem/1.3 var(--mono); color: var(--muted); }
.executors p { margin: 0.9rem 0 0; font-size: 0.92rem; color: var(--muted); }

/* ---- heads-up + cta ------------------------------------------------------------------------- */

.heads-up > p:not(.kicker) {
  max-width: 40rem;
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--pink);
  font-size: 1.08rem;
}

.cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem;
  margin-top: clamp(2rem, 6vw, 4rem);
  padding: clamp(3rem, 8vw, 5.5rem) max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
  background: var(--pink);
  color: var(--ink);
}
.cta h2 {
  max-width: 40rem;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
}
.cta p { max-width: 34rem; margin: 1rem 0 2rem; font-size: 1.1rem; }
.cta-logo {
  width: clamp(7rem, 16vw, 11rem);
  height: auto;
  transform: rotate(7deg);
  filter: drop-shadow(8px 8px 0 rgba(20, 14, 18, 0.9));
}

/* ---- footer --------------------------------------------------------------------------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.foot p { margin: 0; max-width: 38rem; }
.foot-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--mono); color: var(--paper); }
.foot-brand img { border-radius: 6px; }

/* ---- 404 ------------------------------------------------------------------------------------ */

.lost {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 8rem) var(--gutter);
}
.lost h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; }
.lost p { max-width: 32rem; color: var(--muted); }

/* ---- narrow screens ------------------------------------------------------------------------- */

@media (max-width: 52rem) {
  .hero, .getting-grid { grid-template-columns: minmax(0, 1fr); }
  .spec { max-width: 24rem; margin: 2.5rem 0.75rem 0 0; }
  .count { margin-left: 0; width: 100%; }
  .cta { grid-template-columns: minmax(0, 1fr); }
  .cta-logo { display: none; }
}

@media (max-width: 44rem) {
  .game article { grid-template-columns: 2.4rem minmax(0, 1fr); padding: 1.4rem 0 1.25rem; }
  .game-no { padding-top: 0.4rem; font-size: 0.85rem; }
  .game-no { grid-row: 1; }
  .game-menu { grid-column: 1 / 3; grid-row: 3; }
  .game-meta {
    grid-column: 2;
    grid-row: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 0;
    text-align: left;
  }
  .game-blurb { font-size: 0.96rem; margin-bottom: 0.4rem; }
  .pages { columns: 2 8rem; column-gap: 1.25rem; padding: 1rem 1rem 0.1rem; }
  .pages li { font-size: 0.9rem; }
  .steps li { padding-left: 3.4rem; }
  .steps li::before { font-size: 2rem; }
  .search { flex-basis: 100%; }
}

@media (max-width: 30rem) {
  .top li:nth-child(2) { display: none; }
  .brand { font-size: 1.3rem; }
}
