/* ── Design tokens (Fuwari-style OKLCH system) ──────── */
/*
  Single source of truth: change --hue to retheme everything,
  or swap --primary directly for a custom accent.
  --accent bridges the hero WebGL system to the same token.
*/
:root {
  --hue: 140;                                     /* BeetleBox green — change to retheme */
  --primary:    oklch(0.75 0.18 var(--hue));      /* main accent (green-lime) */
  --primary-dim: oklch(0.65 0.14 var(--hue));     /* slightly muted variant */
  --page-bg:    oklch(0.14 0.012 var(--hue));
  --card-bg:    oklch(0.20 0.014 var(--hue));
  --float-bg:   oklch(0.17 0.013 var(--hue));
  --text:       oklch(0.92 0.005 var(--hue));
  --text-dim:   oklch(0.62 0.01  var(--hue));
  --text-muted: oklch(0.42 0.008 var(--hue));
  --border:     color-mix(in oklch, white 7%, transparent);
  --border-strong: color-mix(in oklch, white 14%, transparent);
  --radius:     12px;
  --radius-lg:  16px;
  --page-width: 1100px;
  --navbar-h:   4.5rem;
  --shadow:     0 2px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.7);
  --ease:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* hero accent — JS can override this per-viz, but defaults to --primary */
  --accent:     var(--primary);
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  background: var(--page-bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6, p, a {
  transition:
    color 0.15s var(--ease),
    background-color 0.15s var(--ease);
}

/* ── Utility: card base ─────────────────────────────── */
.card-base {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition:
    background-color 0.15s var(--ease),
    border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}
.card-base:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

/* ── Onload animation ────────────────────────────────── */
@keyframes fade-in-up {
  from { transform: translateY(1.5rem); opacity: 0; }
  to   { transform: translateY(0);      opacity: 1; }
}

.onload-animation {
  animation: fade-in-up 0.4s var(--ease) both;
  animation-delay: var(--delay, 0ms);
}

/* ── Navbar ─────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  padding: 0.75rem 1.5rem;
  animation: fade-in-up 0.3s var(--ease) both;
}

.navbar-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  height: var(--navbar-h);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--float-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0 1.25rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.navbar-logo {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}
.navbar-logo:hover {
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 10%, transparent);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  padding: 0 0.5rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
  white-space: nowrap;
}
.nav-btn:hover {
  color: var(--text);
  background: color-mix(in oklch, white 6%, transparent);
}
.nav-btn:active { transform: scale(0.95); }

/* ── Nav dropdown ────────────────────────────────────── */
.nav-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 130px;
  background: var(--float-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.15s var(--ease),
    transform 0.15s var(--ease);
  z-index: 400;
}
.nav-dropdown-wrap:hover .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-dropdown-item {
  display: block;
  padding: 0.5rem 0.875rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  border-radius: var(--radius);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
  white-space: nowrap;
}
.nav-dropdown-item:hover {
  color: var(--text);
  background: color-mix(in oklch, white 6%, transparent);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.icon-btn:hover {
  color: var(--text);
  background: color-mix(in oklch, white 6%, transparent);
}
.icon-btn:active { transform: scale(0.92); }

/* ── Scrollbars ──────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: color-mix(in oklch, var(--primary) 35%, transparent); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover  { background: color-mix(in oklch, var(--primary) 60%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in oklch, var(--primary) 35%, transparent) transparent; }

/* ── Local fonts ─────────────────────────────────────── */
@font-face {
  font-family: 'Braille-Regular';
  src: url('Braille-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Wingdings';
  src: url('wingding.ttf') format('truetype');
  font-display: swap;
}

/* ── Language picker ─────────────────────────────────── */
.lang-wrap {
  position: relative;
}

.lang-btn-flag {
  width: 1.25em;
  height: 1.25em;
  border-radius: 2px;
  display: block;
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  background: var(--float-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  backdrop-filter: blur(16px);
  z-index: 200;
  max-height: 340px;
  overflow-y: auto;
}

.lang-wrap.lang-open .lang-dropdown,
.lang-wrap:hover .lang-dropdown {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.82rem;
  text-align: left;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.lang-option:hover {
  background: color-mix(in oklch, white 7%, transparent);
  color: var(--text);
}
.lang-option[aria-selected="true"] {
  color: var(--primary);
}
.lang-option .fi {
  width: 1.35em;
  height: 1em;
  border-radius: 2px;
  flex-shrink: 0;
}
.lang-option-label {
  flex: 1;
}

.lang-group {
  display: contents;
}

.lang-sublist {
  display: none;
}
.lang-group--expanded .lang-sublist {
  display: block;
}

.lang-option--sub {
  padding-left: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.lang-option--sub .lang-option-label {
  font-size: 0.78rem;
  line-height: 1.2;
}
.lang-option--sub[aria-selected="true"] {
  color: var(--primary);
}
.lang-sub-arrow {
  font-size: 0.55rem;
  opacity: 0.45;
  margin-right: 0.3rem;
  flex-shrink: 0;
}

.lang-btn-flag--joke {
  font-size: 0.85rem;
  line-height: 1;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

/* Hide the Google Translate toolbar banner it injects */
.goog-te-banner-frame,
#goog-gt-tt,
.goog-te-balloon-frame,
.skiptranslate {
  display: none !important;
}
body { top: 0 !important; }

/* ── Search ──────────────────────────────────────────── */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
  overflow: hidden;
}
.search-wrap.open {
  background: var(--float-bg);
  border-color: color-mix(in oklch, var(--primary) 35%, transparent);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--primary) 15%, transparent);
}

#search-input {
  width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: width 0.25s var(--ease), padding 0.25s var(--ease);
}
.search-wrap.open #search-input {
  width: 180px;
  padding: 0 0.5rem 0 0.625rem;
}
#search-input::placeholder { color: var(--text-muted); }

#search-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  padding-right: 0.25rem;
  white-space: nowrap;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  transition: max-width 0.2s var(--ease), padding 0.2s var(--ease);
}
.search-wrap.open #search-count { max-width: 80px; padding-right: 0.5rem; }

/* Highlighted matches */
mark.search-hl {
  background: color-mix(in oklch, var(--primary) 30%, transparent);
  color: inherit;
  border-radius: 2px;
  outline: 1px solid color-mix(in oklch, var(--primary) 50%, transparent);
  padding: 0 1px;
}
mark.search-hl.search-hl--current {
  background: color-mix(in oklch, var(--primary) 60%, transparent);
  outline-color: var(--primary);
}

/* ── Accent color picker ─────────────────────────────── */
.accent-wrap {
  position: relative;
}

.accent-orb {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  box-shadow: 0 0 6px 1px color-mix(in oklch, var(--primary) 50%, transparent);
  flex-shrink: 0;
}


.accent-popup {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--float-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px 8px;
  z-index: 200;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.accent-wrap.accent-open .accent-popup,
.accent-wrap:hover .accent-popup {
  display: flex;
}

.hue-slider {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 10px;
  height: 140px;
  border-radius: 999px;
  background: linear-gradient(to top,
    #f5f5f5,
    oklch(0.75 0.18 140),
    #6b7068);
  outline: none;
  cursor: pointer;
  border: none;
}
.hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--thumb-color, var(--primary));
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  cursor: pointer;
}
.hue-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--thumb-color, var(--primary));
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  cursor: pointer;
}

