/* ===================================================
   pistachio.css — Pistachio image animations
   =================================================== */

/* -----------------------------------------------
   HERO FLOATING PISTACHIO
----------------------------------------------- */
.hero-pistachio {
  position: absolute;
  right: max(40px, calc(50vw - 560px));
  top: 50%;
  transform: translateY(-50%);
  width: 380px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.hp-img {
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 3;
  animation: pistachioFloat 6s ease-in-out infinite,
             pistachioRotate 18s linear infinite;
  box-shadow:
    0 0 60px rgba(201,168,76,0.15),
    0 30px 80px rgba(0,0,0,0.5);
  filter: brightness(1.05) contrast(1.08);
}

@keyframes pistachioFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  33%       { transform: translateY(-18px) scale(1.02); }
  66%       { transform: translateY(8px) scale(0.99); }
}

@keyframes pistachioRotate {
  0%   { box-shadow: 0 0 60px rgba(201,168,76,0.15), 0 30px 80px rgba(0,0,0,0.5); }
  25%  { box-shadow: 0 0 80px rgba(201,168,76,0.25), 0 30px 80px rgba(0,0,0,0.5); }
  50%  { box-shadow: 0 0 60px rgba(201,168,76,0.15), 0 30px 80px rgba(0,0,0,0.5); }
  75%  { box-shadow: 0 0 90px rgba(201,168,76,0.3),  0 30px 80px rgba(0,0,0,0.5); }
  100% { box-shadow: 0 0 60px rgba(201,168,76,0.15), 0 30px 80px rgba(0,0,0,0.5); }
}

/* Glowing aura behind image */
.hp-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.18) 0%, transparent 70%);
  animation: glowPulse 4s ease-in-out infinite;
  z-index: 2;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.15); }
}

/* Orbit rings */
.hp-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.15);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.hp-ring-1 {
  width: 320px; height: 320px;
  animation: ringRotate 12s linear infinite;
}
.hp-ring-1::before {
  content: '';
  position: absolute;
  top: -3px; left: 50%;
  width: 6px; height: 6px;
  background: #C9A84C;
  border-radius: 50%;
  box-shadow: 0 0 8px #C9A84C;
  margin-left: -3px;
}
.hp-ring-2 {
  width: 370px; height: 370px;
  border-color: rgba(201,168,76,0.07);
  animation: ringRotate 20s linear infinite reverse;
}
.hp-ring-2::before {
  content: '';
  position: absolute;
  bottom: -3px; left: 30%;
  width: 4px; height: 4px;
  background: rgba(201,168,76,0.6);
  border-radius: 50%;
}

@keyframes ringRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* -----------------------------------------------
   PISTACHIO SCROLL SHOWCASE SECTION
----------------------------------------------- */
.pistachio-showcase {
  height: 280vh; /* tall enough for 3 scroll steps */
  background: #0a1f14;
  position: relative;
}

.psc-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  gap: 60px;
  overflow: hidden;
}

/* Image side */
.psc-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 420px;
  height: 420px;
  margin: 0 auto;
}

.psc-canvas {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  position: relative;
  z-index: 3;
  display: block;
  box-shadow:
    0 0 80px rgba(201,168,76,0.2),
    0 40px 100px rgba(0,0,0,0.7);
  transition: box-shadow 0.8s ease;
  /* Canvas pixel dimensions set by JS — CSS size stays fixed */
}

/* Glow */
.psc-glow {
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.15) 0%, transparent 70%);
  z-index: 2;
  animation: glowPulse 4s ease-in-out infinite;
  transition: background 0.8s ease;
}
.psc-image-wrap[data-step="1"] .psc-glow {
  background: radial-gradient(circle, rgba(201,168,76,0.25) 0%, transparent 70%);
}
.psc-image-wrap[data-step="2"] .psc-glow {
  background: radial-gradient(circle, rgba(50,200,100,0.15) 0%, rgba(201,168,76,0.15) 40%, transparent 70%);
}

/* Rings */
.psc-ring {
  position: absolute;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(201,168,76,0.12);
  transition: all 0.8s ease;
}
.psc-ring-1 {
  width: 360px; height: 360px;
  animation: ringRotate 14s linear infinite;
}
.psc-ring-1::before {
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  width: 7px; height: 7px;
  background: #C9A84C;
  border-radius: 50%;
  margin-left: -3.5px;
  box-shadow: 0 0 10px #C9A84C;
}
.psc-ring-2 {
  width: 400px; height: 400px;
  border-color: rgba(201,168,76,0.06);
  animation: ringRotate 22s linear infinite reverse;
}
.psc-ring-2::after {
  content: '';
  position: absolute;
  bottom: -3px; right: 20%;
  width: 5px; height: 5px;
  background: rgba(201,168,76,0.5);
  border-radius: 50%;
}
.psc-ring-3 {
  width: 415px; height: 415px;
  border-color: rgba(248,245,240,0.03);
  border-style: dashed;
  animation: ringRotate 35s linear infinite;
}

/* Content side */
.psc-content {
  position: relative;
  height: 280px;
}

.psc-step {
  position: absolute;
  top: 0; left: 0; right: 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.psc-step.psc-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.psc-step .section-eyebrow { color: #C9A84C; }
.psc-step h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  color: #F8F5F0;
  line-height: 1.2;
  margin-bottom: 20px;
}
.psc-step p {
  font-size: 1rem;
  color: rgba(248,245,240,0.65);
  line-height: 1.8;
  max-width: 420px;
}

/* Progress dots */
.psc-dots {
  position: absolute;
  bottom: 40px;
  right: 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}
.psc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(248,245,240,0.25);
  transition: all 0.3s ease;
  cursor: pointer;
}
.psc-dot.psc-dot-active {
  background: #C9A84C;
  box-shadow: 0 0 8px rgba(201,168,76,0.6);
  transform: scale(1.4);
}

/* -----------------------------------------------
   RESPONSIVE
----------------------------------------------- */
@media (max-width: 1024px) {
  .hero-pistachio { width: 280px; height: 280px; right: 20px; }
  .hp-img { width: 200px; height: 200px; }
  .hp-ring-1 { width: 240px; height: 240px; }
  .hp-ring-2 { width: 275px; height: 275px; }
  .psc-sticky { grid-template-columns: 1fr; justify-items: center; padding: 60px 24px; gap: 40px; }
  .psc-image-wrap { width: 280px; height: 280px; }
  .psc-canvas { width: 220px; height: 220px; }
  .psc-ring-1 { width: 250px; height: 250px; }
  .psc-ring-2 { width: 275px; height: 275px; }
  .psc-ring-3 { width: 290px; height: 290px; }
  .psc-content { height: auto; min-height: 200px; }
  .psc-step { position: relative; top: auto; left: auto; right: auto; }
  .psc-step:not(.psc-active) { display: none; }
}

@media (max-width: 768px) {
  .hero-pistachio { display: none; }
  .pistachio-showcase { height: auto; }
  .psc-sticky { position: relative; height: auto; padding: 60px 18px; }
  .psc-canvas { width: 200px; height: 200px; }
  .psc-dots { bottom: 20px; right: 20px; flex-direction: row; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hp-img, .hp-glow, .hp-ring-1, .hp-ring-2,
  .psc-img, .psc-glow, .psc-ring-1, .psc-ring-2, .psc-ring-3 {
    animation: none !important;
    transition: none !important;
  }
  .psc-step { transition: none !important; }
}
