@charset "utf-8";
/* ==========================================================================
   Fonts (self-hosted — no requests to Google, GDPR-friendly)
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("../fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  --bg: #07070a;
  --surface: rgba(16, 16, 22, 0.72);
  --surface-solid: #101016;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #ecebe8;
  --muted: #9a99a3;
  --faint: #6b6a74;
  --accent: #7cf0c5; /* fallback only; the real one is SITE.accent in content.js */
  --accent-ink: #07070a;
  --dim: 0;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Martian Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
  --radius: 0px;
  --tag-radius: 0px; /* all tag pills (table categories, roles/tools, live coding chips) and the "+ n earlier" button; e.g. 4px for rounded rectangles */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --player-h: 64px;

  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* Anchor jumps put a section heading ~30px below the top bar: heading = scroll-padding
   + scroll-margin + section top padding (48px; 36px on phones, see below). */
html { scroll-behavior: smooth; scroll-padding-top: 46px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: var(--player-h);
}

a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-feature-settings: "calt" 0; }

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

::selection { background: var(--accent); color: var(--accent-ink); }

kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.1em 0.45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 0px;
}

/* ==========================================================================
   Background
   ========================================================================== */

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Canvas matches the screen; on phones visuals.js renders the middle of a 16:9 frame. */
  z-index: -2;
  transition: opacity 0.28s ease;
}
#bg.is-swapping { opacity: 0; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Left-to-right darkening for legibility. main.js replaces it with the same
     gradient as a dithered image (--scrim-img): this gentle a gradient has only a
     dozen colour steps, which otherwise show as faint vertical bands. */
  background-image: var(--scrim-img, linear-gradient(90deg, rgba(7, 7, 10, 0.6) 0%, rgba(7, 7, 10, 0.35) 45%, rgba(7, 7, 10, 0.05) 85%));
  background-size: 100% 256px;
  image-rendering: pixelated; /* keep the dither noise crisp when stretched */
  background-color: rgba(7, 7, 10, calc(0.1 + var(--dim) * 0.62));
}

.no-webgl #bg { display: none; }
.no-webgl body {
  background:
    radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 50%),
    radial-gradient(circle at 80% 70%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 50%),
    var(--bg);
  background-attachment: fixed;
}

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px var(--gutter);
  background: linear-gradient(rgba(7, 7, 10, 0.85), rgba(7, 7, 10, 0));
}

.logo {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.logo:hover { color: var(--accent); }
.logo::before { content: ""; color: var(--accent); }

.topbar nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 16px;
}
.topbar nav a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}
.topbar nav a:hover { color: var(--text); }

/* Dropdowns for games / films */
.nav-group { position: relative; padding-bottom: 14px; margin-bottom: -14px; }
.nav-group > a::after { content: " \25BE"; font-size: 0.7em; opacity: 0.6; }
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  top: 100%;
  left: calc(-12px - var(--nudge, 0px)); /* --nudge: set by main.js to stop at the screen edge */
  min-width: 320px;
  max-width: min(420px, calc(100vw - 2 * var(--gutter)));
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s var(--ease), visibility 0.15s;
}
.nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu { opacity: 1; visibility: visible; transform: none; }
.topbar .nav-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.3;
}
.nav-thumb {
  flex: none;
  width: 64px;
  aspect-ratio: 16 / 9;
  border-radius: 0px;
  overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h) 55% 22%), hsl(calc(var(--h) + 50) 50% 9%));
  border: 1px solid var(--line);
}
.nav-thumb { position: relative; isolation: isolate; }
.nav-thumb:has(img) { background: #000; }
.nav-thumb:has(img)::before { inset: -8px; filter: blur(6px) brightness(0.6) saturate(1.3); }
.nav-thumb img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.nav-title { flex: 1; }
.nav-year { font-size: 11px; color: var(--faint); }
.topbar .nav-menu a:hover, .topbar .nav-menu a[aria-current="page"] { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.topbar .nav-menu a[aria-current="page"] { box-shadow: inset 0 0 0 1px var(--accent); } /* thin accent outline all around */
/* After picking an entry, keep the menu shut until the pointer leaves it. */
@media (min-width: 1081px) {
  .nav-group.is-closed .nav-menu { opacity: 0; visibility: hidden; transform: translateY(4px); }
}

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(7, 7, 10, 0.5);
  cursor: pointer;
  place-content: center;
  gap: 5px;
}
.menu-btn span { display: block; width: 16px; height: 1.5px; background: var(--text); transition: transform 0.2s var(--ease); }
.menu-open .menu-btn span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-open .menu-btn span:last-child { transform: translateY(-3.25px) rotate(-45deg); }


/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  min-height: 60svh; /* shorter than the screen so the showreel peeks in */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--gutter) 32px;
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
}

