:root {
  --bg: #ffffff;
  --surface: #fffdf8;
  --ink: #11110f;
  --muted: #5e5b53;
  --accent: #be5c2f;
  --accent-soft: #eaa57a;
  --line: #ddd5c4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Archivo", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.folder-page {
  position: relative;
  padding-left: 5.8rem;
}

.hero {
  max-width: 70rem;
  margin: 0 auto;
  padding: 4rem 1.2rem 2rem;
  text-align: center;
}

#siteTitle {
  margin: 0;
  font-size: clamp(2rem, 5.4vw, 4.2rem);
  line-height: 1.08;
  display: flex;
  justify-content: center;
  gap: 0.28em;
  flex-wrap: wrap;
}

.site-title-word {
  display: inline-block;
  padding-bottom: 0.08em;
}

.layout {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 1.2rem 3.6rem;
}

.folders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 2.2rem;
}

.folder-hero {
  max-width: 70rem;
  margin: 0 auto;
  padding: 2.2rem 1.2rem 1.2rem;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

.folder-page-title {
  margin: 0.75rem 0 0.2rem;
  font-size: clamp(1.8rem, 4.2vw, 3rem);
  font-family: "Fraunces", serif;
}

.folder-page-subtitle {
  margin: 0;
  color: var(--muted);
}

.folder-gallery {
  display: grid;
  gap: 1rem;
}

.folder-image-card {
  margin-bottom: 0;
}

.folder-image-card img {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0.75rem;
}

.folder-gallery.layout-medium-format {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.folder-gallery.layout-medium-format .folder-image-card img {
  aspect-ratio: 4 / 5;
}

.folder-gallery.layout-medium-format .folder-image-card:nth-child(5n + 1) {
  grid-column: span 2;
}

.folder-gallery.layout-medium-format .folder-image-card:nth-child(5n + 1) img {
  aspect-ratio: 16 / 9;
}

.folder-gallery.layout-35mm-film {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.folder-gallery.layout-35mm-film .folder-image-card img {
  aspect-ratio: 3 / 2;
  border: 0.4rem solid #f2ede2;
}

.folder-gallery.layout-digital {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.folder-gallery.layout-digital .folder-image-card:nth-child(3n + 1) img {
  aspect-ratio: 4 / 5;
}

.folder-gallery.layout-digital .folder-image-card:nth-child(3n + 2) img {
  aspect-ratio: 1 / 1;
}

.folder-gallery.layout-digital .folder-image-card:nth-child(3n) img {
  aspect-ratio: 3 / 4;
}

.folder-gallery.layout-flowers {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.folder-gallery.layout-flowers .folder-image-card img {
  aspect-ratio: 4 / 5;
  border: 0.55rem solid #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.folder-gallery.layout-flowers .folder-image-card:nth-child(2n) {
  transform: rotate(-1.2deg);
}

.folder-gallery.layout-flowers .folder-image-card:nth-child(2n + 1) {
  transform: rotate(1.2deg);
}

.folder-gallery.layout-planes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.folder-gallery.layout-planes .folder-image-card img {
  aspect-ratio: 16 / 9;
}

.folder-gallery.layout-hospitality {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.folder-gallery.layout-hospitality .folder-image-card img {
  aspect-ratio: 1 / 1;
}

.medium-format-main {
  padding-top: 2rem;
}

.medium-format-stream {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 48rem;
  margin: 0 auto;
}

.medium-format-item {
  margin: 0;
}

.medium-format-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: initial;
  border-radius: 0;
}

.infinite-sentinel {
  height: 1px;
}

.medium-format-status {
  margin: 0;
  color: var(--muted);
}

.folder-feed-main {
  padding-top: 2rem;
}

.folder-feed-stream {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 48rem;
  margin: 0 auto;
}

.folder-feed-stream.layout-35mm-feed {
  max-width: 58rem;
  gap: 6.2rem;
}

.folder-feed-stream.layout-planes-feed {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 72rem;
  gap: 0.12rem;
}

.folder-feed-stream.layout-planes-feed .folder-feed-item {
  margin: 0;
}

.folder-feed-stream.layout-planes-feed .folder-feed-item img {
  width: 100%;
  height: auto;
  object-fit: initial;
}

.folder-feed-stream.layout-flowers-feed {
  max-width: 58rem;
  gap: 12rem;
}

.flower-row {
  margin: 0;
  display: grid;
  justify-content: center;
  align-items: start;
  column-gap: 0.22rem;
}

.flower-row-pair {
  grid-template-columns: repeat(2, minmax(0, 20.5rem));
}

.flower-row-single {
  grid-template-columns: minmax(0, 20.5rem);
}

.flower-row img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  max-width: none;
}

.film-row {
  margin: 0;
  display: grid;
  gap: 3.4rem;
  align-items: start;
}

.film-row-single {
  grid-template-columns: 1fr;
}

.film-row-square {
  justify-items: center;
}

.film-row-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.film-row img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

.film-row-square img {
  width: min(72%, 31rem);
}

.folder-feed-item {
  margin: 0;
}

.folder-feed-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

.folder-feed-sentinel {
  height: 1px;
}

.folder-feed-status {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.back-rail {
  position: absolute;
  top: 0;
  left: 0;
  width: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.7rem;
  padding: 1rem 0.35rem;
}

.back-rail-link {
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  transition: transform 160ms ease;
}

.back-rail-link:hover {
  transform: translateX(2px);
}

.card {
  display: block;
  position: relative;
  width: 100%;
  margin-bottom: 0.9rem;
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: var(--surface);
  break-inside: avoid;
  box-shadow: 0 12px 26px rgba(40, 25, 5, 0.1);
  transform: none;
  opacity: 1;
  animation: none;
}

.folder-card {
  margin-bottom: 0;
  break-inside: auto;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  text-decoration: none;
  color: inherit;
}

.folder-card figure {
  display: flex;
  flex-direction: column;
}

.folder-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 0;
  box-shadow: 0 12px 26px rgba(40, 25, 5, 0.1);
}

.card.folder-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

.card.folder-card figcaption {
  position: static;
  margin: 0.85rem auto 0;
  padding: 0.35rem 0.62rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.3;
  text-align: center;
  display: inline-block;
  border-radius: 0;
}

.card.folder-card.active img {
  outline: 3px solid rgba(190, 92, 47, 0.45);
  outline-offset: -3px;
}

@keyframes reveal {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
    transform: none;
    opacity: 1;
  }
}

.card img {
  width: 100%;
  display: block;
  transition: transform 260ms ease;
}

.card.folder-card img {
  transition: none;
}

.card:not(.folder-card):hover img {
  transform: scale(1.03);
}

.card figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.84);
  display: grid;
  place-items: center;
  padding: 3.5rem 1rem 5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: min(92vw, 64rem);
  max-height: 78vh;
  border-radius: 0.8rem;
}

.lightbox-caption {
  position: absolute;
  bottom: 1.35rem;
  text-align: center;
  color: #e9e9e9;
  width: 100%;
  font-size: 0.95rem;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
}

.lightbox-nav.prev {
  left: 1rem;
}

.lightbox-nav.next {
  right: 1rem;
}

@media (max-width: 960px) {
  .folders {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .folder-gallery.layout-35mm-film {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .folder-gallery.layout-digital {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 2.3rem;
  }

  .folder-page {
    padding-left: 0;
  }

  .back-rail {
    display: none;
  }

  .folders {
    grid-template-columns: 1fr;
  }

  .folder-gallery,
  .folder-gallery.layout-medium-format,
  .folder-gallery.layout-35mm-film,
  .folder-gallery.layout-digital,
  .folder-gallery.layout-flowers,
  .folder-gallery.layout-planes,
  .folder-gallery.layout-hospitality {
    grid-template-columns: 1fr;
  }

  .folder-gallery.layout-medium-format .folder-image-card:nth-child(5n + 1) {
    grid-column: auto;
  }

  .medium-format-stream {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .folder-feed-stream {
    gap: 1.6rem;
  }

  .folder-feed-stream.layout-planes-feed {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.08rem;
  }

  .folder-feed-stream.layout-flowers-feed {
    gap: 8rem;
  }

  .flower-row {
    column-gap: 0.16rem;
  }

  .flower-row-pair {
    grid-template-columns: repeat(2, minmax(0, 44vw));
  }

  .flower-row-single {
    grid-template-columns: minmax(0, 44vw);
  }

  .film-row {
    gap: 1.8rem;
  }

  .film-row-square img {
    width: min(84%, 24rem);
  }
}
