/* games.static.md
   Warm paper, ink, and the Knotbox arrow colours. Young Serif for headings, Figtree for text,
   Fredoka only for the Knotbox wordmark. No framework, no build step. */

/* ---------- Fonts (self-hosted, SIL Open Font License 1.1; see assets/fonts/OFL-*.txt) ---------- */

@font-face {
  font-family: "Young Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/young-serif-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Young Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/young-serif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/fredoka-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/fredoka-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  --paper: #f4ede0;
  --paper-deep: #ebe1ce;
  --surface: #fbf7ef;
  --screen: #f2ecdc; /* the Playdate art's own paper */
  --ink: #252737;
  --ink-soft: #4a4c5e;
  --ink-mute: #5f6172;
  --line: #e0d4c0;
  --line-strong: #cbbda4;
  --link: #b8442a;
  --focus: #2f66c9;
  --bezel: #1b1c27;
  --shadow-rgb: 60 46 28;
  --face: #fbf7ef;
  --face-side: #dccdb3;

  --coral: #ee6b4d;
  --gold: #f2b33d;
  --teal: #2ba58f;
  --blue: #4a80d6;
  --purple: #8d5cc6;
  --green: #78b84a;
  --pink: #e9779c;
  --navy: #2d3250;

  --font-display: "Young Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-text: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-round: "Fredoka", "Figtree", ui-rounded, system-ui, sans-serif;

  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --step-1: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
  --step-2: clamp(1.65rem, 1.35rem + 1.2vw, 2.3rem);
  --step-3: clamp(2.05rem, 1.55rem + 2.1vw, 3.2rem);
  --step-4: clamp(2.45rem, 1.6rem + 3.7vw, 4.6rem);

  --gutter: clamp(16px, 4.5vw, 48px);
  --max: 1200px;
  --radius: 22px;
  --radius-sm: 12px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quint */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1c26;
    --paper-deep: #22232f;
    --surface: #262836;
    --ink: #f3ecdf;
    --ink-soft: #cec6b7;
    --ink-mute: #a9a396;
    --line: #353747;
    --line-strong: #4a4d5f;
    --link: #f39277;
    --focus: #8fb4ff;
    --bezel: #0f1017;
    --shadow-rgb: 0 0 0;
    --face: #2e3040;
    --face-side: #13141c;

    --coral: #f07a5e;
    --gold: #f4c35e;
    --teal: #4fbea6;
    --blue: #6f9be6;
    --purple: #a982dc;
    --green: #8cc466;
    --pink: #f08fae;
    --navy: #c9cde8;
  }
}

:root[data-theme="dark"] {
  --paper: #1b1c26;
  --paper-deep: #22232f;
  --surface: #262836;
  --ink: #f3ecdf;
  --ink-soft: #cec6b7;
  --ink-mute: #a9a396;
  --line: #353747;
  --line-strong: #4a4d5f;
  --link: #f39277;
  --focus: #8fb4ff;
  --bezel: #0f1017;
  --shadow-rgb: 0 0 0;
  --face: #2e3040;
  --face-side: #13141c;
  --coral: #f07a5e;
  --gold: #f4c35e;
  --teal: #4fbea6;
  --blue: #6f9be6;
  --purple: #a982dc;
  --green: #8cc466;
  --pink: #f08fae;
  --navy: #c9cde8;
}