.eyebrow {
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 18px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(3.2rem, 12vw, 8rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  color: var(--muted);
  max-width: 30ch;
  margin: 26px 0 36px;
  line-height: 1.4;
}


.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 0px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-strong); background: rgba(7, 7, 10, 0.35); }
.btn-ghost:hover { border-color: var(--text); }
.btn-icon { font-size: 0.8em; }

.readout {
  position: absolute;
  right: var(--gutter);
  bottom: 80px;
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 7, 10, 0.45);
  white-space: pre;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px var(--gutter);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.section h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.section h2 .num { font-size: 13px; color: var(--accent); letter-spacing: 0; font-weight: 400; }

.section-note { color: var(--muted); margin: 0 0 28px; }

.filters { display: flex; gap: 6px; }
.filters button {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.filters button:hover { color: var(--text); }
.filters button.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Work list ---------- */

.works { list-style: none; margin: 0; padding: 0; }

.work { border-bottom: 1px solid var(--line); }

.work-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto 56px 52px;
  align-items: center;
  gap: 20px;
  padding: 20px 14px;
  cursor: pointer;
  position: relative;
  transition: background 0.25s;
}
.work:has(.work-title:focus-visible) .work-btn { outline: 2px solid var(--accent); outline-offset: -2px; }
.work-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--c);
  transform: scaleY(0);
  transition: transform 0.3s var(--ease);
}
.work-btn:hover { background: rgba(255, 255, 255, 0.035); }
.work-btn:hover::before, .work.is-active .work-btn::before { transform: scaleY(1); }
.work.is-active .work-btn { background: color-mix(in srgb, var(--c) 8%, transparent); }

.work-num { font-size: 12px; color: var(--faint); grid-column: 1; grid-row: 1; }
.work.is-active .work-num { visibility: hidden; }

.eq {
  grid-column: 1;
  grid-row: 1;
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}
.eq i { width: 3px; height: 100%; background: var(--c); transform-origin: bottom; transform: scaleY(0.3); }
.work.is-active .eq { display: flex; }
.work.is-playing .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
.work.is-playing .eq i:nth-child(2) { animation-duration: 0.6s; animation-delay: -0.2s; }
.work.is-playing .eq i:nth-child(3) { animation-duration: 0.75s; animation-delay: -0.5s; }
@keyframes eq { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }

.work-main { display: flex; flex-direction: column; min-width: 0; }
.work-title {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.work-title:focus-visible { outline: none; }
.work.is-active .work-title { color: var(--c); }
.work-project { color: var(--muted); font-size: 14px; }
a.work-project {
  width: fit-content;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
a.work-project:hover { color: var(--text); text-decoration-color: var(--c); }

.work-tags { display: flex; gap: 6px; }
.work-tags span {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--tag-radius);
  color: var(--muted);
}
.work-year, .work-dur { font-size: 12px; color: var(--faint); }
.work-dur { text-align: right; }

/* Game/film pages: no category tags or year (the page already says both). */
.page .work-tags, .page .work-year { display: none; }
.page .work-btn { grid-template-columns: 44px 1fr 52px; }
@media (max-width: 900px) { .page .work-btn { grid-template-columns: 36px 1fr 52px; } }
@media (max-width: 1080px) {
  html { scroll-padding-top: 62px; } /* taller top bar with the burger */
  .menu-btn { display: grid; }
  .topbar nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    max-height: calc(100svh - 70px);
    overflow-y: auto;
    padding: 8px var(--gutter) 20px;
    background: var(--surface-solid);
    border-bottom: 1px solid var(--line);
  }
  .topbar.menu-open nav { display: flex; }
  .topbar nav > a, .nav-group > a { display: block; padding: 10px 0; font-size: 18px; color: var(--text); }
  .nav-group { padding: 0; margin: 0; }
  .nav-group > a::after { content: none; }
  .nav-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    padding: 0 0 8px 12px;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .topbar .nav-menu a { padding: 6px 10px 6px 0; font-size: 15px; white-space: normal; }
  .nav-thumb { width: 52px; }
}

