@font-face {
  font-family: "Mona Sans";
  src: url("fonts/MonaSans.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Mona Sans Mono";
  src: url("fonts/MonaSansMono.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #0b0a1c;
  --ground-2: #110f29;
  --panel: #17152f;
  --panel-line: rgba(196, 190, 255, 0.12);
  --ink: #eeedfb;
  --ink-2: rgba(226, 223, 255, 0.72);
  --ink-3: rgba(214, 210, 255, 0.54);
  --shelf: #1d1a38;
  --shelf-face: #14122b;
  --aurora-a: #79f2cf;
  --aurora-b: #5fc7ff;
  --cta: #f3f1ff;
  --cta-ink: #17133a;
  --shadow: 0 30px 60px -18px rgba(3, 2, 14, 0.75), 0 10px 22px -10px rgba(3, 2, 14, 0.6);
  --radius: 14px;
  --measure: 66ch;
  --page: min(1360px, 100% - 2 * var(--gutter));
  --gutter: clamp(20px, 4vw, 56px);
  --spine-w: 48px;
  --spine-h: 270px;
  --pull: 30px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Mona Sans", -apple-system, system-ui, sans-serif;
  font-stretch: 100%;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ground: #eef0f5;
    --ground-2: #e6e9f1;
    --panel: #f8f9fc;
    --panel-line: rgba(27, 23, 70, 0.1);
    --ink: #15132e;
    --ink-2: rgba(21, 19, 46, 0.74);
    --ink-3: rgba(21, 19, 46, 0.58);
    --shelf: #d6d9e4;
    --shelf-face: #c3c7d6;
    --aurora-a: #0b7a63;   /* 5:1 on the panels: it is also text (the step numbers) */
    --aurora-b: #1d7fd1;
    --cta: #17133a;
    --cta-ink: #f3f1ff;
    --shadow: 0 30px 60px -22px rgba(30, 26, 80, 0.35), 0 10px 22px -12px rgba(30, 26, 80, 0.25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: color-mix(in oklab, var(--aurora-a) 70%, transparent); }
a:hover { text-decoration-color: var(--aurora-a); }
code, pre, var { font-family: "Mona Sans Mono", ui-monospace, "SF Mono", Menlo, monospace; font-variant-ligatures: none; }
code { font-size: 0.88em; }
var { font-style: normal; color: var(--aurora-a); }
::selection { background: color-mix(in oklab, var(--aurora-a) 55%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--aurora-a); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: color-mix(in oklab, var(--ink) 28%, transparent) transparent; }

h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
h1, h2 { font-stretch: 125%; font-weight: 850; letter-spacing: -0.035em; line-height: 0.98; }
h2 { font-size: clamp(2.1rem, 4.6vw, 4rem); margin-bottom: 0.6em; }
h3 { font-size: 1.32rem; font-weight: 720; font-stretch: 112%; letter-spacing: -0.012em; line-height: 1.2; margin-bottom: 0.45em; }
p { margin: 0 0 1em; }
.section-lede { max-width: var(--measure); color: var(--ink-2); font-size: 1.12rem; margin-bottom: 2.4em; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 14px; background: var(--cta); color: var(--cta-ink); border-radius: 10px; text-decoration: none; font-weight: 650; }
.skip:focus { top: 12px; }

/* the bar */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 14px var(--gutter);
  background: color-mix(in oklab, var(--ground) 86%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--panel-line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-stretch: 118%; letter-spacing: -0.01em; font-size: 1.08rem; }
.brand img { border-radius: 8px; }
.bar-nav { display: flex; gap: 22px; margin-left: auto; font-size: 0.94rem; }
.bar-nav a { text-decoration: none; color: var(--ink-2); }
.bar-nav a:hover { color: var(--ink); }
.bar-cta {
  text-decoration: none; font-weight: 700; font-size: 0.92rem;
  padding: 8px 16px; border-radius: 999px; background: var(--cta); color: var(--cta-ink);
}
@media (max-width: 960px) { .bar-nav { display: none; } .bar-cta { margin-left: auto; } }

/* the hero: the copy, the open case, and the shelf it came from */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  grid-template-areas: "copy case" "shelf shelf";
  align-items: center;
  column-gap: clamp(24px, 4vw, 72px);
  padding: clamp(24px, 4vh, 72px) var(--gutter) 0;
  max-width: 1500px; margin: 0 auto;
  min-height: calc(100svh - 64px);
  grid-template-rows: 1fr auto;
}
.hero::before {   /* the wall behind the shelf, lit from the ledge */
  content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1;
  background:
    radial-gradient(120% 60% at 50% 100%, color-mix(in oklab, var(--aurora-b) 10%, transparent), transparent 62%),
    linear-gradient(180deg, var(--ground) 0%, var(--ground-2) 100%);
}
.hero > * { min-width: 0; }
.hero-copy { grid-area: copy; padding-bottom: clamp(16px, 2.6vh, 28px); }
.hero h1 { font-size: clamp(2.6rem, min(5.2vw, 7.4vh), 5rem); margin-bottom: 0.4em; }
.lede { font-size: clamp(1.06rem, 1.3vw, 1.24rem); color: var(--ink-2); max-width: 34em; margin-bottom: 1.5em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1.2em; }
.cta, .ghost {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px; text-decoration: none;
  font-weight: 720; font-stretch: 108%; font-size: 1.02rem;
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease), background-color 240ms var(--ease);
}
.cta { background: var(--cta); color: var(--cta-ink); box-shadow: 0 10px 24px -12px color-mix(in oklab, var(--aurora-b) 60%, transparent); }
.cta:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px color-mix(in oklab, var(--aurora-b) 70%, transparent); }
.ghost { color: var(--ink); border: 1px solid var(--panel-line); background: color-mix(in oklab, var(--panel) 60%, transparent); }
.ghost:hover { background: var(--panel); }
.fine { color: var(--ink-3); font-size: 0.9rem; margin: 0; }

