/* Dendrophonia — Gayle Hallowell
   Adobe Express-style replication with motion and carousels. */

:root {
  --bg: #ffffff;
  --fg: #505050;
  --muted: #696969;
  --accent: #b8a48a;
  --serif: 'adobe-clean', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --display: 'Linotype Didot', 'Didot', 'Didot LT STD', 'Bodoni 72',
             'Playfair Display', Georgia, 'Times New Roman', serif;
  --reveal-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* ---------- Scroll-reveal motion ---------- */

.reveal {
  opacity: 0;
  transform: translate3d(0, 48px, 0);
  transition: opacity 1s var(--reveal-ease), transform 1s var(--reveal-ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.reveal-delay-1.is-visible { transition-delay: 0.12s; }
.reveal-delay-2.is-visible { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ken-burns { animation: none !important; }
  .parallax-bg { transform: none !important; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  color: #fff;
}

.hero-bg,
.split-image-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  will-change: transform;
}

/* Slow Ken Burns zoom-in, like Express pan-and-zoom */
.ken-burns {
  animation: kenBurns 22s var(--reveal-ease) both;
}
@keyframes kenBurns {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to   { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.25) 25%,
    rgba(0,0,0,0.5) 50%,
    rgba(0,0,0,0.25) 75%,
    rgba(0,0,0,0) 100%
  );
}

.hero-inner { position: relative; z-index: 1; max-width: 60rem; }

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 7rem);
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.45);
}

.hero .subtitle {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 400;
  margin: 0;
  opacity: 0.95;
  text-shadow: 0 2px 14px rgba(0,0,0,0.5);
}

.scroll-hint {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 46px;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 16px;
  z-index: 2;
}
.scroll-hint::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot {
  0% { opacity: 0; transform: translate(-50%, 0); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 18px); }
}

/* ---------- Split sections ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.split-image {
  position: relative;
  overflow: hidden;
  min-height: 60vh;
}
.split-image-bg {
  /* slight overscale lets us parallax without revealing edges */
  transform: scale(1.08) translate3d(0, 0, 0);
}

.split-text {
  padding: clamp(2rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-text-inner {
  max-width: 36rem;
  width: 100%;
}

.split h3,
.split h4,
.single-column h3,
.single-column h4 {
  font-family: var(--display);
  font-weight: 400;
  margin: 0 0 0.6em;
  line-height: 1.15;
  letter-spacing: 0.005em;
  color: #404040;
}

.split h3, .single-column h3 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); }
.split h4, .single-column h4 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }

.split p,
.single-column p {
  margin: 0 0 1.1em;
  font-size: clamp(1rem, 1.2vw, 1.05rem);
}

.split p:last-child,
.single-column p:last-child { margin-bottom: 0; }

.align-center, p.align-center, h3.align-center, h4.align-center { text-align: center; }
.align-left,   p.align-left   { text-align: left; }
.align-right,  p.align-right  { text-align: right; }

/* ---------- Single-column / spacer-like sections ---------- */

.single-column {
  padding: clamp(3rem, 8vw, 6rem) 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.single-column > p,
.single-column > h3,
.single-column > h4 { max-width: 44rem; width: 100%; }

/* ---------- Card flipbook carousel (Express-style) ---------- */

.flipbook {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #1d1d1d;
}

.flipbook-stage {
  position: absolute;
  inset: 0;
}

.flipbook-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.2s var(--reveal-ease), transform 8s linear;
  will-change: opacity, transform;
}
.flipbook-slide.is-active {
  opacity: 1;
  transform: scale(1);
  transition: opacity 1.2s var(--reveal-ease), transform 8s linear;
}

.flipbook-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0) 40%,
    rgba(0,0,0,0.55) 100%
  );
  pointer-events: none;
}

.flipbook-caption-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(4rem, 10vh, 7rem);
  text-align: center;
  z-index: 2;
  padding: 0 1.5rem;
}

.flipbook-caption {
  display: inline-block;
  max-width: 46rem;
  padding: 0.9rem 1.4rem;
  background: rgba(0,0,0,0.35);
  border-radius: 4px;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--reveal-ease), transform 0.6s var(--reveal-ease);
}
.flipbook-caption.is-active {
  opacity: 1;
  transform: translateY(0);
}

