/* Shared structure. Colours come from the palette (--bg, --surface, --text, --muted, --accent). */
:root {
  --bg: #f3f1ec; --surface: #fff; --text: #1b1b1b; --muted: #6f6b64; --accent: #c2410c; --accent-ink: #fff;
  --line: color-mix(in srgb, var(--text) 14%, transparent);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-body);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1320px;
  --pad: clamp(20px, 4vw, 56px);
  --radius: 0px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
  opacity: 0; transition: opacity .35s ease, background-color .3s, color .3s;
}
body.ready { opacity: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: var(--max); width: 100%; margin: 0 auto; padding: 22px var(--pad);
}
.brand-link { text-decoration: none; display: flex; align-items: baseline; gap: 12px; }
.brand { font: 600 20px/1 var(--font-display); letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-size: 13px; }
.site-nav { display: flex; gap: 26px; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: 14px; letter-spacing: .02em; transition: color .2s; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }

main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) 80px; outline: none; }
.loading, .empty { padding: 120px 0; text-align: center; color: var(--muted); }
.empty h1 { color: var(--text); font-family: var(--font-display); }

.eyebrow { font: 500 12px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 10px; }

/* Hero */
.hero { position: relative; padding: clamp(40px, 9vw, 120px) 0 clamp(30px, 5vw, 60px); }
.hero-backdrop { display: none; }
.hero-title { font: 600 clamp(48px, 9vw, 128px)/.95 var(--font-display); letter-spacing: -.03em; margin: 0; }
.tagline { font-size: clamp(17px, 1.8vw, 21px); color: var(--muted); max-width: 46ch; margin: 22px 0 0; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.chip {
  text-decoration: none; font-size: 13px; padding: 7px 14px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Grid */
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: clamp(20px, 3vw, 40px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.card a { text-decoration: none; display: block; }
.card-media { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); border-radius: var(--radius); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card a:hover .card-media img { transform: scale(1.035); }
.card-placeholder { display: grid; place-items: center; height: 100%; font: 600 64px var(--font-display); color: var(--muted); }
.card-meta { padding: 14px 0 0; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: baseline; }
.idx { font: 12px var(--font-mono); color: var(--accent); }
.card-meta h3 { margin: 0; font: 600 19px/1.3 var(--font-display); }
.cat { grid-column: 2; font-size: 13px; color: var(--muted); }
.card-summary { grid-column: 2; margin: 6px 0 0; font-size: 14px; color: var(--muted); display: none; }

/* Project */
.project { max-width: 1100px; margin: 0 auto; }
.project-head { padding: clamp(30px, 6vw, 80px) 0 32px; max-width: 820px; }
.back { display: inline-block; text-decoration: none; color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.back:hover { color: var(--accent); }
.project-head h1 { font: 600 clamp(36px, 6vw, 76px)/1 var(--font-display); letter-spacing: -.025em; margin: 0; }
.lede { font-size: clamp(18px, 2vw, 22px); color: var(--muted); margin: 20px 0 0; max-width: 52ch; }
.project-cover { margin: 0 0 48px; background: var(--surface); }
.project-cover img { width: 100%; }
.project-video { position: relative; aspect-ratio: 16 / 9; margin: 0 0 48px; background: #000; }
.project-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.project-body { max-width: 680px; font-size: 18px; line-height: 1.7; margin: 0 0 56px; }
.project-body p { margin: 0 0 1.1em; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 2vw, 28px); margin-bottom: 56px; }
.gallery .shot:first-child { grid-column: 1 / -1; }
.shot { margin: 0; }
.shot-btn { all: unset; cursor: zoom-in; display: block; width: 100%; background: var(--surface); }
.shot-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shot-btn img { width: 100%; }
.shot figcaption { font-size: 13px; color: var(--muted); padding-top: 8px; }

.docs { display: grid; gap: 10px; margin-bottom: 56px; max-width: 680px; }
.doc { display: flex; align-items: center; gap: 14px; text-decoration: none; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s; }
.doc:hover { border-color: var(--accent); }
.doc-icon { font: 600 11px var(--font-mono); background: var(--accent); color: var(--accent-ink); padding: 4px 6px; }
.doc-go { margin-left: auto; color: var(--muted); font-size: 13px; }

.project-next { display: block; text-decoration: none; border-top: 1px solid var(--line); padding: 36px 0 0; }
.next-title { display: block; font: 600 clamp(26px, 4vw, 44px)/1.1 var(--font-display); transition: color .2s; }
.project-next:hover .next-title { color: var(--accent); }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); padding: clamp(40px, 7vw, 100px) 0; align-items: start; }
.about:not(:has(.avatar)) { grid-template-columns: 1fr; max-width: 760px; }
.avatar { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.about h1 { font: 600 clamp(40px, 6vw, 72px)/1 var(--font-display); margin: 0; letter-spacing: -.02em; }
.about-text > p:not(.eyebrow):not(.lede) { font-size: 18px; max-width: 62ch; }
.links { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); border-top: 1px solid var(--line); padding-top: 24px; }
.links .eyebrow { display: block; margin-bottom: 4px; }
.links a { text-decoration: none; border-bottom: 1px solid var(--accent); }

/* Footer */
.site-footer { max-width: var(--max); width: 100%; margin: 0 auto; padding: 28px var(--pad) 36px; display: flex; gap: 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.foot-admin { margin-left: auto; text-decoration: none; opacity: .6; }
.foot-admin:hover { opacity: 1; color: var(--accent); }
.demo-flag { background: var(--accent); color: var(--accent-ink); padding: 0 8px; border-radius: 4px; }

/* Lightbox */
.lightbox { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(0,0,0,.93); color: #fff; }
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; grid-column: 2; display: grid; justify-items: center; gap: 12px; }
.lightbox img { max-height: 84vh; width: auto; }
.lightbox figcaption { font-size: 14px; opacity: .75; }
.lightbox button { background: none; border: 0; color: #fff; font-size: 40px; cursor: pointer; opacity: .7; height: 100%; }
.lightbox button:hover { opacity: 1; }
.lb-close { position: absolute; top: 12px; right: 18px; height: auto !important; }
.lb-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); font: 12px var(--font-mono); opacity: .6; }

@media (max-width: 720px) {
  .brand-sub { display: none; }
  .gallery { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .avatar { max-width: 260px; }
  .lightbox[open] { grid-template-columns: 40px 1fr 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
