/* VOUCH and the two personal sites. One stylesheet for the website pages; play.css adds the game UI. */

@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/fonts/geist.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('/assets/fonts/geist-mono.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Pixelify Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/assets/fonts/pixelify-sans.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f2f4f9;
  --surface: #fbfcfe;
  --surface-2: #e7ebf4;
  --ink: #141a2e;
  --muted: #4f5874;
  --line: #d3d9e8;
  --shadow: #c5cde0;
  --accent: #f3b33d;
  --accent-hi: #ffca5c;
  --accent-lo: #a8741a;
  --accent-ink: #291c02;
  --btn2: #dde3f0;
  --btn2-hi: #e9edf6;
  --btn2-lo: #9aa4bf;
  --online: #1f9d5c;
  --outline: #141a2e;
  --vouch: #5b54e0;
  --mizan: #16827a;
  --flows: #2f9e6a;
  --pixel: 'Pixelify Sans', 'Courier New', monospace;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --wrap: 1180px;
  --step: polygon(0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0 calc(100% - 6px));
  color-scheme: light;
}

/* Dark tokens: used when the device is dark and the visitor hasn't picked light,
   or when the visitor picked dark with the switch in the nav. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1222;
    --surface: #161a30;
    --surface-2: #1d2240;
    --ink: #eef0fa;
    --muted: #a6adca;
    --line: #2b3154;
    --shadow: #070913;
    --accent: #f5bf48;
    --accent-hi: #ffd574;
    --accent-lo: #9c6c16;
    --btn2: #2a3057;
    --btn2-hi: #343b69;
    --btn2-lo: #151931;
    --online: #4ade80;
    --outline: #070913;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1222;
  --surface: #161a30;
  --surface-2: #1d2240;
  --ink: #eef0fa;
  --muted: #a6adca;
  --line: #2b3154;
  --shadow: #070913;
  --accent: #f5bf48;
  --accent-hi: #ffd574;
  --accent-lo: #9c6c16;
  --btn2: #2a3057;
  --btn2-hi: #343b69;
  --btn2-lo: #151931;
  --online: #4ade80;
  --outline: #070913;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.skip:focus { top: 12px; }
.icon { width: 1.15em; height: 1.15em; flex: none; }
.pixelated { image-rendering: pixelated; }

/* ---------- Type ---------- */
.display { font-family: var(--pixel); font-weight: 600; letter-spacing: -0.01em; }
h1.display { font-size: clamp(42px, 6vw, 74px); line-height: 1.02; }
h2.display { font-size: clamp(32px, 4vw, 46px); line-height: 1.05; }
.lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); max-width: 58ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dot { width: 10px; height: 10px; background: var(--online); box-shadow: 0 0 0 3px color-mix(in srgb, var(--online) 25%, transparent); }
@media (prefers-reduced-motion: no-preference) { .dot { animation: blink 2.4s steps(2, jump-none) infinite; } }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- Pixel buttons ---------- */
.btn {
  --face: var(--accent); --face-hi: var(--accent-hi); --depth: var(--accent-lo); --label: var(--accent-ink);
  position: relative; display: inline-block; padding: 0 0 6px; border: 0; background: none;
  font: inherit; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn.alt { --face: var(--btn2); --face-hi: var(--btn2-hi); --depth: var(--btn2-lo); --label: var(--ink); }
.btn .depth { position: absolute; inset: 6px 0 0; background: var(--depth); clip-path: var(--step); }
.btn .face {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 20px 13px;
  background: var(--face); color: var(--label); clip-path: var(--step);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  font-family: var(--pixel); font-weight: 600; font-size: 19px; line-height: 1.15; white-space: nowrap;
  transition: transform 80ms steps(2), background-color 80ms steps(2);
}
.btn:hover .face { background: var(--face-hi); transform: translateY(-2px); }
.btn:active .face { transform: translateY(6px); box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.12); }
.btn.big .face { padding: 18px 28px 19px; font-size: clamp(22px, 2.4vw, 28px); gap: 14px; }
.btn.small .face { padding: 8px 14px 9px; font-size: 16px; gap: 8px; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
@media (prefers-reduced-motion: reduce) { .btn .face { transition: none; } }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: center; }

