/* =====================================================================
   Portfolio
   Dark theme, chosen so in-game screenshots read at their best.
   Every colour and size comes from the tokens in :root.
   ===================================================================== */

:root {
  --bg: #0b0c0f;
  --bg-raise: #111318;
  --surface: #161920;
  --surface-2: #1e222a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);

  --text: #eceef2;
  --text-2: #b1b6c0;
  --text-3: #7a808b;

  --accent: #e9a24b;
  --accent-soft: rgba(233, 162, 75, 0.12);
  --accent-edge: rgba(233, 162, 75, 0.3);

  /* One colour per area, used for the small dots and tags. */
  --ls: #5cc4e4;
  --rox: #83cf8c;
  --sal: #b39dff;

  --radius: 12px;
  --radius-sm: 8px;
  --max: 1360px;
  --pad: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.75);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system,
    BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

.area-ls    { --dot: var(--ls); }
.area-rox   { --dot: var(--rox); }
.area-sal   { --dot: var(--sal); }
.area-other { --dot: var(--text-3); }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Soft warm and cool light at the top of the page, so the ground is not flat black. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 560px at 8% -12%, rgba(233, 162, 75, 0.11), transparent 62%),
    radial-gradient(900px 520px at 100% -6%, rgba(92, 196, 228, 0.08), transparent 60%);
}

html.lb-open, html.lb-open body { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #1a1206; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #1a1206;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.noscript {
  width: min(var(--max), calc(100% - 2 * var(--pad)));
  margin: 40px auto;
  color: var(--text-2);
}

/* Images fade in once decoded instead of popping. */
img.fade { opacity: 0; transition: opacity 0.45s ease, transform 0.6s var(--ease); }
img.fade.is-loaded { opacity: 1; }

.dot {
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, var(--text-3));
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: rgba(11, 12, 15, 0.72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.bar {
  height: 100%;
  width: min(var(--max), calc(100% - 2 * var(--pad)));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f4bd6c, #d0662b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 4px 14px -4px rgba(233, 162, 75, 0.55);
}

.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; gap: 2px; }
.nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.93rem;
  color: var(--text-2);
  transition: color 0.15s, background-color 0.15s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

/* ---------- Hero ---------- */

.hero {
  width: min(var(--max), calc(100% - 2 * var(--pad)));
  margin-inline: auto;
  padding: clamp(56px, 10vw, 124px) 0 clamp(40px, 6vw, 68px);
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.6vw, 4.3rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 25%, #aeb4bf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 22px 0 0;
  max-width: 60ch;
  font-size: clamp(1rem, 1.35vw, 1.14rem);
  color: var(--text-2);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 36px 0 0;
}
.stats div {
  min-width: 124px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
}
.stats dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stats dd {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Toolbar: views and filters ---------- */

.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  background: rgba(11, 12, 15, 0.84);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: var(--header-h);
}

.toolbar-inner {
  width: min(var(--max), calc(100% - 2 * var(--pad)));
  margin-inline: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.toolbar-row.filters { justify-content: flex-start; }

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.seg-btn svg { width: 16px; height: 16px; flex: none; }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 2px rgba(0, 0, 0, 0.45);
}
.seg-btn[aria-pressed="true"] svg { color: var(--accent); }

.result-count {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.filter { display: flex; align-items: center; gap: 10px; min-width: 0; }

.filter-label {
  flex: none;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 0.84rem;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.chip:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.035);
}
.chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: #0b0c0f;
}
.chip:disabled { opacity: 0.35; cursor: not-allowed; }
.chip .n { font-size: 0.74rem; opacity: 0.62; font-variant-numeric: tabular-nums; }

.reset {
  margin-left: auto;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
}
.reset:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Shared view layout ---------- */

.view, .empty {
  width: min(var(--max), calc(100% - 2 * var(--pad)));
  margin-inline: auto;
}
.view { padding: 30px 0 84px; }

.empty {
  padding: 96px 0;
  text-align: center;
  color: var(--text-3);
}

/* ---------- Tags ---------- */

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-2);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; }
.badge.kind {
  border-color: var(--accent-edge);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- View 1: projects ---------- */

.jump {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 48px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raise);
}

.jump-label {
  flex: none;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}

.jump-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.jump-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  color: var(--text-2);
  font-size: 0.86rem;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.jump-links a:hover { color: var(--text); border-color: var(--line-2); }

.kind-group + .kind-group { margin-top: 96px; }

