/* lower.bar - Art Deco Dissolve */
/* Colors: #2c2418, #f5ede0, #c4a265, #d4a0a0, #6b9e8f, #8e7f91, #c87f5a, #1a1e2a, #ece4d4 */

:root {
  --deep-sepia: #2c2418;
  --parchment: #f5ede0;
  --faded-gold: #c4a265;
  --watercolor-rose: #d4a0a0;
  --verdigris: #6b9e8f;
  --slate-mauve: #8e7f91;
  --burnt-sienna: #c87f5a;
  --ink-blue: #1a1e2a;
  --warm-ivory: #ece4d4;
  --depth: 0;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  background-color: var(--parchment);
  color: var(--deep-sepia);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ===================== FLOATING PARTICLES ===================== */
.floating-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.float-particle {
  position: fixed;
  left: var(--x);
  top: var(--y);
  width: var(--size, 5px);
  height: var(--size, 5px);
  background: var(--clr, rgba(196,162,101,0.2));
  border-radius: 50%;
  animation: floatY var(--dur, 12s) ease-in-out var(--del, 0s) infinite;
  will-change: transform;
}

.float-particle.fp-chev {
  width: 0;
  height: 0;
  background: none;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid var(--clr, rgba(196,162,101,0.18));
  border-radius: 0;
}

@keyframes floatY {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

/* ===================== ACT 1: THRESHOLD ===================== */
.act-1 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--parchment);
}

.threshold-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  position: relative;
  z-index: 2;
}

.keystone-ornament {
  width: 120px;
  height: 72px;
  opacity: 0;
  animation: fadeInOrnament 1.5s ease-out 0.3s forwards;
}

@keyframes fadeInOrnament {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.threshold-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(4rem, 8vw, 8rem);
  letter-spacing: 0.08em;
  color: var(--deep-sepia);
  opacity: 0;
  animation: fadeInTitle 2s ease-out 1s forwards;
}

.threshold-title span {
  display: inline-block;
  transition: transform 0.3s ease;
}

@keyframes fadeInTitle {
  from { opacity: 0; }
  to { opacity: 0.6; }
}

.threshold-wash {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background:
    radial-gradient(ellipse at 30% 80%, rgba(212,160,160,0.2) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 90%, rgba(107,158,143,0.15) 0%, transparent 55%);
  pointer-events: none;
  z-index: 1;
}

.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: absolute;
  bottom: 40px;
  animation: pulseHint 2.5s ease-in-out infinite;
}

.scroll-hint-text {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-mauve);
}

.scroll-chevron {
  width: 24px;
  height: 12px;
}

@keyframes pulseHint {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(5px); }
}

/* ===================== KEYSTONES ===================== */
.keystone {
  width: 100%;
  max-width: 900px;
  margin: 80px auto;
  padding: 60px 40px;
  text-align: center;
  clip-path: polygon(0 100%, 0 8%, 5% 2%, 15% 0%, 85% 0%, 95% 2%, 100% 8%, 100% 100%);
  background:
    radial-gradient(ellipse at 50% 30%, rgba(196,162,101,0.08) 0%, transparent 70%),
    var(--parchment);
}

.keystone-arch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.keystone-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.8rem, 6vw, 5rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--deep-sepia);
  text-shadow: 2px 2px 8px rgba(212,160,160,0.3);
}

.stepped-pyramid {
  width: 80px;
  height: 24px;
}

.stepped-pyramid-lg {
  width: 120px;
  height: 42px;
}

.keystone-deep {
  background:
    radial-gradient(ellipse at 40% 50%, rgba(200,127,90,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 60% 40%, rgba(142,127,145,0.1) 0%, transparent 55%),
    var(--warm-ivory);
}

/* ===================== GALLERY GRIDS ===================== */
.gallery-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  gap: 48px;
}

