/* ==========================================================================
   KOPLES — Premium Coffee Spread — Design Tokens & Custom Styles
   ========================================================================== */

:root {
  --primary: #5c3d2e;
  --primary-rgb: 92, 61, 46;
  --dark: #2d2d2d;
  --cream: #fff8f2;
  --beige: #eadbc8;
  --gold: #c89b3c;
  --gold-rgb: 200, 155, 60;
  --gold-light: #e4c784;
  --primary-deep: #3a2419;

  --font-display: "Playfair Display", serif;
  --font-sub: "Cormorant Garamond", serif;
  --font-body: "Poppins", sans-serif;

  --ease-lux: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 10px;
}
::-webkit-scrollbar-track {
  background: var(--cream);
}

html {
  background: var(--cream);
}

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--dark);
  overflow-x: hidden;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

.font-display {
  font-family: var(--font-display);
}
.font-sub {
  font-family: var(--font-sub);
}
.font-body {
  font-family: var(--font-body);
}

.text-gold {
  color: var(--gold);
}
.text-primary {
  color: var(--primary);
}
.bg-cream {
  background-color: var(--cream);
}
.bg-beige {
  background-color: var(--beige);
}
.bg-primary {
  background-color: var(--primary);
}
.bg-dark {
  background-color: var(--dark);
}

/* ==========================================================================
   Loading Screen
   ========================================================================== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--primary-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 1s var(--ease-lux),
    visibility 1s var(--ease-lux);
}
#loader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  text-align: center;
}

.loader-bean {
  width: 46px;
  height: 64px;
  margin: 0 auto 28px;
  position: relative;
  animation: beanSpin 1.6s var(--ease-lux) infinite;
}
.loader-bean svg {
  width: 100%;
  height: 100%;
}

@keyframes beanSpin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.08);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.loader-word {
  font-family: var(--font-display);
  letter-spacing: 0.35em;
  font-size: 1.6rem;
  color: var(--cream);
  opacity: 0;
  animation: loaderFade 2.2s var(--ease-lux) forwards;
}
@keyframes loaderFade {
  0% {
    opacity: 0;
    letter-spacing: 0.6em;
  }
  60% {
    opacity: 1;
    letter-spacing: 0.35em;
  }
  100% {
    opacity: 1;
  }
}

.loader-bar {
  width: 160px;
  height: 1px;
  margin: 22px auto 0;
  background: rgba(var(--gold-rgb), 0.25);
  position: relative;
  overflow: hidden;
}
.loader-bar::after {
  content: "";
  position: absolute;
  left: -40%;
  top: 0;
  height: 100%;
  width: 40%;
  background: var(--gold);
  animation: barSlide 1.4s ease-in-out infinite;
}
@keyframes barSlide {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

/* ==========================================================================
   Scroll progress
   ========================================================================== */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--primary));
  z-index: 9000;
  transition: width 0.05s linear;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  transition:
    background-color 0.5s var(--ease-lux),
    backdrop-filter 0.5s var(--ease-lux),
    box-shadow 0.5s var(--ease-lux),
    padding 0.4s var(--ease-lux);
  background: transparent;
}
#navbar.nav-scrolled {
  background: rgba(255, 248, 242, 0.75);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 rgba(var(--primary-rgb), 0.08);
}

.nav-link {
  position: relative;
  padding-bottom: 4px;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.4s var(--ease-lux);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.lang-switch button {
  transition:
    color 0.3s ease,
    opacity 0.3s ease;
}
.lang-switch button.active {
  color: var(--gold);
  font-weight: 600;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.5s var(--ease-lux),
    box-shadow 0.5s var(--ease-lux),
    color 0.4s ease,
    border-color 0.4s ease;
}
.btn:hover {
  transform: translateY(-2px);
}

.btn-gold {
  background: var(--gold);
  color: var(--cream);
}
.btn-gold:hover {
  box-shadow: 0 12px 30px -8px rgba(var(--gold-rgb), 0.55);
}

.btn-outline {
  border: 1px solid rgba(var(--primary-rgb), 0.35);
  color: var(--primary);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.04);
}

