/* ═══════════════════════════════════════════
   ALQUIMIA VEGETAL — Custom Styles
   Laboratorio Botánico Espagírico
   ═══════════════════════════════════════════ */

/* ── Grain Texture Overlay ── */
.grain::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  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)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Scroll Reveal Animations ── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-slow {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-slow.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-fade {
  opacity: 0;
  transition: opacity 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-fade.visible {
  opacity: 1;
}

/* ── Hero Entrance ── */
.hero-enter {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeIn 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.hero-enter-delay-1 { animation-delay: 0.4s; }
.hero-enter-delay-2 { animation-delay: 0.8s; }
.hero-enter-delay-3 { animation-delay: 1.2s; }
.hero-enter-delay-4 { animation-delay: 1.8s; }

@keyframes heroFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Portal Cards ── */
.portal-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.portal-card .portal-image {
  transition: transform 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.8s ease;
}
.portal-card:hover .portal-image {
  transform: scale(1.05);
  filter: brightness(0.4);
}
.portal-card .portal-overlay {
  transition: opacity 0.8s ease;
}
.portal-card:hover .portal-overlay {
  opacity: 1 !important;
}
.portal-card .portal-cta {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 0.15s,
              transform 0.6s ease 0.15s;
}
.portal-card:hover .portal-cta {
  opacity: 1;
  transform: translateY(0);
}

/* ── Process Steps ── */
.process-line {
  position: relative;
}
.process-line::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(184, 115, 51, 0.3) 20%,
    rgba(184, 115, 51, 0.3) 80%,
    transparent
  );
  transform: translateX(-50%);
}

/* ── Product Cards ── */
.product-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(184, 115, 51, 0.1);
  transition: border-color 0.6s ease,
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card:hover {
  border-color: rgba(184, 115, 51, 0.3);
  transform: translateY(-4px);
}
.product-card .product-image {
  transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card:hover .product-image {
  transform: scale(1.04);
}

/* ── CTA Buttons ── */
.cta-primary {
  position: relative;
  overflow: hidden;
  transition: color 0.4s ease,
              border-color 0.4s ease;
}
.cta-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(184, 115, 51, 0.15), transparent);
  transition: left 0.6s ease;
}
.cta-primary:hover::before {
  left: 100%;
}
.cta-primary:hover {
  border-color: rgba(184, 115, 51, 0.8);
  color: #d4944a;
}

/* ── Category Chips ── */
.chip {
  transition: background-color 0.4s ease,
              color 0.4s ease,
              border-color 0.4s ease;
}
.chip:hover {
  background-color: rgba(184, 115, 51, 0.15);
  border-color: rgba(184, 115, 51, 0.5);
  color: #d4944a;
}

/* ── Ritual Time Blocks ── */
.ritual-block {
  position: relative;
  transition: background-color 0.6s ease;
}
.ritual-block::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 1px;
  background: rgba(184, 115, 51, 0.4);
  transition: width 0.6s ease, left 0.6s ease;
}
.ritual-block:hover::after {
  width: 80%;
  left: 10%;
}
.ritual-block:hover {
  background-color: rgba(184, 115, 51, 0.05);
}

/* ── Navigation ── */
.nav-scrolled {
  background: rgba(10, 10, 8, 0.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(184, 115, 51, 0.1);
}

/* ── Separator Line ── */
.separator {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(184, 115, 51, 0.25),
    transparent
  );
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #0a0a08;
}
::-webkit-scrollbar-thumb {
  background: rgba(184, 115, 51, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(184, 115, 51, 0.5);
}

/* ── Selection ── */
::selection {
  background: rgba(184, 115, 51, 0.3);
  color: #f0e6d2;
}

/* ── Smooth Scroll ── */
html {
  scroll-behavior: smooth;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-slow, .reveal-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-enter {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .portal-card .portal-image,
  .product-card .product-image {
    transition: none;
  }
}
