:root {
  --bg:             #0c0c0c;
  --bg-dim:         #111111;
  --bg-panel:       #161616;
  --text:           #d4c9b0;
  --text-dim:       #6b6255;
  --accent:         #d4962a;
  --accent-lo:      #6b4a10;
  --border:         #252018;
  --green:          #5a8a3c;
  --font:           'JetBrains Mono', 'Courier New', monospace;
  --scanline:       rgba(0,0,0,0.07);
  --sprocket-bg:    #060606;
  --sprocket-hole:  rgba(255,255,255,0.10);
  --strip-bg:       #0e0e0e;
}

[data-theme="light"] {
  --bg:             #f5f0e8;
  --bg-dim:         #ede8de;
  --bg-panel:       #e8e2d6;
  --text:           #2a2520;
  --text-dim:       #8a7d6a;
  --accent:         #b07820;
  --accent-lo:      #d4ae70;
  --border:         #d0c8b8;
  --green:          #4a7a2c;
  --scanline:       rgba(0,0,0,0.02);
  --sprocket-bg:    #c8c0b0;
  --sprocket-hole:  rgba(245,240,232,0.85);
  --strip-bg:       #ddd8cc;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  background-image: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    var(--scanline) 2px, var(--scanline) 4px
  );
  transition: background 0.2s, color 0.2s;
}