.accent-reset-btn {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

/* ── Hero ────────────────────────────────────────────── */
#hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--page-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

#hero-logo {
  /* Hidden — used only to define natural dimensions for the ::before pseudo */
  display: block;
  width: min(520px, 72vw);
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

/* Colored logo drawn as a masked pseudo-element on top */
#hero::before {
  content: '';
  position: absolute;
  width: min(520px, 72vw);
  aspect-ratio: var(--logo-ratio, 4 / 1);
  background: var(--primary);
  -webkit-mask-image: url('https://raw.githubusercontent.com/beetlebox-studios/branding-assets/main/logo/bbtextpng.png');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url('https://raw.githubusercontent.com/beetlebox-studios/branding-assets/main/logo/bbtextpng.png');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  pointer-events: none;
}

/* ── Page sections ───────────────────────────────────── */
.page-section {
  padding: 96px 1.5rem;
}

.section-inner {
  max-width: var(--page-width);
  margin: 0 auto;
}

.section-label {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2rem;
  opacity: 0.8;
}

/* ── Work section ────────────────────────────────────── */
#work {
  background: var(--page-bg);
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Layer 1 — wood grain table texture (grayscale) */
.work-table-bg {
  position: absolute;
  inset: 0;
  background-image: url('../images/woodgrain.jpg');
  background-size: cover;
  background-position: center;
  filter: grayscale(1) brightness(0.32);
  z-index: 0;
}

