/* ==========================================================================
   Kai Geng — portfolio
   Colors come from 4 tokens. Project pages override them from projects.js,
   so every page re-themes itself; everything else is derived.
   ========================================================================== */

:root {
  --bg: #0c0b0a;
  --fg: #f3eee6;
  --accent: #ff5a36;
  --accent2: #ffc93c;
  --muted: color-mix(in srgb, var(--fg) 58%, var(--bg));
  --line: color-mix(in srgb, var(--fg) 14%, transparent);
  --surface: color-mix(in srgb, var(--fg) 5%, var(--bg));

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.75, 0, .2, 1);
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.wrap { width: min(1240px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.eyebrow { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.caption { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* ---------- nav ---------- */

.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px var(--gutter);
  color: #fff; mix-blend-mode: difference;
}
.nav-logo { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.nav-links { display: flex; gap: clamp(16px, 3vw, 36px); font-size: 13px; text-transform: uppercase; letter-spacing: .14em; }
.nav-links a { position: relative; padding: 4px 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-io);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 480px) { .nav-links { gap: 12px; font-size: 11px; letter-spacing: .04em; } }

/* ---------- cursor ---------- */

.has-cursor, .has-cursor a, .has-cursor button, .has-cursor [data-zoom] { cursor: none; }
.cursor {
  position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none;
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #fff; mix-blend-mode: difference;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease);
}
.cursor.is-hover { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.cursor.is-zoom { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
.cursor.is-zoom::after {
  content: "+"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #000; font: 300 34px/1 var(--font-body);
}

/* ---------- page transition ---------- */

.curtain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: var(--accent); transform: scaleY(0); transform-origin: top;
  transition: transform .7s var(--ease-io);
}
.js .curtain { transform: scaleY(1); }
.js body.ready .curtain { transform: scaleY(0); }
.js body.leaving .curtain { transform: scaleY(1); transform-origin: bottom; }

/* ---------- reveal ---------- */

.js [data-reveal] {
  opacity: 0; transform: translateY(40px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].in { opacity: 1; transform: none; }

.word { display: inline-block; white-space: nowrap; }
.char { display: inline-block; }
.ci { display: inline-block; }
.js [data-split] .char {
  opacity: 0; transform: translateY(.45em) rotate(10deg);
  transition: opacity .8s var(--ease), transform 1s var(--ease);
  transition-delay: calc(.25s + var(--i) * .04s);
}
.js .ready [data-split] .char { opacity: 1; transform: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  background: var(--accent); color: var(--bg);
  font-weight: 600; font-size: 15px; border: 1px solid var(--accent);
  transition: translate .4s var(--ease), background .3s, color .3s;
}
.btn:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn--ghost:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* ---------- home hero ---------- */

.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; align-content: end; padding: 120px 0 clamp(32px, 6vw, 64px);
}
.hero-canvas, .p-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; }
.hero-name {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(64px, 17.5vw, 250px); line-height: .86; letter-spacing: -.05em;
  text-transform: uppercase; margin: 0;
}
.hero-name .char .ci { transition: color .3s; }
.hero-name .char:hover .ci { color: var(--accent); }
.hero-name .char.boing .ci { animation: boing .8s var(--ease); }
@keyframes boing {
  30% { transform: scale(1.25, .75); }
  45% { transform: scale(.8, 1.2); }
  60% { transform: scale(1.1, .9); }
  75% { transform: scale(.96, 1.04); }
}
.hero-sub {
  display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap;
  margin-top: clamp(24px, 4vw, 44px); font-size: clamp(17px, 1.7vw, 22px); line-height: 1.45;
}
.hero-sub p { max-width: 36ch; margin: 0; }
.hero-sub .serif { color: var(--accent); font-size: 1.15em; }
.scroll-cue { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.scroll-cue span { display: inline-block; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ---------- marquee ---------- */

.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 20px 0; white-space: nowrap; user-select: none; }
.marquee-track {
  display: inline-flex; gap: 48px; padding-right: 48px;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4.5vw, 56px);
  letter-spacing: -.02em; text-transform: uppercase;
  animation: marquee 32s linear infinite;
}
.marquee-track span:nth-child(even) { color: var(--accent); font-family: var(--font-serif); font-style: italic; text-transform: none; font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */

.section { padding: clamp(80px, 12vw, 160px) 0; position: relative; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(32px, 5vw, 64px); }
.section-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(42px, 8vw, 110px); line-height: .92; letter-spacing: -.045em; margin: 0;
}
.section-title .serif { font-size: 1.12em; color: var(--accent); }
.section-lede { max-width: 42ch; color: var(--muted); margin: 0; }

/* ---------- game fonts (shared by home + game pages) ---------- */

.gf-wobble { font-family: "Lilita One", var(--font-display) !important; font-weight: 400 !important; }
.gf-glitch { font-family: "Black Ops One", var(--font-display) !important; font-weight: 400 !important; text-transform: uppercase; }
.gf-script { font-family: "Caveat Brush", var(--font-serif) !important; font-weight: 400 !important; }
.gf-shields { font-family: "Luckiest Guy", var(--font-display) !important; font-weight: 400 !important; }
.gf-dust { font-family: "Rye", var(--font-display) !important; font-weight: 400 !important; }
.gf-bubbles { font-family: "Fredoka", var(--font-display) !important; font-weight: 700 !important; }

/* ---------- home hero extras ---------- */

.hero-status {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 7px 14px 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted);
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px);
}
.hero-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 #3ddc8488; animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px #3ddc8400; } 100% { box-shadow: 0 0 0 0 #3ddc8400; } }
/* fixed-size letter boxes: swapping in a game font never changes the line layout */
.hero-name .char { transition: color .3s; text-align: center; white-space: nowrap; vertical-align: top; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.rotator { display: inline-block; color: var(--accent); font-family: var(--font-serif); font-style: italic; font-size: 1.18em; transition: transform .35s var(--ease), opacity .35s; }
.rotator.out { transform: translateY(-55%); opacity: 0; }
.rotator.in { transform: translateY(55%); opacity: 0; transition: none; }

.hero-floats { position: absolute; inset: 0; pointer-events: none; --mx: 0; --my: 0; }
.float {
  position: absolute; pointer-events: auto; display: block; border-radius: 10px;
  translate: calc(var(--mx) * var(--d) * -70px) calc(var(--my) * var(--d) * -50px); rotate: var(--r);
  transition: rotate .5s var(--ease), scale .5s var(--ease);
}
.float-inner { display: block; border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); animation: bob 6s ease-in-out infinite; animation-delay: var(--delay); }
.float img { width: 100%; height: auto; }
.float-label {
  position: absolute; left: 10px; bottom: 8px; font-size: 12px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8); opacity: 0; transform: translateY(6px); transition: .3s var(--ease);
}
.float:hover { rotate: 0deg; scale: 1.08; z-index: 2; }
.float:hover .float-label { opacity: 1; transform: none; }
.js .float { opacity: 0; scale: .7; transition: opacity .8s var(--ease), scale .8s var(--ease), rotate .5s var(--ease); transition-delay: calc(.6s + var(--i) * .1s); }
.js .ready .float { opacity: 1; scale: 1; }
.js .ready .float:hover { scale: 1.08; transition-delay: 0s; }
@keyframes bob { 50% { transform: translateY(-12px); } }
@media (max-width: 899px) { .hero-floats { display: none; } }

/* ---------- games showcase (pinned horizontal scroll on desktop) ---------- */

