/* ============================================
   HERO — Foto editorial · Capas vivas
   Composición: pandebono + café humeante (d.png)
   Capas: foto → light shaft → dust → grain → overlay
          → steam → panel cristal → contenido
   ============================================ */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(7rem, 12vw, 10rem);
  padding-bottom: clamp(4rem, 7vw, 6rem);
  padding-inline: var(--space-gutter);
  overflow: hidden;
  isolation: isolate;
  background-color: #0A0F18;
  color: var(--color-cream-off);
}

/* ────────── STAGE — Contenedor de la foto y FX visuales ────────── */
.hero__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* Clip-path reveal cinematográfico tipo apertura de lente */
  clip-path: inset(0 0 round 0);
  animation: hero-aperture 1600ms var(--ease-out) 100ms backwards;
}

@keyframes hero-aperture {
  0%   { clip-path: inset(48% 48% round 50%); }
  60%  { clip-path: inset(0 0 round 24px); }
  100% { clip-path: inset(0 0 round 0); }
}

/* ────────── FOTO — Ken Burns (sin parallax, imagen quieta) ────────── */
.hero__photo {
  position: absolute;
  inset: -4%;
  display: block;
  width: 108%;
  height: 108%;
  z-index: 0;
}
.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% center;
  filter: contrast(1.04) saturate(0.92) brightness(0.88);
  animation: hero-kenburns 40s var(--ease-in-out) infinite alternate;
}

@keyframes hero-kenburns {
  0%   { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1.5%, -1%); }
}


/* ────────── DUST — partículas de polvo flotando ────────── */
.hero__dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}
.hero__dust-mote {
  position: absolute;
  top: var(--dust-y);
  left: var(--dust-x);
  width:  var(--dust-size);
  height: var(--dust-size);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(255, 240, 210, 0.9),
    rgba(255, 220, 160, 0.3) 60%,
    transparent 80%);
  filter: blur(0.5px);
  opacity: 0;
  animation: hero-dust var(--dust-dur) ease-in-out var(--dust-delay) infinite;
}
@keyframes hero-dust {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  20%      { opacity: 0.9; transform: translate(calc(var(--dust-drift) * 0.3), -10px) scale(1); }
  50%      { opacity: 0.6; transform: translate(calc(var(--dust-drift) * 0.7), -30px) scale(1.1); }
  80%      { opacity: 0.3; transform: translate(var(--dust-drift), -55px) scale(0.9); }
}

/* ────────── GRAIN — textura de película ────────── */
.hero__grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.35 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: hero-grain 8s steps(8) infinite;
}
@keyframes hero-grain {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(-2%, 1%); }
  50%      { transform: translate(1%, -2%); }
  75%      { transform: translate(-1%, -1%); }
}

/* ────────── OVERLAY — contraste para el texto ────────── */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(95deg,
      rgba(7, 14, 24, 0.72) 0%,
      rgba(7, 14, 24, 0.55) 28%,
      rgba(7, 14, 24, 0.12) 52%,
      transparent 70%),
    radial-gradient(ellipse 120% 90% at 65% 50%,
      transparent 35%,
      rgba(7, 14, 24, 0.35) 100%),
    linear-gradient(180deg,
      transparent 50%,
      rgba(7, 14, 24, 0.40) 100%);
}


/* ────────── STEAM — vapor sobre la taza ────────── */
.hero__steam {
  position: absolute;
  /* Coordenadas alineadas con la taza de d.png (~60% horizontal, ~30% top) */
  left: 60%;
  top: 30%;
  width: 200px;
  height: 350px;
  pointer-events: none;
  z-index: 5;
  transform: translateX(-50%);
  mix-blend-mode: screen;
}
.hero__steam-puff {
  position: absolute;
  bottom: 0;
  left: 50%;
  width:  var(--sw, 100px);
  height: var(--sh, 180px);
  margin-left: calc(var(--sw, 100px) / -2);
  border-radius: 48% 52% 50% 50% / 60% 40% 60% 40%;
  background: radial-gradient(ellipse 60% 80% at 50% 100%,
    rgba(255, 250, 238, 0.42) 0%,
    rgba(240, 225, 195, 0.18) 50%,
    transparent 78%);
  filter: blur(18px);
  opacity: 0;
  animation: hero-steam var(--sdur, 8s) ease-out var(--sd, 0s) infinite;
}
@keyframes hero-steam {
  0%   { opacity: 0;    transform: translate(var(--sx, 0%), 10%) scale(0.5);  }
  20%  { opacity: 0.85; transform: translate(calc(var(--sx, 0%) * 1.1), -10%) scale(0.75); }
  55%  { opacity: 0.5;  transform: translate(calc(var(--sx, 0%) * 1.6 + var(--sdr, 0px) * 0.4), -55%) scale(1.15); }
  100% { opacity: 0;    transform: translate(calc(var(--sx, 0%) * 2 + var(--sdr, 0px)), -110%) scale(1.8); }
}