/* Layer 2 — sticker canvas (sits on the table, below the overlay) */
.work-sticker-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none; /* individual stickers re-enable their own events */
}

/* Layer 3 — half-transparent black overlay (darkens table + stickers visually,
   pointer-events:none so clicks pass through to stickers below) */
.work-table-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 2;
  pointer-events: none;
}

/* Layer 4 — the section-inner / games grid floats above everything */
#work .section-inner {
  position: relative;
  z-index: 3;
}

/* ── Stickers ────────────────────────────────────────── */
/* Outline is baked into the image at init — no CSS filter needed for it.
   Single drop-shadow here is just the cast shadow beneath the sticker. */
.sticker {
  position: absolute;
  cursor: grab;
  user-select: none;
  pointer-events: auto;
  touch-action: none;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.55));
  transition: transform 0.15s ease, filter 0.15s ease;
}
.sticker img {
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  image-rendering: pixelated;
}
.sticker:hover {
  transform: scale(1.08) rotate(var(--sticker-rot, 0deg));
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.7));
  z-index: 10;
}
.sticker.dragging {
  cursor: grabbing;
  transform: scale(1.14) rotate(var(--sticker-rot, 0deg));
  filter: drop-shadow(0 14px 20px rgba(0,0,0,0.75));
  z-index: 20;
  transition: none;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.work-card {
  cursor: pointer;
  overflow: hidden;
}
.work-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.work-card:active { transform: scale(0.98); }

.work-img-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
  background: oklch(0.18 0.02 var(--hue));
}

.work-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  color: transparent;
  transition: opacity 0.3s, transform 0.5s var(--ease);
}
.work-img[src]:not([src=""]) { opacity: 1; }
.work-card:hover .work-img { transform: scale(1.04); }

/* GIF preview — stacked above the static thumbnail */
.work-gif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  color: transparent;
  transition: opacity 0.25s var(--ease);
  /* No pointer-events so the filter button beneath stays clickable */
  pointer-events: none;
  z-index: 1;
}
/* Fade in once src is populated (mouseenter sets it) */
.work-gif[src]:not([src=""]) { opacity: 1; }

.work-placeholder-bg {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    color-mix(in oklch, var(--primary) 3%, transparent),
    color-mix(in oklch, var(--primary) 3%, transparent) 1px,
    transparent 1px,
    transparent 20px
  );
  opacity: 0.5;
}

/* ── Game image overlay buttons ───────────────────────── */
/* Stacked group positioned top-right of the image wrap */
.game-img-btns {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.work-card:hover .game-img-btns {
  opacity: 1;
  transform: translateY(0);
}

.game-img-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in oklch, var(--float-bg) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  text-decoration: none;
  transition:
    color 0.15s var(--ease),
    background 0.15s var(--ease),
    border-color 0.15s var(--ease),
    transform 0.15s var(--ease);
}
.game-img-btn:hover {
  color: var(--text);
  background: color-mix(in oklch, var(--primary) 20%, var(--float-bg));
  border-color: color-mix(in oklch, var(--primary) 50%, transparent);
}
.game-img-btn:active { transform: scale(0.9); }
/* Active state — GIF preview is pinned on */
.game-gif-btn--active {
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 20%, var(--float-bg));
  border-color: color-mix(in oklch, var(--primary) 50%, transparent);
}