.showcase {
  position: relative; background: var(--s-bg, var(--bg)); color: var(--s-fg, var(--fg));
  transition: background-color .8s ease, color .8s ease;
}
.showcase-sticky { padding: clamp(80px, 12vw, 140px) 0 60px; display: flex; flex-direction: column; gap: clamp(24px, 4vh, 40px); }
.showcase.is-pinned .showcase-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; justify-content: center; padding: 76px 0 32px; }
.showcase-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.showcase-head .eyebrow { color: inherit; opacity: .6; }
.showcase-head .section-title { font-size: clamp(40px, 6vw, 88px); }
.showcase-head .section-title .serif { color: var(--s-accent, var(--accent)); transition: color .8s; }
.showcase-count { font-size: 14px; font-weight: 600; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.showcase-track { display: flex; gap: clamp(20px, 3vw, 48px); padding: 0 var(--gutter); will-change: transform; }
/* symmetric padding puts each card dead-center when it becomes active */
/* card width grows with the screen but never taller than the window allows (media is ~0.33 × card width) */
.showcase { --card-w: min(90vw, 1640px, calc((100svh - 300px) * 3)); }
.showcase.is-pinned .showcase-track { padding-inline: calc((100vw - var(--card-w)) / 2); }
.showcase.is-pinned .g-card { flex-basis: var(--card-w); }
.showcase.is-pinned .showcase-head { width: var(--card-w); max-width: none; margin-inline: auto; }
.showcase:not(.is-pinned) .showcase-track { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 6px; }
.showcase:not(.is-pinned) .showcase-track::-webkit-scrollbar { display: none; }
.showcase-progress { margin: 0 var(--gutter); height: 2px; background: color-mix(in srgb, currentColor 18%, transparent); }
.showcase-progress i { display: block; height: 100%; background: var(--s-accent, var(--accent)); transform-origin: left; transform: scaleX(0); transition: background-color .8s; }

.g-card {
  flex: 0 0 min(86vw, 1100px); scroll-snap-align: center; scroll-margin: var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  background: var(--c-bg); color: var(--c-fg); border-radius: 20px; overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c-fg) 14%, transparent), 0 40px 100px rgba(0, 0, 0, .35);
  transition: scale .7s var(--ease), opacity .7s var(--ease);
}
.showcase.is-pinned .g-card { min-height: min(52svh, 520px); }
.showcase.is-pinned .g-card:not(.is-active) { scale: .94; opacity: .55; }
.g-card-media { position: relative; overflow: hidden; background: #000; }
.g-card-media { display: flex; align-items: center; background: var(--c-bg); }
.g-card-media img { display: block; width: 100%; height: auto; transition: transform 1.4s var(--ease); }
.g-card:hover .g-card-media img { transform: scale(1.06); }
.g-card-body { container-type: inline-size; padding: clamp(22px, 3vw, 52px); display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-width: 0; }
.g-card-num { font-size: 13px; letter-spacing: .2em; opacity: .6; }
.g-card-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 10.5cqi, 84px); line-height: .95; letter-spacing: 0; margin: 10px 0 14px; color: var(--c-accent); }
.g-card-tag { font-family: var(--font-serif); font-style: italic; font-size: clamp(18px, 1.6vw, 24px); line-height: 1.25; margin: 0; }
.g-card-meta { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; opacity: .7; margin: 0 0 14px; }
.g-card-cta { display: inline-flex; gap: 10px; align-items: center; font-weight: 600; color: var(--c-accent); }
.g-card-cta span { transition: transform .4s var(--ease); }
.g-card:hover .g-card-cta span { transform: translateX(8px); }
/* a taste of each game's own title animation */
.g-card:hover .g-card-title.gf-wobble { animation: card-wobble 1.1s ease-in-out infinite; transform-origin: 20% 90%; }
.g-card:hover .g-card-title.gf-glitch { animation: card-glitch .35s steps(2) infinite; }
.g-card:hover .g-card-title.gf-shields { animation: card-squash .6s; }
.g-card:hover .g-card-title.gf-bubbles { animation: card-float 1.8s ease-in-out infinite; }
.g-card .g-card-title.gf-dust { text-shadow: .04em .04em 0 var(--c-accent2), .08em .08em 0 #120502; color: var(--c-fg); }
.g-card .g-card-title.gf-script { background: linear-gradient(currentColor, currentColor) 0 100% / 0 3px no-repeat; transition: background-size .7s var(--ease); }
.g-card:hover .g-card-title.gf-script { background-size: 100% 3px; }
@keyframes card-wobble { 25% { transform: rotate(-2.5deg) scale(1.02, .98); } 75% { transform: rotate(2deg) scale(.99, 1.01); } }
@keyframes card-glitch { 0% { text-shadow: -3px 0 var(--c-accent2), 3px 0 #ff2e4d; } 50% { text-shadow: 3px 0 var(--c-accent2), -3px 0 #ff2e4d; } }
@keyframes card-squash { 30% { transform: scale(1.12, .8) translateY(10%); } 60% { transform: scale(.95, 1.08); } }
@keyframes card-float { 50% { transform: translateY(-10%); } }
@media (max-width: 899px) {
  .g-card { grid-template-columns: 1fr; }
}

/* ---------- stats ---------- */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.stat { padding: clamp(28px, 4vw, 48px) clamp(12px, 2vw, 28px); border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-family: var(--font-display); font-weight: 800; font-size: clamp(44px, 6vw, 88px); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }
.stat:nth-child(2) b { color: var(--accent); }
@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* ---------- art parallax wall ---------- */

.art-parallax { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 32px); align-items: start; }
.ap-col { display: flex; flex-direction: column; gap: clamp(14px, 2.4vw, 32px); will-change: transform; }
.ap-col:nth-child(2) { margin-top: clamp(40px, 8vw, 120px); }
.ap-tile { position: relative; display: block; border-radius: 12px; overflow: hidden; background: var(--surface); }
.ap-tile img { width: 100%; transition: transform 1.2s var(--ease), filter .6s; }
.ap-tile:hover img { transform: scale(1.06); }
.ap-cap {
  position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; align-items: end; gap: 12px;
  padding: 40px 16px 14px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .5s var(--ease);
}
.ap-cap b { font-weight: 600; }
.ap-cap i { font-style: normal; font-size: 12px; opacity: .8; text-align: right; }
.ap-tile:hover .ap-cap, .ap-tile:focus-visible .ap-cap { opacity: 1; transform: none; }
@media (hover: none) { .ap-cap { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  .art-parallax { grid-template-columns: 1fr 1fr; }
  .ap-col { display: contents; }
}

/* ---------- about teaser ---------- */

.about-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: end; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.facts li span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); padding-top: 3px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- covers ---------- */

.cover { position: relative; overflow: hidden; background: var(--surface); }
.cover img { display: block; width: 100%; height: auto; transition: transform 1s var(--ease); }
.cover--ph {
  display: grid; place-items: center; height: 100%;
  background: radial-gradient(circle at 25% 25%, var(--c2), transparent 55%), linear-gradient(135deg, var(--c1), var(--cbg));
  color: var(--cfg); font-family: var(--font-display); font-weight: 800; font-size: 56px;
}

/* ---------- art grid ---------- */

.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(16px, 2.5vw, 32px); }
.art-card { display: block; }
.art-frame { border-radius: 10px; overflow: hidden; transition: transform .5s var(--ease); will-change: transform; }
.art-grid { display: block; columns: 3 280px; column-gap: clamp(16px, 2.5vw, 32px); }
.art-grid .art-card { break-inside: avoid; margin-bottom: clamp(20px, 3vw, 36px); }
.art-card:hover .cover img { transform: scale(1.06); }
.art-cap { display: flex; justify-content: space-between; gap: 12px; padding: 14px 2px 0; font-weight: 500; }
.art-meta { color: var(--muted); font-size: 13px; font-weight: 400; text-align: right; }

/* ---------- statement (home + bio) ---------- */

.statement {
  font-family: var(--font-serif); font-size: clamp(30px, 4.6vw, 62px); line-height: 1.12;
  letter-spacing: -.01em; margin: 0; max-width: 24ch;
}
.statement .w { opacity: .14; transition: opacity .4s; }
.statement .w.lit { opacity: 1; }
.statement em { color: var(--accent); }

/* ---------- project + art pages ---------- */

.p-hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; align-content: end; padding: 140px 0 clamp(36px, 6vw, 64px);
}
.p-hero-inner { position: relative; }
.back { display: inline-block; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: clamp(24px, 6vh, 60px); transition: color .3s, transform .3s; }
.back:hover { color: var(--accent); transform: translateX(-6px); }
.p-title, .a-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(48px, 11vw, 168px); line-height: .9; letter-spacing: -.05em;
  margin: 0; position: relative;
}
.p-tagline { font-family: var(--font-serif); font-style: italic; font-size: clamp(22px, 2.8vw, 36px); line-height: 1.2; max-width: 30ch; margin: 22px 0 0; color: var(--accent); }
.p-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 20px 32px;
  border-top: 1px solid var(--line); padding-top: 22px; margin: clamp(28px, 5vw, 48px) 0 0;
}
.p-meta dt { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.p-meta dd { margin: 4px 0 0; font-size: 15px; line-height: 1.45; }
.p-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.p-actions:empty { display: none; }

.video { border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 40px 100px rgba(0, 0, 0, .35); }
.video video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.p-cover { margin: 0; border-radius: 14px; overflow: hidden; }

.p-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 28px clamp(32px, 6vw, 96px); }
.p-h {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -.03em; margin: 0; line-height: 1.1;
}
.p-text { font-size: clamp(17px, 1.35vw, 19px); margin: 0 0 clamp(36px, 6vw, 72px); max-width: 64ch; }
.p-text p:first-child::first-letter { font-family: var(--font-serif); font-size: 3.2em; float: left; line-height: .85; padding: 6px 10px 0 0; color: var(--accent); }
.roles { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; }
.roles dt { font-weight: 600; color: var(--accent); }
.roles dd { margin: 0; }
.team, .exhibits { list-style: none; padding: 0; }
.team li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.team li span:last-child { color: var(--muted); text-align: right; }
.exhibits li { padding: 10px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 800px) {
  .p-body { grid-template-columns: 1fr; }
  .p-text { margin-bottom: 48px; }
  .roles { grid-template-columns: 1fr; gap: 2px; }
  .roles dd { margin-bottom: 12px; }
}