.btn-ghost-cream {
  border: 1px solid rgba(255, 248, 242, 0.4);
  color: var(--cream);
}
.btn-ghost-cream:hover {
  border-color: var(--cream);
  background: rgba(255, 248, 242, 0.08);
}

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnim 0.7s ease-out;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  z-index: -1;
}
@keyframes rippleAnim {
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
#hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(
      ellipse at 30% 20%,
      rgba(var(--gold-rgb), 0.14),
      transparent 55%
    ),
    radial-gradient(
      ellipse at 75% 80%,
      rgba(var(--primary-rgb), 0.18),
      transparent 60%
    ),
    linear-gradient(180deg, #fdf6ee 0%, var(--cream) 45%, var(--beige) 100%);
}

.hero-gradient-anim {
  position: absolute;
  inset: -10%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    rgba(var(--gold-rgb), 0.08),
    transparent 30%,
    rgba(var(--primary-rgb), 0.08),
    transparent 70%,
    rgba(var(--gold-rgb), 0.08)
  );
  animation: gradSpin 26s linear infinite;
  filter: blur(60px);
  z-index: 0;
}
@keyframes gradSpin {
  to {
    transform: rotate(360deg);
  }
}

.hero-eyebrow {
  font-family: var(--font-sub);
  font-style: italic;
  letter-spacing: 0.25em;
}

.hero-title {
  font-family: var(--font-display);
  line-height: 0.95;
}

.steam {
  position: absolute;
  bottom: 100%;
  width: 10px;
  border-radius: 50%;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0)
  );
  filter: blur(3px);
  opacity: 0;
  transform-origin: bottom center;
}
.steam.s1 {
  left: 46%;
  animation: steamRise 4.5s ease-in infinite;
  height: 90px;
}
.steam.s2 {
  left: 50%;
  animation: steamRise 4.5s ease-in 1.4s infinite;
  height: 110px;
}
.steam.s3 {
  left: 54%;
  animation: steamRise 4.5s ease-in 2.8s infinite;
  height: 80px;
}

@keyframes steamRise {
  0% {
    opacity: 0;
    transform: translateY(0) scaleX(1) rotate(0deg);
  }
  15% {
    opacity: 0.55;
  }
  50% {
    transform: translateY(-60px) scaleX(1.6) rotate(6deg);
  }
  85% {
    opacity: 0.15;
  }
  100% {
    opacity: 0;
    transform: translateY(-140px) scaleX(2.2) rotate(-4deg);
  }
}

.bean-float {
  position: absolute;
  opacity: 0.5;
  animation: beanFloat linear infinite;
  will-change: transform;
}
@keyframes beanFloat {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-26px) rotate(180deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
  }
}

.jar-hero {
  transition: transform 0.2s ease-out;
  filter: drop-shadow(0 40px 60px rgba(var(--primary-rgb), 0.35));
}

.scroll-cue {
  writing-mode: vertical-rl;
  letter-spacing: 0.3em;
}
.scroll-cue-line {
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: cueMove 2.2s ease-in-out infinite;
}
@keyframes cueMove {
  0%,
  100% {
    transform: scaleY(0.4);
    opacity: 0.4;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* ==========================================================================
   Reveal utility (JS toggles .in-view)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 1s var(--ease-lux),
    transform 1.1s var(--ease-lux);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 1s var(--ease-lux),
    transform 1.1s var(--ease-lux);
}
.reveal-scale.in-view {
  opacity: 1;
  transform: scale(1);
}

.reveal-line {
  overflow: hidden;
}
.reveal-line span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease-lux);
}
.reveal-line.in-view span {
  transform: translateY(0);
}

/* stagger children helper via inline style --d */
.reveal[style*="--d"] {
  transition-delay: var(--d);
}

/* ==========================================================================
   Brand Story
   ========================================================================== */
