:root {
  --bg: #fbfbf9; --surface: #f0efeb; --text: #1b1b1b; --muted: #7a7a76; --line: #e4e3de; --accent: #8a6a2f;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px var(--gutter) 18px; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand-name { font-size: 1.15rem; font-weight: 600; letter-spacing: .02em; }
.brand-tag { color: var(--muted); font-size: .85rem; }
.site-header nav { display: flex; gap: 20px; margin-top: 6px; flex-wrap: wrap; }
.site-header nav a { text-decoration: none; color: var(--muted); font-size: .92rem; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--text); }
.signature img { height: clamp(44px, 7vw, 72px); width: auto; }

main { padding: 0 var(--gutter); }

/* Slideshow */
.show { margin: 4px 0 40px; }
.stage { position: relative; height: min(72vh, 820px); min-height: 260px; }
.slide { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .7s ease; pointer-events: none; }
.slide.is-active { opacity: 1; pointer-events: auto; }
.slide a { display: contents; }
.slide img { max-width: 100%; max-height: calc(100% - 30px); width: auto; height: auto; object-fit: contain; }
.slide figcaption { margin-top: 8px; font-size: .88rem; color: var(--muted); text-align: center; }
.slide figcaption a { text-decoration: none; color: var(--text); }
.controls { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 10px; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.controls button { background: none; border: 0; padding: 4px 2px; font: inherit; color: var(--muted); cursor: pointer; }
.controls button:hover { color: var(--text); }
.thumbs { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.thumbs button { padding: 0; border: 2px solid transparent; background: var(--surface); cursor: pointer; aspect-ratio: 1; width: 100%; overflow: hidden; }
.thumbs button[aria-current="true"] { border-color: var(--text); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.show:fullscreen { background: var(--bg); padding: 24px; display: flex; flex-direction: column; justify-content: center; }
.show:fullscreen .stage { height: calc(100vh - 90px); }
/* Without JavaScript (no .js class on <html>), just stack the images */
html:not(.js) .slide { position: static; opacity: 1; margin-bottom: 24px; }
html:not(.js) .stage { height: auto; }
html:not(.js) .slide img { max-height: none; }
html:not(.js) .controls, html:not(.js) .thumbs { display: none; }

.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin: 8px 0 12px; }
.grid { list-style: none; margin: 0 0 44px; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.grid a { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--surface); text-decoration: none; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card-title { position: absolute; inset: auto 0 0 0; padding: 30px 12px 10px; font-size: .92rem; font-weight: 500; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.72)); opacity: 0; transition: opacity .25s; display: flex; justify-content: space-between; gap: 8px; }
.card-title small { opacity: .8; font-weight: 400; }
.grid a:hover img, .grid a:focus-visible img { transform: scale(1.04); }
.grid a:hover .card-title, .grid a:focus-visible .card-title { opacity: 1; }
@media (hover: none) { .card-title { opacity: 1; } }
.home-blurb { max-width: 680px; color: var(--muted); font-size: .92rem; margin: 0 0 56px; }

.project { max-width: 1300px; margin: 0 auto; }
.project-head { max-width: 760px; margin: 8px auto 32px; text-align: center; }
.project-head h1 { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.25; margin: 0 0 6px; font-weight: 600; }
.meta { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.desc { margin: 0; }
.note { margin: 14px 0 0; font-style: italic; }
.links-inline { margin: 12px 0 0; font-size: .9rem; }
.links-inline a, .text-page a { color: var(--accent); }
.assets { display: flex; flex-direction: column; gap: 28px; max-width: 1200px; margin: 0 auto 24px; }
.assets figure { margin: 0; }
.assets img { width: 100%; height: auto; }
figcaption { color: var(--muted); font-size: .88rem; margin-top: 8px; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; cursor: pointer; background: #000; }
.yt img { width: 100%; height: 100%; object-fit: cover; }
.yt .play { position: absolute; inset: 0; margin: auto; width: 72px; height: 50px; border-radius: 12px; background: rgba(0,0,0,.7); }
.yt .play::after { content: ""; position: absolute; left: 29px; top: 14px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.yt:hover .play { background: #c00; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 40px 0 56px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .9rem; }
.pager a { text-decoration: none; color: var(--muted); }
.pager a:hover { color: var(--text); }

.text-page { max-width: 780px; margin: 16px 0 64px; }
.text-page h1 { font-size: 1.8rem; font-weight: 600; margin: 0 0 20px; }
.text-page h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 32px 0 10px; font-weight: 600; }
.about > header { display: flex; gap: 22px; align-items: center; margin-bottom: 20px; }
.about h1 { margin: 0; }
.avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; }
.role { margin: 0; color: var(--accent); }
.credits { width: 100%; border-collapse: collapse; font-size: .95rem; }
.credits th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 8px 12px 8px 0; }
.credits td { border-bottom: 1px solid var(--line); padding: 12px 12px 12px 0; vertical-align: top; }
.credits td:first-child { color: var(--muted); white-space: nowrap; }
.credits td span { color: var(--muted); font-size: .88rem; }
.credits strong a { color: var(--text); }
.credits .work-links a { color: var(--accent); }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin-bottom: 10px; }
.updates { list-style: none; padding: 0; margin: 0; }
.updates li { border-top: 1px solid var(--line); padding: 18px 0; }
.updates h2 { font-size: 1.15rem; margin: 2px 0 6px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text); }
.updates p { margin: 0 0 6px; }

.site-footer { border-top: 1px solid var(--line); padding: 22px var(--gutter); color: var(--muted); font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer p { margin: 0; }
.site-footer .links { display: flex; gap: 18px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }
@media (max-width: 560px) { .credits th:last-child, .credits td:last-child { display: none; } .stage { height: 56vh; } }
.signature img { mix-blend-mode: multiply; }
.thumbs[hidden] { display: none; }
