/* ==========================================================================
   Bretda Luxury Animations — CSS
   Standalone stylesheet for premium interaction layer
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Design Tokens — Paleta unificada Bretda
   -------------------------------------------------------------------------- */
:root {
  --bg-primary: #2A2B26;
  --bg-elevated: #353630;
  --bg-input: #3E3F38;
  --border-subtle: #4A4B44;
  --text-primary: #FEF7F2;
  --text-secondary: #C8C9C0;
  --text-muted: #8B8C83;
  --accent-whatsapp: #25D366;
  --accent-whatsapp-hover: #1DA851;
}

/* --------------------------------------------------------------------------
   0.1 Hero H1 Scale — Sprint D8: clamp() AINDA MAIS AGRESSIVO em mobile
   -------------------------------------------------------------------------- */
.hero-xl {
  font-size: clamp(1.5rem, 6.2vw, 3.5rem); /* 24px @375px → 56px @desktop */
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
  overflow-wrap: break-word;
  word-break: normal;
}
.hero-md {
  font-size: clamp(1.375rem, 5.5vw, 2.75rem); /* 22px → 44px */
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero-sm {
  font-size: clamp(1.25rem, 4.8vw, 2.25rem);  /* 20px → 36px */
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* Heading utility — evita quebras de linha feias em titulos */
.heading-balance { text-wrap: balance; }

/* Sprint D7: safety-net — previne scroll horizontal causado por off-canvas menu (translateX 100%) */
html, body { overflow-x: hidden; }

/* --------------------------------------------------------------------------
   Sprint D8: mobile typography — agressivo, zerar letter-spacing, reduzir tudo
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* Hero classes — letter-spacing ZERO em mobile */
  .hero-xl,
  .hero-md,
  .hero-sm {
    letter-spacing: 0 !important; /* override inline style do hero — 0.08em estoura */
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  /* Section padding responsivo — mobile 48px vs desktop 120px (D8 reduziu de 64 para 48) */
  section[style*="padding: 120px 0"],
  section[style*="padding: 100px 0"],
  section[style*="padding: 80px 0 120px"],
  section[style*="padding: 80px 0 32px"] {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  /* Cinematic breaks (Opal/Espinela/Zurita) — reduzir altura em mobile */
  section[style*="height: 50vh"] {
    height: auto !important;
    min-height: 240px !important;
    padding: 48px 0 !important;
  }

  /* Hero h-screen — reduzir para 85vh em mobile (nao ocupar tela inteira) */
  section.h-screen#heroSection {
    height: 85vh !important;
    min-height: 560px !important;
  }

  /* Section inner padding horizontal reduzido mobile (16px px-4) */
  .max-w-\[1200px\].px-10,
  .max-w-\[800px\].px-10,
  .max-w-\[1000px\].px-10 {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Headings com letter-spacing inline 0.08em em mobile — zerar */
  h1[style*="letter-spacing: 0.08em"],
  h2[style*="letter-spacing: 0.08em"],
  h3[style*="letter-spacing: 0.08em"] {
    letter-spacing: 0 !important;
  }

  /* Tailwind tracking-[0.08em] utilities em mobile — reduzir */
  .tracking-\[0\.08em\],
  [class*="tracking-[0.0"] {
    letter-spacing: 0.01em !important;
  }

  /* .heading (classe custom) em mobile — force reduzir font-size + letter-spacing */
  .heading {
    letter-spacing: -0.01em !important;
    word-break: normal;
    overflow-wrap: break-word;
  }

  /* text-3xl no mobile era 1.875rem (30px) — muito grande, forcar 1.375rem (22px) */
  .text-3xl,
  .text-4xl,
  .text-5xl {
    font-size: clamp(1.25rem, 5.5vw, 1.625rem) !important;
    line-height: 1.2 !important;
  }

  /* Overlines (uppercase tracked text) mobile — reduzir tracking */
  .overline {
    letter-spacing: 0.1em !important;
    font-size: 0.6875rem !important; /* 11px */
  }

  /* Margins verticais reduzidas — mb-16 (4rem) vira mb-8 (2rem) */
  .mb-16 { margin-bottom: 2rem !important; }
  .mb-12 { margin-bottom: 1.5rem !important; }
  .mt-12 { margin-top: 1.5rem !important; }
  .gap-12 { gap: 1.5rem !important; }

  /* Imagens com aspect-ratio implicita sem height em mobile — prevenir overflow */
  picture, img {
    max-width: 100%;
    height: auto;
  }
}

/* --------------------------------------------------------------------------
   0.2 CTA WhatsApp padronizado
   -------------------------------------------------------------------------- */
.wa-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-whatsapp);
  color: #FFFFFF;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
  text-decoration: none;
}
.wa-cta:hover {
  background: var(--accent-whatsapp-hover);
}

/* --------------------------------------------------------------------------
   1. Magnetic Cursor
   -------------------------------------------------------------------------- */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(254, 247, 242, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor-dot.hover {
  width: 80px;
  height: 80px;
  border-color: rgba(254, 247, 242, 0.8);
}

.cursor-dot.click {
  width: 30px;
  height: 30px;
}

body.has-cursor {
  cursor: none;
}

body.has-cursor a,
body.has-cursor button,
body.has-cursor [role="button"],
body.has-cursor input[type="submit"] {
  cursor: none;
}

/* --------------------------------------------------------------------------
   2. Split-Text Reveal
   -------------------------------------------------------------------------- */
.split-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.split-word-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.split-reveal.visible .split-word-inner {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   3. Luxury Card Hover
   -------------------------------------------------------------------------- */
.luxury-card {
  overflow: hidden;
}

.luxury-card img {
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.luxury-card .card-overlay {
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: opacity;
}

.luxury-card .card-text {
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s,
              opacity 0.5s ease 0.1s;
  will-change: transform, opacity;
}

.luxury-card:hover img,
.luxury-card.is-hovered img {
  transform: scale(1.03);
}

.luxury-card:hover .card-overlay,
.luxury-card.is-hovered .card-overlay {
  opacity: 1;
}

.luxury-card:hover .card-text,
.luxury-card.is-hovered .card-text {
  transform: translateY(0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   4. Scroll-triggered fade-in (generic utility)
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   5. Reduced Motion — accessibility override
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cursor-dot {
    display: none !important;
  }

  body.has-cursor {
    cursor: auto;
  }

  body.has-cursor a,
  body.has-cursor button,
  body.has-cursor [role="button"],
  body.has-cursor input[type="submit"] {
    cursor: pointer;
  }

  .split-word-inner {
    transform: none !important;
    transition: none !important;
  }

  [data-parallax] {
    transform: none !important;
  }

  .luxury-card img {
    transition: none !important;
  }

  .luxury-card .card-overlay,
  .luxury-card .card-text {
    transition: none !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .reveal, .fade-in, .slide-up {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
