/* ============================================================
   BASE — fundo cinematográfico, tipografia, primitivas
   Aderente ao design-system.html · extensões editoriais
   ============================================================ */

/* ---------- BODY · fundo vinho + vinheta + grão ---------- */
body {
  font-family: var(--font-sans);
  background-color: var(--color-vinho);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(201, 161, 91, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 40%,
      var(--color-vinho-center) 0%,
      var(--color-vinho) 45%,
      var(--color-vinho-edge) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.78  0 0 0 0 0.63  0 0 0 0 0.36  0 0 0 0.075 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: auto, 100% 100%, 320px 320px;
  background-attachment: fixed, fixed, fixed;
  color: var(--on-vinho-1);
}

/* ---------- AURORA · halos vivos e dourados em movimento lento ----------
   Substitui os antigos .bg-cinematic / .bg-ember por dois orbes que
   respiram em órbita. Loop suave de 18s, opacidade discreta para não
   competir com o conteúdo. Pausado em prefers-reduced-motion (reset.css). */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  overflow: hidden;
}
.bg-aurora::before,
.bg-aurora::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  will-change: transform, opacity;
}
.bg-aurora::before {
  top: -10%;
  left: 20%;
  width: 38rem;
  height: 38rem;
  background: radial-gradient(circle at center, var(--aurora-1) 0%, transparent 65%);
  animation: aurora-drift var(--d-aurora) ease-in-out infinite;
}
.bg-aurora::after {
  bottom: -15%;
  right: 10%;
  width: 30rem;
  height: 30rem;
  background: radial-gradient(circle at center, var(--aurora-2) 0%, transparent 70%);
  animation: aurora-drift var(--d-aurora) ease-in-out infinite reverse;
  animation-delay: -6s;
}

/* Linhas verticais editoriais sutis · texturizam sem ruído */
.bg-rules {
  position: fixed;
  inset: 0;
  z-index: -9;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, transparent calc(50% - 0.5px), var(--gold-5) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  opacity: 0.35;
  mix-blend-mode: screen;
  mask-image: linear-gradient(180deg, transparent 0%, black 18%, black 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 18%, black 82%, transparent 100%);
}

/* ---------- TIPOGRAFIA ---------- */
.font-serif { font-family: var(--font-serif); }
.font-sans  { font-family: var(--font-sans); }
.italic     { font-style: italic; }
.uppercase  { text-transform: uppercase; }

/*
 * Convenção do design system:
 * As classes .h-display / .h1 / .h2 / .h3 / .h4 controlam APENAS o
 * tamanho visual. O elemento HTML deve refletir a hierarquia semântica
 * correta — uma única <h1> por página, depois <h2> nas seções, <h3> nas
 * sub-seções e assim por diante.
 */
.h-display {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 8vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-feature-settings: "liga", "dlig", "kern";
}
.h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.25rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.75rem, 4vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.25;
}
.h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
}

.body-l   { font-family: var(--font-sans); font-weight: 300; font-size: 1.125rem; line-height: 1.625; }
.body-m   { font-family: var(--font-sans); font-weight: 400; font-size: 1rem;     line-height: 1.5; }
.body-s   { font-family: var(--font-sans); font-weight: 400; font-size: 0.875rem; line-height: 1.4; }
.caption  { font-family: var(--font-sans); font-weight: 500; font-size: 0.75rem;  line-height: 1.2; letter-spacing: 0.05em; }
.eyebrow {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.625rem;
  line-height: 1;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-dourado);
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.05em;
}

/* Utilitários pontuais */
.u-mb-1     { margin-bottom: 1rem; }
.u-mb-2     { margin-bottom: 1.5rem; }
.h-on-vinho { color: var(--color-offwhite); }