#story {
  position: relative;
}
.story-quote {
  font-family: var(--font-sub);
  font-style: italic;
}
.story-swirl-wrap {
  position: relative;
}
.jar-swirl-fill {
  transform-origin: bottom;
  transition: transform 0.1s linear;
}

/* ==========================================================================
   Why KOPLES — cards
   ========================================================================== */
.why-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(var(--primary-rgb), 0.08);
  backdrop-filter: blur(6px);
  transition:
    transform 0.55s var(--ease-lux),
    box-shadow 0.55s var(--ease-lux),
    border-color 0.4s ease;
}
.why-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 60px -20px rgba(var(--primary-rgb), 0.25);
  border-color: rgba(var(--gold-rgb), 0.4);
}
.why-icon {
  transition: transform 0.6s var(--ease-lux);
}
.why-card:hover .why-icon {
  transform: rotate(-8deg) scale(1.08);
}

/* ==========================================================================
   Product Showcase
   ========================================================================== */
.product-card {
  perspective: 1200px;
}
.product-card-inner {
  transition: transform 0.7s var(--ease-lux);
  transform-style: preserve-3d;
}
.product-card:hover .product-card-inner {
  transform: rotateY(4deg) rotateX(2deg) translateY(-8px);
}
.product-float {
  animation: productFloat 5s ease-in-out infinite;
}
@keyframes productFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}
.product-reflection {
  transform: scaleY(-1);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.28), transparent 70%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.28),
    transparent 70%
  );
  opacity: 0.5;
}

/* ==========================================================================
   Ingredients timeline
   ========================================================================== */
.ing-line {
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(var(--primary-rgb), 0.18);
}
.ing-line-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  background: var(--gold);
  height: 0%;
  transition: height 0.2s linear;
}
.ing-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--gold);
  transition:
    background 0.4s ease,
    transform 0.4s ease;
}
.ing-step.in-view .ing-dot {
  background: var(--gold);
  transform: scale(1.15);
}

/* ==========================================================================
   How to enjoy — steps
   ========================================================================== */
.step-num {
  font-family: var(--font-display);
  color: rgba(var(--primary-rgb), 0.15);
  line-height: 0.8;
}
.step-card {
  transition: transform 0.5s var(--ease-lux);
}
.step-card:hover {
  transform: translateY(-6px);
}
.step-card:hover .step-num {
  color: rgba(var(--gold-rgb), 0.55);
}

/* ==========================================================================
   Gallery
   ========================================================================== */
.gallery-item {
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
}
.gallery-item img {
  transition:
    transform 1.1s var(--ease-lux),
    filter 0.6s ease;
  will-change: transform;
}
.gallery-item:hover img {
  transform: scale(1.1);
}
.gallery-caption {
  transition:
    opacity 0.5s ease,
    transform 0.5s var(--ease-lux);
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(45, 45, 45, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
}
#lightbox.open {
  opacity: 1;
  visibility: visible;
}
#lightbox img {
  max-height: 82vh;
  max-width: 88vw;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Testimonials — glass cards
   ========================================================================== */
.glass-card {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 20px 50px -20px rgba(var(--primary-rgb), 0.2);
}
.stars {
  color: var(--gold);
  letter-spacing: 2px;
}

.swiper-pagination-bullet {
  background: var(--primary) !important;
  opacity: 0.3 !important;
}
.swiper-pagination-bullet-active {
  opacity: 1 !important;
  background: var(--gold) !important;
}

/* ==========================================================================
   FAQ Accordion
   ========================================================================== */
.faq-item {
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
}
.faq-question {
  cursor: pointer;
}
.faq-icon {
  transition: transform 0.45s var(--ease-lux);
}
.faq-item.open .faq-icon {
  transform: rotate(135deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.55s var(--ease-lux),
    padding 0.4s ease;
}
.faq-item.open .faq-answer {
  padding-bottom: 1.75rem;
}

/* ==========================================================================
   CTA
   ========================================================================== */
#cta {
  position: relative;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(var(--gold-rgb), 0.25),
      transparent 60%
    ),
    var(--primary-deep);
  overflow: hidden;
}
.cta-beam {
  position: absolute;
  top: -50%;
  left: 50%;
  width: 2px;
  height: 200%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(var(--gold-rgb), 0.4),
    transparent
  );
  transform: translateX(-50%) rotate(12deg);
  animation: beamSweep 8s ease-in-out infinite;
}
@keyframes beamSweep {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.6;
  }
}