@media (max-width: 480px) {
  :root {
    --gutter: 16px;
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

img,
video {
  height: auto;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}

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

a {
  color: inherit;
}

a:not([class]) {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--link);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  transition: color 0.2s, text-decoration-color 0.2s;
}

a:not([class]):hover {
  color: var(--link);
}

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

::selection {
  background: color-mix(in srgb, var(--gold) 55%, transparent);
  color: var(--ink);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  padding-block: 18px;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-name span {
  color: var(--ink-mute);
}

.site-nav ul {
  display: flex;
  gap: clamp(4px, 1.5vw, 12px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--ink-soft);
  transition: background-color 0.2s, color 0.2s;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--paper-deep);
}

@media (max-width: 480px) {
  .brand-name {
    font-size: 1.05rem;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
  }
  .site-nav .nav-optional {
    display: none;
  }
  .site-nav a {
    padding: 8px;
  }
}

@media (max-width: 340px) {
  .brand-name span {
    display: none;
  }
}

/* ---------- Buttons, badges ---------- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 1rem/1.2 var(--font-text);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-coral {
  --btn-bg: var(--coral);
  --btn-fg: #252737;
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--ink);
}

.btn .price {
  font-weight: 700;
  padding-left: 0.6em;
  margin-left: 0.1em;
  border-left: 1.5px solid color-mix(in srgb, currentColor 35%, transparent);
}

.btn svg {
  width: 1em;
  height: 1em;
  flex: none;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding-block: 6px;
  border-bottom: 2px solid var(--link);
}

.arrow-link span {
  transition: transform 0.25s var(--ease-out);
}

.arrow-link:hover span {
  transform: translateX(3px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-soft);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone, var(--ink-mute));
  flex: none;
}

.status {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-mute);
  white-space: nowrap;
}

.status-out {
  color: var(--ink);
}

.tone-coral { --tone: var(--coral); }
.tone-gold { --tone: var(--gold); }
.tone-teal { --tone: var(--teal); }
.tone-blue { --tone: var(--blue); }
.tone-purple { --tone: var(--purple); }
.tone-green { --tone: var(--green); }
.tone-pink { --tone: var(--pink); }

.eyebrow {
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- Landing hero ---------- */

.hero {
  padding-block: clamp(20px, 5vw, 72px) clamp(40px, 6vw, 80px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}

.hero h1 {
  font-size: var(--step-4);
  margin-top: 18px;
  max-width: 13ch;
}

.hero h1 em {
  font-style: normal;
  position: relative;
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0.02em;
  right: 0.02em;
  bottom: 0.02em;
  height: 0.16em;
  border-radius: 999px;
  background: var(--tone, var(--coral));
  opacity: 0.85;
  z-index: -1;
}

.hero .lead {
  font-size: var(--text-lg);
  color: var(--ink-soft);
  margin-top: 22px;
  max-width: 34em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: 30px;
}

.hero-art {
  width: 100%;
  max-width: 520px;
  justify-self: end;
}

.hero-art svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.board .face { fill: var(--face); }
.board .face-side { fill: var(--face-side); }
.board .stroke {
  fill: none;
  stroke-width: 20;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.board .tip {
  stroke-width: 6;
  stroke-linejoin: round;
}
.board .coral { stroke: var(--coral); fill: var(--coral); }
.board .gold { stroke: var(--gold); fill: var(--gold); }
.board .teal { stroke: var(--teal); fill: var(--teal); }
.board .blue { stroke: var(--blue); fill: var(--blue); }
.board .purple { stroke: var(--purple); fill: var(--purple); }
.board .pink { stroke: var(--pink); fill: var(--pink); }
.board .green { stroke: var(--green); fill: var(--green); }
.board .navy { stroke: var(--navy); fill: var(--navy); }
.board .stroke { fill: none; }

@media (prefers-reduced-motion: no-preference) {
  .board .slider {
    animation: slide-out 1.3s var(--ease-out) 0.7s both;
  }
  .rise {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 0.8s var(--ease-out) forwards;
    animation-delay: calc(var(--d, 0) * 1ms);
  }
}

@keyframes slide-out {
  from { transform: translateX(-74px); }
  to { transform: none; }
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (max-width: 820px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-art {
    order: -1;
    justify-self: start;
    max-width: 230px;
  }
  .hero h1 {
    margin-top: 12px;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(40px, 6vw, 80px);
}

.section + .section:not(.band) {
  padding-top: clamp(16px, 3vw, 40px);
}

.section-head {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.section-head h2 {
  font-size: var(--step-3);
}

.section-head p {
  color: var(--ink-soft);
  max-width: 36em;
}

.section-head .eyebrow {
  margin-bottom: -2px;
}

/* ---------- Featured game ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  overflow: hidden;
}

.feature-copy {
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.feature-copy .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.feature-copy .pitch {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.15;
  max-width: 16ch;
}

.feature-copy p {
  max-width: 32em;
  color: var(--ink-soft);
}

.feature-copy .facts {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-mute);
}

.feature-copy .btn {
  margin-top: 6px;
}

.feature-art {
  position: relative;
  background: var(--coral);
  display: grid;
  place-items: center;
  padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 48px);
  min-height: 100%;
  isolation: isolate;
}

.feature-art::before {
  /* a faint grid, like the cells the arrows sit on */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.09) 2px, transparent 2px),
    linear-gradient(90deg, rgb(255 255 255 / 0.09) 2px, transparent 2px);
  background-size: 44px 44px;
  background-position: center;
}

.feature-art .phone {
  width: min(250px, 62vw);
}

.feature-art .icon-tile {
  position: absolute;
  width: clamp(76px, 10vw, 112px);
  left: clamp(16px, 8%, 64px);
  bottom: clamp(20px, 10%, 72px);
  border-radius: 24%;
  box-shadow: 0 18px 30px -16px rgb(var(--shadow-rgb) / 0.5);
  transform: rotate(-8deg);
}

@media (max-width: 860px) {
  .feature {
    grid-template-columns: minmax(0, 1fr);
  }
  .feature-art {
    order: -1;
  }
}

/* ---------- Phone frame (drawn in CSS) ---------- */

.phone {
  position: relative;
  padding: 9px;
  border-radius: 40px;
  background: var(--bezel);
  box-shadow:
    inset 0 0 0 1.5px rgb(255 255 255 / 0.12),
    0 2px 0 1px rgb(0 0 0 / 0.25),
    0 40px 60px -30px rgb(var(--shadow-rgb) / 0.55);
}

.phone::before {
  /* punch-hole camera */
  content: "";
  position: absolute;
  top: 19px;
  left: 50%;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: #0b0b10;
  box-shadow: inset 0 0 0 2px #22232e;
  z-index: 1;
}

.phone::after {
  /* side buttons */
  content: "";
  position: absolute;
  right: -3px;
  top: 22%;
  width: 3px;
  height: 14%;
  border-radius: 0 3px 3px 0;
  background: var(--bezel);
  box-shadow: 0 calc(100% + 120%) 0 0 var(--bezel);
}

.phone img {
  width: 100%;
  border-radius: 31px;
  background: #f4ede0;
}

.phone .screen {
  /* for screenshots without a status bar: leave room for the camera */
  padding-top: 30px;
  border-radius: 31px;
  background: #f5ede0;
  overflow: hidden;
}

.phone .screen img {
  border-radius: 0;
}

/* ---------- Game cards ---------- */

.games-grid {
  display: grid;
  gap: clamp(18px, 2.5vw, 28px);
}

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

.games-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .games-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 681px) and (max-width: 980px) {
  /* an odd last card fills the row, media beside the text */
  .games-grid.three > .game:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
  }
  .games-grid.three > .game:last-child:nth-child(odd) .game-media {
    flex: 0 0 50%;
    aspect-ratio: auto;
    min-height: 220px;
  }
  .games-grid.three > .game:last-child:nth-child(odd) .game-body {
    justify-content: center;
  }
}

@media (max-width: 680px) {
  .games-grid.two,
  .games-grid.three {
    grid-template-columns: minmax(0, 1fr);
  }
}

.game {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  transition: border-color 0.25s, transform 0.35s var(--ease-out);
}

.game:hover {
  border-color: var(--line-strong);
}

.game-media {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--screen);
  aspect-ratio: 630 / 500;
  box-shadow: inset 0 0 0 1.5px rgb(37 39 55 / 0.14);
}