.slides { display: grid; gap: clamp(28px, 5vw, 64px); }
.slide { position: relative; margin: 0; }
.slide img { width: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); background: var(--surface); }
.slide-num {
  position: sticky; top: 80px; z-index: 2; display: inline-block; margin-bottom: 12px;
  font-size: 12px; letter-spacing: .2em; color: var(--muted);
}

.next-project {
  display: block; position: relative; overflow: hidden; isolation: isolate;
  text-align: center; padding: clamp(90px, 16vw, 200px) var(--gutter);
  border-top: 1px solid var(--line);
}
.next-project::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--next-accent); clip-path: circle(0% at 50% 100%);
  transition: clip-path .9s var(--ease-io);
}
.next-project:hover::before { clip-path: circle(150% at 50% 100%); }
.next-project:hover { color: var(--next-bg); }
.next-project:hover .eyebrow { color: inherit; }
.next-title {
  display: block; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(40px, 9vw, 140px); line-height: .95; letter-spacing: -.05em;
  transition: transform .7s var(--ease);
}
.next-project:hover .next-title { transform: scale(1.04); }

/* art piece page */
.a-hero { padding: 140px 0 clamp(40px, 6vw, 80px); }
.a-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.a-hero-text { position: relative; z-index: 1; min-width: 0; container-type: inline-size; }
/* fit the longest word of the title to its column so the image never covers it */
.a-hero-text .a-title { font-size: min(clamp(44px, 11vw, 168px), calc(100cqi / (var(--chars, 8) * .74))); }
.a-hero-img { border-radius: 12px; overflow: hidden; }
.a-single .a-hero-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.a-single .a-hero-img img { max-height: 76svh; }
.a-hero-img { display: flex; justify-content: center; background: none; }
.a-hero-img img { display: block; width: auto; max-width: 100%; height: auto; max-height: 82svh; border-radius: 12px; }
@keyframes kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }
.a-abstract {
  font-family: var(--font-serif); font-size: clamp(26px, 3.4vw, 46px); line-height: 1.18;
  margin: 0; max-width: 32ch;
}
.a-abstract::before { content: "“"; display: block; font-size: 2.4em; line-height: .6; color: var(--accent); }
@media (max-width: 860px) { .a-hero-grid { grid-template-columns: 1fr; } }

.gallery { columns: 3 300px; column-gap: clamp(14px, 2vw, 24px); }
.gallery--wide { columns: 1; }
.g-item { break-inside: avoid; margin: 0 0 clamp(14px, 2vw, 24px); border-radius: 8px; overflow: hidden; }
.g-item img { width: 100%; transition: transform .8s var(--ease); }
.g-item:hover img { transform: scale(1.03); }

/* ---------- lightbox ---------- */