.chip { display: inline-block; padding: 3px 9px; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.textlink { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--pixel); font-weight: 600; font-size: 21px; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 45px; height: 20px; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-end { display: flex; align-items: center; gap: 12px; }
.theme-toggle, .icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; cursor: pointer;
  background: var(--surface-2); color: var(--ink); border: 2px solid var(--line);
}
.theme-toggle:hover, .icon-btn:hover { border-color: var(--ink); }
.theme-toggle:active, .icon-btn:active { transform: translateY(2px); }
.theme-toggle svg, .icon-btn svg { width: 20px; height: 20px; }
@media (max-width: 760px) { .nav-links { display: none; } .nav.solo .brand span { display: none; } }
@media (max-width: 480px) { .hide-sm { display: none; } }

/* ---------- Reveal on scroll (content is visible without JS) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--i, 0) * 70ms); }
  .js .reveal.in { opacity: 1; transform: none; }
}

/* ---------- Sections ---------- */
section { scroll-margin-top: 76px; }
.section { padding-block: clamp(64px, 9vw, 112px); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 44px); }

/* Hero */
.hero { padding-block: clamp(36px, 6vw, 80px) clamp(48px, 7vw, 88px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-copy { display: grid; gap: 22px; justify-items: start; }
.hero-copy .btn-row { margin-top: 6px; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }

.screen-frame {
  position: relative; display: block; width: 100%; padding: 10px; text-decoration: none;
  background: var(--outline); clip-path: var(--step); box-shadow: 0 0 0 0 transparent;
}
.screen-frame .viewport { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #1f5230; }
.screen-frame canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); image-rendering: pixelated; }
.screen-frame .play-tag {
  position: absolute; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: #fff8e1; color: #1c1a2a; font-family: var(--pixel); font-weight: 600; font-size: 16px;
  box-shadow: 0 0 0 3px #1c1a2a;
}
.screen-frame:hover .play-tag { background: var(--accent-hi); }

/* Live scenery on the home page (see assets/js/scenery.js) */
.scenery-sky { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.has-scene { position: relative; overflow: hidden; isolation: isolate; display: grid; }
.has-scene > .wrap { position: relative; z-index: 3; width: 100%; }
.hero.has-scene { min-height: clamp(620px, 90svh, 780px); align-content: center; }
/* case studies: the title sits high, the village fills the space below it */
.page-head.has-scene { min-height: clamp(520px, 70svh, 640px); align-content: start; padding-top: clamp(48px, 7vw, 88px); }
.hero-scene { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-scene:not([data-night]) { background: linear-gradient(#6fb6f0 0%, #9ccff5 40%, #d6ebfa 72%); }
.hero-scene .scene-layer { position: absolute; inset: 0 0 34% 0; background-repeat: repeat-x; background-position: 0 100%; image-rendering: pixelated; will-change: transform; }
.hero-scene .scene-layer.clouds { animation: scene-drift 110s linear infinite; }
@keyframes scene-drift { to { background-position-x: calc(var(--tw, 640) * -1px); } }
.hero-scene .scene-orb { position: absolute; right: 9%; top: 10%; width: 54px; height: 54px; image-rendering: pixelated; filter: drop-shadow(0 0 16px rgba(200, 205, 255, 0.3)); }
.hero-scene .scene-village {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 36px); mask-image: linear-gradient(to bottom, transparent 0, #000 36px);
}
.hero-scene .scene-village canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); image-rendering: pixelated; }
.hero-scene[data-night] .scene-village canvas { filter: brightness(0.62) saturate(0.85); }
.hero-scene .scene-front { position: absolute; inset: 0; z-index: 1; background-repeat: repeat-x; background-position: 0 100%; image-rendering: pixelated; }
.hero-scene .scene-fade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 88%, transparent) 0%, color-mix(in srgb, var(--bg) 62%, transparent) 36%, transparent 68%); }
@media (max-width: 900px) {
  .has-scene { min-height: 0; padding-bottom: 320px; }
  .page-head.has-scene { min-height: 0; padding-bottom: 300px; }
  /* a fixed-height village, so a tall block of text never runs into it */
  .hero-scene .scene-village { height: 270px; }
  .hero-scene .scene-layer { bottom: 230px; }
  /* on phones the text spans the full width, so darken from the top down instead */
  .hero-scene .scene-fade { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 78%, transparent) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 50%, transparent 66%); }
}
@media (prefers-reduced-motion: reduce) { .hero-scene .scene-layer.clouds { animation: none; } }

