/* ==========================================================================
   portfolio-v2-merged — merge of Design1 (icyrelic-v1) + Design2 (portfolio)
   Design tokens & component library
   Dark by default, cyan accent for analyst work, amber for games.
   ========================================================================== */

:root {
  /* --- color tokens --- */
  --bg: #0F1115;
  --surface: #171A21;
  --surface-2: #1D2029;
  --border: #2A2F3A;
  --border-2: #383D49;
  --text: #E6E8EB;
  --text-mute: #A1A9B6;
  --text-faint: #6B7280;
  --accent: #5CC8FF;
  --accent-2: #2EA1E6;
  --accent-soft: rgba(92, 200, 255, 0.12);
  --games: #F5B14C;
  --games-2: #D6892A;
  --games-soft: rgba(245, 177, 76, 0.14);
  --success: #34D399;
  --danger: #FF8A8A;
  --warn: #F5B14C;
  --code-bg: #0B0D11;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  /* --- type --- */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* --- shape --- */
  /* softer than Design1's pill, tighter than Design2's 8px; sits in between for a "rounded rectangle" feel */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-card: 14px;
  --radius-button: 10px;

  /* --- spacing --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --section-gap: 96px;
  --container: 1200px;

  /* --- type scale --- */
  --h1: clamp(2.5rem, 1.6rem + 3vw, 3.75rem);
  --h2: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --h3: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --body: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
}

html[data-theme="light"] {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-2: #F3F4F6;
  --border: #E5E7EB;
  --border-2: #C7C8D0;
  --text: #111827;
  --text-mute: #4B5563;
  --text-faint: #6B7280;
  --accent: #0369A1;
  --accent-2: #0284C7;
  --accent-soft: rgba(3, 105, 161, 0.08);
  --games: #B45309;
  --games-2: #92400E;
  --games-soft: rgba(180, 83, 9, 0.08);
  --success: #047857;
  --code-bg: #F3F4F6;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --surface-2: #F3F4F6;
    --border: #E5E7EB;
    --border-2: #C7C8D0;
    --text: #111827;
    --text-mute: #4B5563;
    --text-faint: #6B7280;
    --accent: #0369A1;
    --accent-2: #0284C7;
    --accent-soft: rgba(3, 105, 161, 0.08);
    --games: #B45309;
    --games-2: #92400E;
    --games-soft: rgba(180, 83, 9, 0.08);
    --success: #047857;
    --code-bg: #F3F4F6;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark light; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.2s ease, color 0.2s ease;
}
/* sticky footer: on pages shorter than the window, main grows so the footer
   sits at the bottom (the admin has its own shell) */
body:not(.admin-body) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:not(.admin-body) > main { flex: 1 0 auto; }
img, picture { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; color: var(--text); }
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
p { color: var(--text-mute); }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-mute); }
.faint { color: var(--text-faint); }
.prose { max-width: 72ch; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow.games { color: var(--games); }

.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-5); }
.section { padding: var(--space-7) 0; }
@media (min-width: 768px) { .section { padding: var(--section-gap) 0; } }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.section-head h2 { margin: 0; }
.section-sub { color: var(--text-mute); font-size: 0.95rem; max-width: 580px; margin-top: var(--space-2); }

/* ==========================================================================
   Header / nav
   - Design1 base, with Home added, right-aligned nav
   - Theme toggle in a settings-cog pull-out panel on the right edge
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  height: 72px;
  gap: var(--space-4);
}
.wordmark { display: flex; align-items: center; gap: var(--space-3); font-weight: 700; font-size: 1.05rem; color: var(--text); }
.wordmark .mark { width: 28px; height: 28px; border-radius: 8px; background: #1e1b4f url('images/Avatar2.jpg') center / cover no-repeat; display: inline-block; }
.wordmark .handle { color: var(--text-mute); font-weight: 400; font-family: var(--font-mono); font-size: 0.78rem; margin-left: 2px; }

.nav-spacer { flex: 1; }
.nav-links { display: none; align-items: center; gap: var(--space-2); }
@media (min-width: 860px) { .nav-links { display: flex; margin-left: auto; } }
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-mute);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a[aria-current="page"] { color: var(--text); position: relative; }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.menu-toggle {
  display: inline-flex;
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
}
@media (min-width: 860px) { .menu-toggle { display: none; } }
.mobile-nav { display: none; border-top: 1px solid var(--border); background: var(--bg); }
.mobile-nav.open { display: block; }
.mobile-nav .container { display: flex; flex-direction: column; padding: var(--space-3) var(--space-5); gap: var(--space-2); height: auto; }
.mobile-nav a { padding: var(--space-3) 0; font-weight: 600; border-bottom: 1px solid var(--border); color: var(--text-mute); }
.mobile-nav a[aria-current="page"] { color: var(--text); }

/* theme toggle button: give any button data-theme-toggle (app.js) */
.theme-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 6px;
  width: 40px; height: 40px;
  background: transparent;
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }

/* a11y */
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

/* ==========================================================================
   Buttons — rounded rectangle (between Design1's pill and Design2's 8px)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  min-height: 44px;
  border-radius: var(--radius-button);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #051018; }
.btn-primary:hover { background: var(--accent-2); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-secondary:hover { background: var(--surface); border-color: var(--accent); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-mute); padding: 8px 12px; }
.btn-ghost:hover { color: var(--text); }
.btn-games { background: var(--games); color: #2A1700; }
.btn-games:hover { background: var(--games-2); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* square icon buttons */
.icon-btn {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--surface);
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn .icon { width: 18px; height: 18px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: var(--space-8) 0 var(--space-7); }
.hero-top { display: flex; gap: var(--space-5); align-items: stretch; flex-wrap: wrap; margin-bottom: var(--space-4); }
/* the avatar is as tall as the name + tagline block: square, stretched to its height;
   text-box trims the empty space above the name's capitals and below the tagline */
.avatar-mark {
  height: auto; min-height: 88px; aspect-ratio: 1;
  border-radius: 20px;
  background: #1e1b4f url('images/Avatar2.jpg') center / cover no-repeat;
  flex-shrink: 0;
}
.hero h1 { margin-bottom: var(--space-3); letter-spacing: -0.035em; }
.hero .positioning { font-size: 1.2rem; color: var(--text-mute); max-width: 60ch; margin-bottom: var(--space-3); }
.hero-top h1 { line-height: 1.05; text-box: trim-start cap alphabetic; }
.hero-top .positioning { margin-bottom: 0; text-box: trim-end cap alphabetic; }
.hero .role-line { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); margin-bottom: var(--space-3); }
.hero .prose { margin-bottom: var(--space-5); }

/* ==========================================================================
   Featured Case Studies — MERGE
   Design2 structure (cat tag + title + summary + metric + tags) +
   Design1's edge-to-edge full-bleed top image
   ========================================================================== */
.study-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 720px) { .study-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .study-grid { grid-template-columns: 1fr 1fr 1fr; } }