@media (max-width: 640px) { .page .work-btn { grid-template-columns: 28px 1fr 40px; } }

/* Showreel slot above "Selected music" */
.showreel { padding-top: 32px; padding-bottom: 48px; scroll-margin-top: 16px; /* makes up for the smaller top padding */ }
.showreel-slot { margin-top: 28px; }
.showreel-slot figure { margin: 0; } /* browsers indent <figure> by 40px per side */
.showreel-placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(7, 7, 10, 0.45);
  color: var(--muted);
  font-size: 15px;
}
.showreel-play {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  padding-left: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-size: 22px;
}

/* Main page: no numbering. A narrow first column is kept for the "now playing" bars. */
#top .section h2 .num, #workList .work-num { display: none; }
/* Selected music: tag | title | year | length. The tag column has a fixed width
   (fits "Live Coding") so the titles line up; year and length sit at the right.
   Each part names its column, so the order in the HTML doesn't matter. */
#workList .work-btn { grid-template-columns: 14px 116px minmax(0, 1fr) 56px 52px; column-gap: 24px; }
#workList .work-btn > * { grid-row: 1; }
#workList .work-tags { grid-column: 2; flex-wrap: wrap; justify-content: flex-start; }
#workList .work-main { grid-column: 3; }
#workList .work-year { grid-column: 4; }
#workList .work-dur { grid-column: 5; }
/* Tablets: no year. Phones: no tag either. */
@media (max-width: 900px) {
  #workList .work-btn { grid-template-columns: 14px 116px minmax(0, 1fr) 52px; }
  #workList .work-dur { grid-column: 4; }
}
@media (max-width: 640px) {
  #workList .work-btn { grid-template-columns: 14px 1fr 40px; column-gap: 12px; }
  #workList .work-main { grid-column: 2; }
  #workList .work-dur { grid-column: 3; }
}


/* ---------- Credits ---------- */

.credits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.credit {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.credit:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.credit-cover {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, hsl(var(--h) 55% 22%), hsl(calc(var(--h) + 50) 50% 9%));
  overflow: hidden;
}
/* Whole image, centred; any leftover space shows a blurred copy of it. */
.credit-cover { position: relative; isolation: isolate; }
.credit-cover.has-img { background: #000; }
.credit-cover.has-img::before,
.nav-thumb:has(img)::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: -1;
  background: var(--img) center / cover no-repeat;
  filter: blur(18px) brightness(0.6) saturate(1.3);
}
.credit-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.credit-cover span { padding: 0 20px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, 0.7); letter-spacing: 0.05em; text-transform: uppercase; }
.credit-body { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px 18px; }
.credit-title { font-size: 1.15rem; font-weight: 500; }
.credit-role { color: var(--muted); font-size: 15px; }
.tag-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.skills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.skills li {
  font-size: 11px;
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--tag-radius);
  color: var(--muted);
  white-space: nowrap;
}
.detail-skills { margin-top: 22px; gap: 8px; }
.detail-skills .skills { gap: 8px; }
.detail-skills li { font-size: 13px; padding: 5px 12px; color: var(--text); background: rgba(7, 7, 10, 0.4); }
.credit-meta { color: var(--faint); font-size: 11px; margin-top: 8px; }

/* ---------- Live ---------- */

.live-grid, .about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  margin-top: 28px;
}
.prose p { margin: 0 0 1.1em; max-width: 60ch; }
.prose .big { font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.35; letter-spacing: -0.01em; }

.chips { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 12px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--tag-radius);
  background: rgba(7, 7, 10, 0.4);
}

.small-h { font-size: 12px; color: var(--accent); font-weight: 400; margin: 0 0 14px; }