/* the open case: a game pulled from the shelf, its capture as its cover */
.case { margin: 0; }
.hero .case { grid-area: case; perspective: 1600px; padding-bottom: 18px; }
.case-art {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16 / 9; background: var(--shelf-face);
  box-shadow: var(--shadow), 0 0 0 1px var(--panel-line);
  transition: transform 700ms var(--ease);
}
.hero .case-art { transform: rotateY(-11deg) rotateX(3deg) translateZ(0); transform-origin: 100% 50%; }
.case-art::after {   /* the case's edge and the light along it */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.16), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.28));
}
.case-shot { width: 100%; height: 100%; object-fit: cover; transition: opacity 360ms var(--ease), filter 360ms var(--ease); }
.case.is-swapping .case-shot { opacity: 0; filter: blur(8px); }
.case figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 16px; }
.case-name { font-weight: 760; font-stretch: 112%; font-size: 1.1rem; }
.case-note { color: var(--ink-3); font-size: 0.94rem; }
.case-link { font-size: 0.94rem; color: var(--ink-2); }

/* the shelf */
.shelf { position: relative; }
.shelf-hero { grid-area: shelf; }
.shelf-hero { margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); overflow: hidden; --spine-h: clamp(160px, 21vh, 270px); --spine-w: clamp(40px, 5.2vh, 50px); }
.spines { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 4px; }
.shelf-hero .spines { padding-top: calc(var(--pull) + 8px); justify-content: center; flex-wrap: nowrap; }
.spine { flex: none; }
.spine:nth-child(3n) { --h: 0.92; }
.spine:nth-child(4n + 1) { --h: 1.06; }
.spine:nth-child(7n + 2) { --h: 0.97; }
.spine button {
  position: relative; display: block; padding: 0; border: 0; cursor: pointer;
  width: var(--spine-w); height: calc(var(--spine-h) * var(--h, 1));
  border-radius: 4px 4px 2px 2px; overflow: hidden; background: var(--c, #333);
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.14), inset -3px 0 0 rgba(0, 0, 0, 0.32), 0 1px 0 rgba(0, 0, 0, 0.4);
  transform: translateY(0); transition: transform 520ms var(--ease), box-shadow 520ms var(--ease);
  color: #fff;
}
.spine img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.08); }
.spine button::before {   /* the spine's roundness: light along one edge, shade along the other */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.02) 18%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.42) 100%);
}
.spine span {   /* the title band, in the game's own colour */
  position: absolute; z-index: 2; left: 6px; right: 6px; top: 34px; bottom: 30px;
  display: flex; align-items: center; justify-content: flex-start;
  writing-mode: vertical-rl;
  padding: 10px 0;
  background: color-mix(in oklab, var(--c, #333) 62%, #0b0a1c);
  border-radius: 3px;
  font-size: 11.5px; font-weight: 760; font-stretch: 75%; letter-spacing: 0.02em; line-height: 1;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #f7f6ff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.spine button:hover, .spine button:focus-visible, .spine.is-out button {
  transform: translateY(calc(-1 * var(--pull)));
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.2), inset -3px 0 0 rgba(0, 0, 0, 0.3), 0 18px 26px -10px rgba(0, 0, 0, 0.6);
}
.spine button:focus-visible { outline-offset: 2px; }

.ledge {   /* the plank, and the strip of light along its lip: the page's one glow */
  position: relative; height: 18px; margin: 0 calc(-1 * var(--gutter));
  background: linear-gradient(180deg, var(--shelf) 0%, var(--shelf-face) 100%);
  box-shadow: 0 22px 40px -18px rgba(0, 0, 0, 0.7);
}
.ledge::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--aurora-a) 18%, var(--aurora-b) 82%, transparent);
  box-shadow: 0 0 18px 2px color-mix(in oklab, var(--aurora-a) 45%, transparent);
}