.flipbook-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 3;
}

.flipbook-btn {
  pointer-events: auto;
  background: rgba(0,0,0,0.35);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 1.2rem;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}
.flipbook-btn:hover { background: rgba(0,0,0,0.6); transform: scale(1.06); }
.flipbook-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.flipbook-dots {
  position: absolute;
  left: 0; right: 0;
  bottom: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  z-index: 3;
}
.flipbook-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.flipbook-dot.is-active {
  background: #fff;
  transform: scale(1.25);
}

/* ---------- Photo carousels (replaces flat photo-grids) ---------- */

.photo-carousel {
  position: relative;
  background: var(--bg);
  padding: clamp(1.5rem, 4vw, 3rem) 0;
}

.photo-carousel-track-wrap {
  overflow: hidden;
  width: 100%;
}

.photo-carousel-track {
  display: flex;
  gap: 12px;
  padding: 0 12px;
  transition: transform 0.6s var(--reveal-ease);
  will-change: transform;
}

.photo-carousel-item {
  flex: 0 0 auto;
  width: calc(
    (100% - 12px * (var(--items-per-view, 4) + 1)) /
    var(--items-per-view, 4)
  );
  aspect-ratio: 1 / 1;
  background: #f0f0f0;
  overflow: hidden;
  display: block;
  position: relative;
  cursor: zoom-in;
}
.photo-carousel-item img,
.photo-carousel-item canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--reveal-ease);
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.photo-carousel-item:hover img,
.photo-carousel-item:hover canvas { transform: scale(1.06); }

/* ---------- Image protection (canvas + transparent overlay) ---------- */

.protected-img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.protected-img > canvas,
.protected-img > img {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.protected-img-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
  cursor: inherit;
}

.photo-carousel-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.photo-carousel-btn {
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.18);
  color: var(--fg);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.25s ease, transform 0.25s ease;
}
.photo-carousel-btn:hover { background: rgba(0,0,0,0.12); transform: scale(1.06); }
.photo-carousel-btn:disabled { opacity: 0.35; cursor: default; transform: none; }
.photo-carousel-btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.photo-carousel-dots {
  display: flex;
  gap: 6px;
}
.photo-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.photo-carousel-dot.is-active { background: var(--fg); transform: scale(1.3); }

/* ---------- Lightbox modal ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lightbox.is-open {
  display: flex;
  opacity: 1;
}
.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.lightbox-image-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 1;
}
.lightbox-close,
.lightbox-nav { z-index: 2; }
.lightbox-caption {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(0.6rem, 2vw, 1.2rem);
  text-align: center;
  color: #fff;
  font-style: italic;
  font-size: clamp(0.9rem, 1.1vw, 1.05rem);
  padding: 0 4rem;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  pointer-events: none;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(255,255,255,0.25); transform: scale(1.06); }
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lightbox-close {
  top: clamp(0.8rem, 2vw, 1.4rem);
  right: clamp(0.8rem, 2vw, 1.4rem);
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
}
.lightbox-nav:hover { transform: translateY(-50%) scale(1.06); }
.lightbox-prev { left: clamp(0.6rem, 2vw, 1.4rem); }
.lightbox-next { right: clamp(0.6rem, 2vw, 1.4rem); }

body.lightbox-open { overflow: hidden; }

/* ---------- Video ---------- */

.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin: 0 0 1.2rem;
  background: #000;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Footer ---------- */

.footer-image {
  margin: 0 auto 2rem;
  max-width: 700px;
}
.footer-image img { border-radius: 2px; }
.footer-image figcaption {
  text-align: center;
  margin-top: 0.6rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; min-height: auto; }
  .split-image { min-height: 60vh; order: 0; }
  .split-text { order: 1; }
  .split-image-right .split-image { order: 0; }
  .split-image-right .split-text  { order: 1; }
  .flipbook-btn { width: 40px; height: 40px; margin: 0 0.6rem; }
}