.gigs { list-style: none; margin: 0; padding: 0; }
.gigs > li {
  display: grid;
  grid-template-columns: 100px 1fr;
  column-gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.gig-date { font-size: 12px; color: var(--faint); grid-row: span 3; padding-top: 4px; }
.gig-tags { margin-top: 6px; }
.gig-tags li { font-size: 10px; padding: 1px 8px; }
.gigs a { text-decoration: none; font-weight: 500; }
.gigs a:hover { color: var(--accent); }
.gig-place { color: var(--muted); font-size: 14px; }
.gigs .is-upcoming .gig-date { color: var(--accent); }
.gigs .is-upcoming .gig-date::after { content: " \25CF"; animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.more-btn {
  margin-top: 16px;
  font-size: 12px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--tag-radius);
  background: rgba(7, 7, 10, 0.4);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.more-btn:hover { border-color: var(--accent); color: var(--text); }

/* ---------- About ---------- */

.portrait {
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.3) contrast(1.05); }
.portrait.is-empty { display: grid; place-items: center; }
.portrait.is-empty img { display: none; }
.portrait.is-empty::after {
  content: "media/portrait.jpg";
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

/* ---------- Contact ---------- */

.email {
  display: inline-block;
  font-size: clamp(1.8rem, 6vw, 1rem);
  letter-spacing: -0.03em;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.1;
  word-break: break-word;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.4s var(--ease), color 0.2s;
}
.email:hover { color: var(--accent); background-size: 100% 2px; }

.socials { list-style: none; padding: 0; margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 14px; }
.socials a { text-decoration: none; color: var(--muted); }
.socials a:hover { color: var(--text); }

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter) 36px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--faint);
  border-top: 1px solid var(--line);
}
.footer a { color: inherit; }
.legal-links > span { margin-left: 16px; white-space: nowrap; }
.legal-links a { text-decoration: none; }
@media (max-width: 640px) {
  .legal-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
  .legal-links > span { margin-left: 0; }
}
.legal-links a:hover { color: var(--accent); }

/* Impressum / Datenschutz */
.legal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.legal-lang { display: flex; gap: 14px; font-size: 12px; }
.legal-lang a { color: var(--muted); text-decoration: none; }
.legal-lang a:hover { color: var(--accent); }
.legal-lang [aria-current] { color: var(--text); border-bottom: 1px solid var(--accent); }
.legal .detail-head h1 { hyphens: auto; overflow-wrap: anywhere; }
.legal-body { max-width: 70ch; }
.legal-body h2 { font-size: 1.15rem; font-weight: 600; margin: 40px 0 10px; letter-spacing: -0.01em; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body ul { margin: 0 0 12px; line-height: 1.6; color: var(--muted); }
.legal-body ul { padding-left: 1.2em; }
.legal-body a { color: var(--accent); }
.legal-body mark.todo { background: #ffd23f; color: #07070a; padding: 0 4px; border-radius: 3px; }

/* ==========================================================================
   Game / film pages
   ========================================================================== */

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 104px var(--gutter) 96px;
}

.back { font-size: 12px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent); }

.detail-head { margin: 32px 0 40px; }
.detail-head h1 {
  font-size: clamp(2.6rem, 8vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}
.detail-head h1:focus { outline: none; }
.detail-head .lede { margin: 20px 0 0; max-width: none; }

.detail-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
.detail-cover {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
}

.detail-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 24px;
  margin: 0;
  padding: 20px 22px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.detail-meta dt { color: var(--faint); }
.detail-meta dd { margin: 0; }

.detail-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Page blocks (the `page` list in content.js) */
.blocks { display: flex; flex-direction: column; gap: 32px; margin-top: 64px; }
.block { margin: 0; }
.block-text p { margin: 0; font-size: 1.1rem; max-width: 65ch; }
.block-text p a { color: var(--accent); }
.block-text + .block-text { margin-top: -14px; }
.block-h {
  margin: 28px 0 -6px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.block-video {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.block-video video { display: block; width: 100%; max-height: 75svh; background: #000; }
.block-video figcaption, .block-image figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--muted);
}
.block-video figcaption { background: var(--surface-solid); border-top: 1px solid var(--line); }
.block-video figcaption .mono, .block-image figcaption { font-size: 12px; color: var(--faint); }
.block-image img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.block-image figcaption { padding: 8px 2px 0; }
.block-quote { padding-left: 24px; border-left: 2px solid var(--accent); }
.block-quote p { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.35; letter-spacing: -0.01em; }
.block-quote cite { display: block; margin-top: 12px; font-size: 12px; font-style: normal; color: var(--faint); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.gallery a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.4s var(--ease); }
.gallery a:hover img { transform: scale(1.03); }

.detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 88px;
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
}
.detail-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.detail-nav a span { font-size: 11px; font-weight: 400; color: var(--faint); letter-spacing: 0; }
.detail-nav a:hover { color: var(--accent); }
.detail-nav .next { text-align: right; margin-left: auto; }

/* ==========================================================================
   Player
   ========================================================================== */

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: var(--player-h);
  display: grid;
  grid-template-columns: auto minmax(0, 280px) 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 0 var(--gutter);
  background: rgba(10, 10, 14, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease);
}
.player.is-visible { transform: none; }

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.4s;
}
.play-btn:active { transform: scale(0.92); }
.play-btn svg { width: 18px; height: 18px; fill: currentColor; }
.play-btn .i-pause { display: none; }
.is-playing .play-btn .i-pause { display: block; }
.is-playing .play-btn .i-play { display: none; }