/* ── THEME TOGGLE ────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 2px;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-dim); }

/* ── FILM STRIP ──────────────────────────────────────────── */
.filmstrip {
  background: var(--strip-bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  user-select: none;
  transition: background 0.2s;
}
/* Sprocket holes — centered perforations with rail depth */
.sprockets {
  height: 18px;
  background-color: var(--sprocket-bg);
  background-image:
    linear-gradient(
      to bottom,
      rgba(255,255,255,0.04) 0%,
      transparent 35%,
      transparent 65%,
      rgba(0,0,0,0.18) 100%
    ),
    repeating-linear-gradient(
      90deg,
      transparent          0,     transparent          9px,
      rgba(0,0,0,0.45)     9px,   rgba(0,0,0,0.45)     9.5px,
      var(--sprocket-hole) 9.5px, var(--sprocket-hole) 21.5px,
      rgba(0,0,0,0.20)     21.5px,rgba(0,0,0,0.20)     22px,
      transparent          22px,  transparent           32px
    );
  background-size: 100% 100%, 32px 12px;
  background-position: 0 0, 3px 3px;
  background-repeat: no-repeat, repeat-x;
  transition: background-color 0.2s;
}
.strip-label {
  background: var(--strip-bg);
  padding: 5px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.strip-label .site-id {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 3px;
  font-size: 12px;
  text-transform: uppercase;
}
.strip-label .site-path { color: var(--text-dim); font-size: 11px; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* ── NAV ─────────────────────────────────────────────────── */
nav {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky; top: 0;
  background: rgba(12,12,12,0.96);
  backdrop-filter: blur(4px);
  z-index: 100;
  transition: background 0.2s;
}
[data-theme="light"] nav {
  background: rgba(245,240,232,0.96);
}
nav .container { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.prompt { color: var(--green); margin-right: 4px; flex-shrink: 0; }
nav a {
  color: var(--text-dim); text-decoration: none;
  padding: 2px 8px; border-radius: 2px;
  font-size: 12px; letter-spacing: 0.5px; text-transform: lowercase;
  transition: color 0.15s, background 0.15s;
}
nav a:hover { color: var(--text); background: var(--bg-panel); }
nav a.active { color: var(--accent); background: var(--bg-panel); }
nav .nav-sep { color: var(--border); font-size: 10px; }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header { padding: 40px 0 0; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.page-header .page-title {
  font-size: 20px; font-weight: 300; color: var(--text);
  letter-spacing: 1px; margin-bottom: 24px;
}

/* ── HERO (index only) ───────────────────────────────────── */
.hero {
  padding: 48px 0 40px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
  border-bottom: 1px solid var(--border);
}
.hero-text { max-width: 520px; }
.hero-text h1 {
  font-size: 11px; font-weight: 400;
  color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 20px;
}
.bio-block {
  border-left: 2px solid var(--accent-lo);
  padding-left: 16px;
  margin-bottom: 24px;
}
.bio-block p { color: var(--text); line-height: 1.8; font-size: 13px; }
.bio-block p.dim { color: var(--text-dim); }
.bio-quote {
  margin: 18px 0 4px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.85;
  font-style: italic;
}
.bio-quote cite {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.5px;
  color: var(--accent-lo);
  text-transform: uppercase;
}
.bio-block .cursor {
  display: inline-block; width: 8px; height: 14px;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1.2s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag {
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 2px;
}
.tag.accent { color: var(--accent); border-color: var(--accent-lo); }
.contact-line { margin-top: 20px; font-size: 12px; color: var(--text-dim); }
.contact-line a { color: var(--accent); text-decoration: none; }
.contact-line a:hover { text-decoration: underline; }
.contact-line .ext-link { color: var(--text-dim); margin-left: 4px; }
.contact-line .ext-link:hover { color: var(--text); text-decoration: none; }

/* ── PORTRAIT ────────────────────────────────────────────── */
.portrait-wrap { position: relative; flex-shrink: 0; }
.portrait-frame { position: relative; width: 200px; }
.frame-label {
  font-size: 9px; letter-spacing: 2px; color: var(--text-dim);
  text-transform: uppercase; padding: 4px 0;
  border-top: 1px solid var(--border); margin-top: 6px; text-align: center;
}
.portrait {
  width: 200px; height: 260px; object-fit: cover; object-position: center top;
  display: block; filter: sepia(20%) contrast(1.05);
  border: 1px solid var(--border);
  transition: filter 0.2s;
}
[data-theme="light"] .portrait { filter: sepia(10%) contrast(1.02); }
.portrait-frame::after {
  content: '';
  position: absolute; top: 0; left: 0; width: 200px; height: 260px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.08'/%3E%3C/svg%3E");
  background-size: 200px 200px; mix-blend-mode: overlay; opacity: 0.4;
}
.portrait-frame .edge-marks {
  position: absolute; right: -14px; top: 0; height: 260px;
  display: flex; flex-direction: column; justify-content: space-around;
  font-size: 8px; color: var(--text-dim); opacity: 0.4;
}

/* ── NEWS / CHANGELOG ────────────────────────────────────── */
.news-log { padding-bottom: 48px; }
.log-entry {
  display: grid;
  grid-template-columns: 90px 130px 1fr;
  gap: 5px 14px;
  padding: 5px 0;
  border-bottom: 1px solid transparent;
  font-size: 12px;
  line-height: 1.5;
  align-items: baseline;
}
.log-entry:hover { border-bottom-color: var(--border); }
.log-date { color: var(--text-dim); font-size: 11px; white-space: nowrap; }
.log-type {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
  align-self: center;
}
.log-type.screening  { color: #7ab8f5; background: rgba(122,184,245,0.08); }
.log-type.workshop   { color: #a8d4a8; background: rgba(168,212,168,0.08); }
.log-type.grant      { color: var(--accent); background: rgba(212,150,42,0.1); }
.log-type.talk       { color: #c49fde; background: rgba(196,159,222,0.08); }
.log-type.lecture    { color: #c49fde; background: rgba(196,159,222,0.08); }
.log-type.exhibition { color: #f5c87a; background: rgba(245,200,122,0.08); }
.log-type.vernissage { color: #f5c87a; background: rgba(245,200,122,0.08); }
.log-type.premiere   { color: #f5a0a0; background: rgba(245,160,160,0.08); }
.log-type.curating   { color: #a8d4a8; background: rgba(168,212,168,0.08); }
.log-type.teaching   { color: #c49fde; background: rgba(196,159,222,0.08); }
.log-type.residency  { color: var(--accent); background: rgba(212,150,42,0.1); }
.log-desc { color: var(--text); min-width: 0; }
.log-year-marker {
  grid-column: 1/-1;
  color: var(--text-dim); font-size: 10px; letter-spacing: 3px;
  text-transform: uppercase; padding: 16px 0 4px; opacity: 0.5;
}
.log-archived {
  grid-column: 1/-1;
  color: var(--text-dim); font-size: 11px; padding: 8px 0;
  opacity: 0.4; font-style: italic;
}

/* ── SECTION HEAD ────────────────────────────────────────── */
.section-head {
  font-size: 11px; color: var(--text-dim); letter-spacing: 2px;
  text-transform: uppercase; padding: 28px 0 14px;
  display: flex; align-items: center; gap: 12px;
}
.section-head::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── FILM LIST ───────────────────────────────────────────── */
.film-list { list-style: none; padding-bottom: 48px; }
.film-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.film-entry:first-child { border-top: 1px solid var(--border); }
.film-title { font-size: 13px; font-weight: 400; }
.film-title a { color: var(--text); text-decoration: none; }
.film-title a:hover { color: var(--accent); }
.film-meta { color: var(--text-dim); font-size: 11px; white-space: nowrap; padding-top: 2px; }
.film-spec { color: var(--text-dim); font-size: 11px; grid-column: 1; }
.film-badge {
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-lo);
  padding: 1px 5px; border-radius: 2px; white-space: nowrap;
  height: fit-content; margin-top: 2px;
}

/* ── GENERIC LIST ────────────────────────────────────────── */
.item-list { list-style: none; padding-bottom: 48px; }
.item-entry { padding: 12px 0; border-bottom: 1px solid var(--border); }
.item-entry:first-child { border-top: 1px solid var(--border); }
.item-title { font-size: 13px; margin-bottom: 3px; }
.item-title a { color: var(--text); text-decoration: none; }
.item-title a:hover { color: var(--accent); }
.item-title strong { font-weight: 400; }
.item-meta { color: var(--text-dim); font-size: 11px; }
.item-desc { color: var(--text-dim); font-size: 12px; margin-top: 6px; line-height: 1.7; }

/* ── FILM DETAIL ─────────────────────────────────────────── */
.film-detail { padding-bottom: 48px; }
.film-detail-header { padding: 40px 0 28px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.film-detail-title { font-size: 18px; font-weight: 300; color: var(--text); margin-bottom: 10px; letter-spacing: 0.5px; }
.film-detail-specs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.spec-tag {
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 2px;
}
.spec-tag.hi { color: var(--accent); border-color: var(--accent-lo); }
.film-detail-distrib { font-size: 11px; color: var(--text-dim); margin-top: 8px; }
.film-detail-distrib a { color: var(--accent); text-decoration: none; }
.film-detail-distrib a:hover { text-decoration: underline; }

.film-desc { font-size: 13px; line-height: 1.85; color: var(--text); max-width: 640px; }
.film-desc p { margin-bottom: 1em; }
.film-desc em { font-style: italic; color: var(--text-dim); }

.screening-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 20px;
  padding-bottom: 12px;
}
.screening-item { font-size: 12px; color: var(--text-dim); padding: 3px 0; }
.screening-item::before { content: "▸ "; color: var(--accent-lo); }

/* ── GALLERY ─────────────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px; margin: 24px 0;
}
.gallery img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  filter: sepia(10%) contrast(1.05);
  border: 1px solid var(--border); display: block;
  transition: filter 0.2s, opacity 0.2s;
}
.gallery img:hover { filter: sepia(0%) contrast(1.1); opacity: 0.9; }
.gallery-wide img { aspect-ratio: 16/9; }
.img-solo {
  width: 100%; max-width: 600px; border: 1px solid var(--border);
  filter: sepia(10%); margin: 20px 0;
}
[data-theme="light"] .gallery img,
[data-theme="light"] .img-solo { filter: sepia(5%) contrast(1.02); }

/* ── SCREENINGS LIST (films page) ────────────────────────── */
.screenings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 3px 20px;
  padding-bottom: 48px;
}
.screenings-grid .s-item { font-size: 12px; color: var(--text-dim); padding: 2px 0; }

/* ── CV ──────────────────────────────────────────────────── */
.cv-section { padding-bottom: 36px; }
.cv-row {
  display: grid; grid-template-columns: 1fr;
  gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--border);
}
.cv-row:first-child { border-top: 1px solid var(--border); }
.cv-title { font-size: 12px; color: var(--text); }
.cv-sub { font-size: 11px; color: var(--text-dim); }
.cv-year { font-size: 10px; color: var(--accent); letter-spacing: 1px; margin-top: 2px; }

/* ── DISTRIBUTION PILLS ──────────────────────────────────── */
.distrib-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.distrib-pill {
  font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 2px;
  text-decoration: none; transition: color 0.15s, border-color 0.15s;
}
.distrib-pill:hover { color: var(--accent); border-color: var(--accent-lo); }

/* ── BACK LINK ───────────────────────────────────────────── */
.back-link {
  display: inline-block; font-size: 11px; color: var(--text-dim);
  text-decoration: none; padding: 28px 0 0; letter-spacing: 0.5px;
}
.back-link:hover { color: var(--accent); }
.back-link::before { content: "← "; }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  font-size: 11px; color: var(--text-dim);
}
footer .container {
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
footer a { color: var(--text-dim); text-decoration: none; }
footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .portrait-wrap { order: -1; }
  .portrait-frame, .portrait { width: 100%; height: 220px; }
  .portrait-frame::after { width: 100%; }
  .portrait-frame .edge-marks { display: none; }
  .film-entry { grid-template-columns: 1fr; }
  .film-meta { white-space: normal; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .screening-grid { grid-template-columns: 1fr; }
  .screenings-grid { grid-template-columns: 1fr; }
  .log-entry {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }
  .log-date { font-size: 10px; }
}