/* ==========================================================================
   Floating buttons
   ========================================================================== */
#whatsapp-btn,
#back-to-top {
  position: fixed;
  right: 22px;
  z-index: 400;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.4s var(--ease-lux),
    opacity 0.4s ease,
    box-shadow 0.4s ease;
}
#whatsapp-btn {
  bottom: 22px;
  background: #25d366;
  color: #fff;
}
#whatsapp-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 34px -6px rgba(37, 211, 102, 0.5);
}

#back-to-top {
  bottom: 86px;
  background: var(--primary);
  color: var(--cream);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}
#back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#back-to-top:hover {
  background: var(--gold);
}

/* ==========================================================================
   Language fade transition
   ========================================================================== */
[data-i18n],
[data-i18n-html] {
  transition: opacity 0.28s ease;
}
.lang-fading [data-i18n],
.lang-fading [data-i18n-html] {
  opacity: 0;
}

/* ==========================================================================
   Misc
   ========================================================================== */
.divider-gold {
  width: 64px;
  height: 2px;
  background: var(--gold);
}
.section-eyebrow {
  font-family: var(--font-sub);
  font-style: italic;
  letter-spacing: 0.3em;
}
.counter {
  font-family: var(--font-display);
}

::selection {
  background: var(--gold);
  color: var(--cream);
}

.no-scroll {
  overflow: hidden;
  height: 100%;
}

@media (max-width: 767px) {
  .hero-title {
    line-height: 1;
  }
}

/* =====================================================
     SIGNATURE ELEMENT — THE COFFEE RING
     (concentric rings referencing the cross-section of a
     "slice" of coffee — reused as hero mockup, dividers,
     loaders and the experience-panel motif)
  ===================================================== */
.ring-disc {
  filter: drop-shadow(0 30px 60px rgba(42, 24, 16, 0.35));
}
.ring-float {
  animation: ringFloat 6s ease-in-out infinite;
}
@keyframes ringFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-22px) rotate(6deg);
  }
}
.ring-spin {
  animation: ringSpin 40s linear infinite;
  transform-origin: center;
}
@keyframes ringSpin {
  to {
    transform: rotate(360deg);
  }
}

/* floating particles */
.particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--coffee-light), transparent 70%);
  opacity: 0.5;
}

/* =====================================================
   EXPERIENCE — HORIZONTAL SCROLL
===================================================== */
#experience-track {
  display: flex;
  height: 100%;
}

.exp-panel {
  flex: 0 0 100vw;
  height: 100vh;
}

/* =====================================================
   GRADIENT BACKDROPS
===================================================== */
.grad-dark {
  background:
    radial-gradient(
      70% 60% at 50% 0%,
      rgba(198, 161, 91, 0.15),
      transparent 60%
    ),
    linear-gradient(180deg, var(--coffee-dark) 0%, #1c110b 100%);
}

/* =====================================================
   SIGNATURE ELEMENT — THE COFFEE RING
===================================================== */
.ring-spin {
  animation: ringSpin 40s linear infinite;
  transform-origin: center;
}

@keyframes ringSpin {
  to {
    transform: rotate(360deg);
  }
}

/* =====================================================
   UTILITY
===================================================== */
.eyebrow {
  letter-spacing: 0.28em;
  font-family: "Inter", sans-serif;
}

/* =====================================================
   ROOT TOKENS
===================================================== */
:root {
  --cream: #f6f0e3;
  --beige: #eae0c8;
  --coffee: #6f4527;
  --coffee-light: #9c6b3f;
  --coffee-dark: #2a1810;
  --gold: #c6a15b;
  --offwhite: #fffdf8;
}
