:root {
  --ink: #2e2e2e;
  --cream: #f5f2ec;
  --accent: #ca5522;
  --header-h: clamp(64px, 10vh, 130px);
  --ticker-h: clamp(34px, 5vh, 60px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  font-family: "Poppins", "Helvetica Neue", Arial, sans-serif;
  cursor: none;
}

/* Modo nocturno: menos brillo cuando la calle está a oscuras */
body.night { filter: brightness(0.8); }
body { transition: filter 2s ease; }

.serif { font-family: "Playfair Display", Georgia, serif; }

/* ================= Cabecera fija ================= */
.brand-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--cream);
  border-bottom: 5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 2.5vw, 48px);
  z-index: 10;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 28px);
}

.brand-logo {
  height: calc(var(--header-h) * 0.44);
  width: auto;
  display: block;
}

.brand-divider {
  width: 2px;
  height: calc(var(--header-h) * 0.5);
  background: var(--accent);
  opacity: 0.85;
}

.brand-tagline {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  color: var(--ink);
}

.tagline-top {
  font-size: clamp(14px, 1.7vw, 30px);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tagline-bottom {
  font-size: clamp(11px, 1.1vw, 20px);
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Reloj doble: hora local + hora en Lombok */
.brand-clock {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 26px);
  color: var(--ink);
}

.clock-local, .clock-remote {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}

.clock-time {
  font-size: clamp(18px, 2vw, 36px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.clock-remote .clock-time { color: var(--accent); }

.clock-zone {
  font-size: clamp(9px, 0.85vw, 15px);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.7;
}

.clock-sep {
  width: 1px;
  height: calc(var(--header-h) * 0.4);
  background: var(--ink);
  opacity: 0.2;
}

.brand-right {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 22px);
}

.brand-web {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}

.web-cta {
  font-size: clamp(10px, 1vw, 18px);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink);
  opacity: 0.75;
}

.web-url {
  font-size: clamp(14px, 1.5vw, 27px);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.brand-qr {
  height: calc(var(--header-h) * 0.74);
  width: auto;
  border-radius: 8px;
  animation: qrPulse 12s ease-in-out infinite;
}

/* Pulso sutil periódico para atraer la mirada al QR */
@keyframes qrPulse {
  0%, 88%, 100% { transform: scale(1); }
  92% { transform: scale(1.09); }
  96% { transform: scale(1); }
}

/* ================= Zona de diapositivas ================= */
.stage {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  bottom: var(--ticker-h);
  background: var(--ink);
  overflow: hidden;
}

/* Viñeta inferior sutil: mejora la lectura de la etiqueta sobre cualquier foto */
.stage::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 13%;
  background: linear-gradient(180deg, transparent, rgba(20, 18, 16, 0.18));
  pointer-events: none;
  z-index: 4;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.1s ease-in-out;
  will-change: opacity, transform;
}

.slide.visible { opacity: 1; }

img.slide {
  object-fit: cover;
  /* Recorta por abajo: la parte superior de las diapositivas lleva texto */
  object-position: center top;
  transform-origin: top center;
}

/* Páginas de datos: imagen completa (sin recortes) sobre fondo desenfocado */
.slide-contain .fit-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(26px) brightness(0.72) saturate(1.05);
  transform: scale(1.12);
}

.slide-contain .fit-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Variantes Ken Burns para que el movimiento no sea repetitivo */
img.slide.visible.kb-0 { animation: kbZoomIn var(--slide-ms, 8000ms) ease-out forwards; }
img.slide.visible.kb-1 { animation: kbPanRight var(--slide-ms, 8000ms) ease-out forwards; }
img.slide.visible.kb-2 { animation: kbZoomOut var(--slide-ms, 8000ms) ease-out forwards; }
img.slide.visible.kb-3 { animation: kbPanLeft var(--slide-ms, 8000ms) ease-out forwards; }

@keyframes kbZoomIn  { from { transform: scale(1); }        to { transform: scale(1.05); } }
@keyframes kbZoomOut { from { transform: scale(1.05); }     to { transform: scale(1); } }
@keyframes kbPanRight{ from { transform: scale(1.05) translateX(-0.8%); } to { transform: scale(1.05) translateX(0.8%); } }
@keyframes kbPanLeft { from { transform: scale(1.05) translateX(0.8%); }  to { transform: scale(1.05) translateX(-0.8%); } }

/* ---------- Pantallas HTML (marca / capítulo / CTA) ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 6vw;
}

.hero .rise {
  opacity: 0;
  transform: translateY(26px);
}

.hero.visible .rise {
  animation: riseIn 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.hero.visible .rise:nth-child(1) { animation-delay: 0.15s; }
.hero.visible .rise:nth-child(2) { animation-delay: 0.35s; }
.hero.visible .rise:nth-child(3) { animation-delay: 0.55s; }
.hero.visible .rise:nth-child(4) { animation-delay: 0.75s; }
.hero.visible .rise:nth-child(5) { animation-delay: 0.95s; }

@keyframes riseIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Pantalla de marca */
.hero-brand { background: var(--cream); color: var(--ink); }

