@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:       #ffffff;
  --ink:      #1a1a18;
  --ink-mid:  #7a7a74;
  --ink-faint:#b8b8b0;
  --accent:   #c0392b;
  --border:   #e8e6e2;
  --serif:    'EB Garamond', Georgia, serif;
  --sans:     'EB Garamond', Georgia, serif;
  --nav-w:    320px;
  --gap:      2rem;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  min-height: 100vh;
  display: flex;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
nav#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--nav-w);
  height: 100vh;
  padding: 2rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  border-right: none;
  z-index: 100;
  background: var(--bg);
}

main {
  margin-left: var(--nav-w);
  padding: 3rem 4rem 6rem;
  max-width: 1100px;
  width: 100%;
  min-height: 100vh;
}

/* ── SIDEBAR NAV ─────────────────────────────────────────── */
.site-name {
  font-family: var(--serif);
  font-size: 1.20rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin-bottom: 4.7rem;
  color: var(--ink);
  text-decoration: none;
}
.site-name:hover { color: var(--accent); }

nav#sidebar ul {
  list-style: none;
  flex: 1;
}
nav#sidebar ul li { margin-bottom: 0; }
nav#sidebar ul li a {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--ink-mid);
  text-decoration: none;
  padding: 0.1rem 0;
  display: block;
  transition: color 0.2s;
}
nav#sidebar ul li a:hover,
nav#sidebar ul li a.active { color: var(--ink); }

/* ── Works dropdown ──────────────────────────────────────── */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-row a { flex: 1; }
.nav-chevron {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: 0.85rem;
  padding: 0.3rem 0 0.3rem 0.4rem;
  line-height: 1;
  transition: transform 0.22s ease, color 0.2s;
}
.nav-chevron:hover { color: var(--ink); }
.nav-chevron.open { transform: rotate(90deg); }

.nav-subnav {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.nav-subnav.open { max-height: 600px; }
.nav-subnav li a {
  font-family: var(--serif) !important;
  font-size: 0.78rem !important;
  font-style: italic !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--ink-faint) !important;
  padding: 0.18rem 0 0.18rem 0.8rem !important;
  display: block;
}
.nav-subnav li a:hover { color: var(--ink) !important; }

.sidebar-social {
  display: flex;
  gap: 1rem;
  margin-top: auto;
  padding-top: 2rem;
}
.sidebar-social a {
  font-family: var(--serif);
  font-size: 0.88rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.2s;
}
.sidebar-social a:hover { color: var(--ink); }

/* ── MOBILE TOPBAR ───────────────────────────────────────── */
.mobile-topbar {
  display: none;
}
.mobile-topbar-name {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

/* ── HAMBURGER (MOBILE) ──────────────────────────────────── */
.hamburger {
  display: none;
  position: fixed;
  top: 1.2rem; right: 1.2rem;
  z-index: 200;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 1px;
  background: var(--ink);
  transition: all 0.25s;
}

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink-mid);
}
.page-header .subtitle {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-top: 0.5rem;
}

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
  max-width: 60ch;
}
p + p { margin-top: 1em; }

a { color: inherit; }

/* ── HOME ────────────────────────────────────────────────── */
.home-name {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}
.home-name em { font-style: italic; color: var(--ink-mid); }
.home-bio {
  max-width: 52ch;
  margin-bottom: 3rem;
}
.home-bio p {
  font-size: 1.1rem;
  line-height: 1.8;
}
.home-recent {
  margin-top: 3rem;
}
.home-recent h2 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 1.2rem;
}

/* ── PROJECTS GRID ───────────────────────────────────────── */
.films-grid {
  display: grid;
  gap: 2px;
}
.film-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.film-card:first-child { border-top: 1px solid var(--border); }
.film-card:hover .film-title { color: var(--accent); }
.film-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-style: italic;
  font-weight: 400;
  transition: color 0.2s;
}
.film-meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--ink-mid);
  text-align: right;
}

/* ── FILM DETAIL ─────────────────────────────────────────── */
.film-detail-header {
  margin-bottom: 2rem;
}
.film-detail-header h1 {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}
.film-specs {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--ink-mid);
  line-height: 2;
}
.film-specs span { margin-right: 1.5rem; }

/* ── Vimeo embed (responsive 16:9) ── */
.film-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  margin-bottom: 2.5rem;
}
.film-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ── Stills filmstrip (horizontal scroll) ── */
.film-filmstrip {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* break out of main's horizontal padding */
  margin: 2.5rem -4rem 2.5rem;
  padding: 0 4rem;
  cursor: grab;
}
.film-filmstrip:active { cursor: grabbing; }
.film-filmstrip::-webkit-scrollbar { display: none; }
.film-filmstrip img {
  height: 380px;
  width: auto;
  max-width: none;
  flex-shrink: 0;
  scroll-snap-align: start;
  display: block;
  object-fit: cover;
  background: var(--border);
  transition: opacity 0.2s;
}
.film-filmstrip img:hover { opacity: 0.88; }

.film-description {
  margin: 2rem 0;
}

