/* Always dark, whatever the visitor's system theme: art reads best on a dark background. */
:root {
  color-scheme: dark;
  --bg: #111;
  --text: #eee;
  --muted: #bbb;
  --line: #333;
  --card: #1a1a1a;
  --accent: #8ab4ff;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 80rem;
  padding: 1.25rem;
  background: var(--bg);
  color: var(--text);
  font: 1.05rem/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main { display: grid; gap: 2.5rem; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .7rem; }

p { margin: 0 0 1rem; }

a { color: var(--accent); }

a:focus-visible { outline: .2rem solid currentColor; outline-offset: .2rem; }

img, iframe { max-width: 100%; border: 1px solid var(--line); }
img { height: auto; }
.media { display: block; width: 100%; }
.video { aspect-ratio: 16 / 9; height: auto; background: #000; }

.hero { border-bottom: 1px solid var(--line); padding-bottom: 2rem; }
.hero .intro { max-width: 70ch; }

.meta, .skills { color: var(--muted); }

.skills { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }

.skills li, .tag { border: 1px solid var(--line); border-radius: 999px; padding: .1rem .55rem; }
.tag { width: fit-content; font-size: .9rem; color: var(--muted); }

.work-list { display: grid; gap: 1rem; }

.work-item, .project-card { background: var(--card); border: 1px solid var(--line); padding: 1rem; }
.work-item p:last-child { margin-bottom: 0; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }

.project-card { display: grid; gap: .75rem; align-content: start; text-decoration: none; color: inherit; }
.project-card .media { aspect-ratio: 16 / 9; object-fit: cover; }
.project-card p:last-child { margin-bottom: 0; }

.project-card:hover h3, .project-card:focus-visible h3 { text-decoration: underline; }

/* Project detail page: art gets the full column width, caption sits under it. */
.detail-list { display: grid; gap: 2.5rem; }
.detail-row { margin: 0; }
.detail-row figcaption { max-width: 70ch; margin-top: .9rem; }
.detail-row figcaption h2 { font-size: 1.25rem; }
.detail-row figcaption p:last-child { margin-bottom: 0; }

.zoom { display: block; cursor: zoom-in; }

.not-found { padding: 2rem 0; }

.lightbox { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; padding: 1rem; border: 0; background: rgba(0, 0, 0, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lightbox img { max-width: 100%; max-height: calc(100vh - 2rem); object-fit: contain; border: 0; cursor: zoom-out; }
.lightbox form { position: fixed; top: .75rem; right: .75rem; margin: 0; }
.lightbox-close { font: inherit; font-size: 2rem; line-height: 1; width: 2.75rem; height: 2.75rem; border: 1px solid #555; border-radius: 50%; background: #111; color: #fff; cursor: pointer; }

@media (min-width: 48rem) {
  body { padding: 2rem; }
}
