/* ============================================================
   JOHN LEAF — Global Styles
   ============================================================ */

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

:root {
  --bg: #ffffff;
  --text: #1c1c1c;
  --muted: #8a8a8a;
  --divider: #e5e5e5;
  --light: #f7f6f4;
  --nav-h: 64px;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ============================================================
   NAVIGATION
   ============================================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 52px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--divider);
  transition: background 0.45s var(--ease), border-color 0.45s var(--ease);
}

.nav.over-hero {
  background: transparent;
  border-bottom-color: transparent;
}

.nav.over-hero .nav-logo {
  color: rgba(255,255,255,0.9);
}

/* Hero-mode links: white only when NOT open (desktop) */
.nav.over-hero .nav-links:not(.open) a {
  color: rgba(255,255,255,0.9);
}

/* Mobile open menu always uses dark text regardless of hero state */
.nav-links.open a {
  color: var(--text) !important;
  opacity: 0.8;
}

.nav.over-hero .nav-toggle span {
  background: rgba(255,255,255,0.9);
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text);
  transition: color 0.45s;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.55;
  transition: opacity 0.25s, color 0.45s;
}

.nav-links a:hover { opacity: 1; }

.nav-links a.active {
  opacity: 1;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 32px; height: 32px;
}

.nav-toggle span {
  display: block;
  width: 22px; height: 1px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s, background 0.45s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.52) 0%,
    rgba(0,0,0,0.06) 52%,
    transparent 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 64px 72px;
  color: #fff;
}

.hero-content h1 {
  font-family: var(--serif);
  font-size: clamp(4rem, 9.5vw, 8rem);
  font-weight: 300;
  letter-spacing: 0.03em;
  line-height: 0.93;
  margin-bottom: 20px;
}

.hero-content .hero-sub {
  font-size: 0.67rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.68;
}

.hero-scroll {
  position: absolute;
  bottom: 36px;
  right: 52px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.5);
  font-size: 0.56rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.hero-scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 52px;
  background: rgba(255,255,255,0.35);
  animation: lineDrop 3s ease-in-out infinite;
}

@keyframes lineDrop {
  0%   { transform: scaleY(0); transform-origin: top; }
  45%  { transform: scaleY(1); transform-origin: top; }
  55%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================================
   SERIES INDEX (homepage)
   ============================================================ */

.series-intro {
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 64px 56px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 40px;
}

.series-intro h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 300;
  letter-spacing: 0.04em;
}

.series-intro p {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 380px;
  line-height: 1.8;
}

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

.series-card {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  display: block;
  cursor: pointer;
  background: var(--light);
}

.series-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

.series-card:hover img { transform: scale(1.06); }

.series-card-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e5e0;
}

.series-card-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 36px 24px 28px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  color: #fff;
  transition: padding 0.4s var(--ease);
}

.series-card:hover .series-card-info { padding-bottom: 36px; }

.series-card-info .period {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 6px;
}

.series-card-info h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
  padding: calc(var(--nav-h) + 72px) 64px 0;
  max-width: 1400px;
  margin: 0 auto;
}

.page-header .eyebrow {
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 300;
  letter-spacing: 0.03em;
  line-height: 1.05;
}

.page-header .sub {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.85;
}

.page-rule {
  width: 48px;
  height: 1px;
  background: var(--text);
  margin: 28px 0 64px;
}

/* ============================================================
   GALLERY (masonry)
   ============================================================ */

.gallery {
  columns: 3 280px;
  column-gap: 10px;
  padding: 0 64px 96px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 10px;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  /* scroll reveal */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.gallery-item.visible {
  opacity: 1;
  transform: none;
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.55s var(--ease), filter 0.5s;
}

.gallery-item:hover img {
  transform: scale(1.02);
  filter: brightness(0.93);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 12px 80px rgba(0,0,0,0.13);
}

.lb-close {
  position: fixed;
  top: 18px; right: 28px;
  background: none; border: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 200;
  color: var(--text);
  opacity: 0.38;
  transition: opacity 0.2s;
  line-height: 1;
  padding: 8px;
}

.lb-close:hover { opacity: 0.9; }

.lb-prev, .lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 200;
  color: var(--text);
  opacity: 0.22;
  transition: opacity 0.2s;
  padding: 24px 20px;
  line-height: 1;
}

.lb-prev:hover, .lb-next:hover { opacity: 0.7; }
.lb-prev { left: 4px; }
.lb-next { right: 4px; }

.lb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  white-space: nowrap;
}

/* ============================================================
   ABOUT
   ============================================================ */

.about-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 64px 96px;
}

.about-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 96px;
  align-items: start;
}

.about-portrait {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
}

.about-portrait img { width: 100%; display: block; }

.about-portrait figcaption {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
}

.about-text h2 {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin-bottom: 32px;
}

.about-text p {
  font-size: 1.05rem;
  line-height: 1.95;
  color: #2d2d2d;
}

.about-text .credit {
  margin-top: 36px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-style: italic;
}

.about-studio {
  max-width: 1200px;
  margin: 56px auto 0;
  padding: 0 64px;
}

.about-studio img { width: 100%; display: block; }

.about-studio figcaption {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
}

