:root {
  --bg: #0c0d10;
  --bg-2: #13151a;
  --bg-3: #1b1e25;
  --bg-4: #252932;
  --line: rgba(255, 255, 255, .08);
  --text: #eeece7;
  --mute: #9a9ba4;
  --accent: #ff5a36;
  --c3d: #6cb8ff;
  --cgames: #c4f04d;
  --cai: #ff5a36;
  --chip: #e9e6df;
  --sw: 340px;
  --D: 70vh;
  --display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 450 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--bg); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.d3d { background: var(--c3d); } .dgames { background: var(--cgames); } .dai { background: var(--cai); }

/* ---------- shared header pieces (from the original site's header) ---------- */
.wordmark { font: 800 22px/1 var(--display); letter-spacing: .14em; font-variation-settings: "opsz" 96; white-space: nowrap; }
.wordmark.sm { font-size: 18px; letter-spacing: .12em; }
.resume { font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); transition: background .25s, color .25s, border-color .25s; }
.resume:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.soc { display: flex; gap: 6px; }
.soc a { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); transition: transform .3s var(--spring), background .25s; }
.soc a:hover { transform: translateY(-3px); background: var(--bg-4); }
.soc img { width: 18px; height: 18px; object-fit: contain; }
.contact { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--mute); transition: color .2s; }
.contact:hover { color: var(--text); }
.contact img { width: 18px; height: 18px; object-fit: contain; opacity: .85; }

/* ---------- tool icons ---------- */
.tools { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.tools li { position: relative; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; transition: transform .35s var(--spring), background .25s; }
.tools li img { width: 34px; height: 34px; object-fit: contain; }
.tools li.sq img { width: 29px; height: 29px; }
.tools li.inv img { filter: invert(1) hue-rotate(180deg); }
.tools li:hover { transform: translateY(-4px) rotate(-4deg); background: var(--bg-3); }
.tools li span { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px); white-space: nowrap; padding: 5px 9px; border-radius: 8px; background: var(--text); color: var(--bg); font: 500 11px var(--mono); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--out); }
.tools li:hover span { opacity: 1; transform: translate(-50%, 0); }
.tools.mini { gap: 2px; }
.tools.mini li { width: 34px; height: 34px; border-radius: 9px; }
.tools.mini li img { width: 24px; height: 24px; }
.tools.mini li.sq img { width: 20px; height: 20px; }

/* ---------- side panel: starts as the intro, becomes the sidebar ---------- */
.side { position: fixed; top: 0; left: 0; bottom: 0; width: 100vw; background: var(--bg); overflow: hidden; z-index: 20; border-right: 1px solid var(--line); }
.side::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(40% 50% at 78% 55%, rgba(255, 90, 54, .10), transparent 70%), radial-gradient(35% 40% at 20% 80%, rgba(108, 184, 255, .06), transparent 70%); pointer-events: none; }
.intro { position: absolute; top: 0; left: 0; width: 100vw; height: 100%; padding: 26px 48px 36px; display: flex; flex-direction: column; will-change: opacity, transform; }
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.top-l { display: flex; align-items: center; gap: 12px; }
.top-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.intro-copy { margin: auto 0; max-width: 46vw; display: flex; flex-direction: column; gap: 26px; position: relative; }
.kicker { margin: 0; display: flex; align-items: center; gap: 10px; font: 500 13px var(--mono); color: var(--mute); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--cgames); box-shadow: 0 0 0 0 rgba(196, 240, 77, .5); animation: pulse 2.4s var(--out) infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(196, 240, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(196, 240, 77, 0); } }
.intro h1 { margin: 0; font: 800 clamp(60px, 8.6vw, 148px)/.88 var(--display); letter-spacing: -.035em; font-variation-settings: "opsz" 96; }
.intro h1 .ln { display: block; overflow: hidden; padding-bottom: .04em; }
.intro h1 .ln > span { display: block; transform: translateY(105%); animation: rise 1s var(--out) forwards; }
.intro h1 .ln:nth-child(2) > span { animation-delay: .09s; }
.intro h1 i { font-style: normal; color: var(--accent); }
@keyframes rise { to { transform: none; } }
.cats { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px 12px 16px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); font-weight: 600; font-size: 15px; transition: transform .35s var(--spring), background .25s, color .25s; }
.chip:hover { transform: translateY(-3px); }
.chip[data-go="3d"]:hover { background: var(--c3d); color: var(--bg); }
.chip[data-go="games"]:hover { background: var(--cgames); color: var(--bg); }
.chip[data-go="ai"]:hover { background: var(--cai); color: var(--bg); }
.chip:hover .dot { background: var(--bg); }
.cue { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); transition: opacity .3s; }
.cue span { display: block; width: 24px; height: 38px; border-radius: 14px; border: 2px solid var(--bg-4); position: relative; }
.cue span::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: wheel 1.8s var(--out) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }
.strip { display: none; }