/* ── Placeholder when no stills ── */
.film-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}
.film-placeholder span {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.film-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.film-link:hover { color: var(--accent); border-color: var(--accent); }
.film-festivals {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.film-festivals h3 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 0.8rem;
}
.film-festivals ul {
  list-style: none;
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 2;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--ink); }
.back-link::before { content: '←'; font-style: normal; }

/* ── CV ──────────────────────────────────────────────────── */
.cv-section { margin-bottom: 3rem; }
.cv-section h2 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.cv-entry {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0 1.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.cv-entry:last-child { border-bottom: none; }
.cv-year {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--ink-mid);
  padding-top: 0.15rem;
}
.cv-body {}
.cv-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
}
.cv-venue {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--ink-mid);
  margin-top: 0.15rem;
}
.cv-download {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  transition: color 0.2s;
}
.cv-download:hover { color: var(--accent); border-color: var(--accent); }

/* ── SCREENINGS ──────────────────────────────────────────── */
.screenings-table { width: 100%; border-collapse: collapse; }
.screenings-table thead tr {
  border-bottom: 1px solid var(--ink);
}
.screenings-table th {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mid);
  padding: 0 0 0.8rem;
  text-align: left;
}
.screenings-table th:last-child,
.screenings-table td:last-child { text-align: right; }
.screenings-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.screenings-table tbody tr:hover { background: rgba(0,0,0,0.02); }
.screenings-table td {
  font-family: var(--serif);
  font-size: 0.95rem;
  padding: 0.85rem 0;
  vertical-align: top;
}
.screenings-table td.film-name { font-style: italic; }
.screenings-table td.event-type {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-mid);
  padding-right: 0;
}
td + td { padding-left: 1.5rem; }

/* ── BIO ─────────────────────────────────────────────────── */
.bio-content { max-width: 58ch; }
.bio-content p { font-size: 1.1rem; line-height: 1.85; }
.contact-block {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.contact-block h2 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 1rem;
}
.contact-email {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.contact-email:hover { border-color: var(--ink); color: var(--accent); }

/* ── WORKS SCROLL (cinematic vertical scroll) ────────────── */
.works-scroll {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.works-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--ink);
}
.works-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.82;
  transition: transform 0.7s ease, opacity 0.4s ease;
}
.works-card:hover img {
  transform: scale(1.03);
  opacity: 0.65;
}
.works-card-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 3rem 2rem 1.6rem;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.works-card:hover .works-card-info,
.works-card-nothumbnail:hover .works-card-info {
  opacity: 1;
  transform: translateY(0);
}
.works-card-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.15;
}
.works-card-meta {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-top: 0.35rem;
}
/* Fallback when no thumbnail */
.works-card-nothumbnail {
  position: relative;
  display: block;
  text-decoration: none;
  color: #fff;
  background: var(--ink);
  aspect-ratio: 16 / 9;
  transition: background 0.3s;
}
.works-card-nothumbnail:hover { background: #2e2e28; }
.works-card-nothumbnail .works-card-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 3rem 2rem 1.6rem;
  background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 100%);
}

@media (max-width: 768px) {
  .works-card-title { font-size: 1.2rem; }
}

/* Mobile: tap-to-reveal title */
@media (hover: none) {
  .works-card.tapped .works-card-info,
  .works-card-nothumbnail.tapped .works-card-info {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── HOME HERO ───────────────────────────────────────────── */
.home-hero {
  position: relative;
  margin: -3rem -4rem 3.5rem;
  width: calc(100vw - var(--nav-w));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink);
}
.home-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.8;
  transition: opacity 0.6s ease;
}
.home-hero-credit {
  position: absolute;
  bottom: 0.8rem;
  right: 1.2rem;
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
}
@media (max-width: 768px) {
  .home-hero {
    margin: -2rem -1.5rem 2.5rem;
    aspect-ratio: 16 / 9;
  }
}

/* ── STUDIO VISIT ────────────────────────────────────────── */
.studio-text { max-width: 56ch; }

/* ── LOADING STATE ───────────────────────────────────────── */
.loading {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ── FADE IN ─────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.5s ease forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}
.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.15s; }
.fade-in:nth-child(4) { animation-delay: 0.2s; }
.fade-in:nth-child(5) { animation-delay: 0.25s; }
.fade-in:nth-child(6) { animation-delay: 0.3s; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  body { display: block; }

  nav#sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 260px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
    padding-top: calc(48px + 1.5rem);
  }
  nav#sidebar.open { transform: translateX(0); }

  .mobile-topbar {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 48px;
    background: var(--bg);
    z-index: 199;
  }

  .hamburger { display: flex; top: 0.85rem; }
  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 90;
  }
  .overlay.active { display: block; }

  main {
    margin-left: 0;
    padding: 2rem 1.5rem 4rem;
    padding-top: calc(48px + 1.5rem);
  }
  .home-name { font-size: 2.5rem; }
  .film-detail-header h1 { font-size: 2rem; }
  .screenings-table th:nth-child(3),
  .screenings-table td:nth-child(3) { display: none; }
  .cv-entry { grid-template-columns: 65px 1fr; }
  .film-detail-header h1 { font-size: 2rem; }
  .film-filmstrip {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 0 1.5rem;
  }
  .film-filmstrip img { height: 240px; }
}