/* how it works */
.how, .app, .devices, .games, .start, .credits { width: var(--page); margin: 0 auto; padding: clamp(88px, 12vw, 160px) 0 0; }
.how { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.how-copy > p { color: var(--ink-2); font-size: 1.14rem; max-width: 34em; margin-bottom: 1.8em; }
.steps { margin: 0; display: grid; gap: 22px; }
.steps dt { font-weight: 760; font-stretch: 112%; font-size: 1.12rem; }
.steps dd { margin: 4px 0 0; color: var(--ink-2); max-width: 36em; }
.listing { margin: 0; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow), 0 0 0 1px var(--panel-line); overflow: hidden; }
.listing figcaption { padding: 14px 20px; font-size: 0.86rem; color: var(--ink-3); border-bottom: 1px solid var(--panel-line); }
.listing pre { margin: 0; padding: 20px 20px 24px; overflow-x: auto; font-size: clamp(0.8rem, 1.05vw, 0.95rem); line-height: 1.9; color: var(--ink-2); }
.listing .k { color: var(--aurora-b); }
.listing i, .tree i, .terminal i { font-style: normal; color: var(--ink-3); }
.listing del, .listing ins { display: block; text-decoration: none; margin: 0 -20px; padding: 0 20px; }
.listing del { --del: #ff8f8f; background: color-mix(in oklab, #ff6b6b 13%, transparent); color: color-mix(in oklab, var(--del) 80%, var(--ink)); }
@media (prefers-color-scheme: light) { .listing del { --del: #a8323c; } }
.listing del::before { content: "− "; }
.listing ins { background: color-mix(in oklab, var(--aurora-a) 13%, transparent); color: var(--ink); }
.listing ins::before { content: "+ "; color: var(--aurora-a); }

/* the app */
.shot { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px var(--panel-line); background: var(--panel); }
.shot img { width: 100%; }
.shot-wide { margin-bottom: clamp(56px, 8vw, 112px); }
.feature { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: clamp(28px, 4vw, 64px); align-items: center; margin-bottom: clamp(56px, 8vw, 104px); }
.feature-flip { grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr); }
.feature-flip .shot { order: 2; }
.feature-copy p { color: var(--ink-2); }
.shot-card { background: transparent; }

/* devices */
.devices { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.devices-copy p { color: var(--ink-2); font-size: 1.12rem; max-width: 32em; }
.cloud { background: var(--panel); border-radius: var(--radius); padding: clamp(24px, 3vw, 36px); box-shadow: 0 0 0 1px var(--panel-line); }
.cloud p { color: var(--ink-2); }
.tree { margin: 18px 0 0; padding: 0; overflow-x: auto; font-size: clamp(0.76rem, 1vw, 0.9rem); line-height: 1.85; color: var(--ink); }

/* every game */
.games-head { display: grid; grid-template-columns: minmax(0, 1fr); }
.filter { display: flex; gap: 8px; margin-bottom: 28px; }
.filter button {
  font: inherit; font-size: 0.94rem; font-weight: 650; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--panel-line);
  background: transparent; color: var(--ink-2);
  transition: background-color 240ms var(--ease), color 240ms var(--ease);
}
.filter button[aria-pressed="true"] { background: var(--cta); color: var(--cta-ink); border-color: transparent; }
.wall { display: grid; grid-template-columns: minmax(300px, 0.62fr) minmax(0, 1fr); gap: clamp(28px, 3.5vw, 56px); align-items: start; }
.case-wall { position: sticky; top: 96px; }
.shelf-wall .spines { flex-wrap: wrap; gap: 0; row-gap: calc(var(--pull) + 6px); padding-top: var(--pull); --spine-w: 40px; --spine-h: 224px; }
.shelf-wall .spine {   /* each spine stands on its piece of the plank; side by side they make one plank per row */
  padding: 0 2px; border-bottom: 10px solid var(--shelf);
  box-shadow: 0 12px 18px -14px rgba(0, 0, 0, 0.7);
}
.shelf-wall .spine span { font-size: 10px; top: 26px; bottom: 22px; left: 5px; right: 5px; }
.shelf-wall[data-filter="switch2"] .spine:not([data-switch2]),
.shelf-wall[data-filter="switch"] .spine[data-switch2] { display: none; }
.games-fine { color: var(--ink-3); font-size: 0.92rem; margin-top: 28px; max-width: var(--measure); }

/* get started */
.start-steps { list-style: none; counter-reset: step; margin: 0 0 48px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 36px); }
.start-steps li { counter-increment: step; border-top: 2px solid var(--panel-line); padding-top: 20px; }
.start-steps li::before { content: counter(step); display: block; font-weight: 850; font-stretch: 125%; font-size: 2.4rem; line-height: 1; margin-bottom: 14px; color: var(--aurora-a); }
.start-steps p { color: var(--ink-2); }
.terminal { background: var(--panel); border-radius: var(--radius); padding: 22px 24px; box-shadow: 0 0 0 1px var(--panel-line); }
.terminal p { color: var(--ink-3); font-size: 0.94rem; margin-bottom: 10px; }
.terminal pre { margin: 0; overflow-x: auto; font-size: clamp(0.78rem, 1vw, 0.92rem); line-height: 1.9; }

/* credits: liner notes */
.credits { padding-bottom: clamp(88px, 12vw, 150px); }
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px clamp(32px, 5vw, 72px); }
.notes p { color: var(--ink-2); max-width: 36em; }
.notes h3 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.06em; font-stretch: 118%; color: var(--ink); }