/* entrance stagger for the intro */
.enter { opacity: 0; transform: translateY(14px); animation: enter .8s var(--out) forwards; }
@keyframes enter { to { opacity: 1; transform: none; } }

.dock { position: absolute; top: 0; left: 0; width: var(--sw); height: 100%; padding: 30px 26px 26px; display: flex; flex-direction: column; gap: 26px; pointer-events: none; }
.dock > * { opacity: 0; transform: translateX(-12px); transition: opacity .45s var(--out), transform .55s var(--out); }
.dock.live { pointer-events: auto; }
.dock.live > * { opacity: 1; transform: none; }
.dock.live > *:nth-child(2) { transition-delay: .06s; } .dock.live > *:nth-child(3) { transition-delay: .12s; } .dock.live > *:nth-child(4) { transition-delay: .18s; }
.dock-head { display: flex; flex-direction: column; gap: 10px; }
.dock-title { font: 700 26px/1.05 var(--display); letter-spacing: -.02em; color: var(--mute); }
.dock-links { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.dock-nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.dock-nav > button, .dock-nav > a { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-radius: 12px; font-weight: 600; font-size: 15px; text-align: left; color: var(--mute); transition: color .25s; }
.dock-nav > button span, .dock-nav > a span { display: inline-flex; align-items: center; gap: 10px; }
.dock-nav > *:hover, .dock-nav .on { color: var(--text); }
.dock-nav i { font: 500 12px var(--mono); font-style: normal; color: var(--mute); }
.ind { position: absolute; left: 0; right: 0; top: 0; height: 44px; border-radius: 12px; background: var(--bg-3); transition: transform .45s var(--out), height .3s; }
.dock-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- fan (intro cards that fly into the grid) ---------- */
.fan { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.fc { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: auto; cursor: pointer; will-change: transform; }
.fc .deal { position: absolute; inset: 0; opacity: 0; transform: translateY(60px) rotate(6deg); animation: deal .9s var(--out) forwards; }
@keyframes deal { to { opacity: 1; transform: none; } }
.fc .lift { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; background: var(--bg-3); box-shadow: 0 30px 60px rgba(0, 0, 0, calc(.5 - var(--capo, 0) * .5)), 0 0 0 1px var(--line); transition: transform .4s var(--spring); }
.fc img { width: 100%; height: 100%; object-fit: cover; }
.fc .cap { opacity: calc(var(--capo, 0) * .92); transform: translateY(calc(6px + (1 - var(--capo, 0)) * 10px)); transition: none; }
.fan.idle .fc:hover .lift { transform: translateY(-18px) scale(1.05); }
.fan.done { visibility: hidden; }

/* ---------- main (layout C) ---------- */
.main { margin-left: var(--sw); min-height: 100vh; padding: 0 40px; }
.spacer { height: var(--D); }
.main-head { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 26px 0 20px; background: rgba(12, 13, 16, .82); backdrop-filter: blur(14px); }
.main-head h2 { margin: 0; font: 800 30px/1 var(--display); letter-spacing: -.02em; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.filters button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--mute); transition: background .3s var(--out), color .25s; }
.filters button:hover { color: var(--text); }
.filters .on { background: var(--text); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; padding-bottom: 40px; }
.tile { position: relative; display: block; text-align: left; border-radius: 18px; aspect-ratio: 4 / 5; perspective: 900px; }
.tile .card { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: var(--bg-3); box-shadow: 0 0 0 1px var(--line); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--out), box-shadow .3s; }
.tile:hover .card { box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 24px 48px rgba(0, 0, 0, .5); }
.tile.ghost { visibility: hidden; }
.tile.reveal { opacity: 0; transform: translateY(24px); }
.tile.reveal.in { opacity: 1; transform: none; transition: opacity .7s var(--out), transform .8s var(--out); }
.tile .media { position: absolute; inset: 0; }
.tile .media img, .tile .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--out), opacity .35s; }
.tile:hover .media img { transform: scale(1.05); }
.tile .media video { opacity: 0; }
.tile.playing .media video { opacity: 1; }
.cap { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 12px; background: rgba(12, 13, 16, .72); backdrop-filter: blur(10px); transform: translateY(6px); opacity: .92; transition: transform .45s var(--out), opacity .3s; }
.tile:hover .cap { transform: none; opacity: 1; }
.cap b { font-weight: 600; font-size: 13px; line-height: 1.2; }
.cap em { margin-left: auto; font: 500 11px var(--mono); font-style: normal; color: var(--mute); white-space: nowrap; }
.tile.feature { grid-column: span 3; grid-row: span 2; aspect-ratio: auto; min-height: 0; }
.tile.feature .stack, .fc.feature .stack { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr; gap: 3px; background: var(--bg); }
.tile.feature .stack i, .fc.feature .stack i { min-height: 0; overflow: hidden; display: block; }
.tile.feature .stack i:first-child, .fc.feature .stack i:first-child { grid-column: 1 / -1; }
.tile.feature .stack img, .fc.feature .stack img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--out); }
.tile.feature:hover .stack img { transform: scale(1.05); }
.tile.feature .stack i:nth-child(2) img { transition-delay: .05s; } .tile.feature .stack i:nth-child(3) img { transition-delay: .1s; }
.tile.feature .ftext, .fc.feature .ftext { position: absolute; left: 0; right: 0; bottom: calc((100% - 3px) / 3 + 3px); padding: 22px; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(to top, rgba(12, 13, 16, .95), rgba(12, 13, 16, 0)); }
.tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: var(--bg); font-weight: 700; font-size: 12px; }
.tile.feature .ft, .fc.feature .ft { font: 800 36px/1 var(--display); letter-spacing: -.03em; }
.tile.feature .fs, .fc.feature .fs { font-size: 14px; color: var(--mute); }
.tile.hide { display: none; }