.game-media.wide {
  aspect-ratio: 16 / 10;
}

.game-media img,
.game-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-media video {
  object-fit: contain;
  background: var(--screen);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .game-media img,
  :root:not([data-theme="light"]) .game-media video {
    filter: brightness(0.93);
  }
}

:root[data-theme="dark"] .game-media img,
:root[data-theme="dark"] .game-media video {
  filter: brightness(0.93);
}

.game-media.is-playing img {
  visibility: hidden;
}

.game-media::after {
  /* keep the inner hairline above the art */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px rgb(37 39 55 / 0.14);
  pointer-events: none;
}

.watch {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  border: 0;
  background: #252737;
  color: #f4ede0;
  font: 600 0.875rem/1 var(--font-text);
  cursor: pointer;
  box-shadow: 0 6px 16px -8px rgb(0 0 0 / 0.5);
  transition: transform 0.25s var(--ease-out), background-color 0.2s;
}

.watch:hover {
  transform: translateY(-1px);
}

.watch svg {
  width: 14px;
  height: 14px;
}

.watch .pause-icon,
.watch[aria-pressed="true"] .play-icon {
  display: none;
}

.watch[aria-pressed="true"] .pause-icon {
  display: block;
}

.game-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 10px 10px;
  flex: 1;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.game h3 {
  font-size: var(--step-2);
  margin-top: 2px;
}

