:root {
  --bg: #1e1e1e;
  --bg-2: #222222;
  --ink: #e6e6e6;
  --mute: #868686;
  --hi: rgba(255, 255, 255, .055);
  --lo: rgba(0, 0, 0, .55);
  --raised: -5px -5px 12px var(--hi), 7px 7px 16px var(--lo);
  --raised-sm: -3px -3px 7px var(--hi), 4px 4px 10px var(--lo);
  --inset: inset 3px 3px 8px var(--lo), inset -3px -3px 8px var(--hi);
  --glass: rgba(30, 30, 30, .72);
  --r: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --hdr: calc(56px + var(--safe-t));
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/jetbrains-mono-400.woff2) format("woff2");
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font: 400 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 1.5px solid var(--mute); outline-offset: 3px; }

.neu {
  display: grid; place-items: center;
  background: var(--bg);
  border-radius: 999px;
  box-shadow: var(--raised-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), opacity .25s;
}
.neu:hover { transform: translateY(-1px); }
.neu:active, .neu[aria-current="page"], .neu[aria-pressed="true"] { box-shadow: var(--inset); transform: none; }

/* ── header ─────────────────────────────────────────── */
.top {
  position: fixed; z-index: 30; inset: 0 0 auto;
  height: var(--hdr); padding: var(--safe-t) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 6px 18px rgba(0, 0, 0, .28);
}
.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  text-decoration: none; color: var(--ink);
  font: 400 14px/1 var(--mono); letter-spacing: .02em; white-space: nowrap;
}
.brand img { width: 26px; height: 26px; flex: none; opacity: .92; }

/* nav pills: raised and icon-only; the current one sinks and unfolds its label,
   the same way a year opens in works */
.tabs { display: flex; gap: 10px; }
.tabs a {
  display: flex; align-items: center; justify-content: flex-start;
  height: 36px; padding: 0 9px;
  text-decoration: none; color: var(--mute);
  font: 400 12.5px/1 var(--mono); letter-spacing: .04em;
}
.tabs svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.tabs span {
  max-width: 0; overflow: hidden; opacity: 0; white-space: nowrap;
  transition: max-width .45s var(--ease), opacity .3s, margin .45s var(--ease);
}
.tabs a[aria-current="page"] { color: var(--ink); padding-right: 13px; }
.tabs a[aria-current="page"] span { max-width: 6em; opacity: 1; margin-left: 8px; }
@media (hover: hover) {
  .tabs a:hover { color: var(--ink); }
}

/* ── tree ───────────────────────────────────────────
   One page, browsed like a file system: every section and year is a folder row
   that unfolds in place. Open folders' rows stick under the header. */
.tree {
  --row: 46px;
  --head: calc(var(--row) + 14px);
  max-width: 1480px; margin: 0 auto;
  padding: calc(var(--hdr) + 8px) 16px calc(45svh + var(--safe-b));
  display: grid; gap: 4px;
}
.tree > .node { scroll-margin-top: var(--hdr); }
.head {
  position: sticky; top: var(--hdr); z-index: 6;
  padding: 7px 0; background: var(--bg);
}
.years .head { top: calc(var(--hdr) + var(--head)); z-index: 5; }
.row {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px;
  width: 100%; height: var(--row); padding: 0 18px;
  border-radius: var(--r);
  font: 400 13.5px/1 var(--mono); letter-spacing: .06em; font-variant-numeric: tabular-nums;
  color: var(--mute);
}
.row svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.open > .head > .row { color: var(--ink); box-shadow: var(--inset); }
.open > .head > .row svg { transform: rotate(90deg); }
.body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.open > .body { grid-template-rows: 1fr; }
.snap > .body { transition: none; }
.body > .inner { min-height: 0; overflow: clip; }
.open > .body > .inner { overflow-clip-margin: 24px; }