/* ---------- TEXT GRADIENT ---------- */
.text-gradient {
  background: linear-gradient(to bottom right, var(--color-offwhite), var(--color-dourado));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- WORD ROTATOR · troca de palavra com mask-reveal ----------
   Usada no italic-soft do hero: a JS empilha .word-rotator__item e
   alterna .is-active em loop. Suave, sem layout-shift. */
.word-rotator {
  position: relative;
  display: inline-grid;
  vertical-align: baseline;
  overflow: hidden;
  height: 1em;
  line-height: 1;
}
.word-rotator__item {
  grid-area: 1 / 1;
  display: inline-block;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(60%);
  transition:
    opacity var(--d-slow) var(--ease-editorial),
    transform var(--d-slow) var(--ease-editorial),
    filter var(--d-slow) var(--ease-editorial);
  filter: blur(8px);
  color: inherit;
  font-style: inherit;
}
.word-rotator__item.is-active {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.word-rotator__item.is-leaving {
  opacity: 0;
  transform: translateY(-60%);
  filter: blur(8px);
}

/* ---------- LAYOUT PRIMITIVES ---------- */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }

.section { padding-top: 5rem; padding-bottom: 5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* ---------- GLASS PANEL ---------- */
.glass-panel {
  background: linear-gradient(180deg, rgba(201, 161, 91, 0.04) 0%, rgba(245, 239, 230, 0.015) 100%);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  border: 1px solid var(--gold-10);
  box-shadow: var(--shadow-soft);
}

/* ---------- DIVIDERS ---------- */
.divider-gold {
  height: 1px;
  background: var(--gold-30);
  width: 100%;
}
.divider-gold--gradient {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-50), transparent);
  width: 100%;
}
.section-divider {
  position: relative;
  height: 1px;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  background: linear-gradient(to right, transparent, var(--gold-30), transparent);
}
.section-divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-dourado);
  box-shadow: 0 0 12px var(--gold-50);
  opacity: 0.8;
}

/* ---------- REVEAL ON SCROLL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  transition: opacity var(--d-reveal) var(--ease-reveal),
              transform var(--d-reveal) var(--ease-reveal),
              filter var(--d-reveal) var(--ease-reveal);
}
.reveal.is-active {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }
.delay-600 { transition-delay: 600ms; }

/* ---------- KINETIC LINE REVEAL · h-display por linhas ----------
   JS quebra texto em .kinetic-line (uma por linha visual);
   cada uma sobe sob mask, com stagger. */
.kinetic-headline { display: block; }
.kinetic-line {
  display: block;
  overflow: hidden;
  line-height: 1;
  padding-bottom: 0.12em;
}
.kinetic-line__inner {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition:
    transform var(--d-letter) var(--ease-editorial),
    opacity var(--d-letter) var(--ease-editorial);
}
.kinetic-headline.is-active .kinetic-line__inner {
  transform: translateY(0);
  opacity: 1;
}
.kinetic-headline.is-active .kinetic-line:nth-child(2) .kinetic-line__inner { transition-delay: 120ms; }
.kinetic-headline.is-active .kinetic-line:nth-child(3) .kinetic-line__inner { transition-delay: 240ms; }
.kinetic-headline.is-active .kinetic-line:nth-child(4) .kinetic-line__inner { transition-delay: 360ms; }

/* ---------- SCROLL CUE · indicador kinético do hero ---------- */
.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--on-vinho-3);
}
.scroll-cue__rail {
  position: relative;
  width: 1px;
  height: 3rem;
  background: linear-gradient(to bottom, transparent, var(--gold-30), transparent);
  overflow: hidden;
}
.scroll-cue__rail::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 0.75rem;
  margin-left: -2px;
  background: var(--color-dourado);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--gold-50);
  animation: scroll-cue-fall 2.2s var(--ease-editorial) infinite;
}

/* ---------- KEYFRAMES ---------- */
@keyframes spin       { to { transform: rotate(360deg); } }
@keyframes ping       { 75%, 100% { transform: scale(2); opacity: 0; } }
@keyframes pulse-slow { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes float      { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes aurora-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.95; }
  50%      { transform: translate3d(4%, 3%, 0) scale(1.08); opacity: 1; }
}
@keyframes scroll-cue-fall {
  0%       { transform: translateY(-100%); opacity: 0; }
  40%      { opacity: 1; }
  100%     { transform: translateY(300%); opacity: 0; }
}
@keyframes float-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 161, 91, 0.55), var(--shadow-strong), var(--shadow-gold); }
  70%      { box-shadow: 0 0 0 18px rgba(201, 161, 91, 0), var(--shadow-strong), var(--shadow-gold); }
}