.kind-head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.kind-head .eyebrow { margin-bottom: 8px; }
.kind-head h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.kind-head .count {
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-3);
}
.kind-blurb { margin: 8px 0 0; max-width: 62ch; color: var(--text-2); }

.area-group { padding-top: 46px; }

.area-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 20px;
}
.area-head .dot {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}
.area-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 620;
  letter-spacing: -0.015em;
}
.area-blurb { font-size: 0.9rem; color: var(--text-3); }
.area-head .count { margin-left: auto; font-size: 0.8rem; color: var(--text-3); }

.project {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
  scroll-margin-top: calc(var(--sticky-offset, 64px) + 18px);
}
.project + .project { margin-top: 18px; }

.project-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 24px;
  margin-bottom: 22px;
}

.project-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 620;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.project-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.shot-count {
  font-size: 0.8rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.project-desc {
  grid-column: 1 / -1;
  margin: 14px 0 0;
  max-width: 74ch;
  color: var(--text-2);
}

.text-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.text-btn { background: var(--surface); color: var(--text); }
.text-btn:hover { border-color: var(--accent-edge); color: var(--accent); }
.ghost-btn { background: transparent; color: var(--text-2); }
.ghost-btn:hover { color: var(--text); border-color: var(--text-3); }
.text-btn svg, .ghost-btn svg { width: 13px; height: 13px; flex: none; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.card { margin: 0; min-width: 0; }

.card-hit {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  text-align: left;
  cursor: zoom-in;
  transition: border-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card-hit:hover {
  border-color: var(--line-2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.frame {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0e1014;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.card-hit:hover .frame img { transform: scale(1.045); }

.card figcaption {
  padding: 9px 2px 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--text-2);
}

/* ---------- View 2: every shot ---------- */

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.grid-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 28px 0 4px;
  font-size: 0.82rem;
  color: var(--text-3);
}
.grid-label:first-child { margin-top: 0; }
.grid-label b { color: var(--text); font-weight: 600; }
.grid-label .dot { width: 8px; height: 8px; }

.tile {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0e1014;
  cursor: zoom-in;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile:hover img { transform: scale(1.05); }

.tile::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--text-3));
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.45);
}

.tile-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 32px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  text-align: left;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}
.tile:hover .tile-meta,
.tile:focus-visible .tile-meta { opacity: 1; transform: none; }
.tile-meta b {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: #fff;
}
.tile-meta span {
  display: block;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.74);
}

@media (hover: none) {
  .tile-meta { opacity: 1; transform: none; }
}

/* ---------- View 3: carousel ---------- */

.carousel { display: flex; flex-direction: column; gap: 14px; }

.stage {
  position: relative;
  display: grid;
  place-items: center;
  height: min(72vh, 800px);
  min-height: 300px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: #07080a;
  touch-action: pan-y;
}

/* The same shot, blurred behind itself, fills the letterbox around it. */
.stage-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  filter: blur(42px) saturate(125%);
  transform: scale(1.2);
}

/* Placed absolutely so the shot always fits inside the stage. A percentage
   max-height on a grid item in an auto-sized row does not resolve, and the
   image would spill out past the bottom of the stage. */
.stage-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
  -webkit-user-drag: none;
  user-select: none;
}
.stage-img.is-swapping { opacity: 0.6; }

.stage-nav, .lb-nav {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(10, 11, 14, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s var(--ease), border-color 0.2s;
}
.stage-nav:hover, .lb-nav:hover {
  background: rgba(10, 11, 14, 0.85);
  border-color: rgba(255, 255, 255, 0.34);
  transform: scale(1.06);
}
.stage-nav svg, .lb-nav svg { width: 22px; height: 22px; }

.stage-nav { position: absolute; top: 50%; z-index: 2; margin-top: -24px; }
.stage-nav.prev { left: 16px; }
.stage-nav.next { right: 16px; }

.progress {
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line);
}
.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #d0662b, var(--accent));
  transition: width 0.35s var(--ease);
}

.stage-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 2px 2px 0;
}
.stage-meta { min-width: 0; }

.stage-caption {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.stage-project {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--text-2);
}
.stage-title { color: var(--text); font-weight: 600; }
.stage-shotpos { color: var(--text-3); }