/* children are indented on a faint guide line, like a directory listing */
.inner { position: relative; }
.tree > .node > .body > .inner::before {
  content: ""; position: absolute; left: 25px; top: 0; bottom: 10px; width: 1px;
  background: rgba(255, 255, 255, .07);
}
#flash .inner::before { display: none; }
.years, .links-inner { margin-left: 25px; padding-left: 17px; }
.stage { margin-left: 42px; }
.years { display: grid; gap: 2px; padding-top: 2px; }

/* ── flash ──────────────────────────────────────────── */
.stage {
  position: relative; overflow: hidden; margin-top: 6px; margin-bottom: 8px;
  height: calc(100svh - var(--hdr) - var(--head) - 16px);
  touch-action: pan-y; cursor: zoom-in; user-select: none; -webkit-user-select: none;
}
/* pressed into the page like the panels: the rim sits over the quilt */
.stage { border-radius: var(--r); }
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  border-radius: inherit; box-shadow: var(--inset), inset 0 0 0 1px rgba(0, 0, 0, .35);
}
.stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; -webkit-touch-callout: none; }
.stage.free { touch-action: none; cursor: grab; }
.stage.free.dragging { cursor: grabbing; }
.stage:focus-visible { outline-offset: 2px; }
.quilt-ctrl {
  position: absolute; z-index: 2; right: 12px; bottom: 12px;
  display: flex; gap: 10px; touch-action: manipulation; cursor: default;
}
.quilt-ctrl .neu { width: 38px; height: 38px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.quilt-ctrl .neu:disabled { opacity: 0; pointer-events: none; }
.quilt-ctrl svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quilt-hint {
  position: absolute; z-index: 2; left: 12px; bottom: 12px; pointer-events: none;
  padding: 0 12px; height: 30px; display: flex; align-items: center; border-radius: 999px;
  font: 400 11.5px/1 var(--mono); letter-spacing: .04em; color: var(--ink);
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity .4s;
}
.quilt-hint.gone { opacity: 0; }
@media (max-width: 420px) { .quilt-hint { bottom: 16px; } }
.plane { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.plane img {
  position: absolute; max-width: none;
  opacity: 0; transition: opacity .6s;
  -webkit-user-drag: none; user-select: none;
}
.plane img.in { opacity: 1; }

/* ── works ──────────────────────────────────────────── */
.grid { position: relative; margin: 22px 6px 10px; }

.tile {
  position: absolute; cursor: pointer;
  border-radius: 10px;
  isolation: isolate;
  transition: transform .35s var(--ease);
}
.tile > .face {
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit;
  background: var(--bg-2);
  box-shadow: var(--raised);
}
.tile .face > img, .tile .face > video, .tile .face > model-viewer, .tile .face > iframe {
  width: 100%; height: 100%; object-fit: cover; border: 0;
}
.tile model-viewer { pointer-events: none; --poster-color: transparent; background: transparent; }
.tile.embed { cursor: default; }
.tile.embed model-viewer, .tile.embed iframe { pointer-events: auto; }

/* stacked cards hint at what fans out */
.tile.stack::before, .tile.stack::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--bg-2);
  box-shadow: var(--raised-sm);
  transition: transform .45s var(--ease);
}
.tile.stack::before { transform: rotate(-2.2deg) translate(-3px, 2px); opacity: .55; }
.tile.stack::after  { transform: rotate(1.8deg) translate(3px, 1px); opacity: .8; }
@media (hover: hover) {
  .tile:hover { transform: translateY(-2px); }
  .tile.stack:hover::before { transform: rotate(-6deg) translate(-12px, 4px); }
  .tile.stack:hover::after  { transform: rotate(4.5deg) translate(10px, 2px); }
}
.tile.away { visibility: hidden; }

/* ── overlays ───────────────────────────────────────── */
.fan, .lb {
  position: fixed; inset: 0;
  background: rgba(22, 22, 22, .55);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  opacity: 0; transition: opacity .35s;
}
.fan { z-index: 40; }
.lb  { z-index: 50; background: rgba(18, 18, 18, .9); }
.fan.in, .lb.in { opacity: 1; }

