/* ============================================
   FONTS — self-hosted (no connection to Google's servers, avoids the
   IP-address-transfer privacy issue Google Fonts' CDN has raised in Germany)
   ============================================ */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/inter-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/inter-latin-600-normal.woff2') format('woff2');
}

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #767676;
  --line: #e6e6e6;
  --accent: #111111;

  --font-display: 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'Inter', -apple-system, sans-serif;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 2rem;
  --space-4: 4rem;
  --space-5: 7rem;

  --max-width: 74rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================================
   HEADER — name sits further left, a touch smaller
   ============================================ */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  width: 100%;
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: row;
    align-items: flex-start;
  }
  .site-nav {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
  }
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

.site-nav {
  display: flex;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: -0.2em;
  right: -0.2em;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* "More Projects" heading at the end of a project page */
.works-heading,
.browse-heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 var(--space-2);
  margin-left: var(--space-3);
}

.works {
  max-width: var(--max-width);
  margin: 0 auto var(--space-5);
  padding: 0 var(--space-3);
}

.works-grid,
.browse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: var(--space-4);
  row-gap: var(--space-4);
}

.grid-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.grid-card.visible { opacity: 1; }

.grid-thumb {
  width: 100%;
  object-fit: contain;
  background: var(--bg);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.grid-card:hover .grid-thumb { transform: scale(1.02); opacity: 0.9; }

.grid-title {
  font-size: clamp(0.9rem, 1.5vw, 1.02rem);
  font-weight: 500;
  letter-spacing: -0.005em;
}

.grid-year {
  font-weight: 300;
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .works-grid, .browse-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .works-grid, .browse-grid { grid-template-columns: 1fr; }
}

/* ============================================
   PROJECT HEADER — Title/Year stacked with labels, in the narrow left
   margin column, above the gallery's top edge
   ============================================ */
.project-body { position: relative; }

.project-header {
  max-width: none;
  margin-top: var(--space-5);
  margin-bottom: var(--space-4);
  margin-left: max(calc((100vw - var(--max-width)) / 2), var(--space-3));
  margin-right: var(--space-3);
}

@media (min-width: 1650px) {
  .project-header {
    position: absolute;
    top: 0; /* set precisely by script.js to line up with the gallery */
    left: var(--space-3);
    width: 13rem;
    margin: 0;
    z-index: 5;
    background: var(--bg);
  }
}

.meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.15rem;
}

.meta-value {
  font-weight: 500;
  margin: 0 0 var(--space-2);
  line-height: 1.3;
}

/* ============================================
   HOVER UNDERLINE — extends slightly beyond the text itself
   ============================================ */
.hover-underline {
  position: relative;
  text-decoration: none;
}

.hover-underline::after {
  content: '';
  position: absolute;
  left: -0.2em;
  right: -0.2em;
  bottom: -0.15em;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.hover-underline:hover::after { transform: scaleX(1); }

/* ============================================
   INFO LIST — Note / Material, sits after the gallery
   ============================================ */
.info-list {
  display: grid;
  grid-template-columns: 7rem 1fr;
  row-gap: 1.4rem;
  column-gap: 1.5rem;
  max-width: 40rem;
  margin: var(--space-4) 0 var(--space-5);
  margin-left: max(calc((100vw - var(--max-width)) / 2), var(--space-3));
  margin-right: var(--space-3);
  font-size: 1rem;
  line-height: 1.7;
}

.info-list dt {
  font-weight: 600;
  color: var(--ink);
}

.info-list dd { margin: 0; font-weight: 400; color: var(--ink); }

@media (max-width: 640px) {
  .info-list { grid-template-columns: 1fr; row-gap: 0.3rem; margin-left: var(--space-2); margin-right: var(--space-2); }
  .info-list dt { margin-top: 0.9rem; }
  .info-list dt:first-child { margin-top: 0; }
}

/* ============================================
   FILMSTRIP SLIDER — flush left with content, bleeds off the right edge.
   Natural aspect ratio, pure white background (matters for transparent PNGs)
   ============================================ */
.slider-section {
  margin: var(--space-5) 0 0;
  margin-left: max(calc((100vw - var(--max-width)) / 2), var(--space-3));
  padding: 0;
}

.slider-viewport { overflow: hidden; }

.slider-track {
  display: flex;
  gap: var(--space-2);
  background: var(--bg);
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.slider-track img,
.slider-track video,
.slider-track .gallery-link-image {
  flex: 0 0 auto;
  height: 66vh;
  max-height: 760px;
}
.slider-track img,
.slider-track video {
  width: auto;
  object-fit: contain;
  background: var(--bg);
  cursor: pointer;
}

.slider-track video { cursor: default; }

/* An image that links out to an external site (e.g. a catalogue cover
   linking to its publisher) instead of opening the lightbox */
.gallery-link-image {
  position: relative;
  display: block;
}

.gallery-link-image img {
  height: 100%;
  width: auto;
  object-fit: contain;
  background: var(--bg);
  cursor: pointer;
}

.gallery-link-image::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 12V7a2.5 2.5 0 0 1 5 0v5'/%3E%3Cpath d='M14 7.5V6a1.5 1.5 0 0 1 3 0v6'/%3E%3Cpath d='M17 8.5a1.5 1.5 0 0 1 3 0V13'/%3E%3Cpath d='M9 12l-1.6-1.6a1.5 1.5 0 0 0-2.4 1.8l3 5.2A5 5 0 0 0 12.4 20H15a5 5 0 0 0 5-5v-2'/%3E%3C/svg%3E") center / 15px no-repeat;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.gallery-link-image:hover::after {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 640px) {
  .slider-section { margin-left: var(--space-2); }
  .slider-track img,
  .slider-track video,
  .slider-track .gallery-link-image { height: 42vh; max-height: 440px; }
}

/* ============================================
   GALLERY NAVIGATION — ruler ticks + arrows
   Sits bottom-left under the image, same spot every time
   ============================================ */
.slider-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: var(--space-2);
  padding-right: var(--space-3);
}