.study-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s, transform 0.18s;
  position: relative;
  text-align: left;
  color: inherit;
}
.study-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.study-card .cover-bleed {
  aspect-ratio: 16/9;
  background: var(--code-bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.study-card .cover-bleed::before {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.3;
}
/* the grid is only a backdrop for cards without a cover image */
.study-card .cover-bleed.has-image::before { content: none; }
.study-card .cover-bleed .label {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  padding: 8px;
}
.study-card .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.study-card .cat-tag {
  align-self: flex-start;
  display: inline-block;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.study-card h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.study-card .summary { color: var(--text-mute); font-size: 0.92rem; line-height: 1.5; }
.study-card .separator { border-top: 1px dashed var(--border); margin: 4px 0; }
.study-card .metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}
.study-card .metric .l { color: var(--text-mute); font-size: 0.78rem; font-weight: 500; }
.study-card .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.study-card .link-cover { position: absolute; inset: 0; z-index: 1; }
.study-card .card-type { position: absolute; top: 10px; left: 10px; padding: 2px 7px; border-radius: 4px; background: color-mix(in srgb, var(--code-bg) 85%, transparent); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.study-card .card-type.is-project { color: var(--text-mute); }
.study-card .card-type.is-dashboard { color: var(--success); }

/* Work page: type filter above the category chips */
.work-types { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-bottom: var(--space-3); padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.work-type { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: calc(var(--radius-md) - 3px); font-size: 0.9rem; font-weight: 500; color: var(--text-mute); transition: background 0.15s, color 0.15s; }
.work-type:hover { color: var(--text); }
.work-type[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.work-type .count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.work-type[aria-pressed="true"] .count { color: inherit; }
.work-empty { margin: var(--space-4) 0; color: var(--text-mute); }

/* ---------- Filter dropdowns (filter-dropdown.js) ----------
   Shared by the admin list toolbars and the public Work page.
   34px triggers · 280px popover · radius 10 / 12. */
.fd { position: relative; display: inline-flex; align-items: stretch; }
.fd[hidden] { display: none; }
.fd-icon { flex-shrink: 0; }
.fd-trigger { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 10px; background: transparent; color: var(--text-mute); font: inherit; font-size: 0.86rem; white-space: nowrap; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.fd-trigger:hover, .fd.is-open > .fd-trigger { background: var(--surface-2); border-color: var(--text-faint); color: var(--text); }
.fd-trigger:focus-visible, .fd-x:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.fd-chev { width: 14px; height: 14px; opacity: 0.8; transition: transform 0.15s; }
.fd.is-open .fd-chev { transform: rotate(180deg); }
/* active chip: "Status: Published, Draft [2] | ×" */
.fd.is-active > .fd-trigger { padding-right: 10px; border-color: color-mix(in srgb, var(--accent) 45%, transparent); border-right: 0; border-radius: 10px 0 0 10px; background: var(--accent-soft); color: var(--accent); }
.fd.is-active > .fd-trigger:hover, .fd.is-active.is-open > .fd-trigger { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.fd-k { color: var(--accent); }
.fd-v { max-width: 240px; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 600; }
.fd-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px; background: var(--accent); color: var(--bg); font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; }
.fd-x { position: relative; display: inline-grid; place-items: center; width: 30px; height: 34px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-left: 0; border-radius: 0 10px 10px 0; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.fd-x::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: color-mix(in srgb, var(--accent) 40%, transparent); }
.fd-x:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.fd-add > .fd-trigger { border-style: dashed; }

/* popover */
.fd-pop { position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; display: flex; flex-direction: column; width: 280px; max-width: calc(100vw - 32px); border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); color: var(--text); font-size: 0.88rem; text-align: left; overflow: hidden; }
.fd-pop[hidden] { display: none; }
.fd-pop.is-right { left: auto; right: 0; }
.fd-pop.is-narrow { width: 268px; }
.fd-pop [hidden] { display: none !important; }
.fd-search { position: relative; display: flex; align-items: center; gap: 8px; margin: 10px; padding: 0 8px 0 10px; height: 36px; border: 1px solid var(--accent); border-radius: 8px; background: var(--bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text-mute); }
.fd-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.88rem; outline: none; box-shadow: none; }
.fd-search input::placeholder { color: var(--text-faint); }
.fd-pop kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid var(--border-2); border-radius: 4px; background: transparent; font-family: var(--font-mono); font-size: 0.66rem; line-height: 1; color: var(--text-mute); }
.fd-title { padding: 12px 14px 6px; font-size: 0.84rem; color: var(--text-mute); }
.fd-body { max-height: 300px; overflow-y: auto; padding: 0 6px 6px; border-top: 1px solid var(--border); outline: none; }
.fd-title + .fd-body { border-top: 0; }
.fd-group + .fd-group { margin-top: 2px; border-top: 1px solid var(--border); }
.fd-head { display: flex; justify-content: space-between; padding: 12px 8px 6px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.fd-opt, .fd-create { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; }
.fd-opt.is-active, .fd-create.is-active { background: var(--surface-2); border-color: var(--border-2); }
.fd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.fd-label mark { padding: 0 1px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); font-weight: 600; }
.fd-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.fd-opt.is-zero .fd-label, .fd-opt.is-zero .fd-count { color: var(--text-faint); }
.fd-box { display: inline-grid; place-items: center; flex-shrink: 0; width: 16px; height: 16px; border: 1.5px solid var(--border-2); border-radius: 4px; color: transparent; }
.fd-opt[aria-selected="true"] .fd-box { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.fd-box .fd-icon { stroke-width: 3; }
.fd-radio { flex-shrink: 0; width: 16px; height: 16px; border: 1.5px solid var(--border-2); border-radius: 50%; }
.fd-opt[aria-selected="true"] .fd-radio { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--accent); }
.fd-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.fd-dot.is-success { background: var(--success); }
.fd-dot.is-accent { background: var(--accent); }
.fd-dot.is-warn { background: var(--warn); }
.fd-dot.is-danger { background: var(--danger); }
.fd-dot.is-draft { width: 9px; height: 9px; background: transparent; border: 1.5px dashed var(--text-mute); }
.fd-create { margin-top: 4px; color: var(--accent); }
.fd-create span:first-of-type { flex: 1; }
.fd-create b { color: var(--text); font-weight: 600; }
.fd-create-key { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); }
.fd-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px 18px; text-align: center; }
.fd-empty.is-compact { padding: 16px 12px 8px; }
.fd-empty-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 6px; border: 1px solid var(--border-2); border-radius: 9px; color: var(--text-mute); }
.fd-empty strong { font-weight: 600; color: var(--text); }
.fd-empty p { margin: 0; font-size: 0.84rem; color: var(--text-mute); }
.fd-empty button { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.84rem; cursor: pointer; }
.fd-note, .fd-error { margin: 10px 8px; font-size: 0.84rem; color: var(--text-mute); }
.fd-error { color: var(--danger); }
.fd-actions { display: flex; align-items: center; gap: 18px; padding: 10px 14px; border-top: 1px solid var(--border); }
.fd-actions button { padding: 0; border: 0; background: none; color: var(--text-mute); font: inherit; font-size: 0.84rem; cursor: pointer; }
.fd-actions button:hover { color: var(--text); }
.fd-actions button:first-child { color: var(--accent); }
.fd-actions button:disabled { opacity: 0.45; cursor: default; }
.fd-actions button.is-primary { padding: 6px 14px; border-radius: 7px; background: var(--accent); color: var(--bg); font-weight: 600; }
.fd-live { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--success); }
.fd-live i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fd-live.is-busy i { animation: fd-pulse 0.8s ease-in-out infinite; }
@keyframes fd-pulse { 50% { opacity: 0.25; } }
.fd-keys { display: flex; align-items: center; gap: 4px; white-space: nowrap; padding: 9px 14px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 35%, var(--surface)); font-size: 0.78rem; color: var(--text-mute); }
.fd-keys kbd + kbd { margin-left: -1px; }
.fd-keys kbd:not(:first-child) { margin-left: 10px; }
.fd-keys kbd:nth-child(2) { margin-left: 2px; }
.fd-form { display: grid; gap: 10px; padding: 4px 14px 14px; }
.fd-form label { display: grid; gap: 4px; font-size: 0.78rem; color: var(--text-mute); }
.fd-form input { height: 34px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 0.86rem; color-scheme: dark; }
:root[data-theme="light"] .fd-form input { color-scheme: light; }
.fd-form input:focus { outline: none; border-color: var(--accent); }
.fd-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-presets button { padding: 4px 9px; border: 1px solid var(--border-2); border-radius: 999px; background: none; color: var(--text-mute); font: inherit; font-size: 0.76rem; cursor: pointer; }
.fd-presets button:hover { color: var(--text); border-color: var(--text-faint); }
/* Add filter menu */
.fd-field-icon { display: grid; place-items: center; width: 18px; color: var(--text-mute); }
.fd-kind { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); }
.fd-badge { padding: 1px 6px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 4px; background: var(--accent-soft); font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); }