.lightbox {
  width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: #fff; overflow: hidden;
}
.lightbox::backdrop { background: rgba(5, 5, 7, .92); backdrop-filter: blur(8px); }
.lightbox[open] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; animation: fadein .35s var(--ease); }
@keyframes fadein { from { opacity: 0; } }
.lb-media { display: grid; place-items: center; height: 100svh; padding: 64px 8px; }
.lb-media img { max-height: calc(100svh - 128px); width: auto; object-fit: contain; border-radius: 6px; animation: zoomin .45s var(--ease); }
@keyframes zoomin { from { opacity: 0; transform: scale(.94); } }
.lightbox button { background: none; border: 0; color: #fff; font: 300 28px/1 var(--font-body); padding: 20px; opacity: .7; transition: opacity .2s; }
.lightbox button:hover { opacity: 1; }
.lb-close { position: absolute; top: 8px; right: 8px; font-size: 36px !important; }
.lb-count { position: absolute; top: 24px; left: 24px; font-size: 12px; letter-spacing: .2em; opacity: .7; }
.lightbox.single .lb-prev, .lightbox.single .lb-next, .lightbox.single .lb-count { visibility: hidden; }

/* ---------- bio ---------- */

.bio-hero { padding: 160px 0 clamp(60px, 8vw, 100px); }
.bio-intro { max-width: 62ch; margin-top: clamp(32px, 5vw, 56px); font-size: clamp(17px, 1.3vw, 19px); line-height: 1.7; color: var(--muted); }
.bio-intro p { margin: 0 0 1.1em; }
.bio-intro .bio-lead { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.55; color: var(--fg); }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.skill { background: var(--bg); padding: 26px 24px 28px; transition: background .4s; }
.skill:hover { background: var(--surface); }
.skill h3 { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; font-weight: 600; }
.skill p { margin: 0; font-size: 16px; line-height: 1.5; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px 32px; padding: 24px 0; border-top: 1px solid var(--line); transition: padding .4s var(--ease); }
.timeline li:hover { padding-left: 12px; }
.timeline .when { color: var(--muted); font-size: 14px; letter-spacing: .04em; }
.timeline h3 { font-family: var(--font-display); font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -.03em; margin: 0 0 6px; font-weight: 700; }
.timeline p { margin: 0; color: var(--muted); }
@media (max-width: 700px) { .timeline li { grid-template-columns: 1fr; } }
.hobbies { display: flex; flex-wrap: wrap; gap: 12px; }
.hobbies span { padding: 10px 20px; border: 1px solid var(--line); border-radius: 999px; transition: background .3s, color .3s, transform .3s var(--ease); }
.hobbies span:hover { background: var(--accent); color: var(--bg); transform: rotate(-4deg) scale(1.06); }

/* ---------- footer ---------- */

.footer { padding: clamp(90px, 14vw, 180px) 0 32px; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
/* sized from the footer's own width so the address always stays on one line */
.footer .wrap { container-type: inline-size; }
.footer-mail {
  display: inline-block; font-family: var(--font-display); font-weight: 700;
  font-size: min(88px, 6.2cqi); letter-spacing: -.045em; line-height: 1.1;
  white-space: nowrap; position: relative;
}
.footer-mail::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.12em; height: .06em;
  background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .6s var(--ease-io);
}
.footer-mail:hover::after { transform: scaleX(1); transform-origin: left; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: clamp(60px, 10vw, 120px); font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 24px; }
.footer-links a:hover { color: var(--fg); }

/* ---------- archive ---------- */

.ar-tag {
  display: inline-block; vertical-align: middle; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); font: 600 10px/1.4 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.archive-note { margin: 40px 0 0; color: var(--muted); }
.archive-note a, .section-lede a { color: var(--accent); }
.ar-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.ar-filter button {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: none; color: var(--muted); font: 500 14px var(--font-body);
  transition: background .3s, color .3s, border-color .3s;
}
.ar-filter button:hover { color: var(--fg); border-color: var(--muted); }
.ar-filter button[hidden] { display: none; }
.ar-filter button[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.ar-filter small { font-size: 12px; opacity: .6; font-variant-numeric: tabular-nums; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.ar-year {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -.03em;
  padding: 40px 0 12px; border-bottom: 1px solid var(--line);
}
.ar-year:first-child { padding-top: 0; }
.ar-row a {
  display: grid; grid-template-columns: 76px 110px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center;
  padding: 14px 8px; border-bottom: 1px solid var(--line); transition: background .3s, padding .4s var(--ease);
}
.ar-row a:hover { background: var(--surface); padding-left: 16px; }
.ar-thumb { display: block; width: 76px; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--surface); }
.ar-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .6s var(--ease); }
.ar-row a:hover .ar-thumb img { transform: scale(1.1); }
.ar-date, .ar-what, .ar-made { font-size: 14px; color: var(--muted); }
.ar-title { font-weight: 600; font-size: 17px; }
.ar-row[hidden], .ar-year[hidden] { display: none; }
@media (max-width: 760px) {
  .ar-row a { grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; }
  .ar-thumb { width: 64px; grid-row: span 2; }
  .ar-date, .ar-made { display: none; }
}

/* ==========================================================================
   Per-game identities (body.fx-<effect>)
   Fonts, title animation, cursor, and page-wide treatments for each game.
   ========================================================================== */

.p-hero { -webkit-user-select: none; user-select: none; }
.p-hero .p-meta, .p-hero .p-tagline { -webkit-user-select: text; user-select: text; }

/* ---------- Wobbleknight: a knight who can barely stay upright ---------- */

.fx-wobble .p-title {
  font-family: "Lilita One", var(--font-display); font-weight: 400; letter-spacing: .01em;
  color: var(--accent); text-shadow: 0 .05em 0 #8a3c0e, 0 .1em 0 #3b1705, 0 .18em .35em rgba(0, 0, 0, .45);
}
.fx-wobble .p-h, .fx-wobble .section-title, .fx-wobble .next-title { font-family: "Lilita One", var(--font-display); font-weight: 400; letter-spacing: .01em; }
.fx-wobble .section-title .serif { font-family: inherit; font-style: normal; }
.fx-wobble .p-title .ci { animation: wobble 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.17s); transform-origin: 50% 90%; }
.fx-wobble .p-title .char:hover .ci { animation: topple 1.3s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes wobble {
  0%, 100% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(-7deg) translateY(-4%) scale(1.04, .96); }
  50% { transform: rotate(2deg) translateY(1%); }
  75% { transform: rotate(6deg) translateY(-2%) scale(.97, 1.03); }
}
@keyframes topple {
  25% { transform: rotate(85deg) translate(8%, 12%); }
  50% { transform: rotate(-24deg); }
  70% { transform: rotate(10deg); }
  85% { transform: rotate(-4deg); }
}
.fx-wobble .p-h:hover, .fx-wobble .section-title:hover { animation: jelly .8s; }
@keyframes jelly { 25% { transform: scale(1.08, .9); } 50% { transform: scale(.94, 1.06); } 75% { transform: scale(1.03, .97); } }
.fx-wobble .slide img, .fx-wobble .video video { transform: skewY(calc(var(--jelly, 0) * 1deg)); transform-origin: 50% 0; }
.js .fx-wobble .slide[data-reveal] { transform: translateY(80px) rotate(-5deg); transition-timing-function: var(--ease), cubic-bezier(.3, 1.6, .5, 1); }
.js .fx-wobble .slide[data-reveal].in { transform: none; }
.fx-wobble .cursor { animation: blob 1.4s ease-in-out infinite; }
@keyframes blob { 0%, 100% { border-radius: 50%; } 33% { border-radius: 62% 38% 55% 45%; } 66% { border-radius: 40% 60% 42% 58%; } }
@media (min-width: 900px) { .fx-wobble .p-hero-inner > *, .fx-shields .p-hero-inner > * { max-width: 58%; } }

/* ---------- Urban Assault: tactical HUD, stencil type, field-of-view ---------- */