.tick-arrow {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  color: var(--ink);
  display: flex;
}

.tick-arrow svg { width: 16px; height: 16px; display: block; }
.tick-arrow:hover { opacity: 0.55; }

.ticks {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 16px;
}

.tick {
  width: 2px;
  height: 7px;
  background: var(--line);
  cursor: pointer;
  transition: height 0.2s ease, background 0.2s ease;
}

.tick.active { height: 16px; background: var(--ink); }

.slide-caption {
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.2em;
  padding-right: var(--space-3);
}

/* ============================================
   PROJECT TEXT — left-aligned with the gallery, same principle as
   the info list below it
   ============================================ */
.project-text {
  max-width: 42rem;
  margin: var(--space-5) auto;
  padding: 0 var(--space-3);
  font-size: 1.05rem;
  line-height: 1.35;
}

.project-text p { margin: 0 0 var(--space-2); }

@media (max-width: 640px) {
  .project-text { margin-left: var(--space-2); margin-right: var(--space-2); }
}

.project-nav {
  max-width: var(--max-width);
  margin: 0 auto var(--space-5);
  padding: var(--space-3) var(--space-3) 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-nav a:hover { color: var(--accent); }

/* ============================================
   ABOUT / TEACHING TEXT CONTAINER
   ============================================ */
.about-text {
  max-width: 42rem;
  margin: var(--space-4) auto var(--space-5);
  padding: 0 var(--space-3);
  font-size: 1.05rem;
  line-height: 1.75;
}

.about-text p { margin: 0 0 var(--space-2); }

.about-heading {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: var(--space-3) 0 var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}

.about-text .about-heading:first-of-type { border-top: none; padding-top: 0; }

.about-portrait {
  width: 100%;
  max-width: 22rem;
  margin-bottom: var(--space-3);
}

/* ============================================
   MORE PROJECTS — grid lines behind, tiles sit offset across them
   (per sketch: not neatly filling cells, crossing the lines instead)
   ============================================ */
.browse-more {
  max-width: var(--max-width);
  margin: var(--space-5) auto 0;
  padding: var(--space-4) var(--space-3) 0;
}

.browse-more .browse-grid { margin-top: var(--space-4); }

/* ============================================
   CONTACT OVERLAY
   ============================================ */
.contact-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  z-index: 200;
  text-align: center;
  padding: var(--space-3);
}

.contact-overlay.open { display: flex; }

.contact-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-3);
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
}

.contact-close:hover { color: var(--ink); }

.contact-email {
  font-size: clamp(1.6rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  word-break: break-word;
}

.contact-email:hover { color: var(--accent); }

.contact-newsletter {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.contact-newsletter:hover { color: var(--ink); }

.contact-copy {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-copy:hover { color: var(--ink); border-color: var(--ink); }

.contact-copied {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.25s ease;
  height: 1em;
}

.contact-copied.show { opacity: 1; }

/* ============================================
   LIGHTBOX — now white (was black), so transparent /
   cut-out images sit correctly and match the site
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.97);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  touch-action: pan-y;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 76vw;
  max-height: 82vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-3);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ink);
  opacity: 0.5;
  display: flex;
  font-size: 2rem;
  font-family: var(--font-mono);
  cursor: pointer;
  padding: var(--space-2);
  transition: opacity 0.2s ease;
}

.lightbox-nav:hover { opacity: 1; }
.lightbox-nav svg { width: 20px; height: 20px; }

.lightbox-prev { left: var(--space-2); }
.lightbox-next { right: var(--space-2); }

.lightbox-caption {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.2em;
  text-align: center;
}

@media (max-width: 700px) {
  .lightbox img { max-width: 88vw; max-height: 70vh; }
  .lightbox-nav { font-size: 1.5rem; padding: var(--space-1); }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
