:root {
  --bg: #0b0a08;
  --fg: #f3efe8;
  --fg-dim: rgba(243, 239, 232, 0.55);
  --fg-faint: rgba(243, 239, 232, 0.32);
  --gap: clamp(8px, 1.6vh, 20px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

a { color: inherit; text-decoration: none; }

/* ---------- Film grain overlay ---------- */
body::after {
  content: '';
  position: fixed;
  inset: -20px;
  z-index: 500;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 48px);
  mix-blend-mode: difference;
  color: #fff;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-logo { font-weight: 500; }
.nav-link { opacity: 0.85; }
.nav-link:hover { opacity: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroDrift 22s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  from { transform: scale(1.02) translateY(0); }
  to   { transform: scale(1.09) translateY(-1.5%); }
}

.hero-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(8,7,5,0.86) 0%, rgba(8,7,5,0.35) 45%, rgba(8,7,5,0.15) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 clamp(20px, 4vw, 48px) clamp(48px, 8vh, 100px);
}

.hero-inner h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: 0.005em;
}

.hero-inner p {
  margin-top: 16px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* ---------- Chapters — rotating carousels ---------- */
.chapters {
  display: flex;
  gap: var(--gap);
  padding: clamp(60px, 10vh, 120px) clamp(16px, 3vw, 40px);
}

.carousel {
  position: relative;
  flex: 1 1 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 2px;
  display: block;
}

.carousel-track {
  position: absolute;
  inset: 0;
}

.carousel-track img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.4s ease, transform 7s ease;
}

.carousel-track img.on {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.carousel-tint {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(6,5,4,0.78) 0%, rgba(6,5,4,0.05) 55%, transparent 100%);
  transition: background 0.4s ease;
}

.carousel-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: clamp(18px, 3vh, 30px);
  text-align: center;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.05rem, 2.1vw, 1.4rem);
  color: var(--fg);
  transition: transform 0.4s ease;
}

.carousel:hover .carousel-tint { background: linear-gradient(to top, rgba(6,5,4,0.88) 0%, rgba(6,5,4,0.15) 60%, transparent 100%); }
.carousel:hover .carousel-label { transform: translateY(-4px); }
.carousel:hover .carousel-track img.on { transform: scale(1.045); }

/* ---------- Gallery pages ---------- */
.gallery-head {
  padding: clamp(120px, 20vh, 200px) 24px clamp(40px, 7vh, 72px);
  text-align: center;
}

.gallery-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--gap);
  padding: 0 clamp(16px, 3vw, 40px) clamp(80px, 12vh, 140px);
}

.thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
  border-radius: 2px;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, opacity 0.5s ease;
  opacity: 0;
  transform: scale(1.04);
}

.thumb img.in { opacity: 1; transform: scale(1); }
.thumb:hover img { transform: scale(1.05); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(6,5,4,0.96);
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox-img {
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 2rem;
  font-weight: 300;
  cursor: pointer;
  padding: 14px 18px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }

.lightbox-close { top: 8px; right: 8px; font-size: 1.7rem; }
.lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); font-size: 2.6rem; }
.lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); font-size: 2.6rem; }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  padding: clamp(90px, 16vh, 160px) 24px 80px;
}

.footer-cta {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  font-weight: 400;
  border-bottom: 1px solid var(--fg-dim);
  padding-bottom: 6px;
  transition: opacity 0.3s ease;
}

.footer-cta:hover { opacity: 0.7; }

.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
}

.footer-links a:hover { color: var(--fg); }

.footer-copy {
  font-size: 0.7rem;
  color: var(--fg-faint);
  margin-top: 8px;
}

/* ---------- Contact page ---------- */
.contact {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 100px;
  gap: 28px;
}

.contact h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3rem);
}

.contact p {
  max-width: 460px;
  color: var(--fg-dim);
  font-size: 0.95rem;
  line-height: 1.7;
}

.contact-mail {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.3rem, 3.6vw, 1.8rem);
  font-weight: 400;
  border-bottom: 1px solid var(--fg-dim);
  padding-bottom: 4px;
  margin-top: 10px;
  word-break: break-word;
}

.contact-mail:hover { opacity: 0.7; }

.contact-links {
  display: flex;
  gap: 28px;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
}

.contact-links a:hover { color: var(--fg); }

.contact-page .footer { padding-top: 60px; }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .chapters { flex-direction: column; }
  .carousel { flex: none; width: 100%; aspect-ratio: 5 / 4; }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox-prev, .lightbox-next { font-size: 2rem; padding: 10px 12px; }
  .footer-links, .contact-links { gap: 20px; }
}