.game .pitch {
  font-size: var(--text-lg);
  line-height: 1.4;
  color: var(--ink);
}

.game .facts {
  font-size: var(--text-sm);
  color: var(--ink-mute);
  font-weight: 500;
}

.game .btn {
  margin-top: auto;
}

.game .game-cta {
  margin-top: auto;
  padding-top: 10px;
}

.games-grid.three .game h3 {
  font-size: var(--step-1);
}

.games-grid.three .game .pitch {
  font-size: var(--text-base);
}

.playdate-note {
  font-size: var(--text-sm);
  color: var(--ink-mute);
  margin-top: 18px;
}

/* ---------- About band ---------- */

.band {
  background: var(--paper-deep);
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: start;
}

.about h2 {
  font-size: var(--step-3);
  max-width: 12ch;
}

.about-text {
  display: grid;
  gap: 18px;
  font-size: var(--text-lg);
  color: var(--ink-soft);
}

.mail-link {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid var(--coral);
  overflow-wrap: anywhere;
  justify-self: start;
  line-height: 1.25;
  transition: color 0.2s;
}

.mail-link:hover {
  color: var(--link);
}

@media (max-width: 760px) {
  .about {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

.site-footer {
  padding-block: 40px 48px;
  border-top: 1.5px solid var(--line);
  font-size: var(--text-sm);
  color: var(--ink-mute);
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 32px;
  align-items: start;
}

.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--link);
  text-underline-offset: 0.2em;
}

.site-footer .brand {
  margin-bottom: 10px;
}

.site-footer .fine {
  display: grid;
  gap: 4px;
}

@media (max-width: 680px) {
  .site-footer .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Knotbox page ---------- */

.wordmark {
  font-family: var(--font-round);
  font-weight: 600;
  font-size: clamp(3rem, 2rem + 5vw, 5.6rem);
  line-height: 1;
  letter-spacing: 0.01em;
  display: flex;
  flex-wrap: nowrap;
}

.wordmark span:nth-child(1) { color: var(--coral); }
.wordmark span:nth-child(2) { color: var(--gold); }
.wordmark span:nth-child(3) { color: var(--teal); }
.wordmark span:nth-child(4) { color: var(--blue); }
.wordmark span:nth-child(5) { color: var(--purple); }
.wordmark span:nth-child(6) { color: var(--green); }
.wordmark span:nth-child(7) { color: var(--pink); }

.feature .wordmark {
  font-size: clamp(2.6rem, 1.8rem + 3.2vw, 4.2rem);
}

.kb-hero {
  padding-block: clamp(28px, 6vw, 80px) clamp(48px, 7vw, 96px);
}

.kb-hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}

.kb-hero-copy {
  display: grid;
  gap: 20px;
  justify-items: start;
}