/* Work page filter row: type switcher + category / tag dropdowns */
.work-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.work-filters .work-types { margin-bottom: 0; }
.work-filters .fd-trigger { height: 44px; padding: 0 14px; font-size: 0.9rem; border-color: var(--border); background: var(--surface); }
.work-filters .fd-x { height: 44px; }
.work-filters .fb-clear { margin-left: 4px; font-size: 0.86rem; color: var(--text-faint); }
.work-filters .fb-clear.is-active { color: var(--accent); }
.work-filters .fb-clear[hidden] { display: none; }
@media (max-width: 640px) {
  .work-filters .fd { flex: 1 1 auto; }
  .work-filters .fd-trigger { flex: 1; }
  .work-filters .fd:not(.is-active) .fd-trigger { justify-content: space-between; }
}

/* ==========================================================================
   Public Dashboards — Design2 with hover-to-scroll
   ========================================================================== */
.dash-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 0 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  position: relative;
}
.dash-strip::-webkit-scrollbar { height: 6px; }
.dash-strip::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
/* fade whichever edge still has cards beyond it (app.js sets .at-start / .at-end) */
.dash-strip { --fade-l: 48px; --fade-r: 48px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%); }
.dash-strip.at-start { --fade-l: 0px; }
.dash-strip.at-end { --fade-r: 0px; }
/* with a mouse the strip hover-scrolls, so snapping would fight it */
@media (hover: hover) and (pointer: fine) { .dash-strip { scroll-snap-type: none; } }
.dash-thumb {
  flex: 0 0 280px;
  height: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  text-align: left;
  color: inherit;
  position: relative;
}
.dash-thumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.dash-thumb .viz {
  flex: 1;
  background: linear-gradient(180deg, var(--surface) 0%, var(--code-bg) 100%);
  display: grid; place-items: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  position: relative;
  text-align: center;
  padding: 12px;
}
.dash-thumb .viz::before {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.3;
}
.dash-thumb .viz img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dash-thumb .meta {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dash-thumb .title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.dash-thumb .tool { font-size: 0.72rem; color: var(--text-mute); font-family: var(--font-mono); }
.scroll-hint { font-size: 0.78rem; color: var(--text-faint); font-family: var(--font-mono); }

/* ==========================================================================
   What I've Shipped on itch.io (homepage + games page cards)
   - Design2 base; new tag-styled jam labels; title-left/engine-right;
     description instead of theme/engine line; future-flexible status field
   ========================================================================== */
.shipped-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .shipped-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .shipped-grid { grid-template-columns: 1fr 1fr 1fr 1fr; } }

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s;
  display: flex;
  flex-direction: column;
  position: relative;
  color: inherit;
  text-align: left;
}
.game-card:hover { border-color: var(--games); transform: translateY(-2px); }
.game-card .cover {
  aspect-ratio: 16/10;
  background: var(--code-bg);
  display: grid; place-items: center;
  color: var(--games-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.game-card .cover .poster {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--games-soft) 0%, var(--code-bg) 100%);
  display: grid; place-items: center;
  color: var(--games);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: center;
  padding: 12px;
}
.game-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-card .tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.game-card .title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.game-card h3 { font-size: 0.95rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em; margin: 0; }
.game-card .engine { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-mute); }
.game-card .description { color: var(--text-mute); font-size: 0.85rem; line-height: 1.45; }
.game-card .tags { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 2px; }
.game-card .tags:empty { display: none; }
.game-card .play-row {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.game-card .status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-mute);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.game-card .play { color: var(--games); font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* jam label uses the same tag pill style as Featured Case Studies tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-mute);
}
.tag.games { background: var(--games-soft); color: var(--games); border-color: color-mix(in srgb, var(--games) 40%, transparent); }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* ==========================================================================
   Dev & Automation (project rows)
   Design2 base; merged with archive-row styling from work page
   ========================================================================== */