/* ────────── INNER — Layout del contenido ────────── */
.hero__inner {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: var(--space-2xl);
}

/* ────────── PANEL — Cristal esmerilado asimétrico ────────── */
/* @property registra --hero-panel-angle como <angle> para que sea animable.
   Sin este registro la variable salta en lugar de interpolarse. Fallback: en
   navegadores sin @property (Firefox <128) el conic gradient queda estático,
   no rotando, lo cual sigue luciendo bien como borde iridiscente. */
@property --hero-panel-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.hero__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0; /* ritmo vertical via margin-top específicos por elemento */
  padding: clamp(1.65rem, 2.2vw + 0.4rem, 2.5rem); /* 26-40px — respiración premium */
  overflow: hidden;
  background: linear-gradient(135deg,
    rgba(13, 23, 38, 0.62) 0%,
    rgba(7, 14, 24, 0.52) 100%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: none; /* reemplazado por el borde conic holográfico via ::before */
  border-radius: 6px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateX(-30px);
  animation: hero-panel-in 1100ms var(--ease-out) 700ms forwards;
}

/* ────────── BORDE CONIC HOLOGRÁFICO ──────────
   Técnica: pseudo-elemento con conic-gradient como background,
   recortado a un anillo de 1.5px via mask + mask-composite: exclude.
   El --hero-panel-angle rota 360° en 8s creando el efecto iridiscente. */
.hero__panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  background: conic-gradient(
    from var(--hero-panel-angle),
    #B8842F   0deg,    /* coffee — warm gold */
    #E5B768  60deg,    /* coffee-light — bright gold */
    #FAF6EE 130deg,    /* cream-light — highlight */
    #4A7A99 205deg,    /* primary-500 — cool blue */
    #B8842F 275deg,    /* coffee */
    #E5B768 335deg,    /* coffee-light */
    #B8842F 360deg     /* seamless loop */
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: hero-panel-conic 8s linear infinite;
}

@keyframes hero-panel-in {
  to { opacity: 1; transform: translateX(0); }
}
@keyframes hero-panel-conic {
  to { --hero-panel-angle: 360deg; }
}

/* ────────── CHIP de horario en vivo ────────── */
.hero__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.5rem 0.85rem;
  width: fit-content;
  background-color: rgba(8, 14, 22, 0.70);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(229, 183, 104, 0.32);
  border-radius: var(--radius-pill);
  font-size: var(--fs-body-xs);
  font-weight: var(--fw-medium);
  color: var(--color-cream-off);
  opacity: 0;
  transform: translateY(8px);
  animation: hero-fade-up var(--dur-slow) var(--ease-out) 1000ms forwards;
}
.hero__chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 0 0 rgba(90, 138, 59, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(90, 138, 59, 0.6); }
  50%      { box-shadow: 0 0 0 8px rgba(90, 138, 59, 0); }
}
.hero__chip.is-closed .hero__chip-dot {
  background-color: var(--color-error);
  animation: none;
}

/* ────────── EYEBROW ────────── */
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: 0.95rem; /* respiro tras el chip — agrupa con chip como metadata */
  font-family: var(--font-body);
  font-size: 0.78rem; /* 12.5px — visible sin gritar, uppercase + tracking lo amplifican */
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.16em; /* tracking generoso para uppercase corto */
  color: var(--color-coffee-light);
  opacity: 0;
  transform: translateY(8px);
  animation: hero-fade-up var(--dur-slow) var(--ease-out) 1100ms forwards;
}
.hero__eyebrow-mark {
  font-size: 0.7em;
  color: var(--color-coffee);
}
@keyframes hero-fade-up {
  to { opacity: 1; transform: translateY(0); }
}