.stage-tools { display: flex; align-items: center; gap: 10px; }
.stage-counter {
  margin: 0 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.ghost-btn.play[aria-pressed="true"] {
  border-color: var(--accent-edge);
  background: var(--accent-soft);
  color: var(--accent);
}

.filmstrip {
  position: relative;
  display: flex;
  gap: 8px;
  padding: 4px 3px 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  cursor: grab;
  user-select: none;
}
.filmstrip.is-dragging { cursor: grabbing; scroll-behavior: auto; }
.filmstrip::-webkit-scrollbar { height: 8px; }
.filmstrip::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

.thumb {
  position: relative;
  flex: none;
  width: 128px;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: 7px;
  overflow: hidden;
  background: #0e1014;
  opacity: 0.45;
  outline: 2px solid transparent;
  outline-offset: 2px;
  cursor: pointer;
  transition: opacity 0.2s, outline-color 0.2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.thumb:hover { opacity: 0.85; }
.thumb[aria-selected="true"] { opacity: 1; outline-color: var(--accent); }

/* A small gap and rule mark where one project ends and the next begins. */
.thumb.group-start { margin-left: 14px; }
.thumb.group-start::before {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: -12px;
  width: 1px;
  background: var(--line-2);
}
.thumb.group-start { overflow: visible; }
.thumb.group-start img { border-radius: 7px; }

.hint { margin: 0; font-size: 0.8rem; color: var(--text-3); }

/* ---------- About and contact ---------- */

.prose {
  width: min(var(--max), calc(100% - 2 * var(--pad)));
  margin-inline: auto;
  padding: 60px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--header-h);
}
.prose h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 620;
  letter-spacing: -0.02em;
}
.prose p { margin: 0; max-width: 64ch; color: var(--text-2); }

.contact-line a {
  padding-bottom: 3px;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 2px;
  transition: background-size 0.35s var(--ease), color 0.2s;
}
.contact-line a:hover { color: var(--accent); background-size: 100% 2px; }

/* ---------- Footer ---------- */

.site-footer {
  width: min(var(--max), calc(100% - 2 * var(--pad)));
  margin-inline: auto;
  padding: 26px 0 44px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--text-3);
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 28px 24px;
  background: rgba(5, 6, 8, 0.93);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  touch-action: pan-y;
  animation: lb-in 0.2s ease;
}

.lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin: 0;
}
.lb-figure img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.85);
  -webkit-user-drag: none;
  user-select: none;
}
.lb-figure figcaption { text-align: center; }
.lb-caption { display: block; font-weight: 600; color: #fff; }
.lb-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
}

.lb-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.14); }
.lb-close svg { width: 20px; height: 20px; }

@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  .project { padding: 20px; }
  .project-head { grid-template-columns: minmax(0, 1fr); }
  .project-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
  }
  .project-desc { margin-top: 10px; }
}

@media (max-width: 720px) {
  :root { --header-h: 56px; }

  /* Let the heading wrap naturally instead of forcing a break that orphans a word. */
  .br-wide { display: none; }

  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stats div { min-width: 0; padding: 12px 12px; }
  .stats dd { font-size: 1.45rem; }

  /* Chips scroll sideways on a phone; fade the right edge so that reads as scrollable. */
  .chips {
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
    padding-right: 24px;
  }

  /* On a phone the toolbar would eat a third of the screen, so it scrolls away. */
  .toolbar { position: static; }

  .nav a { padding: 6px 8px; font-size: 0.88rem; }

  .toolbar-row { flex-direction: column; align-items: stretch; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; padding: 8px 6px; }
  .filter { width: 100%; align-items: center; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .reset { margin-left: 0; align-self: flex-start; }

  .jump { flex-direction: column; gap: 8px; margin-bottom: 36px; }
  .kind-group + .kind-group { margin-top: 72px; }
  .area-head .count { margin-left: 0; width: 100%; }

  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 10px; }
  .shot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

  .stage { height: auto; aspect-ratio: 4 / 3; min-height: 0; }
  .stage-nav { width: 40px; height: 40px; margin-top: -20px; }
  .stage-nav.prev { left: 10px; }
  .stage-nav.next { right: 10px; }
  .stage-tools { width: 100%; }
  .stage-counter { margin-right: auto; }
  .thumb { width: 92px; }

  .lightbox { grid-template-columns: minmax(0, 1fr); padding: 64px 12px 84px; }
  .lb-nav { position: absolute; bottom: 20px; width: 46px; height: 46px; }
  .lb-nav.prev { left: 20px; }
  .lb-nav.next { right: 20px; }
  .lb-figure img { max-height: calc(100vh - 220px); }
}

@media (max-width: 400px) {
  .brand-mark { display: none; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
}

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