.project-rows { display: flex; flex-direction: column; }
.project-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, padding 0.15s, transform 0.15s;
  text-align: left;
  width: 100%;
  color: inherit;
  border: 1px solid transparent;
  margin: 0 -16px;
  width: calc(100% + 32px);
}
.project-row:hover { background: var(--surface); border-color: var(--border); padding-left: 24px; padding-right: 24px; }
.project-row .num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); flex-shrink: 0; width: 32px; }
.project-row .year { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); flex-shrink: 0; width: 60px; }
.project-row .info { flex: 1; min-width: 0; }
.project-row h4 { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.project-row p { font-size: 0.85rem; color: var(--text-mute); margin: 0; }
.project-row .stack-mini { display: flex; gap: 5px; flex-wrap: wrap; }
.project-row .arrow { color: var(--text-faint); transition: transform 0.15s, color 0.15s; flex-shrink: 0; }
.project-row:hover .arrow { color: var(--accent); transform: translateX(2px); }

/* ==========================================================================
   About teaser (homepage) — Design2 as-is
   ========================================================================== */
.about-teaser { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--space-7); align-items: start; }
@media (max-width: 900px) { .about-teaser { grid-template-columns: 1fr; } }
.about-photo {
  aspect-ratio: 1/1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid; place-items: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  padding: 16px;
}
.about-photo, .about-page-photo { overflow: hidden; }
.about-photo:has(img), .about-page-photo:has(img) { padding: 0; }
.about-photo img, .about-page-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-teaser h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: var(--space-4); color: var(--text); letter-spacing: -0.01em; }
.about-teaser p { color: var(--text-mute); margin-bottom: var(--space-3); }
.principles { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-5); }
.principle { display: grid; grid-template-columns: 32px 1fr; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); transition: border-color 0.15s; }
.principle:hover { border-color: var(--accent); }
.principle .num { font-family: var(--font-mono); font-weight: 700; color: var(--accent); font-size: 0.85rem; }
.principle h4 { font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.principle p { font-size: 0.85rem; color: var(--text-mute); line-height: 1.5; margin: 0; }

/* ==========================================================================
   Experience timeline (homepage) — Design2 format with Design1's
   "Present" indicator and top-right "Full Resume" link
   ========================================================================== */
.exp-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-6); }
.exp-head .exp-text h2 { margin: 0; }
.exp-head .exp-text .section-sub { margin-top: var(--space-2); }
.exp-head .full-resume-link { color: var(--accent); font-size: 0.9rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.exp-head .full-resume-link:hover { color: var(--accent-2); }

.timeline { border-left: 1px solid var(--border); padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-5); }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: calc(-1 * var(--space-5) - 4px); top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.timeline-item.current::before { background: var(--success); box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px rgba(52, 211, 153, 0.25); }
.timeline-item .when { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-mute); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.timeline-item .when .present { color: var(--success); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem; }
.timeline-item h4 { font-size: 1rem; font-weight: 600; color: var(--text); }
.timeline-item .where { color: var(--text-mute); font-size: 0.88rem; margin-top: 2px; }
.timeline-item p { color: var(--text-mute); font-size: 0.88rem; margin-top: 6px; max-width: 620px; line-height: 1.6; }
.timeline-desc { color: var(--text-mute); font-size: 0.88rem; line-height: 1.6; max-width: 620px; margin-top: 6px; }
.timeline-desc p { margin-top: 0; }
.timeline-desc ul { padding-left: 18px; }
.timeline-desc li { margin-bottom: 2px; }
.timeline-desc strong { color: var(--text); font-weight: 600; }

/* ==========================================================================
   Hiring CTA (homepage) — MERGED
   Design2 visual (card) + Design1 spacing (roomier) + copy button +
   square icon buttons + right-aligned main Contact
   ========================================================================== */
.cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-6);
  align-items: center;
}
@media (max-width: 900px) { .cta-card { grid-template-columns: 1fr; padding: var(--space-5); } }
.cta-card h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.1rem); font-weight: 700; letter-spacing: -0.025em; margin-bottom: var(--space-4); line-height: 1.15; }
.cta-card p { color: var(--text-mute); font-size: 0.95rem; margin-bottom: var(--space-4); }
.copy-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  min-height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.copy-email-btn:hover { background: var(--code-bg); border-color: var(--accent); color: var(--accent); }
.copy-email-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.copy-email-btn.copied { color: var(--success); border-color: var(--success); }
/* plain text-link variant (contact page), matching the other contact links */
.copy-email-btn.is-link,
.copy-email-btn.is-link:hover {
  display: inline-flex;
  gap: 6px;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  font: inherit;
  color: var(--accent);
}
.copy-email-btn.is-link.copied { color: var(--success); }
.copy-email-btn.is-link .icon { opacity: 0.6; transition: opacity 0.15s; }
.copy-email-btn.is-link:hover .icon,
.copy-email-btn.is-link.copied .icon { opacity: 1; }
.cta-card .icon-row { display: flex; gap: 10px; flex-wrap: wrap; }
/* copy-email button with the profile icons beside it */
.cta-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cta-card .contact-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
@media (max-width: 900px) { .cta-card .contact-right { align-items: flex-start; } }
.cta-card .contact-right .note { font-size: 0.75rem; color: var(--text-faint); text-align: right; max-width: 240px; }
@media (max-width: 900px) { .cta-card .contact-right .note { text-align: left; } }

/* ==========================================================================
   Footer — Design2 single-row: buttons on left, text on right
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border); padding: var(--space-5) 0; margin-top: var(--space-7); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.footer-links { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-meta { margin-left: auto; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Work index
   - Design1 layout, with cards matching the merged home-page case study
     design, archive rows with year on the left
   ========================================================================== */
.page-header { padding: var(--space-7) 0 var(--space-5); }
.page-header h1 { font-size: clamp(2.25rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: var(--space-3); }
.page-header .meta { color: var(--text-mute); font-size: 0.95rem; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--space-5); }
.chip {
  padding: 8px 16px;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.result-count { margin-left: auto; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-faint); }

.archive-section { margin-top: var(--space-7); }
.archive-section h2 { font-size: 1.3rem; margin-bottom: var(--space-2); }
.archive-section .archive-intro { color: var(--text-mute); margin-bottom: var(--space-4); }
.archive-rows { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }

/* ==========================================================================
   Games index
   - Design1 base layout, with cards updated to match the home-page
     "What I've Shipped" style
   ========================================================================== */
.games-intro { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--space-4); margin-bottom: var(--space-5); }
@media (max-width: 640px) { .games-intro { grid-template-columns: 1fr; } }
.games-intro .itch-link { color: var(--games); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.games-intro .itch-link:hover { color: var(--games-2); }

/* ==========================================================================
   About page — Design2 layout, Design1 Beyond Work, Design2 Education
   Toolkit restyled to match Resume's rounded-rectangle tag style
   ========================================================================== */
.about-page-grid { display: grid; grid-template-columns: 280px 1fr; gap: var(--space-7); align-items: start; }
@media (max-width: 900px) { .about-page-grid { grid-template-columns: 1fr; } }
.about-page-photo {
  aspect-ratio: 1/1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid; place-items: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 12px;
  text-align: center;
}
.about-bio, .about-bio-md p { font-size: 0.95rem; line-height: 1.7; color: var(--text-mute); margin-bottom: var(--space-4); max-width: 65ch; }
.about-bio strong, .about-bio-md strong { color: var(--text); font-weight: 600; }
.about-bio-md a, .about-teaser-text a { color: var(--accent); }

.about-section { margin-top: var(--space-7); }
.about-section > h2 { font-size: 1.35rem; margin-bottom: var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.about-section > .section-sub { margin-top: -8px; margin-bottom: var(--space-5); }

.how-list { display: flex; flex-direction: column; gap: var(--space-3); }
.how-item { padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); transition: border-color 0.15s; }
.how-item:hover { border-color: var(--accent); }
.how-item h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.how-item p { color: var(--text-mute); font-size: 0.88rem; }

/* toolkit groups */
.toolkit-group { margin-bottom: var(--space-5); }
.toolkit-group h3 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); margin-bottom: var(--space-3); }
.toolkit-list { display: flex; flex-wrap: wrap; gap: 8px; }
.toolkit-list li {
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.toolkit-list li.daily {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
}

/* toolkit as a left sidebar on the About page */
.about-page-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.toolkit-aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.toolkit-aside > h2 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.toolkit-aside > .section-sub { display: none; }
.toolkit-aside .toolkit-group { margin-bottom: var(--space-4); }
.toolkit-aside .toolkit-group:last-child { margin-bottom: 0; }
.toolkit-aside .toolkit-group h3 {
  font-size: 0.7rem;
  margin-bottom: var(--space-2);
}
.toolkit-aside .toolkit-list { gap: 5px; }
.toolkit-aside .toolkit-list li {
  font-size: 0.72rem;
  padding: 3px 8px;
}

/* certificate box (Design2 styling) wrapped in a proper section (Design1) */
.cert-section { margin-top: var(--space-7); }
.cert-block {
  padding: var(--space-4) var(--space-5);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-md);
}
.cert-block .name { font-weight: 600; color: var(--text); font-size: 0.95rem; }
.cert-block .when { color: var(--text-mute); font-family: var(--font-mono); font-size: 0.78rem; margin-top: 4px; }
.cert-block a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; font-size: 0.85rem; margin-top: 8px; display: inline-block; }

