/* Page title */
.page-title {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.12;
  margin: 0 0 10px;
  color: #0b0f14;
}

/* ===== Section 1: Gallery Intro ===== */
.gallery-intro {
  background: radial-gradient(1100px 700px at 50% -240px, #fff6fb 0%, #ffffff 45%, #ffffff 100%);
}
.intro-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(16px, 4vw, 32px);
  align-items: center;
}
.intro-lead { color: #334054; }
.intro-ribbon { display: grid; gap: 14px; justify-items: center; }
.intro-card {
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(16,20,30,.10);
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.intro-card:hover { transform: translateY(-4px); filter: saturate(1.05); box-shadow: 0 18px 42px rgba(16,20,30,.16); }
.intro-card img { display: block; width: 100%; height: auto; max-width: 350px; aspect-ratio: 4/3; object-fit: cover; }

/* entrance */
.gallery-intro .intro-card,
.gallery-intro .intro-copy { opacity: 0; transform: translateY(10px); }
.in-view.gallery-intro .intro-card,
.in-view.gallery-intro .intro-copy { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease; }
.in-view.gallery-intro .intro-card:nth-child(2) { transition-delay: .06s; }
.in-view.gallery-intro .intro-card:nth-child(3) { transition-delay: .12s; }

@media (max-width: 960px) {
  .intro-grid { grid-template-columns: 1fr; }
  .intro-ribbon { order: 3; }
}

/* ===== Section 2: Reel Weddings (snap reel) ===== */
.reel-weddings { background: #fbfdff; }
.snap-wrap { position: relative; margin-top: .5rem; }
.snap-scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: max-content;
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 16px;
  padding: 8px 4px 8px 4px; -webkit-overflow-scrolling: touch;
}
.reel-card {
  scroll-snap-align: start;
  width: clamp(240px, 34vw, 340px);
  border-radius: 18px; background: #ffffff;
  box-shadow: 0 12px 30px rgba(16,20,30,.08);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.reel-card:hover { transform: translateY(-4px); filter: saturate(1.05); box-shadow: 0 18px 42px rgba(16,20,30,.12); }
.reel-card img { width: 100%; height: auto; max-width: 350px; aspect-ratio: 5/4; object-fit: cover; border-top-left-radius: 18px; border-top-right-radius: 18px; }
.reel-card figcaption { padding: .7rem .9rem 1rem; color: #314054; }

/* ===== Section 3: Spotlights (split grid) ===== */
.spotlights { background: radial-gradient(1100px 700px at 100% -260px, #f3fbff 0%, #ffffff 45%, #ffffff 100%); }
.spot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px,4vw,32px); align-items: center; }
.spot-copy p { color: #334054; }
.spot-cards { display: grid; gap: 14px; justify-items: center; }
.spot-card {
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(16,20,30,.10);
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.spot-card:hover { transform: translateY(-4px); filter: saturate(1.05); box-shadow: 0 18px 42px rgba(16,20,30,.16); }
.spot-card img { display: block; width: 100%; height: auto; max-width: 350px; aspect-ratio: 4/3; object-fit: cover; }
.tilt-a { transform: rotateZ(-0.6deg); }
.tilt-b { transform: rotateZ(0.8deg); }
.tilt-c { transform: rotateZ(-0.4deg); }

/* entrance */
.reel-weddings .reel-card,
.spotlights .spot-card,
.spotlights .spot-copy { opacity: 0; transform: translateY(10px); }
.in-view.reel-weddings .reel-card,
.in-view.spotlights .spot-card,
.in-view.spotlights .spot-copy { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease; }
.in-view.spotlights .spot-card:nth-child(2) { transition-delay: .06s; }
.in-view.spotlights .spot-card:nth-child(3) { transition-delay: .12s; }

@media (max-width: 960px) {
  .spot-grid { grid-template-columns: 1fr; }
}
/* ===== Section 4: Palettes (swipe-reveal) ===== */
.palettes { background: #ffffff; }
.panel-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.panel-card { background: #fff; border-radius: 16px; box-shadow: 0 12px 30px rgba(16,20,30,.08); overflow: hidden; }
.panel-cap { padding: .7rem .9rem 1rem; color: #334054; }

.reveal-img { position: relative; overflow: hidden; }
.reveal-img img { display: block; width: 100%; height: auto; max-width: 350px; aspect-ratio: 4/3; object-fit: cover; }

/* swipe cover that peels away when in-view */
.reveal-img::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(90deg, #fff, #fff0);
  transform: translateX(0%);
}
.in-view.palettes .panel-card:nth-child(1) .reveal-img::after { animation: swipe 0.9s ease forwards .05s; }
.in-view.palettes .panel-card:nth-child(2) .reveal-img::after { animation: swipe 0.9s ease forwards .15s; }
.in-view.palettes .panel-card:nth-child(3) .reveal-img::after { animation: swipe 0.9s ease forwards .25s; }
@keyframes swipe { to { transform: translateX(100%); } }

@media (max-width: 960px){ .panel-row { grid-template-columns: 1fr; } }

/* ===== Section 5: Compare (drag reveal) ===== */
.compare { background: radial-gradient(1100px 700px at 100% -260px, #f3fbff 0%, #ffffff 45%, #ffffff 100%); }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px,4vw,32px); align-items: start; }
.compare-copy p { color:#334054; }

.compare-card { border-radius: 16px; box-shadow: 0 12px 30px rgba(16,20,30,.1); background:#fff; overflow:hidden; }
.cmp-wrap { --cut: 50%; position: relative; width: 100%; max-width: 350px; aspect-ratio: 4/3; }
.cmp-base, .cmp-top { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; border:0; }
.cmp-top { clip-path: inset(0 calc(100% - var(--cut)) 0 0); transition: clip-path .08s linear; }
.cmp-handle { position:absolute; top:0; bottom:0; left:calc(var(--cut)); width:2px; background:#ffd36e; box-shadow: 0 0 0 6px rgba(255,211,110,.25); pointer-events:none; }

.compare-still { border-radius: 16px; overflow: hidden; box-shadow: 0 12px 30px rgba(16,20,30,.1); background:#fff; text-align:center; }
.compare-still img { display:block; width:100%; height:auto; max-width:350px; aspect-ratio:4/3; object-fit:cover; }

@media (max-width: 960px){
  .compare-grid { grid-template-columns: 1fr; }
  .cmp-wrap { margin-inline:auto; }
  .compare-still { justify-self: center; }
}

/* entrance */
.compare .compare-card, .compare .compare-still, .compare .compare-copy { opacity:0; transform: translateY(10px); }
.in-view.compare .compare-card, .in-view.compare .compare-still, .in-view.compare .compare-copy {
  opacity:1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease;
}

/* ===== Section 6: Light Studies (floating trio) ===== */
.light-studies { background:#fbfdff; }
.float-trio { display:grid; grid-template-columns: repeat(3,1fr); gap:14px; justify-items:center; }
.float-card { border-radius:18px; overflow:hidden; box-shadow:0 12px 32px rgba(16,20,30,.1); }
.float-card img { display:block; width:100%; height:auto; max-width:350px; aspect-ratio:4/3; object-fit:cover; }

/* yoyo float + subtle tilt per card */
@keyframes floatY { 0%,100%{ transform: translateY(0) rotateZ(0deg);} 50%{ transform: translateY(-8px) rotateZ(0deg);} }
.f-a { animation: floatY 4.6s ease-in-out infinite; }
.f-b { animation: floatY 5.2s ease-in-out infinite .15s; }
.f-c { animation: floatY 5.8s ease-in-out infinite .3s; }
.f-a:hover, .f-b:hover, .f-c:hover { animation-play-state: paused; transform: translateY(-4px) rotateZ(0deg) !important; filter:saturate(1.06); }

/* reduce motion */
@media (prefers-reduced-motion: reduce){
  .f-a, .f-b, .f-c { animation: none; }
}

@media (max-width:960px){ .float-trio { grid-template-columns: 1fr; } }
/* ===== Section 7: Motion Strip (parallax) ===== */
.motion-strip { background: radial-gradient(1100px 700px at 0% -260px, #fff6f0 0%, #ffffff 45%, #ffffff 100%); }
.motion-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  overflow: hidden;
}
.motion-item {
  will-change: transform;
  transform: translateX(0);
  transition: filter .25s ease, box-shadow .25s ease;
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(16,20,30,.10);
}
.motion-item img { width: 100%; height: auto; max-width: 350px; aspect-ratio: 4/3; object-fit: cover; }
.motion-item:hover { filter: saturate(1.05); box-shadow: 0 18px 42px rgba(16,20,30,.16); }

@media (min-width: 961px){
  /* на десктопах ставим их в три строки с разной начальной смещённостью */
  .motion-track { grid-template-rows: auto; }
  .motion-item:nth-child(1){ transform: translateX(-6%); }
  .motion-item:nth-child(2){ transform: translateX(4%); }
  .motion-item:nth-child(3){ transform: translateX(-2%); }
}

/* ===== Section 8: Textures (3D flip) ===== */
.textures { background:#fbfdff; }

/* Гарантия без вылета: карта вписывается в экран и не больше 350px */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  justify-items: center;
  align-items: start;
  contain: content; /* не распространяем размеры наружу */
}

.flip {
  inline-size: clamp(240px, 92vw, 350px); /* <= экран, <= 350px */
  aspect-ratio: 4 / 3;
  margin-inline: auto;               /* центрируем на всякий случай */
}

.flip-inner {
  position: relative;
  inline-size: 100%;
  block-size: 100%;
  transform-style: preserve-3d;
  transition: transform .6s ease;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(16,20,30,.10);
  overflow: hidden;
}

.flip:focus-visible .flip-inner,
.flip.is-flipped .flip-inner,
.flip:hover .flip-inner { transform: rotateY(180deg); }

.flip-front, .flip-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  display: grid; place-items: center;
}
.flip-front img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.flip-back {
  transform: rotateY(180deg);
  background: #0f1622; color: #d7edff;
  padding: .9rem; text-align: center;
}

@media (max-width: 960px){ .flip-grid { grid-template-columns: 1fr; } }

/* сниженная анимация */
@media (prefers-reduced-motion: reduce){
  .flip-inner { transition: none; }
  .flip:hover .flip-inner { transform: none; }
}


/* ===== Section 9: Frames (Ken Burns) ===== */
.frames { background: radial-gradient(1100px 700px at 100% -260px, #f3fbff 0%, #ffffff 45%, #ffffff 100%); }
.frames-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; justify-items: center; }
.frame-card { width: 100%; max-width: 350px; border-radius: 18px; overflow: hidden; box-shadow: 0 12px 32px rgba(16,20,30,.10); }
.frame-img { width: 100%; height: auto; object-fit: cover; aspect-ratio: 4/3; animation: kb 9s ease-in-out infinite alternate; animation-play-state: paused; }
@keyframes kb { 0%{ transform: scale(1) translate(0,0); } 100%{ transform: scale(1.07) translate(2%, -2%); } }
.in-view.frames .frame-img { animation-play-state: running; }

@media (max-width: 960px){ .frames-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce){
  .frame-img { animation: none; }
}
/* ===== Section 10: Diptych Spotlight ===== */
.diptych { background: #ffffff; }
.diptych-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: clamp(16px,4vw,32px); align-items: start; }
.diptych-copy p { color: #334054; }

.spot { justify-self: center; }
.spot-wrap {
  --x: 50%; --y: 50%; --r: 120px;
  position: relative; inline-size: min(100%, 350px); aspect-ratio: 4/3; overflow: hidden;
  border-radius: 16px; box-shadow: 0 12px 30px rgba(16,20,30,.10);
}
.spot-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spot-base { filter: grayscale(0.85) brightness(0.95) contrast(0.9); }
.spot-top {
  /* Spotlight mask; falls back gracefully if not supported */
  -webkit-mask-image: radial-gradient(var(--r) var(--r) at var(--x) var(--y), #000 68%, transparent 72%);
          mask-image: radial-gradient(var(--r) var(--r) at var(--x) var(--y), #000 68%, transparent 72%);
  transition: -webkit-mask-position .06s linear, mask-position .06s linear;
}
.spot-wrap.no-mask .spot-top { -webkit-mask-image: none; mask-image: none; }

@media (max-width: 960px) { .diptych-grid { grid-template-columns: 1fr; } }

/* ===== Section 11: Backstage Polaroids ===== */
.backstage { background: radial-gradient(1100px 700px at 100% -260px, #f3fbff 0%, #ffffff 45%, #ffffff 100%); }
.pin-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; justify-items: center; }
.pin-card {
  position: relative; inline-size: min(100%, 350px); background: #fff; border-radius: 14px;
  padding: 10px 10px 12px; box-shadow: 0 14px 38px rgba(16,20,30,.12);
  animation: pinIn .7s cubic-bezier(.2,.8,.2,1) both;
}
.pin-card img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.pin-cap { margin-top: .5rem; color: #2f3b4e; text-align: center; font-weight: 600; }

/* pin & tape */
.pin-card::before{
  content:""; position:absolute; top:-8px; left:50%; transform:translateX(-50%);
  width:14px; height:14px; border-radius:50%; background:#ff8ec3; box-shadow: 0 4px 0 rgba(0,0,0,.15);
}
.pin-card::after{
  content:""; position:absolute; top:6px; left:12px; right:12px; height:10px;
  background: linear-gradient(90deg, rgba(255,211,110,.35), rgba(255,211,110,.15));
  border-radius: 6px; filter: blur(4px); opacity:.7; pointer-events:none;
}
@keyframes pinIn {
  0%{ transform: translateY(-16px) rotateZ(-1.5deg); }
  60%{ transform: translateY(3px) rotateZ(0.4deg); }
  100%{ transform: translateY(0) rotateZ(0deg); }
}
.delay-a{ animation-delay: .05s; }
.delay-b{ animation-delay: .15s; }

@media (max-width: 960px){ .pin-list { grid-template-columns: 1fr; } }

/* ===== Section 12: Depth Stack (cursor/scroll perspective) ===== */
.depth { background: #fbfdff; }
.stack {
  --rx: 0deg; --ry: 0deg;
  position: relative; perspective: 900px;
  display: grid; justify-items: center; gap: 8px;
}
.stack-card {
  inline-size: min(100%, 350px); aspect-ratio: 4/3; border-radius: 16px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(16,20,30,.10); position: relative; will-change: transform, filter;
}
.stack-card img { width: 100%; height: 100%; object-fit: cover; }

.s-front { transform: translateZ(22px) rotateX(var(--rx)) rotateY(var(--ry)); z-index: 2; }
.s-back  { transform: translateZ(0)    rotateX(calc(var(--rx) * -0.6)) rotateY(calc(var(--ry) * -0.6)); z-index: 1; filter: saturate(.96); }

.stack:hover .s-front { filter: saturate(1.05); }
.stack:hover .s-back  { filter: saturate(1.02); }

@media (prefers-reduced-motion: reduce){
  .s-front, .s-back { transform: none !important; }
}
/* ===== Section 13: Noticing ===== */
.noticing { background: radial-gradient(1100px 700px at 10% -260px, #fff7ef 0%, #ffffff 45%, #ffffff 100%); }
.notice-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(16px,4vw,32px); align-items: start; }

.notice-head p { color:#334054; }
.notice-progress { position: sticky; top: calc(var(--header-h) + 6px); height: 6px; background: #eef3ff; border-radius: 999px; overflow: hidden; margin-top: 8px; box-shadow: inset 0 0 0 1px #d9e6ff; }
.notice-bar { display:block; height:100%; width:0%; background: linear-gradient(90deg, #9ee0ff, #ffd36e, #ff8ec3); transition: width .12s linear; }

.ticks { display: grid; gap: .55rem; margin: .6rem 0 0; }
.ticks li {
  position: relative; padding-left: 1.6rem; color:#2b3340; background:
    linear-gradient(90deg, rgba(255,211,110,.0), rgba(255,211,110,.18)) 0 100% / 0% 38% no-repeat;
  transition: background-size .55s ease;
  border-radius: 6px;
}
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; transform: translateY(2px); color: #29c27a; font-weight: 800; }
.in-view.noticing .ticks li { background-size: 100% 38%; }
.in-view.noticing .ticks li:nth-child(2){ transition-delay: .05s; }
.in-view.noticing .ticks li:nth-child(3){ transition-delay: .10s; }
.in-view.noticing .ticks li:nth-child(4){ transition-delay: .15s; }
.in-view.noticing .ticks li:nth-child(5){ transition-delay: .20s; }
.in-view.noticing .ticks li:nth-child(6){ transition-delay: .25s; }

.notice-photos { display: grid; gap: 14px; justify-items: center; align-content: start; perspective: 900px; }
.noti-card { inline-size: min(100%, 350px); aspect-ratio: 4/3; border-radius: 18px; overflow: hidden; box-shadow: 0 14px 36px rgba(16,20,30,.12); transform: translateY(8px) rotateZ(-1deg); opacity: 0; }
.noti-card img { width:100%; height:100%; object-fit: cover; }
.in-view.noticing .noti-card { transform: translateY(0) rotateZ(0deg); opacity: 1; transition: transform .6s ease, opacity .6s ease, box-shadow .25s ease; }
.in-view.noticing .noti-card.b { transition-delay: .08s; }
.noti-card:hover { box-shadow: 0 18px 46px rgba(16,20,30,.16); filter: saturate(1.05); }

@media (max-width: 960px){
  .notice-grid { grid-template-columns: 1fr; }
}

/* ===== Section 14: CTA Gallery ===== */
.cta-gallery { background: linear-gradient(180deg, #0b0f14 0%, #111b29 100%); color: #cfe9ff; }
.cta-gallery .light { color: #eaf7ff; }
.cta-g-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px,4vw,32px); align-items: center; }

.cta-g-photo { position: relative; inline-size: min(100%, 280px); aspect-ratio: 1/1; border-radius: 50%; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.35); justify-self: center; }
.cta-g-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Animated ring using a rotating pseudo-element */
.cta-g-photo.ring::before {
  content:""; position:absolute; inset:-10px; border-radius: 50%;
  background: conic-gradient(#ff8ec3, #ffd36e, #9ee0ff, #ff8ec3);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 0px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 0px));
  animation: spin 8s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cta-g-copy { text-align: center; }
.btn-row.center { justify-content: center; }

@media (max-width: 960px){
  .cta-g-grid { grid-template-columns: 1fr; }
}
