@font-face {
  font-family: "Comforter Brush";
  font-weight: 400;
  font-display: block;
  src: url("comforter-brush-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-weight: 600 800;
  font-display: swap;
  src: url("bricolage-grotesque-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Umoupen Brush";
  font-weight: 400;
  font-display: swap;
  src: url("umoupen-brush.woff2") format("woff2");
}

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/fredoka-latin-ext-600.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("fonts/fredoka-latin-600.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;
}

:root {
  color-scheme: light dark;
  --bg: #fbfcff;
  --card: #ffffff;
  --card-hover: #eef3fb;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --text: #171b26;
  --text-soft: #4b5567;
  --text-muted: #737d90;
  --border: #d8deea;
  --paper: #ffffff;
  --shadow: 0 1px 2px rgba(23, 27, 38, 0.06), 0 12px 32px -8px rgba(23, 27, 38, 0.22);
  --shadow-board: 0 1px 3px rgba(23, 27, 38, 0.06), 0 24px 60px -24px rgba(23, 27, 38, 0.28);
  --page-top: oklch(0.977 0.010 252);
  --page-bottom: oklch(0.952 0.022 252);
  --hatch: rgb(61 135 255 / 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --header-h: 64px;
  --max-w: 1120px;
  --view-h: calc(100svh - var(--header-h));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e14;
    --card: #1a1e2e;
    --card-hover: #222840;
    --text: #e8eaf0;
    --text-soft: #9ca3b4;
    --text-muted: #6b7280;
    --border: #2a2f42;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 36px -8px rgba(0, 0, 0, 0.6);
    --shadow-board: 0 1px 3px rgba(0, 0, 0, 0.4), 0 28px 70px -24px rgba(0, 0, 0, 0.7);
    --page-top: oklch(0.20 0.035 260);
    --page-bottom: oklch(0.27 0.058 260);
    --hatch: rgb(61 135 255 / 0.035);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  background: var(--page-top);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background: linear-gradient(var(--page-top), var(--page-bottom));
}

body::after {
  left: -18px;
  background: repeating-linear-gradient(135deg, var(--hatch) 0 1.414px, transparent 1.414px 12.728px);
  mask-image: linear-gradient(transparent, #000);
  animation: stripes 0.6s linear infinite;
}

@keyframes stripes {
  to { translate: 18px 0; }
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

img {
  max-width: 100%;
}

h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.1;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

section {
  padding: 6rem 1.5rem;
}

.section-title {
  margin-bottom: 2rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  text-align: center;
}

.brush {
  font-family: "Umoupen Brush", var(--display);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
}

.icon {
  display: inline-block;
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.icon-android { --icon: url("icons/android.svg"); }
.icon-apple { --icon: url("icons/apple.svg"); }
.icon-bluesky { --icon: url("icons/bluesky.svg"); }
.icon-forum { --icon: url("icons/forum.svg"); }
.icon-instagram { --icon: url("icons/instagram.svg"); }
.icon-linux { --icon: url("icons/linux.svg"); }
.icon-menu { --icon: url("icons/menu.svg"); }
.icon-paypal { --icon: url("icons/paypal.svg"); }
.icon-share { --icon: url("icons/share.svg"); }
.icon-tablet { --icon: url("icons/tablet.svg"); }
.icon-tiktok { --icon: url("icons/tiktok.svg"); }
.icon-warning { --icon: url("icons/warning.svg"); color: #f2b705; }
.icon-windows { --icon: url("icons/windows.svg"); }
.icon-x { --icon: url("icons/x.svg"); }
.icon-youtube { --icon: url("icons/youtube.svg"); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.button:hover {
  background: var(--card-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

.button.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-hover);
}

.button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--page-top) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--max-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-family: "Comforter Brush", var(--font);
  font-size: 2rem;
  line-height: 1;
}

.logo:hover {
  text-decoration: none;
}

.logo img {
  width: 28px;
}

.menu-button {
  display: none;
  padding: 0.5rem;
  border: 0;
  background: none;
  color: var(--text-soft);
  cursor: pointer;
}

.menu-button .icon {
  display: block;
  width: 24px;
  height: 24px;
}

.site-nav {
  position: static;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  list-style: none;
  overflow: visible;
}

.site-nav a {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.languages {
  display: flex;
  gap: 0.5rem;
}

.languages a {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.languages a[aria-current] {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 64rem) {
  .menu-button {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--page-top);
  }

  .site-nav:popover-open {
    display: flex;
  }

  .site-nav > li > a {
    display: block;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
  }

  .languages {
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
  }

  .languages a {
    padding: 0.75rem;
  }
}

.download {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: var(--max-w);
  min-height: var(--view-h);
  margin: 0 auto;
}

.mascot {
  justify-self: center;
  width: auto;
  height: min(64vh, 760px);
}

.title {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.35rem);
}

.title h1 {
  font-family: "Comforter Brush", var(--font);
  font-size: clamp(4.2rem, 13vw, 8.5rem);
  font-weight: 400;
  line-height: 0.86;
}

.title img {
  width: clamp(4.5rem, 9vw, 7.5rem);
}

.tagline {
  margin: 0.35rem 0 2rem clamp(1.5rem, 4.5vw, 3.5rem);
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tagline.brush {
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: inherit;
}

.platforms {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.platforms > h2 {
  align-self: center;
  color: var(--text-soft);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 650;
  text-align: right;
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: center;
}

.choice .button {
  flex-direction: column;
  gap: 0.32rem;
  min-height: 4.4rem;
  padding: 0.65rem;
}

.button-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.button-detail {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.primary .button-detail {
  color: rgb(255 255 255 / 0.75);
}

.price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.price[hidden] {
  display: none;
}

.price-was {
  opacity: 0.68;
  font-size: 0.62rem;
}

.price-now {
  font-size: 0.8rem;
  font-weight: 800;
}

.price-note {
  font-size: 0.62rem;
  font-weight: 750;
}

.choice > a:not(.button) {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.choice > a:not(.button):hover {
  color: var(--text);
}

.tip {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 50%;
  z-index: 20;
  display: flex;
  gap: 0.4rem;
  width: max-content;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.55rem 0.7rem;
  border-radius: 0.45rem;
  background: var(--text);
  box-shadow: var(--shadow);
  color: var(--bg);
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: left;
  translate: -50% 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
}

.tip.above {
  top: auto;
  bottom: calc(100% + 0.35rem);
  text-align: center;
}

.choice a:hover + .tip,
.choice a:focus-visible + .tip {
  opacity: 1;
  visibility: visible;
}

.centered {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 650;
  text-align: center;
}

.version {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.download details {
  max-width: 36rem;
  margin: 0.4rem auto 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.download details[open] {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.download summary {
  color: var(--text-muted);
  font-weight: 650;
  text-align: center;
  cursor: pointer;
}

.download details[open] summary {
  margin-bottom: 0.35rem;
  color: var(--text);
}

.download details p + p {
  margin-top: 0.35rem;
}

@media (max-width: 820px) {
  .download {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .mascot {
    height: min(54vh, 620px);
  }

  .title {
    justify-content: center;
  }

  .tagline {
    margin-left: 0;
  }
}

@media (max-width: 639px) {
  .platforms {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .platforms > h2 {
    grid-column: 1 / -1;
    text-align: left;
  }
}

.panel {
  max-width: 36rem;
  margin: 1rem auto;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  text-align: left;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.panel-head h2 {
  flex: 1;
  color: var(--text-soft);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 650;
}

.panel-head button {
  padding: 0 0.3rem;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.panel label {
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 650;
}

.panel input[type="email"],
.panel input[type="number"] {
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.panel input[type="number"] {
  width: 4.2rem;
  margin-left: 0.45rem;
  padding: 0.25rem 0.4rem;
}

.panel p {
  margin-bottom: 0.75rem;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.gift-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--bg);
  cursor: pointer;
}

.gift-option[hidden] {
  display: none;
}

.gift-option input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.gift-option strong {
  display: block;
  color: var(--text);
}

.gift-option small {
  display: block;
  font-size: 0.76rem;
  font-weight: 400;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.inline-form[hidden] {
  display: none;
}

.inline-form label {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 12rem;
}

.checkout-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--bg);
}

.checkout-summary[hidden] {
  display: none;
}

.checkout-summary strong {
  font-size: 1.15rem;
}

.checkout-summary span {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.checkout-frame {
  min-width: 312px;
}

.status {
  color: var(--text-soft);
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.status code {
  color: var(--text);
  font-size: 0.95rem;
  user-select: all;
}

.features {
  padding: 0;
}

.features-intro {
  display: grid;
  place-items: center;
  gap: 2.5rem;
  padding: calc(var(--header-h) + 1rem) 1.5rem 6rem;
  text-align: center;
}

.app-shot {
  width: min(100%, 64rem);
}

.app-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-board);
}

.features-heading .section-title {
  margin-bottom: 1.5rem;
}

.chapter-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
}

.chapter-links a {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

.chapter-links a:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

.chapter {
  padding: 3rem 0 4rem;
}

.chapter-art {
  display: grid;
  place-items: center;
  view-timeline: --artwork block;
}

.art {
  --art-w: min(100vw - 2rem, var(--art-max, 1600px), (var(--view-h) - 2rem) * var(--ratio));
  position: relative;
  width: var(--art-w);
  aspect-ratio: var(--ratio);
  overflow: hidden;
  isolation: isolate;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-board);
}

.art.blue { --ratio: 1.5764; --art-max: 1240px; }
.art.ocean { --ratio: 2.3869; }
.art.train { --ratio: 2; }

.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(calc((var(--entry) + var(--exit)) / 2));
}

/* transform, not translate and scale: Chrome shook the individual properties
   vertically while scrolling. */
@keyframes depth {
  from { transform: translateY(calc(var(--travel) * 50%)) scale(var(--entry)); }
  to { transform: translateY(calc(var(--travel) * -50%)) scale(var(--exit)); }
}

.blue .bg { --travel: 0.02; --entry: 1.06; --exit: 1.02; }
.blue .back-cell { --travel: 0.04; --entry: 1.08; --exit: 1.04; }
.blue .small-back { --travel: 0.10; --entry: 1.12; --exit: 1.00; transform-origin: 15% 22%; }
.blue .middle-cell { --travel: 0.06; --entry: 1.12; --exit: 1.06; }
.blue .haze { --travel: 0.06; --entry: 1.12; --exit: 1.06; }
.blue .small-front { --sway: 0.06; --travel: 0.32; --entry: 1.30; --exit: 0.98; transform-origin: 88% 82%; }
.blue .front-cell { --travel: 0.16; --entry: 1.24; --exit: 1.16; transform-origin: 20% 50%; }

.ocean .background { --travel: 0.04; --entry: 1.12; --exit: 1.06; }
.ocean .girl-right { --travel: 0.23; --entry: 1.36; --exit: 1.26; }
.ocean .girl-left { --travel: 0.12; --entry: 1.20; --exit: 1.14; }
.ocean .girl-front { --travel: 0.38; --entry: 1.58; --exit: 1.42; }
.ocean .light { --travel: 0.12; --entry: 1.20; --exit: 1.14; mix-blend-mode: screen; }

.train .window { --travel: 0.02; --entry: 1.08; --exit: 1.04; }
.train .train { --travel: 0.08; --entry: 1.16; --exit: 1.10; }
.train .bars { --travel: 0.16; --entry: 1.30; --exit: 1.20; }
.train .handles { --travel: 0.24; --entry: 1.40; --exit: 1.28; }

.credit {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: #222;
  font: 600 12px/1.4 var(--font);
}

@property --window {
  syntax: "<number>";
  inherits: true;
  initial-value: 0.5;
}

@keyframes window {
  from { --window: 0; }
  to { --window: 1; }
}

.room {
  --scene-width: min(1500px, 165vw, 150svh);
  --scene-top: calc(76px - var(--scene-width) * 0.07);
  --scene-h: calc(var(--scene-width) * 4008 / 5670);
  --room-h: min(var(--view-h) - 2rem, var(--scene-top) + var(--scene-h));
  --frame-scale: calc(1.45 - 0.40 * var(--window));
  --frame-top: calc(var(--scene-top) + var(--scene-h) * (1 - var(--frame-scale)) / 2);
  --frame-bottom: calc(var(--scene-top) + var(--scene-h) * (1 + var(--frame-scale)) / 2);
  --frame-y: min(-1 * var(--frame-top), max(var(--scene-width) * (0.06 - 0.225 * var(--window)), var(--room-h) - var(--frame-bottom)));
  position: relative;
  width: min(100% - 2rem, 1500px);
  height: var(--room-h);
  overflow: hidden;
  isolation: isolate;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-board);
}

.scene {
  position: absolute;
  top: var(--scene-top);
  left: 50%;
  width: var(--scene-width);
  aspect-ratio: 5670 / 4008;
  translate: -50% 0;
  overflow: hidden;
}

.scene img,
.window-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

.room-back {
  transform-origin: 50% 40%;
  transform: translateX(calc(var(--mouse-x, 0) * -0.010 * var(--scene-width))) translateY(calc(-1.25 * (var(--window) - 0.5) * 0.035 * var(--scene-width))) scale(1.035);
}

.room-chair {
  transform-origin: 50% 75%;
  transform: translate(calc((-0.035 - 0.025 * var(--mouse-x, 0)) * var(--scene-width)), calc(var(--scene-width) * (-0.04 - 1.25 * (var(--window) - 0.5) * 0.095))) scale(0.82);
}

.window-frame {
  transform: translate(calc(var(--mouse-x, 0) * -0.022 * var(--scene-width)), var(--frame-y)) scale(var(--frame-scale));
}

.window-frame::after {
  content: "";
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  height: 100%;
  background: var(--paper);
}

.window-frame .leaves {
  inset: 57.18% auto auto 60.25%;
  width: 21.16%;
  height: auto;
}

.room > .credit {
  bottom: calc(var(--room-h) - min(var(--room-h), var(--scene-top) + var(--scene-h), var(--frame-bottom) + var(--frame-y)) + 12px);
}

/* --mouse-x (-1 to 1, set by site.js) slides each plane sideways by its depth;
   --sway stands in for --travel where a plane has little edge to spare. */
.art img {
  translate: calc(var(--mouse-x, 0) * var(--sway, var(--travel)) * -15%) 0;
  animation: depth linear both;
  animation-timeline: --artwork;
  animation-range: cover 0% cover calc(100% + var(--header-h));
}

.room {
  animation: window linear both;
  animation-timeline: --artwork;
  animation-range: cover 0% cover calc(100% + var(--header-h));
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  width: min(calc(100% - 3rem), var(--max-w));
  margin: 2.5rem auto 0;
}

.card {
  padding: 1.5rem;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.chapter-title {
  margin: 0 1.5rem 2.5rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}

.card h4 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
  font-family: "Fredoka", var(--font);
  font-size: 20px;
  font-weight: 600;
}

.card ul {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-left: 1rem;
}

.card li {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.card li::marker {
  color: var(--accent);
}

.card.highlight {
  border: 2px solid color-mix(in srgb, var(--accent) 45%, var(--border));
}

.badge {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 750;
}

.face {
  animation: bob var(--bob) ease-in-out var(--delay) infinite alternate;
}

@media (max-width: 639px) {
  .art {
    --art-w: min(100vw - 1.25rem, (var(--view-h) - 1.25rem) * var(--ratio));
  }

  .room {
    --scene-width: max(165vw, calc((92vw + 180px) * 1.7));
    --scene-top: calc(0px - var(--scene-width) * 0.07);
    --room-h: min(var(--view-h) - 1.25rem, 92vw + 180px);
    width: calc(100% - 1.25rem);
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: calc(100% - 1.5rem);
    margin-top: 1.5rem;
  }

  .credit {
    right: 8px;
    bottom: 8px;
    font-size: 11px;
  }
}

/* Fanart stays between chapters in the page flow; only the horizontal loop moves. */
.fanart {
  --fan-h: 240px;
  padding: 1.25rem 0;
  overflow-x: clip;
}

/* The trailing padding matches the gap, so each of site.js's three copies is exactly a
   third of the track and the loop can shift by a plain percentage. Safari's tab memory
   grew about 2 MB a second while the shift mixed % and rem in calc(). */
.fanart-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  height: var(--fan-h);
  padding-right: 1rem;
  animation: marquee 70s linear infinite;
}

.fanart.reverse .fanart-track {
  animation-direction: reverse;
}

.fanart:hover .fanart-track,
.fanart:focus-within .fanart-track {
  animation-play-state: paused;
}

@keyframes marquee {
  to { translate: calc(100% / -3) 0; }
}

.fanart figure {
  position: relative;
  flex: none;
  width: calc(var(--fan-h) * var(--w) / 480);
  height: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.fanart img,
.fanart video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fanart .credit {
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  font-size: 11px;
}

@media (max-width: 700px) {
  .fanart {
    --fan-h: 150px;
  }
}

.stickers {
  padding: 3rem 1.5rem 8rem;
}

.stickers .card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

@media (prefers-color-scheme: dark) {
  .stickers .card {
    background: rgba(26, 30, 46, 0.8);
  }
}

.sticker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  max-width: var(--max-w);
  margin: 0 auto;
}

.sticker-row + .sticker-row {
  margin-top: clamp(3rem, 8vw, 6rem);
}

.sticker-stack {
  display: grid;
  gap: 1.5rem;
}

.sticker-stack .card:nth-last-child(2) {
  margin-left: clamp(0rem, 4vw, 3rem);
}

.sticker-stack .card:last-child {
  margin-left: clamp(0rem, 1.5vw, 1rem);
}

.sticker {
  position: relative;
  justify-self: center;
  width: min(100%, 26rem);
}

.sticker img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 16px 22px rgba(23, 27, 38, 0.22));
}

.sticker.sparkle {
  width: min(90%, 22rem);
  rotate: 3deg;
}

.sticker.coat {
  width: min(100%, 30rem);
  rotate: -2deg;
}

@media (max-width: 820px) {
  .sticker-row {
    grid-template-columns: 1fr;
  }

  .sticker {
    order: -1;
  }

  .sticker-stack .card:nth-child(n) {
    margin-left: 0;
  }

  .sticker.sparkle,
  .sticker.coat {
    width: min(76%, 22rem);
  }
}

.community {
  position: relative;
  isolation: isolate;
  padding-block: 7rem;
}

.faces {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow-x: clip;
  pointer-events: none;
}

.face {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: auto;
  rotate: var(--turn);
  filter: drop-shadow(0 8px 12px rgba(23, 27, 38, 0.14));
}

@keyframes bob {
  from { transform: translateY(-6px) rotate(-3deg); }
  to { transform: translateY(8px) rotate(3deg); }
}

.face:nth-child(1) { --x: 3%; --y: 6%; --size: 118px; --turn: -8deg; --bob: 6.2s; --delay: 0s; }
.face:nth-child(2) { --x: 12%; --y: 30%; --size: 96px; --turn: 6deg; --bob: 5.4s; --delay: -1.2s; }
.face:nth-child(3) { --x: 4%; --y: 58%; --size: 112px; --turn: 4deg; --bob: 7.1s; --delay: -2s; }
.face:nth-child(4) { --x: 13%; --y: 84%; --size: 100px; --turn: -6deg; --bob: 5.9s; --delay: -0.6s; }
.face:nth-child(5) { --x: 86%; --y: 5%; --size: 110px; --turn: 9deg; --bob: 6.6s; --delay: -1.5s; }
.face:nth-child(6) { --x: 77%; --y: 24%; --size: 92px; --turn: -5deg; --bob: 5.2s; --delay: -0.3s; }
.face:nth-child(7) { --x: 88%; --y: 45%; --size: 120px; --turn: 7deg; --bob: 7.4s; --delay: -2.6s; }
.face:nth-child(8) { --x: 79%; --y: 70%; --size: 98px; --turn: -9deg; --bob: 6s; --delay: -1s; }
.face:nth-child(9) { --x: 89%; --y: 88%; --size: 104px; --turn: 5deg; --bob: 5.7s; --delay: -3.1s; }
.face:nth-child(10) { --x: 22%; --y: 3%; --size: 84px; --turn: 10deg; --bob: 6.9s; --delay: -0.9s; }
.face:nth-child(11) { --x: 66%; --y: 2%; --size: 88px; --turn: -10deg; --bob: 5.5s; --delay: -2.2s; }
.face:nth-child(12) { --x: 30%; --y: 93%; --size: 90px; --turn: 6deg; --bob: 6.3s; --delay: -1.7s; }
.face:nth-child(13) { --x: 60%; --y: 94%; --size: 92px; --turn: -4deg; --bob: 7s; --delay: -0.4s; }
.face:nth-child(14) { --x: 47%; --y: -1%; --size: 80px; --turn: 0deg; --bob: 6.8s; --delay: -2.9s; }

.community-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 58rem;
  margin: 0 auto;
}

.community-grid .card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem;
  animation: none;
}

.community-grid .card > .icon {
  width: 3.25rem;
  height: 3.25rem;
  color: var(--accent);
}

.community-grid h3 {
  font-size: 1.3rem;
}

.community-grid p {
  color: var(--text-soft);
}

.community-grid .card > p:last-child {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.discord {
  overflow: hidden;
}

.community-grid .discord {
  padding: 0;
}

.discord iframe {
  display: block;
  width: 100%;
  height: 500px;
  border: 0;
}

@media (max-width: 980px) {
  .discord {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 350px);
  }
}

@media (max-width: 639px) {
  .community-grid {
    grid-template-columns: 1fr;
  }

  .face {
    width: calc(var(--size) * 0.62);
  }

  .face:nth-child(even),
  .face:nth-child(n + 10) {
    display: none;
  }
}

.legal {
  max-width: 52rem;
  margin: 0 auto;
}

.legal details {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.legal summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  list-style: none;
  cursor: pointer;
}

.legal summary::-webkit-details-marker {
  display: none;
}

.legal summary::after {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  rotate: 45deg;
  transition: rotate 0.2s;
}

.legal details[open] summary::after {
  rotate: 225deg;
}

.legal summary h3 {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
}

.legal-body {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.7;
}

.legal-body h4 {
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
}

.legal-body p + p {
  margin-top: 1rem;
}

footer {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

footer p:last-child {
  margin-top: 1rem;
}

.motion-control {
  flex: none;
  margin-left: auto;
}

.motion-control p {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.motion-control button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-hover);
  color: var(--text);
  cursor: pointer;
}

.motion-control button::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-block: 7px solid transparent;
  border-left: 11px solid currentColor;
}

:root[data-motion="playing"] .motion-control button::before {
  width: 11px;
  height: 14px;
  margin-left: 0;
  border: 0;
  border-inline: 4px solid currentColor;
}

.header-inner:has(.motion-control:not([hidden])) {
  gap: 0.75rem;
}

.header-inner:has(.motion-control:not([hidden])) .site-nav {
  gap: 1rem;
}

@media (max-width: 64rem) {
  .header-inner:has(.motion-control:not([hidden])) .site-nav {
    gap: 0;
  }
}

html[data-motion="paused"] {
  scroll-behavior: auto;
}

:root[data-motion="paused"] :is(.fanart-track, .face, .art img, .room),
:root[data-motion="paused"] body::after {
  animation: none;
}

:root[data-motion="paused"] .art img {
  translate: none;
}

/* Honor the device preference before JavaScript runs, and without JavaScript. */
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="playing"]) {
    scroll-behavior: auto;
  }

  :root:not([data-motion="playing"]) :is(.fanart-track, .face, .art img, .room),
  :root:not([data-motion="playing"]) body::after {
    animation: none;
  }

  :root:not([data-motion="playing"]) .art img {
    translate: none;
  }
}
