/* ============================================================
   EIGHT PETAL FILMS — CINEMATIC ANIMATIONS
   ============================================================ */

/* === Reveal on Scroll (Intersection Observer driven) === */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for children */
.stagger-children > *:nth-child(1)  { transition-delay: 0s; }
.stagger-children > *:nth-child(2)  { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3)  { transition-delay: 0.2s; }
.stagger-children > *:nth-child(4)  { transition-delay: 0.3s; }
.stagger-children > *:nth-child(5)  { transition-delay: 0.4s; }
.stagger-children > *:nth-child(6)  { transition-delay: 0.5s; }
.stagger-children > *:nth-child(7)  { transition-delay: 0.6s; }
.stagger-children > *:nth-child(8)  { transition-delay: 0.7s; }
.stagger-children > *:nth-child(9)  { transition-delay: 0.8s; }

/* === Hero Text Entrance === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.anim-fade-up   { animation: fadeInUp 0.9s cubic-bezier(0.4, 0, 0.2, 1) both; }
.anim-fade-down { animation: fadeInDown 0.9s cubic-bezier(0.4, 0, 0.2, 1) both; }
.anim-fade      { animation: fadeIn 0.9s ease both; }
.anim-slide-left  { animation: slideInLeft 0.9s cubic-bezier(0.4, 0, 0.2, 1) both; }
.anim-slide-right { animation: slideInRight 0.9s cubic-bezier(0.4, 0, 0.2, 1) both; }
.anim-scale     { animation: scaleIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) both; }

/* Delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.25s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.65s; }
.delay-5 { animation-delay: 0.85s; }
.delay-6 { animation-delay: 1.05s; }

/* === Shimmer (skeleton loading) === */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* === Gold Glow Pulse === */
@keyframes goldGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(212,175,55,0.15); }
  50%       { box-shadow: 0 0 40px rgba(212,175,55,0.4); }
}

.glow-pulse { animation: goldGlow 3s ease-in-out infinite; }

/* === Floating Elements === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.floating { animation: float 4s ease-in-out infinite; }

/* === Typing Cursor === */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.typing-cursor::after {
  content: '|';
  color: var(--gold);
  animation: blink 1s step-end infinite;
}

/* === Gold Line Draw === */
@keyframes drawLine {
  from { width: 0; }
  to   { width: 60px; }
}

.draw-line {
  display: block;
  width: 0;
  height: 2px;
  background: var(--gold);
  animation: drawLine 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

/* === Masonry item entrance === */
@keyframes masonryIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.masonry-item.in { animation: masonryIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both; }

/* === Page Transition === */
.page-transition-out {
  animation: fadeOut 0.3s ease forwards;
}

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

/* === Particle Dots (decorative) === */
.particle-dots {
  position: absolute;
  pointer-events: none;
  overflow: hidden;
}

.particle-dots::before,
.particle-dots::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.3;
  animation: particleFloat 6s ease-in-out infinite;
}

.particle-dots::before {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.particle-dots::after {
  top: 60%;
  left: 85%;
  animation-delay: 3s;
}

@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.3; }
  33%       { transform: translate(20px, -30px) rotate(120deg); opacity: 0.6; }
  66%       { transform: translate(-15px, 20px) rotate(240deg); opacity: 0.2; }
}

/* === Progress Bar === */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  z-index: 9999;
  transition: width 0.1s linear;
  width: 0%;
}

/* === Noise Texture Overlay === */
.noise-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

/* === Gradient Lines (decorative) === */
.gradient-line-h {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  opacity: 0.2;
}

.gradient-line-v {
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, var(--gold) 50%, transparent 100%);
  opacity: 0.15;
  position: absolute;
  top: 0;
}

/* === Card Tilt Effect (JS-driven class) === */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
}

/* === Success/Error Message === */
.form-success {
  background: rgba(39,174,96,0.12);
  border: 1px solid rgba(39,174,96,0.3);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: #2ecc71;
  font-size: 0.9rem;
  display: none;
  text-align: center;
  margin-top: 16px;
}

.form-success.show { display: block; animation: fadeInUp 0.4s ease both; }

.form-error-msg {
  font-size: 0.75rem;
  color: #e74c3c;
  margin-top: 4px;
  display: none;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: #e74c3c;
}

.form-group.has-error .form-error-msg { display: block; }