/* ============================================================
   CONTACT
   ============================================================ */

.contact-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 64px 96px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 96px;
  align-items: start;
}

.contact-fields { }

.contact-field {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--divider);
}

.contact-field:last-child {
  border-bottom: none;
}

.contact-field .label {
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.contact-field .value {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 300;
  line-height: 1.4;
}

.contact-field .value a {
  color: var(--text);
  border-bottom: 1px solid var(--divider);
  transition: border-color 0.25s;
}

.contact-field .value a:hover {
  border-color: var(--text);
}

.contact-note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.85;
  margin-top: 8px;
}

.contact-image img {
  width: 100%;
  display: block;
  position: sticky;
  top: calc(var(--nav-h) + 40px);
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  padding: 40px 64px;
  border-top: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer p {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   HERO SLIDESHOW
   ============================================================ */

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease-in-out;
  will-change: opacity;
}

.hero-slide.active { opacity: 1; }

.hero-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}

.slide-dots {
  position: absolute;
  bottom: 36px;
  left: 64px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
}

.slide-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.35s, transform 0.35s;
}

.slide-dot.active {
  background: rgba(255,255,255,0.9);
  transform: scale(1.4);
}

@media (max-width: 900px) { .slide-dots { left: 28px; } }

/* ============================================================
   2025 PLACEHOLDER GALLERY
   ============================================================ */

.placeholder-notice {
  margin: 0 64px 48px;
  padding: 32px 36px;
  background: var(--light);
  border-left: 2px solid var(--divider);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.8;
}

.placeholder-notice strong {
  color: var(--text);
  font-weight: 400;
}

.placeholder-notice code {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  background: rgba(0,0,0,0.05);
  padding: 1px 6px;
  border-radius: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Prevent horizontal overflow on all screen sizes */
html, body { overflow-x: hidden; }

@media (max-width: 1100px) {
  .series-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Tablet / large mobile ── */
@media (max-width: 900px) {
  :root { --nav-h: 56px; }

  .nav { padding: 0 20px; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    border-bottom: 1px solid var(--divider);
    z-index: 199;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }

  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 18px 20px;
    border-bottom: 1px solid var(--divider);
    font-size: 0.8rem;
    min-height: 48px; /* touch target */
  }
  .nav-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  /* Force dark text in the open mobile menu regardless of over-hero state */
  .nav-links.open a,
  .nav.over-hero .nav-links.open a {
    color: var(--text);
    opacity: 0.7;
  }
  .nav-links.open a:hover,
  .nav.over-hero .nav-links.open a:hover,
  .nav-links.open a.active,
  .nav.over-hero .nav-links.open a.active {
    opacity: 1;
  }

  /* Hero */
  .hero-content { padding: 0 20px 52px; }
  .hero-scroll  { display: none; }
  .slide-dots   { left: 20px; bottom: 24px; }

  /* Series */
  .series-intro { padding: 48px 20px 32px; flex-direction: column; gap: 12px; }
  .series-intro p { max-width: 100%; }
  .series-grid { grid-template-columns: repeat(2, 1fr); gap: 2px; }
  .series-card { aspect-ratio: 4/5; }

  /* Page headers */
  .page-header { padding: calc(var(--nav-h) + 40px) 20px 0; }
  .page-rule   { margin-bottom: 32px; }

  /* Gallery */
  .gallery { columns: 2 160px; column-gap: 8px; padding: 0 20px 56px; }
  .gallery-item { margin-bottom: 8px; }

  /* About */
  .about-wrap   { padding: 0 20px 56px; }
  .about-grid   { grid-template-columns: 1fr; gap: 32px; }
  .about-portrait { position: static; max-width: 380px; }
  .about-studio { padding: 0 20px; margin-top: 32px; }

  /* Contact */
  .contact-layout { padding: 0 20px 56px; grid-template-columns: 1fr; gap: 40px; }
  .contact-image img { position: static; }

  /* Lightbox arrows — bigger touch targets */
  .lb-prev, .lb-next { padding: 24px 16px; font-size: 1.4rem; }
  .lb-close { top: 12px; right: 16px; padding: 12px; font-size: 1.8rem; }

  /* Footer */
  .site-footer { padding: 28px 20px; flex-direction: column; gap: 6px; text-align: center; }

  .placeholder-notice { margin: 0 20px 32px; }
}

/* ── Small mobile ── */
@media (max-width: 540px) {
  .hero-content h1  { font-size: clamp(2.8rem, 13vw, 4.5rem); }
  .page-header h1   { font-size: clamp(2.2rem, 10vw, 3.5rem); }

  .series-grid { grid-template-columns: 1fr 1fr; gap: 2px; }
  .series-card { aspect-ratio: 1/1; }
  .series-card-info h3 { font-size: 0.95rem; }

  .gallery { columns: 1; padding: 0 12px 40px; }
  .gallery-item { margin-bottom: 8px; }

  .about-portrait { max-width: 100%; }

  .contact-field .value { font-size: 1.1rem; }
}

/* ── Very small (320px) ── */
@media (max-width: 360px) {
  .nav-logo { font-size: 1rem; }
  .hero-content h1 { font-size: 2.6rem; }
  .slide-dots { gap: 7px; }
}