.foot { border-top: 1px solid var(--panel-line); padding: 40px var(--gutter) 56px; display: grid; gap: 14px; color: var(--ink-3); font-size: 0.9rem; max-width: 1500px; margin: 0 auto; }
.foot p { max-width: 80ch; margin: 0; }
.foot-brand { display: flex; align-items: center; gap: 14px; color: var(--ink); margin-bottom: 6px; }
.foot-brand img { border-radius: 10px; }
.foot-brand strong { display: block; font-stretch: 118%; font-size: 1.06rem; }
.foot-brand span { color: var(--ink-3); }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 6px; }

/* narrower screens */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "case" "shelf"; grid-template-rows: auto; min-height: 0; }
  .hero .case { max-width: 720px; }
  .hero .case-art { transform: none; }
  .how, .devices { grid-template-columns: minmax(0, 1fr); }
  .feature, .feature-flip { grid-template-columns: minmax(0, 1fr); }
  .feature-flip .shot { order: 0; }
  .start-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall { grid-template-columns: minmax(0, 1fr); }
  .case-wall {   /* pinned under the bar while the wall scrolls past: a pulled spine always shows its game */
    position: sticky; top: 68px; z-index: 5; max-width: none;
    display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 16px; align-items: center;
    margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter);
    background: color-mix(in oklab, var(--ground) 94%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--panel-line);
  }
  .case-wall .case-art { box-shadow: 0 0 0 1px var(--panel-line); }
  .case-wall figcaption { margin-top: 0; flex-direction: column; align-items: flex-start; flex-wrap: nowrap; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --spine-w: 40px; --spine-h: 226px; --pull: 22px; }
  .shelf-hero { overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .shelf-hero .spines { justify-content: flex-start; }
  .shelf-hero .spine { scroll-snap-align: start; }
  .start-steps, .notes { grid-template-columns: minmax(0, 1fr); }
  .shelf-wall .spines { --spine-w: 34px; --spine-h: 190px; gap: 30px 3px; }
  .case-wall .case-name { font-size: 0.98rem; }
  .case-wall .case-note, .case-wall .case-link { font-size: 0.84rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; }
}