/* ==========================================================================
   Resume page — Design2 as-is (William's clear preference)
   ========================================================================== */
.resume-page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); padding-bottom: var(--space-5); border-bottom: 1px solid var(--border); margin-bottom: var(--space-6); }
.resume-page-header h1 { font-size: clamp(2rem, 3.5vw, 2.75rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: var(--space-2); }
.resume-page-header .meta { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-mute); }
.resume-page-header .updated { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); margin-top: 4px; }
.resume-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-7); }
@media (max-width: 900px) { .resume-grid { grid-template-columns: 1fr; } }
.resume-section { margin-bottom: var(--space-6); }
.resume-section h2 { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); font-weight: 600; }
.resume-section .summary-text { font-size: 0.95rem; color: var(--text-mute); line-height: 1.65; max-width: 60ch; }
.resume-job { display: grid; grid-template-columns: 140px 1fr; gap: var(--space-4); padding-bottom: var(--space-5); margin-bottom: var(--space-5); border-bottom: 1px dashed var(--border); }
.resume-job:last-child { border-bottom: none; }
.resume-job .when { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-mute); padding-top: 2px; }
.resume-job .when .now-tag { color: var(--success); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.resume-job h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.resume-job .where { font-size: 0.85rem; color: var(--text-mute); margin-bottom: var(--space-3); }
.resume-job ul { color: var(--text-mute); padding-left: 18px; font-size: 0.88rem; line-height: 1.6; }
.resume-job li { margin-bottom: 4px; }
.resume-job li strong { color: var(--text); font-weight: 600; }
/* Markdown from the admin: descriptions may be lists or paragraphs */
.resume-desc { color: var(--text-mute); font-size: 0.88rem; line-height: 1.6; }
.resume-desc p { margin-bottom: var(--space-2); }
.resume-desc > :last-child { margin-bottom: 0; }
.resume-desc strong, .resume-section .summary-text strong { color: var(--text); font-weight: 600; }
.resume-desc a, .resume-section .summary-text a { color: var(--accent); }
.resume-section .summary-text p + p { margin-top: var(--space-2); }
.resume-projects { padding-left: 18px; }
.resume-projects li { color: var(--text-mute); font-size: 0.92rem; margin-bottom: 6px; }
.resume-projects a { color: var(--accent); }

.skill-list { display: flex; flex-direction: column; gap: var(--space-4); }
.skill-list h3 { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); margin-bottom: 8px; }
.skill-list ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.skill-list li { padding: 3px 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 0.78rem; color: var(--text); font-family: var(--font-mono); }
.skill-list li.daily { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }

/* ==========================================================================
   Contact page — Design2 + Design1 form container + whole-button copy
   ========================================================================== */
.contact-page-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--space-7); align-items: start; }
@media (max-width: 900px) { .contact-page-grid { grid-template-columns: 1fr; } }
.contact-info-list { display: flex; flex-direction: column; gap: var(--space-5); margin-top: var(--space-5); }
.contact-info-item .k { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 4px; }
.contact-info-item .v { font-size: 0.95rem; color: var(--text); }
.contact-info-item .v.mono { font-family: var(--font-mono); font-size: 0.88rem; }
.contact-info-item .contact-link { color: var(--accent); }
.contact-info-item .contact-link.is-games { color: var(--games); }

/* Design1's bounding box around the form */
.contact-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.contact-form { display: flex; flex-direction: column; gap: var(--space-4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 0.85rem; color: var(--text); font-weight: 600; }
.form-field label .req { color: var(--danger); }
.form-field input, .form-field select, .form-field textarea {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field .hint { font-size: 0.78rem; color: var(--text-faint); }
/* the reCAPTCHA badge is hidden; the form footer carries Google's required notice instead */
.grecaptcha-badge { visibility: hidden; }
.form-footer { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-2); padding-top: var(--space-4); border-top: 1px dashed var(--border); flex-wrap: wrap; gap: var(--space-3); }
.form-footer .spam-note { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); display: inline-flex; align-items: center; gap: 4px; }
.form-error {
  padding: 10px 14px;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 0.88rem;
}
.form-success {
  padding: 12px 14px;
  background: color-mix(in srgb, var(--success) 15%, transparent);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  color: var(--success);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ==========================================================================
   Work / Game detail pages (case-study.html, game-entry.html — Design1)
   New section: these templates didn't exist in portfolio-v2-merged, so
   this reuses the merged token set (--text-mute, --surface, --code-bg,
   --radius-card, --space-*) rather than the v1-spec prototype's own
   --text-muted / --radius-pill / --accent-ink tokens.
   ========================================================================== */
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: var(--space-4) 0 var(--space-5);
}
.detail-meta-item .meta-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  display: block;
  margin-bottom: 4px;
}

.impact-strip { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, 1fr); margin: var(--space-5) 0; }
@media (min-width: 640px) { .impact-strip { grid-template-columns: repeat(4, 1fr); } }
.metric-badge { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-3); }
.metric-badge .metric-value { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; color: var(--accent); display: block; }
.metric-badge .metric-label { color: var(--text-mute); font-size: 0.85rem; display: block; margin-top: 2px; }
.metric-badge .metric-note { color: var(--text-faint); font-size: 0.72rem; display: block; margin-top: 6px; }

.detail-two-col { display: grid; gap: var(--space-5); grid-template-columns: 1fr; align-items: start; margin-top: var(--space-6); }
@media (min-width: 900px) { .detail-two-col { grid-template-columns: 2fr 1fr; } }

.detail-gallery { display: grid; gap: var(--space-3); grid-template-columns: 1fr; margin: var(--space-5) 0; }
@media (min-width: 640px) { .detail-gallery { grid-template-columns: 1fr 1fr; } }
.detail-gallery img { border-radius: var(--radius-card); border: 1px solid var(--border); width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.detail-gallery figure { margin: 0; }
.detail-gallery figcaption { color: var(--text-faint); font-size: 0.78rem; margin-top: 6px; }

/* game detail page: hero + jam facts, click-to-load embed, body + aside */
.game-detail .games-link { color: var(--games); display: inline-flex; align-items: center; gap: 4px; }
.game-detail .games-link:hover { color: var(--games-2); }

.game-hero { display: grid; gap: var(--space-6); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .game-hero { grid-template-columns: 1.7fr 1fr; } }
.game-hero h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); margin-bottom: var(--space-3); }
.game-hero .lede { color: var(--text-mute); font-size: 1.05rem; line-height: 1.55; max-width: 60ch; margin-bottom: var(--space-5); }