/* ────────── H1 — stagger por palabra ────────── */
.hero__title {
  font-family: var(--font-display);
  /* Escala más segura: 38-64px (antes 35-54px). Más presencia editorial. */
  font-size: clamp(2.4rem, 3.2vw + 0.4rem, 4rem);
  font-weight: 300;
  line-height: 1.02; /* compacto para dos líneas grandes */
  letter-spacing: -0.038em;
  color: var(--color-cream-off);
  font-variation-settings: 'opsz' 144;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.42);
  margin-top: 1.5rem; /* salto fuerte: eyebrow es metadata, el H1 es contenido */
  margin-bottom: 0.15rem;
}
.hero__title-line {
  display: block;
  overflow: hidden;
}
.hero__title-line--italic .hero__word {
  font-style: italic;
  font-variation-settings: 'opsz' 144;
  color: var(--color-coffee-light);
}
.hero__word {
  display: inline-block;
  transform: translateY(110%);
  animation: hero-word-up 1100ms var(--ease-out) forwards;
  padding-right: 0.25em;
}
.hero__title-line:nth-child(1) .hero__word:nth-child(1) { animation-delay: 1200ms; }
.hero__title-line:nth-child(1) .hero__word:nth-child(2) { animation-delay: 1300ms; }
.hero__title-line:nth-child(1) .hero__word:nth-child(3) { animation-delay: 1400ms; }
.hero__title-line:nth-child(2) .hero__word:nth-child(1) { animation-delay: 1550ms; }
.hero__title-line:nth-child(2) .hero__word:nth-child(2) { animation-delay: 1680ms; }
.hero__title-line:nth-child(2) .hero__word:nth-child(3) { animation-delay: 1820ms; }
@keyframes hero-word-up { to { transform: translateY(0); } }

/* ────────── BADGE de frescura ────────── */
.hero__freshness {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.5rem 1.1rem 0.5rem 0.85rem;
  background: rgba(184, 132, 47, 0.12);
  border: 1px solid rgba(229, 183, 104, 0.35);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--fs-body-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  color: var(--color-coffee-light);
  width: fit-content;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  animation: hero-fade-up var(--dur-slow) var(--ease-out) 1850ms forwards;
}
.hero__freshness-icon {
  flex-shrink: 0;
  animation: steam-float 3.5s ease-in-out infinite;
}
@keyframes steam-float {
  0%, 100% { opacity: 0.65; transform: translateY(0); }
  50%      { opacity: 1;    transform: translateY(-2px); }
}
.hero__freshness-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(229, 183, 104, 0.18) 50%,
    transparent 100%);
  transform: translateX(-150%);
  animation: freshness-sweep 6s ease-in-out 3s infinite;
}
@keyframes freshness-sweep {
  0%   { transform: translateX(-150%); }
  35%  { transform: translateX(220%); }
  100% { transform: translateX(220%); }
}

/* ────────── SUBHEADLINE ────────── */
.hero__lead {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.6vw + 0.85rem, 1.125rem); /* 16-18px — legible sin competir con H1 */
  line-height: 1.55; /* respiración cómoda para 3 líneas */
  color: rgba(250, 246, 238, 0.84); /* +6% legibilidad sobre 0.78 */
  max-width: 46ch; /* 38ch era estrecho — fuerza saltos extra */
  text-wrap: pretty;
  margin-top: 1.15rem; /* respiro pos-título */
  opacity: 0;
  transform: translateY(8px);
  animation: hero-fade-up var(--dur-slow) var(--ease-out) 2000ms forwards;
}
.hero__lead strong {
  font-weight: var(--fw-semibold);
  color: var(--color-cream-off);
}

/* ────────── CTAs ────────── */
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.65rem; /* salto fuerte lead→acción — separa contenido de CTA */
  opacity: 0;
  transform: translateY(8px);
  animation: hero-fade-up var(--dur-slow) var(--ease-out) 2150ms forwards;
}
.hero__ctas .btn {
  padding: 0.95rem 1.25rem; /* +vert para acomodar las 2 líneas internas con confort */
  flex: 1 1 auto;
  min-width: 200px; /* +20px para evitar que el sub-label se corte en breakpoints raros */
  max-width: 280px;
  justify-content: space-between;
}

