@font-face {
  font-family: "VT323";
  src: url("fonts/VT323-Regular.woff2") format("woff2"), url("fonts/VT323-Regular.ttf") format("truetype");
  font-display: swap;
  font-display: swap;
}
@font-face {
  font-family: "Roundsquare";
  src: url("fonts/WavegooRoundsquare.woff2") format("woff2"), url("fonts/WavegooRoundsquare.ttf") format("truetype");
  font-display: swap;
  font-display: swap;
}

/* wavegoo palette */
:root {
  color-scheme: dark;
  --bg: #090a0d;
  --panel: #12141a;
  --line: #23262f;
  --dot: #4a505c;
  --text: #dfe4ec;
  --muted: #9aa1ad;
  --goo-a: #7f77dd;
  --goo-b: #1d9e75;
  --mag: #ff4fd8;
  --cyan: #35e6ff;
  --yel: #ffe04a;
  --radius: 14px;
  --display: "Roundsquare", system-ui, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(var(--line) 1px, transparent 1.2px);
  background-size: 14px 14px;
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--yel); }
img, video { display: block; max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: .88em; background: #1b1e26; padding: .1em .35em; border-radius: 5px; }
b { color: #fff; font-weight: 650; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: min(96vh, 900px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(24px, 5vh, 56px) 0 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
#dots { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; padding: 0 0 clamp(40px, 7vh, 80px); pointer-events: none; display: flex; flex-direction: column; align-items: center; }
.hero-inner a, .hero-inner .btn { pointer-events: auto; }
.hero-inner { z-index: 1; }
.hero-splash { position: relative; z-index: 1; display: block; width: min(calc(100% - 32px), 620px, 62vh); aspect-ratio: 1080 / 1032; object-fit: cover; margin: 0 auto clamp(4px, 1.5vh, 16px); }
/* the rat footage is near-black around the artwork: lighten drops that out so the page shows
   through, and a thin feather on the frame edges hides the seam without touching the artwork */
.hero-splash, .video video.blend {
  mix-blend-mode: lighten;
  --fade: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: var(--fade); -webkit-mask-composite: source-in;
  mask-image: var(--fade); mask-composite: intersect;
}
/* the player keeps its bottom edge solid so the controls stay visible */
.video video.blend { border: 0; border-radius: 0; background: none; box-shadow: none;
  --fade: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(transparent, #000 4%); }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 13px/1 var(--mono); letter-spacing: .02em;
  color: var(--text);
  background: rgba(18, 20, 26, .8); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 14px; margin: 0 0 22px;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 #3ddc8488; animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px #3ddc8400; } 100% { box-shadow: 0 0 0 0 #3ddc8400; } }
h1 {
  font: 400 clamp(84px, 19vw, 220px)/.85 var(--display);
  margin: 0 0 18px;
  letter-spacing: -.01em;
  background: linear-gradient(100deg, var(--goo-a), var(--mag) 45%, var(--cyan) 75%, var(--goo-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: clamp(18px, 2.3vw, 23px); max-width: 36ch; margin: 0 auto 28px; color: var(--muted); }
.lede b { color: var(--text); }
.links, .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }

.btn {
  display: inline-block; text-decoration: none;
  font: 650 15px/1 system-ui, sans-serif;
  padding: 13px 18px; border-radius: 10px;
  color: #0b0c10; background: linear-gradient(100deg, var(--cyan), var(--goo-a));
  border: 1px solid transparent;
  transition: transform .15s, filter .15s;
}
.btn:hover { color: #0b0c10; transform: translateY(-1px); filter: brightness(1.1); }
button.btn { cursor: pointer; }
.btn.ghost { background: rgba(18, 20, 26, .8); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--dot); color: #fff; }

/* ---------- sections ---------- */
main > section { padding-top: clamp(64px, 10vw, 120px); }
.section-title, .feature h2 {
  font: 400 clamp(36px, 6vw, 60px)/1 var(--display);
  margin: 0 0 28px;
}
.tag {
  font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 0 0 12px;
}
.tag.released { color: var(--yel); }
.footnote { color: var(--muted); font: italic 14px/1.4 var(--mono); margin: -4px 0 12px; }
.sub { color: var(--muted); font-size: 19px; max-width: 52ch; margin: -12px 0 32px; }
h3 { font-size: 19px; line-height: 1.3; margin: 0 0 10px; }

/* feature blocks */
.feature-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: start; }
.feature .copy h3 { margin-top: 4px; }
.feature .copy h3 + ul { margin-bottom: 24px; }
ul { padding-left: 1.1em; margin: 0 0 18px; }
li { margin: 0 0 8px; }
li::marker { color: var(--mag); }

.gallery { display: grid; gap: 12px; }
.gallery img, .video video, .clip video, .cover, .thumbs img {
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
}
.clip { margin: 0; }
.clip video { width: 100%; display: block; }
.gallery.small { grid-template-columns: 1fr 1fr; margin: 6px 0 20px; }
.video { margin: 0; position: sticky; top: 24px; }
.video video { width: 100%; box-shadow: 0 30px 80px -30px #7f77dd55; }
.shot { margin: 0; position: sticky; top: 24px; }
.shot img { width: 100%; height: auto; display: block; border: 1px solid var(--line, #2a2d38); border-radius: var(--radius); box-shadow: 0 30px 80px -30px #ff8a3d55; }

/* game cards */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
  padding: 14px 14px 20px; display: flex; flex-direction: column;
}
.card > :not(.cover) { margin-inline: 8px; }
.card .cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 18px; }
.card h3 { font: 400 36px/1 "VT323", var(--mono); color: var(--yel); }
.card p { color: var(--muted); }
.card ul { color: var(--text); font-size: 15px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; }
.thumbs img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 9px; }
.card video.cover { aspect-ratio: 1280 / 592; display: block; }
.thumbs.wide img { aspect-ratio: 1200 / 554; }
.video.extra { position: static; margin: 4px 8px 14px; }
.video.extra video { box-shadow: none; display: block; }
.thumbs.wide-set { row-gap: 8px; }
.thumbs a { display: block; }
.thumbs a img { width: 100%; display: block; }

/* splash and extras */
.muted, figcaption { color: var(--muted); font-size: 14px; }
figcaption { margin-top: 10px; }
.breakdown { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 18px; }
.breakdown summary { cursor: pointer; font-weight: 650; color: var(--cyan); }
.more-me summary { font: 400 26px/1.2 "VT323", var(--mono); color: var(--yel); }
.more-body { max-width: 62ch; margin-top: 16px; }
.more-body p { margin: 0 0 14px; }
.gallery a, .splash-still { display: block; }
.splash-still { max-width: 320px; margin-top: 24px; }
.splash-still img { border: 1px solid var(--line); border-radius: var(--radius); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }

/* assorted assets */

/* lab */
.lab { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lab article {
  border: 1px dashed var(--dot); border-radius: var(--radius); padding: 20px 22px;
  background: rgba(18, 20, 26, .6);
}
.lab h3 { font: 400 30px/1 "VT323", var(--mono); color: var(--yel); }
.lab p { color: var(--muted); font-size: 15px; margin: 0; }

/* about + hire */
#about { padding-top: 80px; }
.about { font-size: 21px; line-height: 1.5; max-width: 60ch; margin: 0 0 40px; }
.hire-title { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 16px; }
.lab.hire { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* skills */
.skills { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.skills li {
  margin: 0; font: 500 14px/1 var(--mono); padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
}
.skills li:nth-child(4n+1) { border-color: #7f77dd66; }
.skills li:nth-child(4n+2) { border-color: #ff4fd855; }
.skills li:nth-child(4n+3) { border-color: #35e6ff55; }
.skills li:nth-child(4n)   { border-color: #ffe04a55; }

footer { padding: 100px 0 48px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 100px; }
footer p:first-child { font-size: 20px; color: var(--text); }
.fine { font: 13px var(--mono); }

/* hero is centred under the rat */
.hero .links { justify-content: center; }

/* the browser skips laying out and painting sections until they're near the screen */
main > section ~ section { content-visibility: auto; contain-intrinsic-size: auto 1000px; }

/* phones: no animated dots behind the hero (dots.js bails out too) */
@media (hover: none), (max-width: 700px) {
  #dots { display: none; }
  .hero { background: radial-gradient(circle, #ffffff1f 1.2px, transparent 1.6px) 0 0 / 18px 18px, var(--bg); }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .feature-body { grid-template-columns: 1fr; }
  .video, .shot { position: static; }
  .cards, .lab { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hero { padding-top: 16px; min-height: 0; }
  .gallery.small { grid-template-columns: 1fr; }
  .btn { padding: 12px 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  html { scroll-behavior: auto; }
}

/* the interactive desktop: edge to edge, but never taller than the window */
.desk-bleed { width: 100%; margin-top: 24px; }
.desk-bleed .md-frame { width: min(100%, calc(86vh * 16 / 9)); margin-inline: auto; border-inline: 0; }
.desk-foot { margin-top: 4px; }
.desk-foot .md-hint { margin: 0 0 16px; }

.md-hint-touch{display:none}
@media (hover: none){.md-hint-touch{display:block}.md-hint-mouse{display:none}}

/* assorted assets: a reel that drifts upward on its own (assets-reel.js) */
.card-assets { display: flex; flex-direction: column; }
.card-assets .reel { flex: none; width: 100%; aspect-ratio: 16 / 10; min-height: 0; margin-bottom: 18px; }
.card-assets .reel .reel-track { height: 100%; }
.reel {
  position: relative; margin-top: 6px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: radial-gradient(120% 60% at 50% 0%, #7f77dd14, transparent 70%), #0d0f14;
  overflow: hidden;
}
.reel-track {
  position: absolute; inset: 0; overflow-y: auto; padding: 10px 10px 0;
  scrollbar-width: none; overscroll-behavior: contain; cursor: grab;
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; align-content: start;
  /* pieces fade in at the bottom and out at the top instead of being sliced off */
  -webkit-mask-image: linear-gradient(transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(transparent, #000 56px, #000 calc(100% - 56px), transparent);
}
.reel-track::-webkit-scrollbar { display: none; }
.reel-track:focus-visible { outline: 2px solid var(--cyan); outline-offset: -4px; border-radius: var(--radius); }
.reel.dragging .reel-track { cursor: grabbing; user-select: none; }
.reel-tile {
  --accent: var(--goo-a);
  position: relative; margin: 0 0 10px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
  transition: border-color .25s, box-shadow .25s;
}
.reel-tile:nth-child(4n+2) { --accent: var(--mag); }
.reel-tile:nth-child(4n+3) { --accent: var(--cyan); }
.reel-tile:nth-child(4n)   { --accent: var(--yel); }
/* a mosaic: one wide piece, then two side by side (keep the set a multiple of 3 so copies line up) */
.reel-tile:nth-child(3n+1) { grid-column: span 2; }
.reel-tile a { display: block; }
.reel-tile img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2,.7,.2,1), filter .5s; filter: saturate(.92); }
.reel-tile figcaption {
  position: absolute; left: 10px; bottom: 10px; margin: 0;
  font: 600 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #fff;
  background: rgba(9, 10, 13, .78); backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 999px;
  padding: 7px 11px; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.reel-tile:nth-child(3n+1) img { aspect-ratio: 16 / 9; }
.reel-tile:hover, .reel-tile:focus-within {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 18px 40px -22px var(--accent);
}
.reel-tile:hover img, .reel-tile:focus-within img { transform: scale(1.035); filter: saturate(1.08); }
.reel-tile:hover figcaption, .reel-tile:focus-within figcaption { opacity: 1; transform: none; }
@media (hover: none) { .reel-tile figcaption { opacity: 1; transform: none; } }
.reel-toggle {
  position: absolute; right: 12px; bottom: 12px; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 12px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--text);
  background: rgba(18, 20, 26, .82); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px;
  transition: border-color .15s, color .15s;
}
.reel-toggle:hover { border-color: var(--dot); color: #fff; }
.reel-toggle:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
/* pause bars, or a play triangle once paused */
.reel-toggle i { width: 8px; height: 9px; border-inline: 3px solid var(--cyan); }
.reel.paused .reel-toggle i { width: 0; height: 0; border: 0; border-left: 8px solid var(--yel); border-block: 5px solid transparent; }
@media (max-width: 900px) { .card-assets .reel { flex: none; height: min(78vh, 640px); min-height: 0; } }
/* reel polish: media first like the other cards' covers. No top padding on the track, so one set of
   tiles is exactly one loop period and assets-reel.js wraps without a 10px jump. */
/* (removed order:-1 so text stays on top) */
.reel-track { padding-top: 0; grid-auto-rows: max-content; } /* rows keep their tile height; otherwise the fixed-height grid squashes them to slivers */
/* assets reel: uniform square tiles with gaps, inset from the panel */
.card-assets .reel-track { padding: 14px; box-sizing: border-box; display: grid; grid-template-columns: 1fr; gap: 14px; align-content: start; }
.card-assets .reel-tile, .card-assets .reel-tile:nth-child(3n+1) { grid-column: auto; margin: 0; border-radius: 10px; overflow: hidden; }
.card-assets .reel-tile img, .card-assets .reel-tile:nth-child(3n+1) img { aspect-ratio: 1 / 1; object-fit: cover; }
.card-assets .reel-tile, .card-assets .reel-tile:nth-child(3n+1) { width: 56%; justify-self: center; }
.card-assets .reel-tile, .card-assets .reel-tile:nth-child(3n+1) { width: 100%; justify-self: stretch; }

/* final: text on top, reel fills rest of card */
.card-assets { display: flex; flex-direction: column; }
.card-assets .reel { flex: 1 1 auto; aspect-ratio: auto; min-height: 420px; margin: 14px 0 0; }
.card-assets .reel .reel-track { position: absolute; inset: 0; height: auto; padding: 14px; grid-template-columns: 1fr; gap: 14px; }
.card-assets .reel-tile, .card-assets .reel-tile:nth-child(3n+1) { width: 100%; justify-self: stretch; }
.card-assets .reel-tile img, .card-assets .reel-tile:nth-child(3n+1) img { aspect-ratio: 1 / 1; object-fit: cover; }
.card-assets .reel { order: 0; }

/* secret stash: brain */
.stash .brain { position: relative; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #0b0c10; }
.stash canvas { display: block; width: 100%; aspect-ratio: 1024 / 732; max-height: 70vh; }
.brain-info { position: absolute; left: 14px; bottom: 8px; margin: 0; font: 400 20px/1 "VT323", var(--mono); color: var(--cyan); }
.pn-frame { position: relative; width: min(100%, calc(86vh * 16 / 9)); aspect-ratio: 16 / 9; margin-inline: auto; overflow: hidden; background: #05080c; border-block: 1px solid #ffffff1a; }
.pn-frame iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; border: 0; transform-origin: 0 0; }
.pn-start { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border: 0; cursor: pointer; color: #dfe4ec; font: 400 clamp(20px, 4vw, 34px)/1 var(--display); letter-spacing: 2px;
  background: radial-gradient(ellipse at 50% 55%, rgba(159,225,203,.14), transparent 65%), #05080c; }
.pn-start small { font: 14px/1.2 var(--mono); letter-spacing: 0; color: var(--muted); }
.pn-play { width: 0; height: 0; border-style: solid; border-width: 22px 0 22px 36px; border-color: transparent transparent transparent #9fe1cb; transition: transform .2s; }
.pn-start:hover .pn-play, .pn-start:focus-visible .pn-play { transform: scale(1.15); }
.brain-cap { max-width: 62ch; margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.stash .brain-layers { position: relative; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #0b0c10; }
.brain-title { margin: 28px 0 0; font-size: 18px; }
@media (max-width: 600px) { .brain-info { font-size: 15px; left: 10px; right: 10px; } }

/* Pinoch: NPC brain (npc-brain.js, ported from brain.js) */
.npc-brain { position: relative; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(ellipse at 50% 45%, rgba(182,163,255,.08), transparent 70%), #0b0c10; overflow: hidden; }
.npc-brain canvas { display: block; width: 100%; aspect-ratio: 1024 / 732; max-height: 70vh; }
@media (max-width: 600px) { .npc-brain canvas { aspect-ratio: 1024 / 820; } }