.jam-facts { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-1) var(--space-4); }
.jam-facts > div { display: grid; grid-template-columns: 96px 1fr; gap: var(--space-3); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.jam-facts > div:last-child { border-bottom: 0; }
.jam-facts dt { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.jam-facts dd { margin: 0; font-size: 0.85rem; color: var(--text); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 4px; background: var(--games-soft); color: var(--games); font-family: var(--font-mono); font-size: 0.7rem; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.game-embed { margin-top: var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; background: var(--code-bg); }
.game-embed-stage { position: relative; aspect-ratio: 16/8; display: grid; place-items: center; background: radial-gradient(ellipse at 20% 0%, var(--games-soft), transparent 60%), var(--code-bg); }
.game-embed-stage.is-loaded { aspect-ratio: 16/9; background: #000; }
.game-embed-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.game-embed-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.12; filter: blur(2px); }
.game-embed-prompt { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-4); padding: var(--space-5); text-align: center; }
.game-embed-prompt p { color: var(--text-mute); font-size: 0.8rem; max-width: 42ch; line-height: 1.6; }
.game-embed-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-md); border: 1px solid color-mix(in srgb, var(--games) 40%, transparent); background: var(--games-soft); color: var(--games); }
.game-embed-icon .icon { width: 18px; height: 18px; }
.game-embed-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: 10px var(--space-4); border-top: 1px solid var(--border); background: var(--surface); font-size: 0.75rem; color: var(--text-mute); }
.game-embed-bar > span { display: inline-flex; align-items: center; gap: 6px; }
.game-embed-bar a { font-weight: 500; }

.game-body { display: grid; gap: var(--space-7); grid-template-columns: 1fr; margin-top: var(--space-7); align-items: start; }
@media (min-width: 900px) { .game-body { grid-template-columns: 1fr 300px; gap: var(--space-8); } }
.game-main { display: flex; flex-direction: column; gap: var(--space-7); min-width: 0; }
.game-main h2 { font-size: 1.3rem; margin-bottom: var(--space-4); }
.game-main .prose p, .game-main .prose li { color: var(--text-mute); line-height: 1.7; }

.credits-table-wrap { overflow-x: auto; border-radius: var(--radius-md); background: var(--surface); }
.credits-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.credits-table th { text-align: left; font-family: var(--font-mono); font-weight: 400; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); padding: 12px var(--space-4); background: var(--surface-2); }
.credits-table td { padding: 12px var(--space-4); border-top: 1px solid var(--border); color: var(--text-mute); }
.credits-table td:first-child { color: var(--text); }

.game-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.game-pager a { display: flex; flex-direction: column; gap: 6px; padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); transition: border-color 0.15s ease; }
.game-pager a:hover { border-color: var(--games); }
.game-pager a.next { text-align: right; grid-column: 2; }
.game-pager .pager-label { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); }
.game-pager .pager-title { font-weight: 600; font-size: 0.92rem; color: var(--text); }

.game-aside { display: flex; flex-direction: column; gap: var(--space-5); }
.game-aside .aside-label { font-family: var(--font-mono); font-weight: 400; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: var(--space-2); }
.game-aside .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag.square { border-radius: 4px; }
.aside-link { display: flex; justify-content: space-between; align-items: center; padding: 8px var(--space-3); border: 1px solid var(--border-2); border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500; color: var(--text); transition: border-color 0.15s ease; }
.aside-link:hover { border-color: var(--games); }

/* dashboard detail page */
.accent-link { color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }
.accent-link:hover { color: var(--accent-2); }
.chip-sq { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px solid var(--border-2); border-radius: 4px; font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-mute); }
.chip-sq.accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.chip-sq.strong { color: var(--text); }
.chip-sq.tiny { font-size: 0.58rem; padding: 1px 5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }

.dash-hero { display: grid; gap: var(--space-6); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .dash-hero { grid-template-columns: 1.7fr 1fr; } }
.dash-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3); }
.dash-hero h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); margin-bottom: var(--space-3); }
.dash-hero .lede { color: var(--text-mute); font-size: 1.05rem; line-height: 1.6; max-width: 60ch; margin-bottom: var(--space-5); }

.facts-table { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-1) var(--space-4); }
.facts-table > div { display: grid; grid-template-columns: 78px 1fr; gap: var(--space-3); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.facts-table > div:last-child { border-bottom: 0; }
.facts-table dt { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.facts-table dd { margin: 0; font-size: 0.85rem; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

.badge-recreated { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 2px 6px; border-radius: 3px; background: var(--code-bg); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }

.dash-preview { margin: var(--space-6) 0 0; }
.dash-preview-frame { border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; background: var(--surface); }
.dash-preview-stage { position: relative; aspect-ratio: 16/9; display: grid; place-items: center; overflow: hidden; background-color: var(--code-bg); background-image: linear-gradient(color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px); background-size: 24px 24px; }
.dash-preview-stage.is-loaded { background: #fff; }
.dash-preview-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dash-preview-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dash-skeleton { position: absolute; inset: 16px; display: grid; gap: 10px; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 48px 1fr; }
.dash-skeleton span { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; opacity: 0.8; }
.dash-skeleton .wide { grid-column: 1; }
.dash-skeleton .hl { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 25%, var(--surface)), var(--surface)); }
.dash-skeleton .big { grid-column: 1 / span 2; }
.dash-load-card { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); max-width: 320px; margin: var(--space-4); padding: var(--space-5); text-align: center; background: color-mix(in srgb, var(--code-bg) 92%, transparent); border: 1px solid var(--border-2); border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
.dash-load-card strong { font-size: 0.9rem; color: var(--text); }
.dash-load-card p { font-size: 0.75rem; line-height: 1.6; color: var(--text-mute); margin-bottom: var(--space-2); }
.dash-load-card .btn-row { justify-content: center; }
.dash-load-card .btn { padding: 8px 14px; font-size: 0.8rem; }
.dash-load-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: var(--space-2); border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); color: var(--accent); }
.dash-preview-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: 10px var(--space-4); border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--text-mute); }
.dash-preview-bar > span { display: inline-flex; align-items: center; gap: 6px; }
.dash-preview-bar .mono { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-faint); }
.dash-preview figcaption { margin-top: var(--space-2); font-size: 0.75rem; color: var(--text-mute); }

.dash-section { margin-top: var(--space-8); }
.dash-section h2 { font-size: 1.3rem; }
.dash-section .section-sub { font-size: 0.85rem; margin: var(--space-1) 0 var(--space-4); }
.dash-section h2 + :not(.section-sub) { margin-top: var(--space-4); }

.fact-cards { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .fact-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .fact-cards { grid-template-columns: repeat(4, 1fr); } }
.fact-card { padding: var(--space-3) var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.fact-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.fact-label { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-mute); }
.fact-label .icon { color: var(--accent); }
.fact-value { font-size: 0.85rem; line-height: 1.5; color: var(--text); }
.fact-note { margin-top: var(--space-2); font-size: 0.75rem; line-height: 1.5; color: var(--text-mute); }