.player-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.player-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-project { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress {
  --p: 0;
  height: 28px;
  display: flex;
  align-items: center;
  position: relative;
  touch-action: none;
}
.progress.is-seekable { cursor: pointer; }
.progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--line-strong);
  border-radius: 3px;
  transition: height 0.15s;
}
.progress-fill {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--p));
  transition: height 0.15s, transform 0.1s linear;
}
.progress.is-scrubbing .progress-fill { transition: height 0.15s; }

/* Handle */
.progress.is-seekable::after {
  content: "";
  position: absolute;
  left: calc(var(--p) * 100%);
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
  transform: scale(0);
  transition: transform 0.15s var(--ease);
}
.progress.is-seekable:hover::before, .progress.is-seekable:hover .progress-fill,
.progress.is-scrubbing::before, .progress.is-scrubbing .progress-fill { height: 5px; }
.progress.is-seekable:hover::after, .progress.is-scrubbing::after,
.progress.is-seekable:focus-visible::after { transform: scale(1); }

/* Time preview under the cursor */
.progress-tip {
  position: absolute;
  bottom: 100%;
  transform: translateX(-50%);
  padding: 3px 7px;
  font-size: 11px;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.progress.is-seekable:hover .progress-tip, .progress.is-scrubbing .progress-tip { opacity: 1; }
@media (hover: none) { .progress.is-seekable:not(.is-scrubbing) .progress-tip { opacity: 0; } }
.player.is-synth .progress-fill {
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 10px);
  opacity: 0.6;
}
.is-playing .player.is-synth .progress-fill { animation: crawl 0.5s linear infinite; }
@keyframes crawl { to { background-position: 10px 0; } }

.player-time { font-size: 12px; color: var(--muted); min-width: 92px; text-align: right; }

/* ==========================================================================
   Video stage
   ========================================================================== */

.stage {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 72px var(--gutter) calc(var(--player-h) + 24px);
  background: rgba(7, 7, 10, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.stage.is-open { opacity: 1; }
.stage-inner {
  width: min(1100px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 120px color-mix(in srgb, var(--accent) 25%, transparent);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.35s var(--ease);
}
.stage.is-open .stage-inner { transform: none; }
.stage-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 8px 8px 16px;
  font-size: 12px;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--line);
}
.stage video { display: block; width: 100%; max-height: calc(100svh - 220px); background: #000; }

.icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 4cqw;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + 16px);
  z-index: 50;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 16px;
  font-size: 12px;
  border-radius: var(--radius);
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .work-btn { grid-template-columns: 36px 1fr auto 52px; }
  .work-year { display: none; }
  .live-grid, .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 360px; }
  .readout { position: static; margin-top: 48px; align-self: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .work-btn { grid-template-columns: 28px 1fr 40px; gap: 12px; padding: 16px 6px; }
  .work-tags { display: none; }
  .section { padding: 36px var(--gutter); }
  .hero { min-height: 50svh; }
  html { scroll-padding-top: 72px; } /* taller top bar */
  .showreel { scroll-margin-top: 0; } /* same padding as the rest here */
  .player { grid-template-columns: auto 1fr auto; gap: 12px; }
  .progress { position: absolute; left: 0; right: 0; top: -14px; height: 28px; }
  .player-time { min-width: 0; }
  .gigs > li { grid-template-columns: 88px 1fr; }
}

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