/* ── New Art Pope — custom layer on top of Tailwind ───────────── */

:root {
  color-scheme: dark;
}

html,
body {
  background-color: #0b0b0c;
}

:focus-visible {
  outline: 2px solid #b9a063;
  outline-offset: 4px;
}

/* Smooth, weighty feel for a contemplative gallery */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* When the mobile menu opens, the page is pushed down by this amount
     (set in JS) so the expanded header never overlays the content. */
  transition: padding-top 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Mobile menu: gentle expand/collapse (animated height + fade) ── */
.mobile-menu {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.4s ease;
}
.mobile-menu.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}
.mobile-menu-inner {
  min-height: 0;
  overflow: hidden;
}

/* ── Hero parallax (scroll-linked zoom + fade-up text) ────────── */
#hero-bg {
  /* Zoom anchored slightly below center, onto Alex's face */
  transform-origin: 50% 58%;
  will-change: transform, opacity, filter;
}
#hero-overlay {
  will-change: opacity;
}
#hero-content {
  will-change: transform, opacity;
}
/* Über-section portrait: scroll-linked zoom (no dim / no brightness) */
#portrait {
  transform-origin: center center;
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  #hero-bg { transform: none !important; }
  #hero-content { transform: none !important; opacity: 1 !important; }
  #portrait { transform: none !important; }
}

/* ── Mobile hamburger toggle (animates bars → X) ──────────────── */
.menu-toggle {
  position: relative;
  width: 1.75rem;
  height: 1.25rem;
  cursor: pointer;
  background: none;
  border: 0;
  color: #8d8a84;
}
.menu-toggle:hover { color: #e9e5dd; }

.menu-bars,
.menu-bars::before,
.menu-bars::after {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}
.menu-bars { top: 50%; transform: translateY(-50%); }
.menu-bars::before { content: ""; top: -7px; }
.menu-bars::after  { content: ""; top: 7px; }

/* Open state: middle bar fades, outer bars cross into an X */
.menu-toggle.is-open .menu-bars { background: transparent; }
.menu-toggle.is-open .menu-bars::before { top: 0; transform: rotate(45deg); }
.menu-toggle.is-open .menu-bars::after  { top: 0; transform: rotate(-45deg); }

/* ── Scroll-reveal ────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
}

/* ── Horizontal carousel (one chunk visible, slide for more) ───── */
.carousel {
  position: relative;
}

/* The scrolling track: a row of works that slides left/right.
   Native scroll-snap keeps each chunk neatly aligned. */
.carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
  padding-bottom: 0.5rem;
}
.carousel-track::-webkit-scrollbar { display: none; } /* WebKit */

/* Slide width controls how many works form one chunk.
   A sliver of the next work peeks in to invite sliding. */
.carousel-slide {
  flex: 0 0 auto;
  width: 82%;
  scroll-snap-align: start;
}
@media (min-width: 640px) {
  .carousel-slide { width: 46%; }
  .carousel-track { gap: 1.25rem; }
}
@media (min-width: 1024px) {
  .carousel-slide { width: 31.5%; }
  .carousel-track { gap: 1.5rem; }
}

/* Navigation arrows */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid #26262a;
  border-radius: 9999px;
  background: rgba(11, 11, 12, 0.7);
  backdrop-filter: blur(6px);
  color: #e9e5dd;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}
.carousel-btn:hover { color: #b9a063; border-color: #b9a063; }
.carousel-btn:disabled { opacity: 0.25; cursor: default; }
.carousel-btn:disabled:hover { color: #e9e5dd; border-color: #26262a; }
.carousel-btn--prev { left: -0.5rem; }
.carousel-btn--next { right: -0.5rem; }
@media (min-width: 1024px) {
  .carousel-btn--prev { left: -1.5rem; }
  .carousel-btn--next { right: -1.5rem; }
}

.art-item {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid #26262a;
  background: #141416;
  cursor: pointer;
  border-radius: 2px;
}
/* Uniform tile height so the chunk reads as a clean row;
   the full, uncropped work opens in the lightbox. */
.art-item img {
  display: block;
  width: 100%;
  height: clamp(20rem, 42vh, 30rem);
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.8s ease;
}
.art-item:hover img {
  transform: scale(1.04);
}
.art-item:focus-visible {
  border-color: #b9a063;
}
.art-item:focus-visible img {
  transform: scale(1.04);
}

/* Caption overlay on hover */
.art-item .meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.25rem 1rem 1rem;
  background: linear-gradient(to top, rgba(11, 11, 12, 0.85), transparent);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.art-item:hover .meta { opacity: 1; transform: none; }
.art-item .meta .title { font-family: "Cormorant Garamond", serif; font-size: 1.05rem; color: #e9e5dd; }
.art-item .meta .sub   { font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: #8d8a84; }

/* Elegant placeholder slots (used until real artwork is dropped in) */
.art-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: #5a5750;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(185,160,99,0.05), transparent 60%),
    linear-gradient(160deg, #161618, #0f0f10);
}
