/* Luces Umbrarum — photography portfolio
   Design language: warm neutral, Instrument Serif + Inter
   Shares palette with apps.lucesumbrarum.com */

:root {
  --surface:      #F0EBE3;
  --ink:          #1A1A1E;
  --ink-muted:    #6B6560;
  --ink-soft:     #9B9490;
  --border:       #DDD6CC;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --header-h:     60px;
}

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

body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ── Header ─────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease;
}
.site-header.scrolled,
.site-header.solid {
  background: var(--surface);
  border-bottom-color: var(--border);
}

.site-header .inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.35s ease;
}
.site-header.scrolled .brand,
.site-header.solid .brand { color: var(--ink); }

.brand-mark {
  padding: 0 7px;
  height: 26px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: 32px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}
.nav a:hover { color: #fff; }
.site-header.scrolled .nav a,
.site-header.solid    .nav a       { color: var(--ink-muted); }
.site-header.scrolled .nav a:hover,
.site-header.solid    .nav a:hover { color: var(--ink); }

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

/* ── Hero ────────────────────────────────────────────────────────── */

.hero {
  height: 100svh;
  min-height: 500px;
  overflow: hidden;
  background: #1a1a1a;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ── Page head (sub-pages) ───────────────────────────────────────── */

.page-head {
  padding: calc(var(--header-h) + 80px) 40px 40px;
  border-bottom: 1px solid var(--border);
}
.page-head .inner {
  max-width: 1400px;
  margin: 0 auto;
}
.page-head .eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.page-head .eyebrow a {
  color: var(--ink-muted);
  transition: color 0.2s;
}
.page-head .eyebrow a:hover { color: var(--ink); }
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 104px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.page-head .lead {
  margin-top: 18px;
  max-width: 52ch;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(18px, 1.6vw, 22px);
  color: var(--ink-muted);
}

/* ── Series ──────────────────────────────────────────────────────── */

.series {
  padding: 80px 40px 100px;
  max-width: 1400px;
  margin: 0 auto;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.series-grid--2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 1080px;
  margin: 0 auto;
}

.series-card {
  display: block;
  cursor: pointer;
}

.series-img-wrap {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--border);
}
.series-grid[data-media="video"] .series-img-wrap {
  aspect-ratio: 16 / 9;
}
.series-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.4s ease;
}
.series-card:hover .series-img-wrap img {
  transform: scale(1.04);
  filter: brightness(0.9);
}

.series-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 16px;
}
.series-meta h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 34px);
  letter-spacing: -0.01em;
}
.arrow {
  font-size: 18px;
  color: var(--ink-soft);
  transition: transform 0.2s ease, color 0.2s ease;
}
.series-card:hover .arrow {
  transform: translateX(5px);
  color: var(--ink);
}

/* ── Gallery (leaf pages: dias, schnecke, …) ─────────────────────── */

.gallery {
  max-width: 1400px;
  margin: 0 auto;
  padding: 56px 40px 100px;
}

/* Masonry: row-first grid with JS-computed row spans per image.
   Source order preserved (left-to-right, top-to-bottom). */
.gallery-grid[data-style="masonry"] {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 8px;
  grid-auto-flow: dense;
  column-gap: 28px;
  row-gap: 28px;
}

.gallery-grid[data-style="uniform"] {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: dense;
  gap: 28px;
}
.gallery-grid[data-style="uniform"] .gallery-link {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}
.gallery-grid[data-style="uniform"] .gallery-item.portrait {
  grid-row: span 2;
}
.gallery-grid[data-style="uniform"] .gallery-item.portrait .gallery-link {
  aspect-ratio: 2 / 3;
}
.gallery-grid[data-style="uniform"] .gallery-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item {
  margin: 0;
  display: block;
}
.gallery-link {
  display: block;
  overflow: hidden;
  background: var(--border);
  cursor: zoom-in;
}
.gallery-link img {
  width: 100%;
  height: auto;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.3s ease;
  display: block;
}
.gallery-item:hover .gallery-link img {
  transform: scale(1.025);
  filter: brightness(0.94);
}