/* Active state — filter is currently applied for this game */
.game-filter-btn--active {
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 20%, var(--float-bg));
  border-color: color-mix(in oklch, var(--primary) 50%, transparent);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--primary) 20%, transparent);
}

/* ── Game Jams subsection ────────────────────────────── */
.jam-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  pointer-events: none; /* pass clicks through to stickers below */
}

.jam-heading {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  pointer-events: none;
}

.jam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.625rem;
  pointer-events: none; /* cards re-enable their own events */
}

.jam-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  cursor: default;
  pointer-events: auto;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.jam-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Image wrap — square thumbnail with GIF preview stacked above */
.jam-img-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: oklch(0.18 0.02 var(--hue));
}

.jam-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

.jam-gif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  color: transparent;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.jam-gif[src]:not([src=""]) { opacity: 1; }

.jam-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.jam-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jam-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jam-link {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
  transition: color 0.15s var(--ease);
  align-self: flex-start;
}
.jam-link:hover { color: var(--primary); }

/* ── Person card — all same size now ─────────────────── */

/* ── Person photo overlay (link buttons on hover) ──────── */
.person-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  padding-bottom: 0.875rem;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.person-card:hover .person-overlay {
  opacity: 1;
  pointer-events: auto;
}

.person-overlay-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in oklch, var(--float-bg) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 0.8rem;
  backdrop-filter: blur(6px);
  text-decoration: none;
  transition:
    color 0.15s var(--ease),
    background 0.15s var(--ease),
    border-color 0.15s var(--ease),
    transform 0.15s var(--ease);
}
.person-overlay-btn:hover {
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 20%, var(--float-bg));
  border-color: color-mix(in oklch, var(--primary) 50%, transparent);
  transform: translateY(-2px);
}

/* ── Founder sticker ───────────────────────────────────── */
/* Vinyl-style sticker stuck to the top-left of the photo */
.person-founder-sticker {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 52px;
  height: 52px;
  pointer-events: none;
  /* Same hard white outline as the table stickers */
  filter:
    drop-shadow(-3px -3px 0 white)
    drop-shadow( 3px -3px 0 white)
    drop-shadow(-3px  3px 0 white)
    drop-shadow( 3px  3px 0 white)
    drop-shadow(-3px  0   0 white)
    drop-shadow( 3px  0   0 white)
    drop-shadow( 0   -3px 0 white)
    drop-shadow( 0    3px 0 white);
  transform: rotate(-8deg);
}
.person-founder-sticker-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: pixelated;
}

/* ── People filter states ─────────────────────────────── */

.person-card--hidden {
  opacity: 0.18;
  filter: grayscale(0.5);
  pointer-events: none;
  transform: scale(0.97);
}

/* Filter banner — shown above the people grid when a filter is active */
.people-filter-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  margin-bottom: 1.25rem;
  background: color-mix(in oklch, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--primary) 25%, transparent);
  border-radius: var(--radius);
}

.people-filter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--primary);
  flex: 1;
}

.people-filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.people-filter-clear:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: color-mix(in oklch, white 5%, transparent);
}

.work-info {
  padding: 1.125rem 1.25rem 1.25rem;
}

.work-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.work-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.work-desc {
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* Shared link-row style — used by both .work-links and .person-links */
.work-links,
.person-links {
  display: flex;
  gap: 0.625rem;
  margin-top: 0.875rem;
}

.work-links a,
.person-links a {
  width: 1.875rem;
  height: 1.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: color-mix(in oklch, white 5%, transparent);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: color 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.work-links a:hover,
.person-links a:hover {
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 10%, transparent);
  border-color: color-mix(in oklch, var(--primary) 30%, transparent);
}

/* ── Gallery section ─────────────────────────────────── */
#gallery {
  position: relative;
  padding: 0;
  overflow: hidden;
  min-height: 520px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklch, var(--page-bg) 70%, oklch(0.10 0.02 var(--hue)));
}