.fan-scroll {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 76px 16px calc(40px + var(--safe-b));
}
.fan-grid { position: relative; margin: 0 auto; }
.card {
  position: absolute; cursor: zoom-in;
  border-radius: 10px; overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .45);
  transform-origin: 50% 50%;
  will-change: transform;
}
.card > img, .card > video, .card > model-viewer, .card > iframe { width: 100%; height: 100%; object-fit: cover; border: 0; }
.card model-viewer { pointer-events: none; background: transparent; }
.card.embed { cursor: default; }
.card.embed iframe { pointer-events: auto; }

.ctrl {
  position: fixed; z-index: 60; top: max(16px, env(safe-area-inset-top)); right: 16px;
  display: flex; gap: 12px;
}
.ctrl .neu, .lb-nav { width: 42px; height: 42px; }
.ctrl svg, .lb-nav svg { width: 17px; height: 17px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.cap {
  max-width: 62ch; margin: 0 auto 24px; padding: 18px 22px;
  color: var(--mute); font-size: 13.5px; line-height: 1.65;
  border-radius: var(--r); box-shadow: var(--inset);
  opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s var(--ease);
}
.cap.in { opacity: 1; transform: none; }
.cap p { margin: 0; }
.cap p a { color: var(--ink); text-decoration-color: rgba(255, 255, 255, .3); text-underline-offset: 3px; }
.cap p a:hover { text-decoration-color: currentColor; }
.cap p + .cap-links { margin-top: 14px; }
.cap-links { display: flex; flex-wrap: wrap; gap: 10px; }
.cap-links a {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 12px;
  font: 400 12.5px/1 var(--mono); letter-spacing: .04em; color: var(--ink); text-decoration: none;
}
.cap-links svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── lightbox ───────────────────────────────────────── */
.lb-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.lb-stage .plane img { opacity: 1; }
.lb-stage > video {
  position: absolute; inset: 0; margin: auto;
  max-width: 100%; max-height: 100%; width: auto; height: auto;
}
.lb-stage > model-viewer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: transparent; --poster-color: transparent;
  --progress-bar-color: var(--mute); --progress-bar-height: 1px;
}
.lb-nav {
  position: absolute; z-index: 2; top: 50%; margin-top: -21px;
  opacity: .8;
}
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }
@media (hover: none) { .lb-nav { display: none; } }

/* ── links ──────────────────────────────────────────── */
.links-inner { max-width: 680px; display: grid; gap: 18px; justify-items: stretch; padding-top: 8px; padding-bottom: 10px; }
.panel {
  list-style: none; margin: 0; padding: 16px 20px;
  border-radius: var(--r); box-shadow: var(--inset);
  display: grid; gap: 8px;
  font-size: 13.5px; color: var(--mute);
}
.panel li { display: flex; justify-content: space-between; gap: 16px; }
.panel a { text-decoration: none; transition: color .2s; }
.panel a:hover { color: var(--ink); }
.panel i { font-style: normal; font-variant-numeric: tabular-nums; opacity: .7; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 2px; }
.socials a { width: 36px; height: 36px; }
.socials img { width: 18px; height: 18px; opacity: .82; transition: opacity .2s; }
.socials a:hover img { opacity: 1; }
.socials a.off { pointer-events: none; cursor: default; filter: grayscale(1); opacity: .4; }
.cv { display: grid; gap: 18px; }

@media (max-width: 600px) {
  .top { gap: 8px; }
  .brand { gap: 8px; font-size: 13px; }
  .brand img { width: 24px; height: 24px; }
  .tabs { gap: 8px; }
  .tree { --row: 42px; padding-left: 12px; padding-right: 12px; }
  .years, .links-inner { margin-left: 21px; padding-left: 9px; }
  .stage { margin-left: 0; }
  .tree > .node > .body > .inner::before { left: 21px; }
  .row { padding: 0 14px; gap: 10px; }
  .grid { margin: 18px 2px 6px; }
}

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