.btn--primary {
  background-color: var(--color-coffee);
  color: #0D1A22;
  border-color: var(--color-coffee);
  box-shadow: 0 12px 32px rgba(184, 132, 47, 0.28);
}
.btn--primary:hover {
  background-color: var(--color-coffee-light);
  border-color: var(--color-coffee-light);
  color: #0D1A22;
  box-shadow: 0 16px 40px rgba(229, 183, 104, 0.42);
  transform: translateY(-2px);
}

.btn--secondary {
  background-color: rgba(255, 252, 246, 0.04);
  color: var(--color-cream-off);
  border-color: rgba(250, 246, 238, 0.32);
  backdrop-filter: blur(8px);
}
.btn--secondary:hover {
  background-color: rgba(250, 246, 238, 0.10);
  border-color: rgba(250, 246, 238, 0.70);
  color: var(--color-cream-off);
}

.btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn__label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  flex: 1;
}
.btn__main {
  font-size: var(--fs-body-m);
  font-weight: var(--fw-semibold);
  line-height: 1.1;
}
.btn__sub {
  font-size: var(--fs-body-xs);
  font-weight: var(--fw-regular);
  opacity: 0.72;
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.btn__arrow {
  font-size: 1.25rem;
  transition: transform var(--dur-mid) var(--ease-spring);
}
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ────────── TRUST STRIP ────────── */
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem; /* gap horizontal cómodo entre items */
  margin-top: 1.4rem; /* respiro tras CTAs antes del separator */
  padding-top: 1rem; /* aire tras el border-top */
  border-top: 1px solid rgba(250, 246, 238, 0.12);
  opacity: 0;
  transform: translateY(8px);
  animation: hero-fade-up var(--dur-slow) var(--ease-out) 2350ms forwards;
}
.hero__trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem; /* 12.5px — consistente con eyebrow */
  font-weight: var(--fw-medium);
  letter-spacing: 0.005em;
  color: rgba(250, 246, 238, 0.62); /* +7% sobre 0.55 — más legible */
}
.hero__trust-item svg {
  color: var(--color-coffee-light);
  opacity: 0.85;
  flex-shrink: 0;
}

/* ────────── RESPONSIVE ────────── */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .hero__steam { left: 65%; top: 25%; }
}

@media (max-width: 760px) {
  .hero { padding-top: clamp(6rem, 18vw, 8rem); }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__panel { padding: 1.6rem; }
  .hero__title { font-size: clamp(2.3rem, 10vw, 3.4rem); margin-top: 1.25rem; }
  .hero__lead  { font-size: 1rem; margin-top: 1rem; }
  .hero__ctas  { flex-direction: column; gap: 0.7rem; margin-top: 1.4rem; }
  .hero__ctas .btn { width: 100%; min-width: 0; max-width: none; }
  .hero__trust { gap: 0.9rem; font-size: 0.72rem; margin-top: 1.2rem; padding-top: 0.85rem; }
  .hero__eyebrow { margin-top: 0.75rem; }
  .hero__steam { left: 75%; top: 8%; opacity: 0.7; }
  .hero__photo img { object-position: 65% 38%; }
  .hero__overlay {
    background:
      linear-gradient(180deg,
        rgba(7, 14, 24, 0.30) 0%,
        rgba(7, 14, 24, 0.55) 45%,
        rgba(7, 14, 24, 0.78) 100%);
  }
}

@media (max-width: 480px) {
  .hero__freshness { font-size: 0.68rem; padding: 0.4rem 0.9rem 0.4rem 0.7rem; }
  .hero__panel { padding: 1.35rem; }
  .hero__title { font-size: clamp(2rem, 9.5vw, 2.8rem); }
}

/* ────────── MOTION REDUCTION ────────── */
@media (prefers-reduced-motion: reduce) {
  .hero__stage    { animation: none; clip-path: none; }
  .hero__photo img{ animation: none; }
  .hero__dust-mote, .hero__grain,
  .hero__steam-puff,
  .hero__freshness-icon, .hero__freshness-glow,
  .hero__chip-dot {
    animation: none;
  }
  .hero__panel, .hero__chip, .hero__eyebrow, .hero__freshness,
  .hero__lead, .hero__ctas, .hero__trust, .hero__word {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