.dash-views { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .dash-views { grid-template-columns: repeat(3, 1fr); } }
.dash-views li { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-views a { position: relative; display: block; margin-bottom: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: border-color 0.15s ease, transform 0.15s ease; }
.dash-views a:hover { border-color: var(--accent); transform: translateY(-2px); }
.dash-views a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.dash-views img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.dash-views strong { font-size: 0.8rem; color: var(--text); }
.dash-views li > span { font-size: 0.72rem; color: var(--text-mute); }

.dash-related { display: grid; gap: var(--space-4); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .dash-related { grid-template-columns: 1.2fr 1fr; } .dash-related.no-study { grid-template-columns: 1fr; } }
.related-study { display: grid; grid-template-columns: 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: border-color 0.15s ease; }
@media (min-width: 560px) { .related-study { grid-template-columns: 155px 1fr; } }
.related-study:hover { border-color: var(--accent); }
.related-cover { position: relative; min-height: 140px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--code-bg)), var(--code-bg)); border-right: 1px solid var(--border); }
.related-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-skeleton { position: absolute; inset: 0; margin: auto; width: 70%; height: 55%; display: grid; gap: 6px; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1.4fr; }
.mini-skeleton span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 2px; }
.mini-skeleton .hl { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); }
.related-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-4); }
.related-body strong { font-size: 0.95rem; color: var(--text); }
.related-body p { font-size: 0.75rem; line-height: 1.6; color: var(--text-mute); margin-bottom: var(--space-3); }
.related-body .accent-link { margin-top: auto; font-size: 0.75rem; }

.more-dashboards .aside-label { font-family: var(--font-mono); font-weight: 400; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
.more-dashboards ul { list-style: none; margin: 0; padding: 0; }
.more-dashboards a { display: flex; align-items: center; gap: var(--space-3); padding: 8px 4px; border-bottom: 1px solid var(--border); color: var(--text-faint); transition: color 0.15s ease; }
.more-dashboards a:hover { color: var(--accent); }
.more-thumb { position: relative; flex: 0 0 46px; height: 30px; overflow: hidden; border: 1px solid var(--border-2); border-radius: 3px; background-color: var(--code-bg); background-image: linear-gradient(var(--border-2) 1px, transparent 1px), linear-gradient(90deg, var(--border-2) 1px, transparent 1px); background-size: 15px 15px; }
.more-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.more-title { flex: 1; min-width: 0; font-size: 0.82rem; font-weight: 600; color: var(--text); }
.more-tool { font-family: var(--font-mono); font-size: 0.62rem; }

.dash-footer-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--border); }

/* admin-only notice on a draft's public page */
.draft-banner { background: color-mix(in srgb, var(--warn) 14%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); font-size: 0.82rem; color: var(--warn); }
.draft-banner .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); padding-top: 10px; padding-bottom: 10px; }
.draft-banner span { display: inline-flex; align-items: center; gap: 6px; }
.draft-banner a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* project page: link through to its case study */
.project-page .chip-sq.tiny { margin-bottom: var(--space-2); }
.project-study-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); padding: var(--space-4); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: var(--radius-card); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.project-study-cta > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.project-study-cta .eyebrow { margin: 0; }
.project-study-cta strong { font-size: 1.05rem; color: var(--text); }

/* case-study detail page */
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.case-study .breadcrumb { margin-bottom: var(--space-2); }
.cs-title { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: var(--space-3); }
.cs-lede { font-size: 1.05rem; line-height: 1.6; max-width: 70ch; }

.cs-facts { display: grid; grid-template-columns: repeat(2, 1fr); margin: var(--space-6) 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
@media (min-width: 760px) { .cs-facts { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); } .cs-facts .wide { grid-column: span 2; } }
.cs-facts > div { padding: 10px var(--space-3); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; min-width: 0; }
.cs-facts dt { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.cs-facts dd { margin: 0; font-size: 0.82rem; color: var(--text); overflow-wrap: anywhere; }
.cs-sample-note { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); padding: 6px var(--space-2); border: 1px dashed var(--border-2); border-radius: var(--radius-sm); font-size: 0.75rem; }

.cs-cover { position: relative; margin: var(--space-5) 0 0; aspect-ratio: 16/7.5; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-card); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--code-bg)), var(--code-bg) 45%); }
.cs-cover img { width: 100%; height: 100%; object-fit: cover; }
.cs-cover-skeleton { position: absolute; inset: 0; margin: auto; width: 46%; height: 20%; display: grid; gap: 4px; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1.4fr 1fr 2fr; }
.cs-cover-skeleton span { background: var(--surface-2); border-radius: 2px; opacity: 0.8; }
.cs-cover-skeleton .hl { grid-column: 1 / span 2; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 45%, var(--surface)), var(--surface)); }
.cs-cover-skeleton .big { grid-column: 1 / span 2; }

.cs-metrics { display: grid; gap: var(--space-3); grid-template-columns: 1fr; margin-top: var(--space-3); }
@media (min-width: 640px) { .cs-metrics { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.cs-metric { display: flex; flex-direction: column; gap: 4px; padding: var(--space-4) var(--space-3) var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.cs-metric-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--accent); }
.cs-metric-label { font-size: 0.8rem; color: var(--text); }
.cs-metric-meta { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-faint); }

.cs-body { display: grid; gap: var(--space-6); grid-template-columns: 1fr; margin-top: var(--space-7); align-items: start; }
@media (min-width: 960px) { .cs-body { grid-template-columns: minmax(0, 1fr) 210px; gap: var(--space-8); } }
.cs-main { min-width: 0; max-width: 680px; }
.cs-section { scroll-margin-top: 96px; }
.cs-section + .cs-section { margin-top: var(--space-6); }
.cs-section h2 { font-size: 1.25rem; margin-bottom: var(--space-3); }
.cs-section .prose { font-size: 0.92rem; }
.cs-section .prose > * + * { margin-top: var(--space-3); }
.cs-section .prose h3 { font-size: 1rem; margin-top: var(--space-5); }
.cs-section .prose p, .cs-section .prose li { line-height: 1.7; color: var(--text-mute); }
.cs-section .prose strong { color: var(--text); }
.cs-section .prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cs-section .prose ul, .cs-section .prose ol { padding-left: 1.25rem; }
.cs-section .prose li + li { margin-top: 4px; }
.cs-section .prose li::marker { color: var(--text-faint); }
.cs-section .prose blockquote { padding-left: var(--space-3); border-left: 2px solid var(--accent); }
.cs-section .prose code { font-family: var(--font-mono); font-size: 0.85em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); color: var(--text); }
.cs-section .prose pre { overflow-x: auto; max-width: 100%; padding: var(--space-3) var(--space-4); background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-md); line-height: 1.6; }
.cs-section .prose pre code { padding: 0; background: none; font-size: 0.78rem; color: var(--text-mute); white-space: pre; }
.cs-section .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-section .prose pre code { color: var(--text); }
.tok-comment { color: var(--text-faint); font-style: italic; }
.tok-keyword { color: var(--accent); }
.tok-fn { color: var(--games); }
.tok-string { color: #9FD68C; }
.tok-number { color: #F5B14C; }
html[data-theme="light"] .tok-string { color: #3F7D20; }
html[data-theme="light"] .tok-number { color: #B45309; }
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .tok-string { color: #3F7D20; }
  html:not([data-theme]) .tok-number { color: #B45309; }
}

.cs-gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 560px) { .cs-gallery { grid-template-columns: 1fr 1fr; } }
.cs-gallery li { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cs-gallery a { position: relative; display: block; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); transition: border-color 0.15s ease, transform 0.15s ease; }
.cs-gallery a:hover { border-color: var(--accent); transform: translateY(-2px); }
.cs-gallery a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cs-gallery img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.cs-gallery li > span { font-size: 0.72rem; color: var(--text-mute); }

.cs-embed { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.cs-embed-stage { position: relative; aspect-ratio: 16/9; display: grid; place-items: center; background-color: var(--code-bg); background-image: linear-gradient(color-mix(in srgb, var(--border) 60%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--border) 60%, transparent) 1px, transparent 1px); background-size: 24px 24px; }
.cs-embed-stage.is-loaded { background: #fff; }
.cs-embed-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cs-embed-placeholder { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-4); text-align: center; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-faint); }
.cs-embed-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2) var(--space-3); padding: 8px var(--space-3); border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--text-mute); }
.cs-embed-bar > span { display: inline-flex; align-items: center; gap: 6px; }
.cs-embed-bar .btn-row { gap: 6px; }