/* ---------- about + footer ---------- */
.about { padding: 80px 0 40px; border-top: 1px solid var(--line); margin-top: 40px; }
.about h2 { margin: 0 0 28px; font: 800 30px/1 var(--display); }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 40px; }
.xp { list-style: none; margin: 0; padding: 0; }
.xp li { display: grid; grid-template-columns: 110px 1fr; gap: 2px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.xp span { font: 500 12px var(--mono); color: var(--mute); grid-row: span 2; padding-top: 3px; }
.xp b { font-weight: 600; }
.xp em { font-style: normal; color: var(--mute); font-size: 14px; }
.about-side { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.about-side p { margin: 0; font-size: 18px; line-height: 1.55; color: #cfcdc8; }
.about-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; padding: 12px 20px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; transition: transform .3s var(--spring); }
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 40px 0 48px; font-size: 14px; color: var(--mute); }
.foot a { font: 800 24px var(--display); color: var(--text); transition: color .2s; }
.foot a:hover { color: var(--accent); }

/* ---------- lightbox + case study ---------- */
.lb, .case { position: fixed; inset: 0; z-index: 100; background: rgba(8, 9, 11, .97); animation: fade .35s var(--out) both; }
@keyframes fade { from { opacity: 0; } }
.lb { display: grid; grid-template-rows: auto 1fr auto auto; padding: 22px 40px; }
.lb-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.lb-cat { font: 500 12px var(--mono); color: var(--mute); }
.lb-top h3 { margin: 4px 0 0; font: 800 34px/1.05 var(--display); letter-spacing: -.02em; }
.x { width: 46px; height: 46px; border-radius: 50%; background: var(--bg-3); font-size: 15px; flex: none; transition: background .2s, color .2s, transform .3s var(--spring); }
.x:hover { background: var(--accent); color: var(--bg); transform: rotate(90deg); }
.lb-stage { min-height: 0; display: grid; place-items: center; padding: 16px 0; overflow: hidden; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100svh - 270px); width: auto; height: auto; border-radius: 14px; background: #000; animation: pop .5s var(--out) both; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.lb-bar p { margin: 0; color: var(--mute); font-size: 15px; max-width: 70ch; }
.lb-link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; transition: color .2s; }
.lb-link:hover { color: var(--accent); }
.lb-nav { display: flex; align-items: center; gap: 12px; font: 500 12px var(--mono); flex: none; }
.lb-nav button { width: 42px; height: 42px; border-radius: 50%; background: var(--bg-3); transition: background .2s, color .2s; }
.lb-nav button:hover { background: var(--text); color: var(--bg); }
.lb-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-top: 14px; }
.lb-thumbs button { flex: none; width: 86px; height: 54px; border-radius: 9px; overflow: hidden; opacity: .4; outline: 2px solid transparent; position: relative; transition: opacity .2s; }
.lb-thumbs button:hover { opacity: .8; }
.lb-thumbs button.on { opacity: 1; outline-color: var(--accent); }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumbs .pl { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; text-shadow: 0 0 6px #000; }

.case { overflow-y: auto; }
.case-x { position: fixed; top: 20px; right: 24px; z-index: 2; }
.case-in { max-width: 1120px; margin: 0 auto; padding: 72px 32px 96px; display: flex; flex-direction: column; gap: 56px; }
.case-in > * { animation: enter .8s var(--out) both; }
.case-in > *:nth-child(2) { animation-delay: .08s; } .case-in > *:nth-child(3) { animation-delay: .16s; } .case-in > *:nth-child(4) { animation-delay: .24s; }
.case-hero { display: flex; flex-direction: column; gap: 18px; }
.case-hero h2 { margin: 0; font: 800 clamp(52px, 7.5vw, 104px)/.92 var(--display); letter-spacing: -.04em; }
.case-hero p { margin: 0; font-size: 19px; color: var(--mute); max-width: 52ch; }
.case-shot { width: 100%; border-radius: 20px; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-3); }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.role { padding: 24px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.role h3 { margin: 0; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.role ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.role li { padding: 8px 12px; border-radius: 999px; background: var(--bg-3); font-size: 14px; font-weight: 500; }
.flow-title { margin: 0; font: 800 34px/1 var(--display); letter-spacing: -.02em; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; counter-reset: s; }
.flow li { padding: 22px 20px 24px; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.flow li::before { counter-increment: s; content: counter(s, decimal-leading-zero); font: 500 12px var(--mono); color: var(--bg); background: var(--cgames); align-self: flex-start; padding: 4px 8px; border-radius: 6px; }
.flow li.claude { border-color: rgba(255, 90, 54, .5); }
.flow li.claude::before { background: var(--accent); }
.flow b { font: 700 21px var(--display); }
.flow span { font-size: 14px; color: var(--mute); line-height: 1.5; }
.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.stat > div { padding: 26px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.stat strong { font: 800 clamp(30px, 3.6vw, 46px)/1.05 var(--display); letter-spacing: -.03em; }
.stat strong s { color: var(--mute); text-decoration-thickness: 3px; text-decoration-color: var(--accent); }
.stat span { font-size: 14px; color: var(--mute); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 14px; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 200; padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--out); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- phones and small tablets ---------- */
@media (max-width: 1279px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .side { position: relative; width: auto; min-height: 100svh; overflow: visible; border-right: 0; }
  .intro { position: relative; width: auto; min-height: 100svh; padding: 18px 18px 30px; gap: 28px; }
  .top { grid-template-columns: 1fr auto; }
  .top .wordmark { grid-column: 1; grid-row: 1; font-size: 18px; }
  .top-l { grid-column: 2; grid-row: 1; }
  .top-l .resume { display: none; }
  .top-r { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 16px; flex-wrap: wrap; }
  .intro-copy { max-width: none; margin: 30px 0 0; }
  .strip { display: flex; gap: 12px; overflow-x: auto; margin: 0 -18px; padding: 6px 18px 10px; scroll-snap-type: x mandatory; }
  .strip button { flex: none; width: 46vw; max-width: 220px; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; scroll-snap-align: start; }
  .strip img { width: 100%; height: 100%; object-fit: cover; }
  .cue, .dock, .fan { display: none; }
  .main { margin-left: 0; padding: 0 14px; }
  .spacer { display: none; }
  .main-head h2 { font-size: 24px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile.feature { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 6 / 5; min-height: 0; }
  .tile .cap em { display: none; }
  .lb { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .intro h1 .ln > span, .enter, .fc .deal { transform: none !important; opacity: 1 !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Monkey Legends ---------- */
.tag.t3d { background: var(--c3d); }
.tile.feature[data-id="ml"] { grid-column: span 2; grid-row: span 2; }
.tile.feature[data-id="ml"] .stack, .fc.feature[data-id="ml"] .stack { grid-template-rows: 1fr 1fr; background: #000; }
.tile.feature[data-id="ml"] .stack i:first-child, .fc.feature[data-id="ml"] .stack i:first-child { grid-column: auto; }
.tile.feature[data-id="ml"] .stack img, .fc.feature[data-id="ml"] .stack img { object-position: center 30%; }
.tile.feature[data-id="ml"] .ftext, .fc.feature[data-id="ml"] .ftext { bottom: 0; }
.ml-hero { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ml-hero img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; background: #000; }
.mixer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 24px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line); }
.mix-stage { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: radial-gradient(60% 60% at 50% 38%, #2b303b, #101216); }
.mix-stage img, .fur-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mix-ctl { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.mix-ctl h3 { margin: 0; font: 800 32px/1 var(--display); letter-spacing: -.02em; }
.mix-ctl p { margin: 0; color: var(--mute); font-size: 15px; }
.mix-row { display: flex; flex-direction: column; gap: 8px; }
.mix-row b { font: 500 12px var(--mono); color: var(--mute); }
.mix-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.mix-opts button { padding: 7px 12px; border-radius: 999px; background: var(--bg-3); font-size: 13px; font-weight: 600; color: var(--mute); transition: background .2s, color .2s, transform .3s var(--spring); }
.mix-opts button:hover { color: var(--text); transform: translateY(-2px); }
.mix-opts button.on { background: var(--text); color: var(--bg); }
.fur-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.fur-card { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.fur-card span { position: absolute; left: 8px; bottom: 8px; font: 500 11px var(--mono); padding: 3px 7px; border-radius: 6px; background: rgba(12, 13, 16, .75); }
.ladder { display: flex; flex-wrap: wrap; gap: 8px; }
.ladder span { display: flex; align-items: baseline; gap: 8px; padding: 9px 13px; border-radius: 12px; background: var(--bg-3); font-size: 13px; color: var(--mute); }
.ladder b { font: 800 19px var(--display); color: var(--text); }
.role li em { font-style: normal; font: 500 11px var(--mono); color: var(--mute); margin-left: 4px; }
@media (max-width: 900px) {
  .tile.feature[data-id="ml"] { grid-row: auto; }
  .mixer { grid-template-columns: 1fr; padding: 16px; }
  .ml-hero, .fur-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- grid rows ---------- */
.main { container-type: inline-size; }
.grid { grid-auto-flow: row dense; grid-auto-rows: calc((100cqw - 56px) / 5 * 1.25); }
@media (max-width: 1279px) { .grid { grid-auto-rows: calc((100cqw - 42px) / 4 * 1.25); } }
@media (max-width: 1023px) { .grid { grid-auto-rows: calc((100cqw - 28px) / 3 * 1.25); } }
@media (max-width: 900px) { .grid { grid-auto-rows: auto; } }
.case-hero .note { font-size: 13px; line-height: 1.5; max-width: 72ch; padding: 10px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); color: var(--mute); }

/* ---------- Punchline Delta: problems and fixes ---------- */
.hard { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.hard-card { padding: 22px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.hard-k { font: 500 12px var(--mono); color: var(--accent); }
.hard-card b { font: 700 20px/1.2 var(--display); letter-spacing: -.01em; }
.hard-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--mute); }
.hard-card p em { font-style: normal; font: 500 11px var(--mono); padding: 2px 7px; border-radius: 5px; margin-right: 8px; background: var(--bg-3); color: var(--text); }
.hard-card .hard-f { color: #d6d4cf; }
.hard-card .hard-f em { background: var(--accent); color: var(--bg); }

/* ---------- intro background loop ---------- */
.intro { isolation: isolate; }
.bgloop { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, transparent 40%, #000 64%); mask-image: linear-gradient(to bottom, transparent 40%, #000 64%); }

/* ---------- Punchline Delta: art passes ---------- */
.art-intro { margin: -10px 0 0; max-width: 72ch; color: var(--mute); font-size: 15px; line-height: 1.6; }
.art-pass { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.art-head { display: flex; align-items: baseline; gap: 12px; }
.art-head b { font: 700 20px/1.2 var(--display); letter-spacing: -.01em; }
.art-head span { font: 500 12px var(--mono); color: var(--mute); }
.art-steps { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent; }
.art-step { flex: none; margin: 0; width: min-content; display: flex; flex-direction: column; gap: 10px; scroll-snap-align: start; }
.art-imgs { display: flex; gap: 8px; }
.art-imgs img { height: 280px; width: auto; max-width: none; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.art-step figcaption { display: flex; flex-direction: column; gap: 4px; min-width: 250px; }
.art-step figcaption b { font: 500 12px var(--mono); color: var(--accent); }
.art-step figcaption span { font-size: 14px; line-height: 1.5; color: var(--mute); }
@media (max-width: 900px) { .art-imgs img { height: 190px; } }

/* feature cards in the intro fan: text appears as they land */
.fc.feature .ftext { opacity: var(--capo, 0); }

/* About: LinkedIn role notes and skills */
.xp .xd { grid-column: 2; margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--mute); }
.about-side p.skills { font: 500 13px/1.6 var(--mono); color: var(--mute); }

/* Monkey Legends: sources line */
.src { margin: -6px 0 0; font: 500 12px/1.6 var(--mono); color: var(--mute); }
.src a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Monkey Legends: skills chips */
.skills-row { display: flex; flex-wrap: wrap; gap: 8px; }
.skills-row span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); font: 500 12px var(--mono); color: var(--text); }

/* ---------- phone navigation ---------- */
.mnav { display: none; }
@media (max-width: 900px) {
  /* The side glow bled 75px past the screen, which widened the page and pushed overlay close buttons off-screen. */
  .side { overflow: hidden; overflow: clip; }
  body { overflow-x: hidden; overflow-x: clip; }
  .main-head { margin: 0 -14px; padding: 10px 14px; flex-wrap: nowrap; justify-content: center; }
  .main-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .filters { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; padding: 9px 13px; font-size: 13px; white-space: nowrap; }
  .about { scroll-margin-top: 70px; }
  .foot { padding-bottom: 96px; }
  .mnav { display: flex; align-items: center; gap: 2px; position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 40; padding: 5px; border-radius: 999px; background: rgba(22, 24, 29, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); transform: translate(-50%, calc(100% + 30px)); transition: transform .45s var(--out); }
  .mnav.show { transform: translate(-50%, 0); }
  .mnav a, .mnav button { display: grid; place-items: center; min-height: 40px; padding: 0 15px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--mute); white-space: nowrap; transition: background .25s, color .2s; }
  .mnav .on { background: var(--text); color: var(--bg); }
  .mnav .mnav-top { width: 40px; padding: 0; font-size: 16px; color: var(--text); }
  .case-x { top: 12px; right: 12px; background: rgba(30, 32, 38, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .lb { padding: 14px 14px 16px; }
  .lb-top h3 { font-size: 22px; }
  .lb-stage img, .lb-stage video { max-height: calc(100svh - 300px); }
  .lb-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .lb-bar p { font-size: 14px; max-height: 22svh; overflow-y: auto; }
  .lb-nav { justify-content: space-between; }
  .lb-nav button { width: 48px; height: 48px; }
  .lb-thumbs button { width: 64px; height: 44px; }
}

/* ---------- phone card deck ---------- */
.deck-dots { display: none; }
@media (max-width: 900px) {
  .strip { --cw: min(58vw, 240px); display: block; position: relative; height: calc(var(--cw) * 1.25 + 26px); margin: 0; padding: 0; overflow: visible; scroll-snap-type: none; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
  .strip button { position: absolute; top: 0; left: 50%; width: var(--cw); max-width: none; margin-left: calc(var(--cw) / -2); aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: var(--bg-3); box-shadow: 0 18px 44px rgba(0, 0, 0, .5); transform-origin: 50% 90%; transition: transform .55s var(--out), opacity .45s var(--out); will-change: transform; -webkit-tap-highlight-color: transparent; }
  .strip button.drag { transition: none; }
  .strip img { pointer-events: none; -webkit-user-drag: none; }
  .dk-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 2px; padding: 34px 14px 12px; text-align: left; background: linear-gradient(transparent, rgba(8, 9, 11, .88)); opacity: 0; transition: opacity .35s; }
  .dk-cap b { font: 700 16px/1.15 var(--display); color: var(--text); }
  .dk-cap em { font: 500 11px var(--mono); font-style: normal; color: var(--mute); }
  .strip button.front .dk-cap { opacity: 1; }
  .deck-dots { display: flex; justify-content: center; gap: 2px; margin-top: -20px; }
  .deck-dots button { width: 26px; height: 26px; display: grid; place-items: center; }
  .deck-dots button::after { content: ""; width: 7px; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .28); transition: width .35s var(--out), background .3s; }
  .deck-dots button.on::after { width: 20px; background: var(--accent); }
}

/* ---------- play badge on video tiles ---------- */
.tile .play { position: absolute; left: 50%; top: 44%; z-index: 2; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; display: grid; place-items: center; background: rgba(12, 13, 16, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .22); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); pointer-events: none; transition: opacity .3s, transform .4s var(--spring); }
.tile .play::before { content: ""; margin-left: 4px; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; }
.tile:hover .play { transform: scale(1.08); }
.tile.playing .play { opacity: 0; transform: scale(.8); }
@media (max-width: 900px) { .tile .play { width: 46px; height: 46px; margin: -23px 0 0 -23px; } .tile .play::before { border-width: 8px 0 8px 13px; } }

/* trait layers as a ranked bar list */
.role.layers h3 .lg { margin-left: auto; display: flex; align-items: center; gap: 6px; font: 500 11px var(--mono); color: var(--mute); }
.role.layers h3 .lg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.lg .k3 { background: var(--cgames); }
.lg .k2 { background: rgba(238, 236, 231, .45); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 100px 1fr 28px; align-items: center; gap: 12px; padding: 0; border-radius: 0; background: none; font-size: 14px; font-weight: 500; }
.bars .nm { white-space: nowrap; }
.bars .bar { height: 8px; border-radius: 99px; background: var(--bg-3); overflow: hidden; }
.bars .bar i { display: block; height: 100%; border-radius: inherit; background: var(--cgames); }
.bars li.t2D .bar i { background: rgba(238, 236, 231, .45); }
.bars b { font: 600 13px var(--mono); text-align: right; }

/* numbered points in the viewer description */
.lb-points { display: grid; gap: 8px; margin: 12px 0 14px; }
.lb-points span { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: baseline; color: var(--text); }
.lb-points b { font: 600 12px var(--mono); color: var(--cgames); }
@media (max-width: 900px) { .lb-bar p { max-height: 30svh; } }

/* ---------- Tennis Smash case study ---------- */
.tag.tg { background: var(--cgames); }
.tile.wide { grid-column: span 2; aspect-ratio: auto; }
.tile.wide .ftext { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 22px; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(to top, rgba(12, 13, 16, .95), rgba(12, 13, 16, .6) 60%, transparent); }
.tile.wide .ft { font: 800 30px/1 var(--display); letter-spacing: -.03em; }
.tile.wide .fs { font-size: 14px; color: var(--mute); }
.ts-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .32fr); gap: 12px; }
.ts-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; }
.ts-hero video { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; background: #000; }
.ts-gal figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ts-gal figcaption { font: 500 12px var(--mono); color: var(--mute); }
@media (max-width: 900px) {
  .tile.wide { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
  .tile.wide .ft { font-size: 26px; }
  .ts-hero { grid-template-columns: 1fr; }
  .ts-hero video { justify-self: center; width: 62%; height: auto; aspect-ratio: 9 / 16; }
}

/* ---------- case study cards: one row tall ---------- */
.tile.feature, .tile.feature[data-id="ml"] { grid-row: span 1; }
.tile.feature .stack, .fc.feature .stack { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr; }
.tile.feature .stack i:first-child, .fc.feature .stack i:first-child { grid-column: auto; }
.tile.feature[data-id="ml"] .stack, .fc.feature[data-id="ml"] .stack { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr; }
.tile.feature .ftext, .fc.feature .ftext { bottom: 0; padding: 20px 22px; background: linear-gradient(to top, rgba(12, 13, 16, .95), rgba(12, 13, 16, .6) 60%, transparent); }
.tile.feature .ft, .fc.feature .ft { font-size: 32px; }
@media (max-width: 900px) { .tile.feature, .tile.feature[data-id="ml"] { grid-row: auto; aspect-ratio: 16 / 10; } .tile.feature .ft { font-size: 26px; } }

/* wide card in the intro fan matches its grid tile */
.fc.wide .media { position: absolute; inset: 0; }
.fc.wide .ftext { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(to top, rgba(12, 13, 16, .95), rgba(12, 13, 16, .6) 60%, transparent); opacity: var(--capo, 0); }
.fc.wide .ft { font: 800 30px/1 var(--display); letter-spacing: -.03em; }
.fc.wide .fs { font-size: 14px; color: var(--mute); }

/* Tennis Smash: how new content gets in */
.ts-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: s; }
.ts-steps div { position: relative; padding: 18px 18px 18px 52px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2, rgba(255,255,255,.03)); display: flex; flex-direction: column; gap: 4px; }
.ts-steps div::before { counter-increment: s; content: counter(s); position: absolute; left: 16px; top: 16px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--mono); background: var(--cgames); color: var(--bg); }
.ts-steps b { font: 700 16px var(--display); }
.ts-steps span { font-size: 14px; color: var(--mute); }
@media (max-width: 900px) { .ts-steps { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 520px) { .ts-steps { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Synthetic dataset scene ---------- */
.tile.feature[data-id="sds"] .stack, .fc.feature[data-id="sds"] .stack { grid-template-rows: 1fr 1fr; background: #000; }
.tile.feature[data-id="sds"] .stack i:first-child, .fc.feature[data-id="sds"] .stack i:first-child { grid-column: auto; }
.tile.feature[data-id="sds"] .ftext, .fc.feature[data-id="sds"] .ftext { bottom: 0; }
#case.scene { overflow: hidden; background: var(--bg); }
#case.scene .case-in { position: absolute; inset: 0; max-width: none; margin: 0; padding: 0; display: block; }
#case.scene .case-in > * { animation: none; }
.scene-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #0c0d10; }
@media (max-width: 900px) { .scene-frame { top: 76px; height: calc(100% - 76px); } }