/* ── Lightbox (native <dialog>) ──────────────────────────────────── */

.lightbox {
  border: 0;
  padding: 0;
  margin: auto;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  background: rgba(16, 14, 12, 0.96);
  color: #EDE7DC;
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(10, 8, 6, 0.9);
  backdrop-filter: blur(8px);
}
.lightbox-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox-inner img {
  max-width:  calc(100vw - 80px);
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #EDE7DC;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, opacity 0.2s;
}
.lightbox-close { top: 20px; right: 20px; font-size: 22px; width: 40px; height: 40px; }
.lightbox-prev  { top: 50%; left: 20px;  transform: translateY(-50%); font-size: 28px; padding-bottom: 4px; }
.lightbox-next  { top: 50%; right: 20px; transform: translateY(-50%); font-size: 28px; padding-bottom: 4px; }

.lightbox-close:hover,
.lightbox-prev:not(:disabled):hover,
.lightbox-next:not(:disabled):hover { background: rgba(255, 255, 255, 0.18); }

.lightbox-prev:disabled,
.lightbox-next:disabled { opacity: 0.2; cursor: default; }

/* ── Video grid (leaf pages) + player ──────────────────────────────── */

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.video-tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--border);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.video-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.3s ease;
}
.video-tile:hover img {
  transform: scale(1.04);
  filter: brightness(0.7);
}
.video-tile .play-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(26, 26, 30, 0.7);
  color: #fff;
  font-size: 18px;
  display: grid;
  place-items: center;
  padding-left: 4px; /* optically centre the triangle */
  transition: background 0.2s, transform 0.25s ease;
  backdrop-filter: blur(4px);
}
.video-tile:hover .play-icon {
  background: var(--ink);
  transform: translate(-50%, -50%) scale(1.08);
}

/* Video player (reuses .lightbox shell) */
.video-player { padding: 0; }
.video-player .lightbox-inner {
  padding: 40px;
}
.video-player video {
  width: min(calc(100vw - 80px), calc((100vh - 80px) * 16 / 9));
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
  object-fit: contain;
}

/* ── Footer ──────────────────────────────────────────────────────── */

.site-footer {
  padding: 32px 40px;
  border-top: 1px solid var(--border);
}
.site-footer .inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
}
.site-footer a { transition: color 0.2s; }
.site-footer a:hover { color: var(--ink); }

/* ── Mobile ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .series-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .gallery-grid[data-style="masonry"] { grid-template-columns: repeat(2, 1fr); column-gap: 20px; row-gap: 20px; }
  .gallery-grid[data-style="uniform"] { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 600px) {
  .site-header .inner { padding: 0 20px; }
  .brand-name { display: none; }
  .nav { gap: 20px; font-size: 11px; }

  .hero { height: 85svh; }

  .page-head { padding: calc(var(--header-h) + 48px) 20px 28px; }

  .series { padding: 48px 20px 64px; }
  .series-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .series-meta h2 { font-size: 24px; }

  .site-footer { padding: 24px 20px; }

  .gallery { padding: 32px 20px 56px; }
  .gallery-grid[data-style="masonry"] { grid-template-columns: 1fr; row-gap: 20px; }
  .gallery-grid[data-style="uniform"] { grid-template-columns: 1fr; gap: 20px; }
  .video-grid { grid-template-columns: 1fr; gap: 14px; }
  .video-player .lightbox-inner { padding: 16px; }
  .video-player video { width: min(calc(100vw - 32px), calc((100vh - 32px) * 16 / 9)); }

  .lightbox-inner { padding: 16px; }
  .lightbox-inner img {
    max-width:  calc(100vw - 32px);
    max-height: calc(100vh - 32px);
  }
  .lightbox-close { top: 12px; right: 12px; }
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 22px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