.fx-glitch { --font-mono: "Space Mono", ui-monospace, monospace; }
.fx-glitch .p-title { font-family: "Black Ops One", var(--font-display); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; }
.fx-glitch .p-h, .fx-glitch .section-title, .fx-glitch .next-title { font-family: "Black Ops One", var(--font-display); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; }
.fx-glitch .section-title .serif { font-family: inherit; font-style: normal; }
.fx-glitch .eyebrow, .fx-glitch .p-meta, .fx-glitch .back, .fx-glitch .slide-num, .fx-glitch .roles dt, .fx-glitch .team, .fx-glitch .btn { font-family: var(--font-mono); }
.fx-glitch .p-tagline { font-family: var(--font-mono); font-style: normal; font-size: clamp(16px, 1.6vw, 20px); }
.fx-glitch .p-text p:first-child::first-letter { font-family: "Black Ops One", var(--font-display); }
.fx-glitch .p-title::before, .fx-glitch .p-title::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; }
.fx-glitch .p-title::before { color: var(--accent); animation: glitch-a 3s steps(1) infinite; }
.fx-glitch .p-title::after { color: var(--accent2); animation: glitch-b 2.4s steps(1) infinite; }
@keyframes glitch-a {
  0%, 86%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  88% { clip-path: inset(10% 0 60% 0); transform: translate(-6px, 2px); }
  91% { clip-path: inset(55% 0 20% 0); transform: translate(5px, -2px); }
  94% { clip-path: inset(30% 0 45% 0); transform: translate(-3px, 0); }
}
@keyframes glitch-b {
  0%, 80%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  83% { clip-path: inset(70% 0 5% 0); transform: translate(6px, 1px); }
  87% { clip-path: inset(20% 0 65% 0); transform: translate(-5px, -1px); }
}
/* targeting brackets around media */
.fx-glitch .slide, .fx-glitch .video { position: relative; }
.fx-glitch .slide::after, .fx-glitch .video::after {
  content: ""; position: absolute; inset: 24px -10px -10px; pointer-events: none;
  --c: var(--accent); --l: 26px; --t: 2px;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) var(--t), linear-gradient(var(--c) 0 0) top left / var(--t) var(--l),
    linear-gradient(var(--c) 0 0) top right / var(--l) var(--t), linear-gradient(var(--c) 0 0) top right / var(--t) var(--l),
    linear-gradient(var(--c) 0 0) bottom left / var(--l) var(--t), linear-gradient(var(--c) 0 0) bottom left / var(--t) var(--l),
    linear-gradient(var(--c) 0 0) bottom right / var(--l) var(--t), linear-gradient(var(--c) 0 0) bottom right / var(--t) var(--l);
  background-repeat: no-repeat; transition: inset .4s var(--ease);
}
.fx-glitch .slide:hover::after { inset: 34px 0 0; }
.fx-glitch .video::after { inset: 12px; }
.fx-glitch .video::before {
  content: "● REC"; position: absolute; top: 22px; left: 26px; z-index: 2; pointer-events: none;
  font: 700 12px var(--font-mono); letter-spacing: .12em; color: #ff4d4d; animation: blink 1.2s steps(1) infinite;
}
.fx-glitch .slide img { filter: saturate(.9) contrast(1.05); }
.fx-glitch .cursor {
  background: linear-gradient(var(--accent2), var(--accent2)) center / 100% 1.5px no-repeat;
  border: 1.5px solid var(--accent2); mix-blend-mode: normal;
}
.fx-glitch .cursor::before { content: ""; position: absolute; left: 50%; top: -8px; bottom: -8px; width: 1.5px; margin-left: -.75px; background: var(--accent2); }
.ua-hud {
  position: fixed; left: var(--gutter); bottom: 20px; z-index: 45; pointer-events: none; min-width: 200px;
  font-family: var(--font-mono); letter-spacing: .08em; color: var(--accent);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); padding: 10px 14px 12px;
  opacity: 0; transform: translateY(20px); transition: opacity .4s, transform .4s var(--ease);
}
.ua-hud.on { opacity: 1; transform: none; }
.ua-hud span { display: block; font-size: 10px; text-transform: uppercase; color: var(--muted); }
.ua-hud b { display: block; font-size: 22px; color: var(--fg); }
.ua-hud i { display: block; height: 3px; margin-top: 8px; background: var(--accent); transform-origin: left; }
.ua-hud.low b { color: #ff4d4d; animation: blink .5s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- The Living Script: ink, pictographs, a four-phase journey ---------- */

.fx-script { transition: background-color 1.2s ease, color 1.2s ease; }
.fx-script::before {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .09; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.fx-script .p-title { font-family: "Caveat Brush", var(--font-serif); font-weight: 400; letter-spacing: 0; font-size: clamp(64px, 12.5vw, 196px); line-height: .95; }
.fx-script .p-h, .fx-script .section-title, .fx-script .next-title { font-family: "Caveat Brush", var(--font-serif); font-weight: 400; letter-spacing: 0; }
.fx-script .section-title .serif { font-family: inherit; font-style: normal; }
.fx-script .p-tagline { color: var(--accent); }
.js .fx-script [data-split] .char {
  transform: none; clip-path: inset(-20% 100% -20% -20%); filter: blur(8px);
  transition: clip-path .55s ease, filter .9s ease, opacity .2s; transition-delay: calc(.3s + var(--i) * .08s);
}
.js .fx-script.ready [data-split] .char { clip-path: inset(-20% -20% -20% -20%); filter: none; }
.fx-script .slide img, .fx-script .video { border-radius: 4px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 25%, transparent), 0 30px 80px rgba(0, 0, 0, .25); }
.js .fx-script .slide[data-reveal] { transform: none; clip-path: inset(0 100% 0 0); transition: clip-path 1.4s cubic-bezier(.7, 0, .2, 1), opacity .4s; }
.js .fx-script .slide[data-reveal].in { clip-path: inset(0 0 0 0); }
.fx-script .cursor { background: var(--fg); mix-blend-mode: normal; opacity: .85; border-radius: 50% 50% 50% 10%; }
.phase-tag { font: 400 22px "Caveat Brush", var(--font-serif); color: var(--accent); margin: 0 0 10px; }
.phases {
  position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 45; display: flex; flex-direction: column; gap: 4px;
  padding: 6px 2px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 85%, transparent); box-shadow: 0 0 0 1px var(--line);
  transition: background-color 1.2s ease;
}
.phases button {
  display: flex; flex-direction: row-reverse; align-items: center; gap: 10px;
  background: none; border: 0; padding: 6px; color: var(--fg); opacity: .35;
  font: 400 19px "Caveat Brush", var(--font-serif); transition: opacity .4s, color .6s, transform .4s var(--ease);
}
.phases svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.phases span {
  position: absolute; right: calc(100% + 6px); padding: 2px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  background: var(--bg); box-shadow: 0 0 0 1px var(--line); opacity: 0; transform: translateX(8px); transition: opacity .3s, transform .3s var(--ease);
}
.phases button { position: relative; }
.phases button:hover { opacity: .8; }
.phases button.on { opacity: 1; color: var(--accent); transform: scale(1.15); }
.phases button:hover span { opacity: 1; transform: none; }
@media (max-width: 800px) {
  .phases { top: auto; bottom: 14px; right: 50%; transform: translateX(50%); flex-direction: row; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 88%, transparent); box-shadow: 0 0 0 1px var(--line); }
  .phases span { display: none; }
}

/* ---------- Thrown Guard: cartoon VR dusk, fly swatters ---------- */

.fx-shields .p-title {
  font-family: "Luckiest Guy", var(--font-display); font-weight: 400; letter-spacing: .02em; color: var(--accent);
  text-shadow: 0 2px 0 #7b4fd6, 0 4px 0 #6a40c4, 0 6px 0 #5832a8, 0 8px 0 #45268a, 0 16px 26px rgba(0, 0, 0, .45);
}
.fx-shields .p-h, .fx-shields .section-title, .fx-shields .next-title { font-family: "Luckiest Guy", var(--font-display); font-weight: 400; letter-spacing: .02em; }
.fx-shields .section-title .serif { font-family: inherit; font-style: normal; }
.js .fx-shields [data-split] .char { transform: translate(-40vw, -30vh) rotate(-540deg); transition: opacity .3s, transform 1.2s cubic-bezier(.2, 1.3, .4, 1); transition-delay: calc(.2s + var(--i) * .06s); }
.js .fx-shields.ready [data-split] .char { transform: none; }
.fx-shields .p-title .char:hover .ci { animation: squash .5s; }
@keyframes squash { 30% { transform: scale(1.3, .6) translateY(20%); } 60% { transform: scale(.9, 1.15); } }
.fx-shields .slide img, .fx-shields .video { border-radius: 20px; box-shadow: 0 0 0 4px var(--accent2), 0 24px 60px rgba(0, 0, 0, .4); }
.js .fx-shields .slide[data-reveal] { transform: scale(1.25) rotate(4deg); transition: transform .65s cubic-bezier(.2, 1.6, .4, 1), opacity .3s; }
.js .fx-shields .slide[data-reveal].in { transform: none; }
.fx-shields .cursor { background: var(--accent); mix-blend-mode: normal; }
.swatting .cursor { opacity: 0; }
.swatting .p-hero { cursor: none; }

/* ---------- Dustdevil's Gambit: the frontier, wanted posters, cards & dice ---------- */