/* Left/right fade vignette — on the section so overflow:hidden on the stage doesn't clip them */
#gallery::before,
#gallery::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 180px;
  z-index: 10;
  pointer-events: none;
}
#gallery::before {
  left: 0;
  background: linear-gradient(to right,
    color-mix(in oklch, var(--page-bg) 70%, oklch(0.10 0.02 var(--hue))) 10%,
    transparent);
}
#gallery::after {
  right: 0;
  background: linear-gradient(to left,
    color-mix(in oklch, var(--page-bg) 70%, oklch(0.10 0.02 var(--hue))) 10%,
    transparent);
}

.gallery-stage {
  position: relative;
  width: 100%;
  height: 480px;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  overflow: hidden;
  cursor: grab;
}
.gallery-stage:active { cursor: grabbing; }

.gallery-cards {
  position: absolute;
  inset: 0;
  /* Cards are absolutely positioned children */
}

/* ── Polaroid shake + develop keyframes ──────────────── */
@keyframes polaroid-shake {
  0%   { transform: rotate(0deg)   translate(0,    0); }
  8%   { transform: rotate(-5deg)  translate(-4px, 1px); }
  18%  { transform: rotate( 5.5deg) translate( 4px,-2px); }
  28%  { transform: rotate(-4deg)  translate(-3px, 2px); }
  38%  { transform: rotate( 4.5deg) translate( 3px,-1px); }
  48%  { transform: rotate(-2.5deg) translate(-2px, 1px); }
  58%  { transform: rotate( 3deg)  translate( 2px, 0); }
  68%  { transform: rotate(-1.5deg) translate(-1px, 1px); }
  78%  { transform: rotate( 1.5deg) translate( 1px, 0); }
  88%  { transform: rotate(-0.5deg) translate(0,    0); }
  100% { transform: rotate(0deg)   translate(0,    0); }
}

/* ── Individual gallery card ─────────────────────────── */
.gallery-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260px;
  height: 340px;
  margin-left: -130px;
  transition: box-shadow 0.25s var(--ease);
  user-select: none;
  box-shadow: var(--shadow);
}
.gallery-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
}

/* Polaroid frame */
.polaroid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #f0ede8;
  border-radius: 4px;
  padding: 10px 10px 0 10px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(0,0,0,0.08);
}
.gallery-card:hover .polaroid {
  animation: polaroid-shake 0.75s var(--ease) both;
}

/* Photo area */
.polaroid__photo {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #222;
}
.polaroid__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 55%,
    rgba(0,0,0,0.45) 100%);
}

.polaroid__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: grayscale(1) brightness(0.85);
  transition: filter 0.6s var(--ease) 0.1s;
}
.gallery-card:hover .polaroid__img {
  filter: none;
}

/* Accent tint — blends over the grayscale, develops away on hover */
.polaroid__tint {
  position: absolute;
  inset: 0;
  background: var(--primary);
  mix-blend-mode: color;
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.6s var(--ease) 0.1s;
}
.gallery-card:hover .polaroid__tint {
  opacity: 0;
}


/* White bottom strip */
.polaroid__strip {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.polaroid__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: #444;
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* On mobile: smaller cards */
@media (max-width: 640px) {
  .gallery-stage {
    height: 360px;
  }
  .gallery-card {
    width: 200px;
    height: 270px;
    margin-left: -100px;
  }
  .polaroid__strip {
    height: 44px;
  }
}

/* ── About section ───────────────────────────────────── */
#about {
  background: color-mix(in oklch, var(--page-bg) 80%, oklch(0.12 0.02 var(--hue)));
  border-top: 1px solid var(--border);
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.about-heading {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  position: sticky;
  top: calc(var(--navbar-h) + 2rem);
}

.about-right {
  padding: 2rem;
}

.about-body-text {
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}
.about-body-text:last-of-type { margin-bottom: 1.5rem; }

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--primary) 12%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in oklch, var(--primary) 25%, transparent);
}

/* ── People section ──────────────────────────────────── */
#people {
  background: color-mix(in oklch, var(--page-bg) 80%, oklch(0.12 0.02 var(--hue)));
  border-top: 1px solid var(--border);
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  align-items: start;
}