.kb-hero h1 {
  margin-top: 4px;
}

.kb-hero .tagline {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.15;
}

.kb-hero .intro {
  color: var(--ink-soft);
  font-size: var(--text-lg);
  max-width: 32em;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 6px;
}

.soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 12px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  line-height: 1.25;
}

.soon-pill svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.store-link[hidden] {
  display: none;
}

.small-links {
  font-size: var(--text-sm);
  color: var(--ink-mute);
}

.kb-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: 12px 40px;
}

.kb-stage::before {
  /* a coral disc behind the phone */
  content: "";
  position: absolute;
  width: min(440px, 92%);
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  translate: -50% -54%;
  border-radius: 50%;
  background: var(--coral);
  opacity: 0.9;
}

.kb-stage::after {
  /* the floor shadow the box sits on in the game */
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: min(260px, 60%);
  height: 18px;
  translate: -50% 0;
  border-radius: 50%;
  background: rgb(var(--shadow-rgb) / 0.12);
}

.kb-stage .phone {
  width: min(290px, 72vw);
  position: relative;
}

@media (max-width: 860px) {
  .kb-hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

.how {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}

.how-shot {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--line);
  max-width: 380px;
  justify-self: center;
  width: 100%;
}

.how-shot img {
  width: 100%;
}

.steps {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 26px;
}

.steps li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.step-num {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-round);
  font-weight: 600;
  font-size: 1.5rem;
  color: #252737;
  background: var(--tone);
}

.steps h3 {
  font-size: var(--step-1);
  margin-bottom: 6px;
}

.steps p {
  color: var(--ink-soft);
}

@media (max-width: 760px) {
  .how {
    grid-template-columns: minmax(0, 1fr);
  }
  .how-shot {
    max-width: 300px;
    order: 1;
  }
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px) clamp(24px, 5vw, 72px);
}

.features li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.features svg {
  width: 30px;
  height: 30px;
  margin-top: 2px;
  color: var(--tone);
}

.features h3 {
  font-size: var(--step-1);
  margin-bottom: 6px;
}

.features p {
  color: var(--ink-soft);
}

@media (max-width: 720px) {
  .features {
    grid-template-columns: minmax(0, 1fr);
  }
}

.names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.names li {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
  padding: 7px 15px 7px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 22%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--tone) 45%, var(--surface));
  font-family: var(--font-round);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--ink);
}

.names li b {
  font-family: var(--font-text);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.names li:nth-child(7n + 1) { --tone: var(--coral); }
.names li:nth-child(7n + 2) { --tone: var(--gold); }
.names li:nth-child(7n + 3) { --tone: var(--teal); }
.names li:nth-child(7n + 4) { --tone: var(--blue); }
.names li:nth-child(7n + 5) { --tone: var(--purple); }
.names li:nth-child(7n + 6) { --tone: var(--green); }
.names li:nth-child(7n + 7) { --tone: var(--pink); }

.names .more {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-strong);
  color: var(--ink-mute);
  font-family: var(--font-text);
  font-size: 0.95rem;
}

.daily {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding: clamp(24px, 5vw, 56px);
  border-radius: calc(var(--radius) + 8px);
  background: var(--surface);
  border: 1.5px solid var(--line);
}

.daily-cal {
  width: clamp(92px, 14vw, 140px);
  aspect-ratio: 1;
  border-radius: 24px;
  background: var(--coral);
  color: #252737;
  display: grid;
  place-content: center;
  text-align: center;
  font-family: var(--font-round);
  font-weight: 600;
  line-height: 1;
  box-shadow: inset 0 -8px 0 rgb(0 0 0 / 0.12);
}