.fx-dust .p-title { font-family: "Rye", var(--font-display); font-weight: 400; letter-spacing: .01em; color: var(--fg); text-shadow: .04em .04em 0 var(--accent2), .08em .08em 0 #120502; }
.fx-dust .p-h, .fx-dust .section-title, .fx-dust .next-title { font-family: "Rye", var(--font-display); font-weight: 400; letter-spacing: 0; }
.fx-dust .section-title .serif { font-family: inherit; font-style: normal; }
.fx-dust .p-title { text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent), .04em .04em 0 var(--accent2), .08em .08em 0 #120502; }
.js .fx-dust [data-split] .char { filter: blur(14px); transform: translateX(calc(var(--i) * 12px - 80px)) rotate(calc(var(--i) * 30deg)); transition: opacity 1.2s var(--ease), transform 1.4s var(--ease), filter 1.2s var(--ease); transition-delay: calc(.2s + var(--i) * .05s); }
.js .fx-dust.ready [data-split] .char { filter: none; transform: none; }
.fx-dust .p-tagline { color: var(--fg); text-shadow: 0 2px 14px rgba(0, 0, 0, .85), 0 0 2px rgba(0, 0, 0, .6); }
.fx-dust .p-meta { text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.fx-dust .p-cover {
  position: relative; max-width: 980px; margin-inline: auto; border-radius: 4px; transform: rotate(-1deg);
  background: #ecd3a4; padding: clamp(14px, 3vw, 30px); padding-top: clamp(72px, 10vw, 128px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 0 60px rgba(120, 70, 20, .35);
}
.fx-dust .p-cover::before {
  content: "WANTED"; position: absolute; top: clamp(12px, 2.4vw, 26px); left: 0; right: 0; text-align: center;
  font: 400 clamp(40px, 7vw, 86px)/1 "Rye", serif; letter-spacing: .1em; color: #3a1508;
}
.fx-dust .p-cover img { border: 3px solid #3a1508; }
.fx-dust #showcase .caption { text-align: center; margin-top: 28px; }
.fx-dust #about {
  background: #ecd3a4; color: #2b1206; padding: clamp(28px, 5vw, 64px); border-radius: 6px; transform: rotate(.5deg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 0 0 2px #2b1206, inset 0 0 0 9px #ecd3a4, inset 0 0 0 11px #2b1206, inset 0 0 80px rgba(120, 70, 20, .3);
}
.fx-dust #about .p-text { margin-bottom: 0; }
.fx-dust #about .p-text p:first-child::first-letter { color: #a3231a; font-family: "Rye", serif; }
.fx-dust .slide { transition: transform .5s var(--ease); }
.fx-dust .slide img { border: 10px solid #ecd3a4; border-radius: 8px; }
.js .fx-dust .slide[data-reveal] { transform: translate(-45vw, 80px) rotate(-28deg); transition: transform 1.1s cubic-bezier(.2, .9, .25, 1.04), opacity .6s; }
.js .fx-dust .slide[data-reveal].in { transform: rotate(var(--tilt, 0deg)); transition-delay: 0s; }
.js .fx-dust .slide[data-reveal].in:hover { transform: rotate(0) translateY(-8px) scale(1.01); }
.fx-dust .cursor { background: var(--accent); mix-blend-mode: normal; border-radius: 0; }
.dice { position: absolute; top: 108px; right: var(--gutter); z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.dice-btn { display: flex; gap: 20px; padding: 12px; background: none; border: 0; perspective: 700px; }
.die { --s: 54px; position: relative; display: block; width: var(--s); height: var(--s); transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.2, .8, .25, 1); }
.dice-btn:hover .die { filter: brightness(1.12); }
.face {
  position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 7px;
  background: #f3e3c3; border: 2px solid #2b1206; border-radius: 10px; box-shadow: inset 0 0 10px rgba(80, 40, 10, .35);
}
.face i { width: 10px; height: 10px; place-self: center; border-radius: 50%; }
.face i.pip { background: #a3231a; }
.f1 { transform: translateZ(calc(var(--s) / 2)); }
.f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.f2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.f5 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.f3 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.f4 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.dice-msg { margin: 0; max-width: 24ch; text-align: right; font: 400 15px/1.3 "Rye", serif; color: var(--fg); text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
@media (max-width: 700px) { .dice { top: 76px; } .die { --s: 38px; } .face { padding: 5px; } .face i { width: 7px; height: 7px; } .dice-msg { font-size: 12px; } }

/* ---------- Bubblism: pixel arcade, bubbles that pop ---------- */

.fx-bubbles { --font-pixel: "Silkscreen", ui-monospace, monospace; }
.fx-bubbles .p-title { font-family: "Fredoka", var(--font-display); font-weight: 700; letter-spacing: 0; text-shadow: -.035em 0 0 var(--accent), .035em 0 0 var(--accent2); }
.fx-bubbles .p-h, .fx-bubbles .section-title, .fx-bubbles .next-title { font-family: "Fredoka", var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.fx-bubbles .section-title .serif { font-family: inherit; font-style: normal; color: var(--accent2); }
.fx-bubbles .eyebrow, .fx-bubbles .p-meta dt, .fx-bubbles .slide-num, .fx-bubbles .back, .fx-bubbles .btn { font-family: var(--font-pixel); letter-spacing: .04em; }
.fx-bubbles .p-title .ci { animation: float 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.4s); }
.fx-bubbles .p-title .char.pop .ci { animation: pop 1.4s ease; }
@keyframes float { 50% { transform: translateY(-10%); } }
@keyframes pop {
  0% { transform: scale(1); opacity: 1; }
  14% { transform: scale(1.4); opacity: 1; }
  20% { transform: scale(1.6); opacity: 0; }
  60% { transform: scale(0); opacity: 0; }
  61% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.js .fx-bubbles [data-split] .char { transform: scale(0); transition: opacity .3s, transform .9s cubic-bezier(.3, 1.6, .5, 1); transition-delay: calc(.3s + var(--i) * .07s); }
.js .fx-bubbles.ready [data-split] .char { transform: none; }
.fx-bubbles .slide img, .fx-bubbles .video { border-radius: 0; box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--accent2), 10px 10px 0 8px var(--accent); }
.js .fx-bubbles .slide[data-reveal] { transform: scale(.6); transition: transform .8s cubic-bezier(.3, 1.6, .5, 1), opacity .4s; }
.js .fx-bubbles .slide[data-reveal].in { transform: none; }
.fx-bubbles .btn { border-radius: 0; box-shadow: 4px 4px 0 var(--accent2); }
.fx-bubbles .cursor {
  background: radial-gradient(circle at 32% 30%, #fff 0 14%, transparent 15%), color-mix(in srgb, var(--accent2) 18%, transparent);
  border: 2px solid #fff; mix-blend-mode: normal;
}

/* ==========================================================================
   Design process (game pages) — built from assets/js/process.js
   ========================================================================== */

.proc-toc {
  position: sticky; top: 62px; z-index: 6; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 0; margin-bottom: clamp(8px, 2vw, 24px);
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px);
}
.proc-toc::-webkit-scrollbar { display: none; }
.proc-toc a {
  flex: none; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--muted); white-space: nowrap; transition: color .3s, background .3s, border-color .3s;
}
.proc-toc a:hover { color: var(--fg); border-color: var(--muted); }
.proc-toc a.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }

.proc-sec { padding: clamp(44px, 6vw, 88px) 0; border-top: 1px solid var(--line); scroll-margin-top: 120px; }
.proc-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 18px; margin-bottom: clamp(22px, 3vw, 38px); }
.proc-num { font-size: 13px; letter-spacing: .2em; color: var(--accent); font-variant-numeric: tabular-nums; }
.proc-title { font-size: clamp(28px, 3.8vw, 52px) !important; margin: 0; }
.proc-tag { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }

.proc-body { display: grid; gap: clamp(20px, 2.4vw, 32px); }
.proc-body p { margin: 0; max-width: 72ch; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.7; }
.proc-body b { color: var(--accent); font-weight: 600; }
.proc-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.proc-h { margin: 8px 0 -8px; font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 1.5vw, 22px); letter-spacing: -.02em; }
.proc-quote {
  margin: 0; padding-left: 20px; border-left: 3px solid var(--accent);
  font-family: var(--font-serif); font-style: italic; font-size: clamp(24px, 2.6vw, 36px); line-height: 1.2; color: var(--accent);
}
.proc-note { font-size: 13px !important; color: var(--muted); }
.proc-note::before { content: "* "; }

.proc-list { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; max-width: 72ch; font-size: clamp(15px, 1.1vw, 17px); line-height: 1.65; }
.proc-list li::marker { color: var(--accent); }
.proc-list.defs { list-style: none; padding: 0; gap: 0; max-width: none; }
.proc-list.defs li { padding: 14px 0; border-top: 1px solid var(--line); }
.proc-list.defs li > b:first-child { display: block; margin-bottom: 2px; }

.proc-split { display: grid; grid-template-columns: var(--a) var(--b); gap: clamp(24px, 4vw, 64px); align-items: start; }
.proc-split > div { display: grid; gap: 20px; align-content: start; min-width: 0; }
.r-1-1 { --a: minmax(0, 1fr); --b: minmax(0, 1fr); }
.r-3-2 { --a: minmax(0, 3fr); --b: minmax(0, 2fr); }
.r-2-3 { --a: minmax(0, 2fr); --b: minmax(0, 3fr); }
@media (max-width: 860px) { .proc-split { grid-template-columns: minmax(0, 1fr); } }

.proc-figs { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); align-items: start; }
.proc-figs figure { margin: 0; min-width: 0; }
.proc-figs img { width: 100%; border-radius: 10px; background: var(--surface); }
.proc-figs.is-contain img { object-fit: contain; background: transparent; }
.proc-figs.c1.is-contain img { width: auto; max-width: 100%; max-height: 420px; }
.proc-figs.c1.is-contain figure { display: grid; justify-items: start; }
.proc-figs.paper img, .on-light { background: #f3eee4 !important; padding: clamp(10px, 1.5vw, 18px); }
.proc-figs figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.45; }
@media (max-width: 700px) { .proc-figs.many { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Justified rows: widths follow each image's aspect ratio, so a row shares one height and nothing is cropped. */
.proc-row { display: flex; align-items: flex-start; gap: clamp(10px, 1.4vw, 18px); }
.proc-row + .proc-row { margin-top: calc(clamp(10px, 1.4vw, 18px) - clamp(20px, 2.4vw, 32px)); }
.proc-row figure { flex: var(--ar, 1) 1 0%; min-width: 0; margin: 0; }
.proc-row img { display: block; width: 100%; height: auto; border-radius: 10px; }
.proc-row figcaption { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.proc-row.single { justify-content: center; }
.proc-row.single figure { flex: 0 1 auto; width: min(100%, calc(min(72vh, 680px) * var(--ar, 1))); }
.proc-split .proc-row.single { justify-content: flex-start; }
.proc-row.paper img { background: #f3eee4; padding: clamp(10px, 1.5vw, 18px); }
/* phones: long rows become a swipeable strip at a readable height, still uncropped */
@media (max-width: 700px) {
  .proc-row.many { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .proc-row.many::-webkit-scrollbar { display: none; }
  .proc-row.many figure { flex: none; width: calc(min(240px, 56vw) * var(--ar, 1)); scroll-snap-align: start; }
}

.proc-cards { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 16px; }
.proc-cards article { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); min-width: 0; }
.proc-cards img { display: block; width: 100%; height: auto; background: #fff; }
.proc-cards article > div { display: grid; gap: 8px; padding: 16px 18px 18px; }
.proc-cards h4 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.proc-cards p { margin: 0; font-size: 15px !important; line-height: 1.55; }
.proc-cards .speed { color: var(--muted); font-size: 13px !important; }
.proc-cards dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.proc-cards dt { color: var(--muted); }
.proc-cards dd { margin: 0; }
.proc-cards.is-tall h4 { font-size: 15px; text-align: center; }
.proc-cards.is-glyph img, .proc-cards.is-pieces img { object-fit: contain; padding: clamp(14px, 2vw, 24px); background: #efe7d6; }
.proc-cards.is-pieces img { background: #ece6dc; }
.proc-cards.is-tiles article { flex-direction: row; align-items: center; }
.proc-cards.is-tiles img { width: 76px; flex: none; padding: 6px; background: #d9d2c3; }
@media (max-width: 860px) { .proc-cards.many { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .proc-cards:not(.is-tall):not(.is-tiles) { grid-template-columns: minmax(0, 1fr); } }

.proc-refs { display: grid; gap: 14px; }
.proc-refs article { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: center; }
.proc-refs img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 8px; background: color-mix(in srgb, var(--fg) 7%, transparent); }
.proc-refs h4 { margin: 0 0 4px; font-size: 16px; font-style: italic; }
.proc-refs p { font-size: 14px !important; color: var(--muted); line-height: 1.5; }
.proc-refs.is-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.proc-refs.is-wide article { grid-template-columns: minmax(0, 1fr); align-items: start; }
.proc-refs.is-wide img { aspect-ratio: auto; background: none; }
@media (max-width: 760px) { .proc-refs.is-wide { grid-template-columns: minmax(0, 1fr); } }
.yes { color: #3ddc84; } .no { color: #ff5a5a; }

.credits { border-top: 1px solid var(--line); padding-top: 18px; }
.credits summary { cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 18px; list-style: none; }
.credits summary::after { content: " +"; color: var(--accent); }
.credits[open] summary::after { content: " –"; }
.credits h4 { margin: 18px 0 4px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.credits p { font-size: 14px !important; color: var(--muted); }

/* --- Wobbleknight: game flow + movement versions --- */
.flow-steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; gap: clamp(28px, 3.5vw, 48px); }
.flow-steps li { position: relative; flex: var(--ar, 1) 1 0%; min-width: 0; display: grid; gap: 14px; justify-items: center; text-align: center; }
/* outline (not border/padding) so the frame doesn't skew the equal-height row */
.flow-steps img { display: block; width: 100%; height: auto; border-radius: 12px; outline: 3px dashed var(--accent); outline-offset: 5px; }
.flow-steps span { font-family: var(--font-serif); font-style: italic; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.3; max-width: 22ch; }
.flow-steps li:not(:last-child)::after { content: "→"; position: absolute; right: calc(clamp(28px, 3.5vw, 48px) / -2 - 9px); top: 30%; color: var(--accent); font-size: 24px; }
@media (max-width: 700px) {
  .flow-steps { flex-direction: column; align-items: stretch; }
  .flow-steps li { flex: none; }
  .flow-steps li:not(:last-child)::after { content: "↓"; position: static; }
}
.versions { display: grid; gap: 26px; }
.versions article { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 6px 20px; padding-top: 24px; border-top: 1px solid var(--line); }
.ver { grid-row: span 3; font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; color: var(--accent); }
.versions h4 { margin: 0; font-size: 19px; }
.versions p { color: var(--muted); }
.ver-figs { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
.ver-figs img { flex: var(--ar, 1) 1 0%; min-width: 0; height: auto; border-radius: 8px; }
@media (max-width: 600px) { .versions article { grid-template-columns: minmax(0, 1fr); } .ver { grid-row: auto; } }

/* --- Urban Assault: animated mechanic diagrams + level columns --- */
.mech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.mech-grid article { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.mech-grid h4 { margin: 0 0 6px; font-size: 16px; }
.mech-grid h4 span { margin-right: 8px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; color: var(--accent); }
.mech-grid p { font-size: 14px !important; color: var(--muted); line-height: 1.55; }
.mech { display: block; width: 100%; height: auto; margin-bottom: 14px; border-radius: 8px; background: color-mix(in srgb, var(--fg) 5%, transparent); }
.mech * { transform-box: view-box; }
.mech .me { fill: var(--fg); }
.mech .foe { fill: var(--accent2); }
.mech-sight .cone { fill: var(--accent); opacity: .3; transform-origin: 40px 70px; animation: m-sweep 4s ease-in-out infinite alternate; }
.mech-sight .seen { animation: m-blink 4s ease-in-out infinite; }
.mech-sight .ring { fill: none; stroke: var(--accent2); stroke-width: 1.5; transform-origin: 96px 44px; animation: m-ping 2s ease-out infinite; }
.mech-sight .r2 { animation-delay: 1s; }
.mech-maze .walls { fill: none; stroke: var(--fg); stroke-width: 3; opacity: .45; }
.mech-maze .route { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 220; animation: m-draw 3.5s ease-in-out infinite; }
.mech-clock .face { fill: none; stroke: color-mix(in srgb, var(--fg) 20%, transparent); stroke-width: 6; }
.mech-clock .arc { fill: none; stroke: var(--accent); stroke-width: 6; stroke-dasharray: 188.5; transform: rotate(-90deg); transform-origin: 60px 40px; animation: m-drain 6s linear infinite; }
.mech-clock .hand { stroke: var(--fg); stroke-width: 3; stroke-linecap: round; transform-origin: 60px 40px; animation: m-spin 6s linear infinite; }
.mech-clock .pin { fill: var(--fg); }
.mech-sneak .steps ellipse { fill: var(--fg); opacity: .15; animation: m-step 2.5s ease-in-out infinite; }
.mech-sneak .steps ellipse:nth-child(2) { animation-delay: .25s; } .mech-sneak .steps ellipse:nth-child(3) { animation-delay: .5s; }
.mech-sneak .steps ellipse:nth-child(4) { animation-delay: .75s; } .mech-sneak .steps ellipse:nth-child(5) { animation-delay: 1s; }
.mech-sneak .zz { fill: none; stroke: var(--muted); stroke-width: 2; }
.mech-cover .solid { fill: var(--fg); opacity: .55; }
.mech-cover .thin { fill: var(--accent); opacity: .35; }
.mech-cover .shot { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 6; animation: m-shot .8s linear infinite; }
@keyframes m-sweep { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
@keyframes m-blink { 0%, 30%, 100% { opacity: 1; } 55%, 75% { opacity: .15; } }
@keyframes m-ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.4); opacity: 0; } }
@keyframes m-draw { 0% { stroke-dashoffset: 220; } 60%, 100% { stroke-dashoffset: 0; } }
/* negative offset: the yellow shrinks from the end the hand is passing, so both move clockwise */
@keyframes m-drain { to { stroke-dashoffset: -188.5; } }
@keyframes m-spin { to { transform: rotate(360deg); } }
@keyframes m-step { 0%, 100% { opacity: .1; } 40% { opacity: .8; } }
@keyframes m-shot { to { stroke-dashoffset: -22; } }
.level-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); gap: 14px 20px; }
.level-cols article { display: grid; grid-row: span 5; grid-template-rows: subgrid; align-content: start; }
/* every level shows the same three stages, each row lined up across the columns */
.level-cols figure { margin: 0; }
.level-cols figcaption { margin-top: 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.level-cols .lv-sheet img { aspect-ratio: 4 / 3; object-fit: contain; background: #f3eee4; padding: 10px; }
.level-cols h4 { margin: 0; font-size: 18px; }
.level-cols h4 em { margin-left: 8px; font-style: normal; font-family: var(--font-mono, ui-monospace, monospace); font-size: 14px; color: var(--accent); }
.level-cols p { font-size: 14px !important; color: var(--muted); }
.level-cols img { width: 100%; border-radius: 8px; }
@media (max-width: 860px) { .level-cols { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; } .level-cols article { grid-row: auto; grid-template-rows: none; gap: 12px; } }

/* --- The Living Script: realm journey + enemy groups --- */
.realm-flow { display: grid; grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)); gap: 14px; }
.realm { --ra: #b5541c; padding: 18px; border-radius: 14px; background: #efe7d6; color: #2b231c; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.realm .glyph { width: 64px; height: 64px; object-fit: contain; }
.realm h4 { margin: 8px 0 10px; font-family: "Caveat Brush", var(--font-serif); font-weight: 400; font-size: 26px; }
.realm h4 small { margin-left: 6px; font-family: var(--font-body); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ra); }
.realm ul { margin: 0; padding-left: 1.1em; display: grid; gap: 5px; font-size: 14px; line-height: 1.5; }
.realm b { color: var(--ra) !important; }
.realm-hell { --ra: #ff7a5c; background: #2a0f0b; color: #f3e2d0; }
.realm-hell .glyph { filter: invert(1); }
.realm-nature { --ra: #3f7d3a; background: #dde5cb; color: #1f2a1c; }
.realm-heaven { --ra: #a87a00; background: #fbf3d6; color: #2a2418; }
@media (max-width: 900px) { .realm-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .realm-flow { grid-template-columns: minmax(0, 1fr); } }
.enemy-realms { display: grid; grid-template-columns: 3fr 1.6fr 2.1fr 1.2fr; gap: 12px; }
.enemy-realms section { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; align-content: start; padding: 12px; border: 2px solid var(--fg); border-radius: 10px; }
.enemy-realms h4 { grid-column: 1 / -1; margin: 0 0 4px; text-align: center; font-family: "Caveat Brush", var(--font-serif); font-weight: 400; font-size: 24px; }
.enemy-realms figure { margin: 0; text-align: center; }
.enemy-realms img { width: 100%; max-width: 76px; aspect-ratio: 1; object-fit: contain; }
.enemy-realms section { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); justify-items: center; }
.enemy-realms figcaption { font-family: "Caveat Brush", var(--font-serif); font-size: 17px; line-height: 1.1; }
@media (max-width: 900px) { .enemy-realms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Thrown Guard: wave loop + towers --- */
.wave-loop { position: relative; display: grid; gap: 10px; max-width: 640px; }
.wave-loop::before { content: ""; position: absolute; left: 50%; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.wave-loop > * { position: relative; }
.wl-step { padding: 12px 18px; border-radius: 999px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--bg)); text-align: center; font-weight: 600; }
.wl-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wl-pair .wl-step { border-radius: 12px; }
.wl-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 18px; border: 1px dashed var(--muted); border-radius: 12px; background: var(--bg); }
.wl-check span { font-weight: 600; }
.wl-check span::before { content: "◆ "; color: var(--accent); }
.wl-check em { padding: 3px 10px; border-radius: 999px; background: var(--surface); font-style: normal; font-size: 13px; color: var(--muted); }
.wl-check .lose { color: #ff8fa3; } .wl-check .win { color: #8dffbe; }
.towers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.towers article { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.towers img { width: 120px; height: 120px; margin: 0 auto 10px; object-fit: contain; border-radius: 12px; background: #fff; }
.towers h4 { margin: 0 0 10px; font-size: 18px; }
.towers dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; text-align: left; font-size: 14px; }
.towers dt { color: var(--muted); } .towers dd { margin: 0; }
@media (max-width: 640px) { .towers { grid-template-columns: minmax(0, 1fr); } }

/* --- Dustdevil's Gambit: win/lose, card fans, turn flow, MP table --- */
.win-lose { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.win-lose article { padding: 22px; border-radius: 6px; background: #ecd3a4; color: #2b1206; transform: rotate(-.6deg); box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.win-lose article:nth-child(2) { transform: rotate(.5deg); }
.win-lose article.lose { background: #3a1508; color: #fbe6cc; transform: rotate(-.3deg); }
.win-lose h4 { margin: 0 0 8px; font-family: "Rye", serif; font-weight: 400; font-size: 20px; }
.win-lose p { font-size: 15px !important; }
@media (max-width: 700px) { .win-lose { grid-template-columns: minmax(0, 1fr); } }
.card-fan { display: flex; justify-content: center; padding: 22px 14px 18px; }
.card-fan img {
  /* overlap -12px each side, so n cards need n×(w−24)+24 ≤ available width */
  position: relative; width: min(clamp(96px, 15vw, 180px), calc((100vw - 2 * var(--gutter) - 52px) / var(--n, 3) + 24px)); margin: 0 -12px; border-radius: 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  transform: translateY(var(--y, 0)) rotate(var(--r, 0deg)); transition: transform .45s var(--ease);
}
.card-fan img:hover { z-index: 2; transform: translateY(-18px) rotate(0) scale(1.08); }
.turn-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.turn-flow > li > span { display: inline-block; padding: 8px 16px; border: 1px solid var(--accent); border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, var(--bg)); font-weight: 600; }
.turn-flow ul { list-style: none; display: grid; gap: 6px; margin: 10px 0 0 18px; padding: 0 0 0 16px; border-left: 2px dashed var(--line); font-size: 14px; line-height: 1.5; }
.turn-flow ul b { display: inline-block; min-width: 128px; }
.table-wrap { overflow-x: auto; }
.mp-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.mp-table th, .mp-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.mp-table thead th { font-family: "Rye", var(--font-display); font-weight: 400; color: var(--accent); }
.mp-table tbody th { text-align: left; font-weight: 500; color: var(--muted); }
.mp-table td i { display: block; width: calc(var(--p) * 4%); max-width: 100%; height: 4px; margin: 0 auto 6px; border-radius: 2px; background: var(--accent); }
.formula { font-family: ui-monospace, "Space Mono", monospace; font-size: 14px !important; color: var(--muted); }

/* --- Bubblism: pixel tileset --- */
.tileset { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.tileset figure { display: grid; gap: 10px; justify-items: center; margin: 0; padding: 16px; border: 4px solid var(--accent2); background: #0f0d1a; box-shadow: 6px 6px 0 var(--accent); }
.tileset img { height: 56px; width: auto; image-rendering: pixelated; }
.tileset .rot { display: flex; gap: 8px; }
.tileset .bub img { height: 44px; }
.tileset figcaption { font-family: var(--font-pixel, monospace); font-size: 11px; color: #f4f1ff; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal], .js [data-split] .char { opacity: 1 !important; transform: none !important; filter: none !important; }
  .statement .w { opacity: 1; }
}