.cs-pager { margin-top: var(--space-7); }
.cs-pager a:hover { border-color: var(--accent); }
.cs-cta { margin-top: var(--space-3); }

.cs-toc { display: none; }
@media (min-width: 960px) { .cs-toc { display: block; position: sticky; top: 96px; } }
.cs-toc .aside-label { font-family: var(--font-mono); font-weight: 400; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: var(--space-3); }
.cs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.cs-toc a { display: block; margin-left: -1px; padding: 3px var(--space-3); border-left: 2px solid transparent; font-size: 0.75rem; color: var(--text-mute); transition: color 0.15s ease, border-color 0.15s ease; }
.cs-toc a:hover { color: var(--text); }
.cs-toc a[aria-current="true"] { color: var(--text); border-left-color: var(--accent); }
.cs-read-time { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-faint); }

/* game screenshots: thumbnail grid that opens the lightbox */
.screenshot-thumbs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.screenshot-thumbs a { display: block; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); transition: border-color 0.15s ease, transform 0.15s ease; }
.screenshot-thumbs a:hover { border-color: var(--games); transform: translateY(-2px); }
.screenshot-thumbs a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.screenshot-thumbs img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }

.lightbox {
  /* fills the viewport so a click on the empty area hits the dialog itself and closes it */
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 56px 72px; border: 0;
  background: transparent;
  color: #fff;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(5, 6, 8, 0.9); }
body:has(.lightbox[open]) { overflow: hidden; }
.lightbox-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-3); max-width: 100%; max-height: 100%; }
.lightbox-figure img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: var(--radius-md); }
.lightbox-count { font-family: var(--font-mono); font-size: 0.78rem; color: rgba(255, 255, 255, 0.7); }
.lightbox-btn {
  position: absolute;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}
.lightbox-btn .icon { width: 20px; height: 20px; }
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.18); }
.lightbox-btn:focus-visible { outline: 2px solid var(--games); outline-offset: 2px; }
.lightbox-btn[hidden] { display: none; }
.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox { padding: 64px 12px; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 12px; transform: none; }
}

.detail-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-4); margin: var(--space-5) 0; }
.detail-panel h2 { font-size: 1.05rem; margin-bottom: var(--space-3); }

.footer-nav-pages {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

/* game-card / study-card cover-link: lets the whole index card navigate to
   its detail page while the nested "Play" link stays independently
   clickable (opens itch.io in a new tab instead of the detail page). */
.game-card .link-cover { position: absolute; inset: 0; z-index: 1; }
.game-card .play-row { position: relative; z-index: 2; }

/* ==========================================================================
   404
   ========================================================================== */
.not-found { min-height: 70vh; display: flex; align-items: center; padding: var(--space-8) 0; }
/* maintenance page (errors/503): standalone, full height, no site nav */
.not-found.maintenance { min-height: 100vh; min-height: 100dvh; }
.maintenance-brand { margin-bottom: var(--space-6); }
.maintenance .btn-row { flex-wrap: nowrap; gap: 8px; }
.maintenance .btn-row .btn, .maintenance .btn-row .icon-btn { flex-shrink: 0; }
@media (max-width: 420px) {
  .maintenance .btn-row { gap: 6px; }
  .maintenance .btn-row .btn { padding-left: 14px; padding-right: 14px; }
  .maintenance .btn-row .btn .icon { display: none; }
  .maintenance .btn-row .icon-btn { width: 40px; height: 40px; }
}
@media (max-width: 370px) {
  .maintenance .btn-row { gap: 5px; }
  .maintenance .btn-row .btn { padding-left: 11px; padding-right: 11px; }
  .maintenance .btn-row .icon-btn { width: 36px; height: 36px; }
}
@media (max-width: 340px) {
  .maintenance .btn-row { gap: 4px; }
  .maintenance .btn-row .btn { padding-left: 10px; padding-right: 10px; font-size: 0.82rem; }
  .maintenance .btn-row .icon-btn { width: 32px; height: 32px; }
}
/* shown to a logged-in admin on public pages while maintenance mode is on */
.maintenance-banner { background: color-mix(in srgb, var(--danger) 12%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); font-size: 0.82rem; color: var(--danger); }
.maintenance-banner .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); padding-top: 10px; padding-bottom: 10px; }
.maintenance-banner a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.not-found-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: center; width: 100%; }
.not-found .code { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--space-4); }
.not-found h1 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: var(--space-3); }
.not-found p { font-size: 1.1rem; color: var(--text-mute); margin-bottom: var(--space-6); }

.nf-terminal { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.nf-terminal-bar { display: flex; gap: 6px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.nf-terminal-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2); }
.nf-terminal-body { padding: var(--space-4) var(--space-4) var(--space-5); font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.8; color: var(--text-mute); overflow-wrap: anywhere; }
.nf-prompt { color: var(--text-faint); }
.nf-path { color: var(--accent); }
.nf-status { color: var(--warn, #F5B14C); }
.nf-cursor { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: text-bottom; background: var(--accent); animation: nf-blink 1s steps(1) infinite; }
@keyframes nf-blink { 50% { opacity: 0; } }

@media (max-width: 860px) {
  .not-found-grid { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* ==========================================================================
   Misc / responsive / motion
   ========================================================================== */
.breadcrumb { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-mute); margin-bottom: var(--space-3); }
.breadcrumb a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media print {
  body { background: white; color: black; }
  .site-header, .site-footer, .menu-toggle, .result-count, .proto-banner { display: none !important; }
  a { color: inherit; text-decoration: underline; }
}

/* prototype notice (small, in corner) */
.proto-banner {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-mute);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  max-width: 240px;
  line-height: 1.4;
  pointer-events: none;
}
.proto-banner strong { color: var(--accent); display: block; margin-bottom: 4px; font-family: var(--font-ui); font-weight: 600; font-size: 0.78rem; }
