/* ============================================
   BASE.CSS - Base Element Styles
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600&family=Manrope:wght@400;500;600;700&family=Ovo&display=swap');

/* Body */
body {
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  line-height: var(--body-lh);
  letter-spacing: var(--body-ls);
  color: var(--color-dark);
  background-color: var(--color-white);
  overflow-x: hidden;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-cream);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

/* Headings */
h1, h2, h3 { font-family: var(--font-heading); }
h4, h5, h6 { font-family: var(--font-body); }

h1 { font-size: var(--h1-size); font-weight: var(--h1-weight); line-height: var(--h1-lh); letter-spacing: var(--h1-ls); }
h2 { font-size: var(--h2-size); font-weight: var(--h2-weight); line-height: var(--h2-lh); letter-spacing: var(--h2-ls); }
h3 { font-size: var(--h3-size); font-weight: var(--h3-weight); line-height: var(--h3-lh); letter-spacing: var(--h3-ls); }
h4 { font-size: var(--h4-size); font-weight: var(--h4-weight); line-height: var(--h4-lh); }
h5 { font-size: var(--h5-size); font-weight: var(--h5-weight); line-height: var(--h5-lh); }
h6 { font-size: var(--h6-size); font-weight: var(--h6-weight); line-height: var(--h6-lh); }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-primary);
  transition: color var(--ease-fast);
}
a:hover { color: var(--color-dark); }

::selection {
  background-color: var(--color-primary-light);
  color: var(--color-dark);
}

/* Utility */
.text-large {
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-lh);
}

.label {
  font-family: var(--font-body);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-ls);
  text-transform: uppercase;
  line-height: 1.6em;
}

/* ========================================
   PRELOADER
   ======================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader--done {
  opacity: 0;
  visibility: hidden;
}

/* Spinning logo animation */
.preloader__spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.preloader__logo {
  width: 140px;
  height: auto;
  animation: preloaderPulse 1.2s ease-in-out infinite;
}

.preloader__bar {
  width: 120px;
  height: 3px;
  background: var(--color-cream);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.preloader__bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: var(--gradient-brand);
  border-radius: 3px;
  animation: preloaderSlide 1s ease-in-out infinite;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.95); }
}

@keyframes preloaderSlide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */
.btt {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: var(--color-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(91, 45, 142, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btt svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-white);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btt--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.btt:hover {
  background: var(--color-primary-dark);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(91, 45, 142, 0.45);
}

.btt:active {
  transform: translateY(0) scale(0.92);
}

/* ========================================
   MOUSE TRAIL EFFECT
   Elegant dot trail that follows cursor
   ======================================== */
.mouse-trail {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99990;
  pointer-events: none;
  mix-blend-mode: difference;
}

.mouse-trail__dot {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  pointer-events: none;
  will-change: transform;
  transition: width 0.3s ease, height 0.3s ease, background 0.3s ease;
}

/* First dot (lead) - slightly larger */
.mouse-trail__dot:first-child {
  width: 10px;
  height: 10px;
  background: var(--color-accent);
}

/* Active state on interactive elements */
.mouse-trail__dot--active {
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  border-radius: 50%;
}

/* Hide on mobile */
@media (max-width: 1024px) {
  .mouse-trail {
    display: none;
  }
}

/* Hide on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .mouse-trail {
    display: none;
  }
  .preloader {
    display: none;
  }
}