.person-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: default;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease),
    opacity 0.3s var(--ease),
    filter 0.3s var(--ease);
}
.person-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in oklch, var(--primary) 35%, transparent);
}

/* Photo */
.person-photo-wrap {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: oklch(0.18 0.02 var(--hue));
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

/*
  Tint technique: grayscale the <img>, then overlay a ::after pseudo-element
  filled with var(--primary) using mix-blend-mode:color. The blend mode
  colorizes the gray luminance values with whatever hue --primary currently is,
  so changing --hue automatically updates the tint with no JS needed.
  On hover: remove grayscale + fade out the overlay → natural photo.
*/
.person-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  filter: grayscale(1) brightness(0.9);
  transition: filter 0.45s var(--ease), transform 0.45s var(--ease);
  position: relative;
  z-index: 0;
}
.person-card:hover .person-photo {
  filter: none;
  transform: scale(1.03);
}

/* Tint overlay — sits above the img, colorizes via blend mode */
.person-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  mix-blend-mode: color;
  opacity: 0.75;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
  z-index: 1;
}
.person-card:hover .person-photo-wrap::after {
  opacity: 0;
}

/* Monogram placeholder (shown when no image is set) */
.person-monogram {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 300;
  color: color-mix(in oklch, var(--primary) 50%, transparent);
  background: color-mix(in oklch, var(--primary) 6%, transparent);
  letter-spacing: 0.05em;
  user-select: none;
}

/* Info block */
.person-info {
  padding: 1.125rem 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.person-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.person-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.person-bio {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-dim);
  flex: 1;
}

/* ── Contact section ─────────────────────────────────── */
#contact {
  background: color-mix(in oklch, var(--page-bg) 70%, oklch(0.10 0.02 var(--hue)));
  border-top: 1px solid var(--border);
}

.contact-cta {
  padding: 3.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.contact-heading {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
}

.contact-heading a {
  color: var(--primary);
  border-bottom: 1px solid color-mix(in oklch, var(--primary) 40%, transparent);
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.contact-heading a:hover {
  border-color: var(--primary);
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.5rem;
  background: color-mix(in oklch, var(--primary) 15%, transparent);
  border: 1px solid color-mix(in oklch, var(--primary) 30%, transparent);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition:
    background 0.15s var(--ease),
    border-color 0.15s var(--ease),
    transform 0.15s var(--ease);
}
.contact-btn:hover {
  background: color-mix(in oklch, var(--primary) 22%, transparent);
  border-color: color-mix(in oklch, var(--primary) 50%, transparent);
  transform: translateY(-1px);
}
.contact-btn:active { transform: scale(0.97); }

/* ── Footer ─────────────────────────────────────────── */
#site-footer {
  border-top: 1px dashed color-mix(in oklch, white 10%, transparent);
  padding: 2rem 1.5rem 2.5rem;
  animation: fade-in-up 0.4s var(--ease) both;
  animation-delay: 200ms;
}

.footer-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Hide section nav links */
  .navbar-links {
    display: none;
  }

  /* Tighten navbar padding and let actions sit flush right */
  .navbar-inner {
    padding: 0 0.75rem;
    gap: 0.25rem;
  }

  .navbar-actions {
    margin-left: auto;
  }

  /* Dropdowns: anchor to right edge, cap width to viewport */
  .lang-dropdown,
  .accent-popup {
    right: 0;
    left: auto;
    max-width: calc(100vw - 1.5rem);
  }

  /* Hero logo smaller on mobile */
  #hero-logo {
    width: min(320px, 88vw);
  }
  #hero::before {
    width: min(320px, 88vw);
  }

  /* Section padding tighter */
  .page-section {
    padding: 64px 1rem;
  }

  /* Hide long game descriptions on mobile */
  .work-desc {
    display: none;
  }

  /* Always show game overlay buttons on mobile (no hover) */
  .game-img-btns {
    opacity: 1;
    transform: translateY(0);
  }

  /* Always show person overlay buttons on mobile (no hover) */
  .person-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