.hero-brand .hero-logo {
  height: clamp(60px, 13vh, 160px);
  margin-bottom: 2.5vh;
}

.hero-brand .hero-claim {
  font-size: clamp(22px, 3.4vw, 62px);
  font-weight: 500;
  font-style: italic;
  margin-bottom: 5vh;
}

.stats-row {
  display: flex;
  gap: clamp(24px, 4.5vw, 90px);
  justify-content: center;
}

.stat { display: flex; flex-direction: column; }

.stat-value {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(34px, 4.6vw, 88px);
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
}

.stat-caption {
  font-size: clamp(11px, 1.1vw, 21px);
  font-weight: 300;
  letter-spacing: 0.06em;
  max-width: 14ch;
  margin: 0 auto;
}

.hero-note {
  position: absolute;
  bottom: 2.5vh;
  left: 0; right: 0;
  font-size: clamp(9px, 0.8vw, 14px);
  font-weight: 300;
  opacity: 0.55;
}

/* Pantalla de capítulo (portada de proyecto) */
.hero-chapter {
  background-size: cover;
  background-position: center;
  color: var(--cream);
}

.hero-chapter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 26, 23, 0.45) 0%, rgba(28, 26, 23, 0.72) 100%);
}

.hero-chapter > * { position: relative; }

.chapter-kicker {
  font-size: clamp(12px, 1.2vw, 23px);
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.9;
  margin-bottom: 1.6vh;
}

.chapter-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(44px, 6.5vw, 128px);
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 1.2vh;
}

.chapter-price {
  display: inline-block;
  background: var(--accent);
  color: var(--cream);
  font-size: clamp(18px, 2.1vw, 40px);
  font-weight: 500;
  padding: 0.3em 1em;
  border-radius: 999px;
  margin-bottom: 2.2vh;
}

.chapter-subtitle {
  font-size: clamp(15px, 1.7vw, 32px);
  font-weight: 300;
  margin-bottom: 3vh;
}

.chapter-tags {
  display: flex;
  gap: clamp(10px, 1.2vw, 22px);
  justify-content: center;
  flex-wrap: wrap;
}

.chapter-tag {
  border: 1.5px solid rgba(245, 242, 236, 0.75);
  border-radius: 999px;
  padding: 0.4em 1.1em;
  font-size: clamp(12px, 1.15vw, 22px);
  font-weight: 300;
  letter-spacing: 0.04em;
}

/* Pantalla CTA final */
.hero-cta { background: var(--ink); color: var(--cream); }

.hero-cta .cta-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(34px, 4.6vw, 92px);
  font-weight: 600;
  margin-bottom: 1.4vh;
}

.hero-cta .cta-sub {
  font-size: clamp(15px, 1.6vw, 30px);
  font-weight: 300;
  margin-bottom: 4vh;
}

.cta-qr-card {
  background: var(--cream);
  border-radius: 18px;
  padding: clamp(10px, 1.4vh, 22px);
  display: inline-block;
  margin-bottom: 2.2vh;
}

.cta-qr-card img {
  display: block;
  height: clamp(140px, 26vh, 320px);
  width: auto;
}

.hero-cta .cta-url {
  font-size: clamp(20px, 2.3vw, 44px);
  font-weight: 600;
  color: var(--accent);
}

/* ---------- Etiqueta del proyecto ---------- */
.slide-label {
  position: absolute;
  left: clamp(16px, 2vw, 40px);
  bottom: clamp(16px, 2.6vh, 42px);
  background: rgba(46, 46, 46, 0.82);
  color: var(--cream);
  padding: 0.5em 1.1em;
  border-left: 4px solid var(--accent);
  font-size: clamp(13px, 1.4vw, 26px);
  font-weight: 400;
  letter-spacing: 0.06em;
  border-radius: 4px;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.slide-label.visible { opacity: 1; }

/* ---------- Barra de progreso (bajo la cabecera) ---------- */
.progress {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5px;
  background: rgba(245, 242, 236, 0.14);
  z-index: 6;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.progress-fill.animating {
  animation: fill var(--slide-ms, 8000ms) linear forwards;
}

@keyframes fill { from { width: 0%; } to { width: 100%; } }

/* ================= Rótulo inferior (ticker) ================= */
.ticker-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--ticker-h);
  background: var(--cream);
  border-top: 3px solid var(--accent);
  overflow: hidden;
  display: flex;
  align-items: center;
  z-index: 10;
}

.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker 42s linear infinite;
  will-change: transform;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-item {
  color: var(--ink);
  font-size: clamp(13px, 1.4vw, 26px);
  font-weight: 400;
  letter-spacing: 0.03em;
  padding: 0 clamp(18px, 2vw, 40px);
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 40px);
}

.ticker-item::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