.gallery-grid-3col {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-grid-4col {
  grid-template-columns: repeat(4, 1fr);
}

/* ===================== GALLERY CARDS ===================== */
.gallery-card {
  aspect-ratio: 3/4;
  position: relative;
  border: 1px solid rgba(196,162,101,0.3);
  background:
    radial-gradient(ellipse at var(--wash-ox, 40%) var(--wash-oy, 50%), rgba(212,160,160,0.2) 0%, transparent 60%),
    radial-gradient(ellipse at calc(100% - var(--wash-ox, 40%)) calc(100% - var(--wash-oy, 50%)), rgba(200,127,90,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 80%, rgba(107,158,143,0.08) 0%, transparent 50%),
    var(--parchment);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}

.gallery-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at var(--wash-ox, 50%) var(--wash-oy, 50%), rgba(196,162,101,0.25) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-card:hover::before {
  opacity: 1;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(44,36,24,0.1);
}

.gallery-card-dense {
  aspect-ratio: 2/3;
}

.card-inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  letter-spacing: 0.02em;
  color: var(--deep-sepia);
  line-height: 1.2;
}

.card-body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: var(--deep-sepia);
  max-width: 52ch;
}

.card-meta {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-mauve);
  margin-top: auto;
}

/* ===================== FLOAT PANELS ===================== */
.float-panel {
  position: relative;
  z-index: 5;
  transform: translate(var(--float-x, 0), var(--float-y, 0));
  padding: 20px;
  grid-column: span 1;
}

.float-quote {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.4rem);
  line-height: 1.6;
  color: var(--deep-sepia);
  opacity: 0.7;
  text-align: center;
}

.float-ornament {
  width: 40px;
  height: 40px;
  display: block;
  margin: 0 auto;
}

.float-panel-deep .float-quote {
  color: var(--warm-ivory);
}

/* ===================== GUTTER ORNAMENTS ===================== */
.gutter-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.gutter-ornament svg {
  width: 48px;
  height: 48px;
}

/* ===================== ZIGZAG BORDER ===================== */
.zigzag-border {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.zigzag-border svg {
  width: 100%;
  height: 20px;
}

/* ===================== ACT 3: DEEP END ===================== */
.act-3 {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(200,127,90,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(142,127,145,0.12) 0%, transparent 55%),
    var(--warm-ivory);
  padding-bottom: 80px;
}

.act-3 .gallery-card {
  background:
    radial-gradient(ellipse at var(--wash-ox, 40%) var(--wash-oy, 50%), rgba(200,127,90,0.25) 0%, transparent 55%),
    radial-gradient(ellipse at calc(100% - var(--wash-ox, 40%)) calc(100% - var(--wash-oy, 50%)), rgba(142,127,145,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(196,162,101,0.12) 0%, transparent 45%),
    var(--warm-ivory);
  border-color: rgba(196,162,101,0.4);
}

/* ===================== ACT 4: FLOOR ===================== */
.act-4 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 40% 50%, rgba(200,127,90,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 60% 40%, rgba(142,127,145,0.2) 0%, transparent 55%),
    var(--deep-sepia);
}

.keystone-final {
  background: transparent;
  clip-path: none;
  max-width: 100%;
  padding: 0;
}

.keystone-arch-final {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.final-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2.8rem);
  color: var(--parchment);
  opacity: 0.8;
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

/* ===================== PANEL REVEAL ANIMATIONS ===================== */
.panel-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.panel-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Column stagger delays */
.panel-reveal[data-col="0"] { transition-delay: 0ms; }
.panel-reveal[data-col="1"] { transition-delay: 100ms; }
.panel-reveal[data-col="2"] { transition-delay: 200ms; }
.panel-reveal[data-col="3"] { transition-delay: 300ms; }
.panel-reveal[data-col="full"] { transition-delay: 0ms; }

/* ===================== GLITCH EFFECT ===================== */
@keyframes glitchCard {
  0% { transform: skewX(0deg); }
  33% { transform: skewX(2deg); filter: drop-shadow(1px 0 0 rgba(107,158,143,0.5)); }
  100% { transform: skewX(0deg); filter: none; }
}

.gallery-card.glitching {
  animation: glitchCard 200ms ease-in-out forwards;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .gallery-grid-3col {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
  .gallery-grid-4col {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

@media (max-width: 600px) {
  .gallery-grid-3col,
  .gallery-grid-4col {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .keystone {
    padding: 40px 20px;
    clip-path: none;
  }
  .gallery-card {
    aspect-ratio: auto;
    min-height: 300px;
  }
  .gallery-card-dense {
    aspect-ratio: auto;
    min-height: 250px;
  }
}