/* Stack strip */
.stack { border-block: 1px solid var(--line); padding-block: 22px; }
.stack ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; }
.stack li { color: var(--muted); }
.stack svg { width: 30px; height: 30px; display: block; }
@media (max-width: 640px) { .stack ul { justify-content: center; } .stack svg { width: 26px; height: 26px; } }

/* Work bento */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.work { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow); }
.work.vouch { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-rows: auto; }
.work.mizan { grid-column: 1 / span 6; }
.work.flows { grid-column: 7 / span 6; }
.work .shot { overflow: hidden; border-bottom: 2px solid var(--outline); padding: 16px 16px 0; display: flex; align-items: flex-end; }
.work.vouch .shot { border-bottom: 0; border-right: 2px solid var(--outline); padding: 22px 22px 0; }
.work.vouch .shot { background: color-mix(in srgb, var(--vouch) 30%, var(--surface)); }
.work.mizan .shot { background: color-mix(in srgb, var(--mizan) 30%, var(--surface)); }
.work.flows .shot { background: color-mix(in srgb, var(--flows) 30%, var(--surface)); }
.work .shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border: 2px solid var(--outline); border-bottom: 0; }
.work .body { display: grid; gap: 12px; align-content: start; padding: 20px 22px 22px; }
.work.vouch .body { align-content: center; padding: clamp(22px, 3vw, 36px); }
.work h3 { font-family: var(--pixel); font-weight: 600; font-size: 28px; line-height: 1.1; }
.work.vouch h3 { font-size: clamp(32px, 3.4vw, 40px); }
.work p { color: var(--muted); }
.work .links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 4px; }
.work .note { font-size: 14px; color: var(--muted); }
.work .tag { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.work.mizan .shot { padding: 0; }
.work.mizan .shot img { border: 0; }
@media (max-width: 900px) {
  .work.vouch { grid-template-columns: minmax(0, 1fr); }
  .work.vouch .shot { border-right: 0; border-bottom: 2px solid var(--outline); padding: 16px 16px 0; }
  .work.mizan, .work.flows { grid-column: 1 / -1; }
}

/* Game banner */
.game-banner {
  margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch;
  background: var(--outline); color: #f4f2ff; border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow);
}
.game-banner .banner-copy { display: grid; gap: 18px; align-content: center; justify-items: start; padding: clamp(24px, 4vw, 44px); background: #1b1f3a; }
.game-banner h3 { font-family: var(--pixel); font-weight: 600; font-size: clamp(26px, 3vw, 36px); line-height: 1.08; }
.game-banner p { color: #c3c8e6; max-width: 44ch; }
.game-banner .banner-copy a:not(.btn) { color: #f4f2ff; }
.game-banner .viewport { position: relative; min-height: 260px; overflow: hidden; background: #1f5230; }
.game-banner canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); image-rendering: pixelated; }
@media (max-width: 800px) { .game-banner { grid-template-columns: minmax(0, 1fr); } .game-banner .viewport { min-height: 220px; order: -1; } }

/* Team */
.team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); }
.person { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; }
.person .avatar { width: 128px; padding: 14px 16px 0; background: linear-gradient(#8fd0ff 0 62%, #5dab56 62%); border: 2px solid var(--outline); box-shadow: 4px 4px 0 var(--shadow); }
.person .avatar canvas { width: 96px; height: 150px; image-rendering: pixelated; }
.person .info { display: grid; gap: 8px; }
.person h3 { font-size: 22px; font-weight: 600; }
.person .role { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.person p { color: var(--muted); }
.person .textlink { justify-self: start; margin-top: 4px; }
.edu { margin-top: 36px; display: flex; gap: 10px; align-items: center; color: var(--muted); }
@media (max-width: 860px) { .team { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .person { grid-template-columns: minmax(0, 1fr); } }

/* Services */
.services { display: grid; }
.service { display: grid; grid-template-columns: 56px minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 20px 28px; padding-block: 28px; border-top: 2px solid var(--line); align-items: start; }
.service:last-child { border-bottom: 2px solid var(--line); }
.service .glyph { width: 48px; height: 48px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); clip-path: var(--step); }
.service .glyph svg { width: 26px; height: 26px; }
.service h3 { font-family: var(--pixel); font-weight: 600; font-size: 26px; line-height: 1.15; }
.service .text { display: grid; gap: 10px; color: var(--muted); }
.service .proof { font-size: 15px; color: var(--ink); }
@media (max-width: 760px) { .service { grid-template-columns: 48px minmax(0, 1fr); } .service .text { grid-column: 2; } }

/* Remote facts */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fact { display: grid; gap: 12px; align-content: start; padding: 22px; background: var(--surface); border: 2px solid var(--line); }
.fact svg { width: 28px; height: 28px; color: var(--ink); }
.fact h3 { font-size: 18px; font-weight: 600; }
.fact p { color: var(--muted); font-size: 16px; }
@media (max-width: 980px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* Contact */
.contact { background: var(--surface-2); border-block: 2px solid var(--line); }
.contact-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.contact-card { display: grid; gap: 16px; padding: 26px; background: var(--surface); border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow); }
.contact-card header { display: flex; gap: 14px; align-items: center; }
.contact-card header canvas { width: 40px; height: 40px; image-rendering: pixelated; }
.contact-card h3 { font-size: 21px; font-weight: 600; }
.contact-card .addr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--mono); font-size: 14.5px; color: var(--muted); word-break: break-all; }
.copy { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: 500 13px var(--sans); cursor: pointer; }
.copy:hover { border-color: var(--ink); }
/* the company inbox spans the full row, above the two of us */
.contact-card.company { grid-column: 1 / -1; }
.contact-card header canvas[data-heads] { width: 90px; height: 40px; }
@media (min-width: 761px) { .contact-card.company { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 32px; } }
@media (max-width: 760px) { .contact-cards { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.footer { padding-block: 36px 48px; color: var(--muted); font-size: 15px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* ---------- Case studies page ---------- */
.page-head { padding-block: clamp(40px, 6vw, 72px) 24px; }
.page-head .wrap { display: grid; gap: 18px; justify-items: start; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; }
.jump a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 2px solid var(--outline); background: var(--surface); text-decoration: none; font-weight: 600; }
.jump a:hover { background: var(--surface-2); }
.jump i { width: 12px; height: 12px; display: inline-block; }

.case { padding-block: clamp(48px, 7vw, 88px); border-top: 2px solid var(--line); }
/* the live sky shows through faintly; long text stays easy to read */
.case { background: color-mix(in srgb, var(--bg) 86%, transparent); }
.case .wrap { display: grid; gap: 32px; }
.case-head { display: grid; gap: 14px; }
.case-head .tag { display: inline-flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.case-head .tag i { width: 12px; height: 12px; display: inline-block; }
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; border: 2px solid var(--outline); background: var(--surface); }
.meta div { padding: 16px 18px; border-left: 2px solid var(--line); }
.meta div:first-child { border-left: 0; }
.meta dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.meta dd { margin: 0; font-size: 15.5px; }
@media (max-width: 860px) { .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } .meta div:nth-child(3) { border-left: 0; } .meta div:nth-child(n + 3) { border-top: 2px solid var(--line); } }
@media (max-width: 480px) { .meta { grid-template-columns: minmax(0, 1fr); } .meta div { border-left: 0; } .meta div + div { border-top: 2px solid var(--line); } }

.case-video { margin: 0; border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow); background: #000; }
.case-video video { width: 100%; aspect-ratio: 16 / 9; }
.case-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 48px; }
.case-body section { display: grid; gap: 10px; align-content: start; }
.case-body h3 { font-family: var(--pixel); font-weight: 600; font-size: 24px; }
.case-body p, .case-body li { color: var(--muted); }
.case-body ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.case-body li::marker { color: var(--accent-lo); }
@media (max-width: 820px) { .case-body { grid-template-columns: minmax(0, 1fr); } }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.shots figure { margin: 0; display: grid; gap: 8px; align-content: start; }
.shots button { padding: 0; border: 2px solid var(--outline); background: var(--surface-2); cursor: zoom-in; }
.shots img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.shots figcaption { font-size: 14px; color: var(--muted); }
.case-links { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; }

/* Lightbox */
.lightbox { width: min(1200px, 96vw); max-height: 94vh; padding: 0; border: 2px solid var(--outline); background: var(--surface); color: var(--ink); }
.lightbox::backdrop { background: rgba(8, 10, 22, 0.78); }
.lightbox figure { margin: 0; display: grid; }
.lightbox img { width: 100%; max-height: calc(94vh - 72px); object-fit: contain; background: var(--surface-2); }
.lightbox figcaption { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 15px; color: var(--muted); }
.lightbox .nav-btns { display: flex; gap: 8px; }
.lightbox button { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--outline); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.lightbox button svg { width: 20px; height: 20px; }

/* ---------- Personal sites (site/panda, site/sayeh) ---------- */
/* Each person's site takes the colour of their hoodie as its one accent, in both themes. */
html:root[data-person="panda"] { --accent: #d9483b; --accent-hi: #ea5c4e; --accent-lo: #8f2a22; --accent-ink: #ffffff; }
html:root[data-person="sayeh"] { --accent: #3f5fd8; --accent-hi: #5675ea; --accent-lo: #283c92; --accent-ink: #ffffff; }
.brand-face { width: 32px; height: 32px; }
.title-line { font-family: var(--mono); font-size: clamp(14px, 1.3vw, 16px); letter-spacing: 0.03em; }
.title-line span { white-space: nowrap; }
/* a wider text column, so the name fits on one line */
@media (min-width: 901px) { .hero.solo .wrap { grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.5fr); } .hero.solo h1 { white-space: nowrap; } }
@media (max-width: 1120px) { .nav.solo .brand span { display: none; } }

/* Character sheet */
.sheet { display: grid; grid-template-columns: minmax(180px, 250px) minmax(0, 1fr); background: var(--surface); border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow); }
.sheet-portrait { margin: 0; display: grid; justify-items: center; align-content: end; padding: 32px 20px 0; background: linear-gradient(#8fd0ff 0 66%, #5dab56 66%); border-right: 2px solid var(--outline); }
.sheet-portrait canvas { width: 128px; height: 200px; image-rendering: pixelated; }
.sheet-portrait figcaption { margin: 12px 0 18px; padding: 4px 12px; background: #1b1f3a; color: #f4f2ff; font-family: var(--pixel); font-weight: 600; font-size: 18px; }
.sheet dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.sheet dl div { padding: 18px 22px; border-bottom: 2px solid var(--line); }
.sheet dl div:nth-child(odd):not(.wide) { border-right: 2px solid var(--line); }
.sheet dl .wide { grid-column: 1 / -1; border-bottom: 0; }
.sheet dt { margin-bottom: 4px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sheet dd { margin: 0; font-size: 16.5px; }
@media (max-width: 760px) {
  .sheet { grid-template-columns: minmax(0, 1fr); }
  .sheet-portrait { border-right: 0; border-bottom: 2px solid var(--outline); }
  .sheet dl { grid-template-columns: minmax(0, 1fr); }
  .sheet dl div:nth-child(odd):not(.wide) { border-right: 0; }
}

/* Experience */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline > li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 32px; padding-block: 26px; border-top: 2px solid var(--line); }
.timeline > li:last-child { border-bottom: 2px solid var(--line); }
.timeline .when { padding-top: 5px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.timeline .when b { display: inline-block; padding: 2px 8px; background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.timeline .what { display: grid; gap: 6px; }
.timeline h3 { font-family: var(--pixel); font-weight: 600; font-size: 26px; line-height: 1.15; }
.timeline .where { color: var(--muted); }
.timeline ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.timeline ul li::marker { color: var(--accent); }
@media (max-width: 700px) { .timeline > li { grid-template-columns: minmax(0, 1fr); } }

/* Projects on a personal site */
.proj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.proj { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow); }
.proj .shot { display: flex; align-items: flex-end; padding: 14px 14px 0; overflow: hidden; border-bottom: 2px solid var(--outline); background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
.proj .shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border: 2px solid var(--outline); border-bottom: 0; }
.proj[data-p="vouch"] { --c: var(--vouch); }
.proj[data-p="mizan"] { --c: var(--mizan); }
.proj[data-p="flows"] { --c: var(--flows); }
.proj[data-p="mizan"] .shot { padding: 0; }
.proj[data-p="mizan"] .shot img { border: 0; }
.proj .body { display: grid; gap: 10px; align-content: start; padding: 18px 20px 20px; }
.proj h3 { font-family: var(--pixel); font-weight: 600; font-size: 26px; line-height: 1.1; }
.proj p { color: var(--muted); font-size: 16px; }
.proj .part { color: var(--ink); font-size: 15px; }
.proj .links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 4px; }
@media (max-width: 980px) { .proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .proj-grid { grid-template-columns: minmax(0, 1fr); } }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.skill-group { display: grid; gap: 12px; align-content: start; padding: 20px 22px; background: var(--surface); border: 2px solid var(--line); }
.skill-group h3 { font-size: 17px; font-weight: 600; }
@media (max-width: 900px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .skills { grid-template-columns: minmax(0, 1fr); } }

.cv-note { margin-top: 28px; }
.textbtn { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--ink); font: 600 16px var(--sans); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.textbtn:hover { text-decoration-color: currentColor; }
.print-only { display: none; }

/* ---------- Print: a personal site prints as a plain CV ---------- */
@media print {
  @page { margin: 14mm 16mm; }
  /* :not(#print) only raises specificity, so these beat the dark theme and the accents */
  :root:not(#print) { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --muted: #333; --line: #c8c8c8; --shadow: transparent; --outline: #000; color-scheme: light; }
  body { font-size: 11pt; line-height: 1.45; }
  .nav, .skip, .stack, .scenery-sky, .hero-scene, .btn-row, .no-print, .footer nav, .proj .shot, .proj .links { display: none !important; }
  .print-only { display: block; }
  .has-scene { min-height: 0 !important; padding: 0 0 8px !important; }
  .hero .wrap { display: block; }
  .section { padding-block: 10px; }
  .section-head { margin-bottom: 10px; gap: 4px; }
  .section-head .lead { display: none; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  h1.display { font-size: 30pt; }
  h2.display { font-size: 18pt; }
  .lead { font-size: 11.5pt; max-width: none; }
  .sheet, .proj, .contact-card, .skill-group { box-shadow: none; break-inside: avoid; }
  .sheet { grid-template-columns: 130px minmax(0, 1fr); }
  .sheet-portrait { padding: 12px 10px 0; }
  .sheet-portrait canvas { width: 64px; height: 100px; }
  .timeline > li { padding-block: 10px; break-inside: avoid; }
  .timeline h3, .proj h3 { font-size: 15pt; }
  .proj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .skills { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .skill-group { padding: 10px 12px; }
  .contact { background: none; border: 0; }
  .contact-cards { grid-template-columns: minmax(0, 1fr); }
  .contact-card.company { display: none; }
  a { text-decoration: none; }
}