.daily-cal small {
  font-size: clamp(0.8rem, 0.6rem + 0.6vw, 1rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.daily-cal strong {
  font-size: clamp(2.6rem, 1.8rem + 3vw, 4.2rem);
  font-weight: 600;
}

.daily h2 {
  font-size: var(--step-2);
  margin-bottom: 12px;
}

.daily p + p {
  margin-top: 12px;
}

.daily p {
  color: var(--ink-soft);
  max-width: 40em;
}

@media (max-width: 600px) {
  .daily {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Legal pages ---------- */

.doc-head {
  padding-block: clamp(32px, 6vw, 80px) clamp(24px, 4vw, 48px);
}

.doc-head h1 {
  font-size: var(--step-4);
  margin-top: 14px;
}

.doc-head .updated {
  margin-top: 16px;
  color: var(--ink-mute);
  font-weight: 600;
  font-size: var(--text-sm);
}

.doc-head .summary {
  margin-top: 28px;
  max-width: 46em;
  padding: 22px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1.5px solid var(--line);
}

.doc-head .summary h2 {
  font-size: var(--step-1);
  margin-bottom: 10px;
}

.doc-head .summary ul {
  margin: 0;
  padding-left: 1.2em;
  color: var(--ink-soft);
  display: grid;
  gap: 6px;
}

.doc {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  padding-bottom: clamp(56px, 9vw, 120px);
  align-items: start;
}

.toc {
  position: sticky;
  top: 24px;
  font-size: 0.95rem;
}

.toc h2 {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
  display: grid;
  gap: 2px;
  border-left: 1.5px solid var(--line);
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr);
  padding: 5px 0 5px 14px;
  margin-left: -1.5px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.35;
  transition: color 0.2s, border-color 0.2s;
}

.toc a::before {
  content: counter(toc) ".";
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.toc a:hover,
.toc a.is-current {
  color: var(--ink);
  border-left-color: var(--coral);
}

.prose {
  max-width: 68ch;
  font-size: var(--text-base);
  line-height: 1.7;
}

.prose section {
  padding-top: 8px;
}

.prose section + section {
  margin-top: 44px;
}

.prose h2 {
  font-size: var(--step-2);
  margin-bottom: 16px;
  scroll-margin-top: 24px;
}

.prose h3 {
  font-family: var(--font-text);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: 0;
  margin: 28px 0 8px;
}

.prose p,
.prose ul,
.prose ol,
.prose .table-wrap {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 6px;
}

.prose li::marker {
  color: var(--ink-mute);
}

.prose strong {
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

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

.prose th {
  font-weight: 700;
  color: var(--ink);
  background: var(--paper-deep);
}

.prose td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .doc {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc {
    position: static;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1.5px solid var(--line);
  }
  .toc ol {
    border-left: 0;
  }
  .toc a {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .prose td:first-child {
    white-space: normal;
  }
  .prose th,
  .prose td {
    padding: 10px 11px;
  }
}

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

.lost {
  min-height: 62vh;
  display: grid;
  align-content: center;
  padding-block: clamp(40px, 8vw, 96px);
}

.lost .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}

.lost h1 {
  font-size: var(--step-4);
  margin-top: 14px;
  max-width: 12ch;
}

.lost p.lead {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: var(--text-lg);
  max-width: 30em;
}

.lost .hero-actions {
  margin-top: 28px;
}

.lost-art {
  width: clamp(200px, 30vw, 340px);
}

@media (prefers-reduced-motion: no-preference) {
  .lost-art .slider {
    animation: slide-off 5s var(--ease-out) 0.8s infinite;
  }
}

@keyframes slide-off {
  0% { transform: translateX(0); opacity: 1; }
  28% { transform: translateX(140px); opacity: 0; }
  40% { transform: translateX(-24px); opacity: 0; }
  56%, 100% { transform: translateX(0); opacity: 1; }
}

@media (max-width: 700px) {
  .lost .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .lost-art {
    order: -1;
    width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

.d1 { --d: 80; }
.d2 { --d: 160; }
.d3 { --d: 240; }
.d4 { --d: 320; }

.game-media img.pos-right {
  object-position: 72% 50%;
}

.section-first {
  padding-top: 0;
}

.section-title {
  font-size: var(--step-3);
  margin-top: 10px;
}
