/* ==========================================================
   Cinematic Hero — Caribb Paradise
   Scoped to .cine-hero so it doesn't collide with style.css
   ========================================================== */
.cine-hero {
  --cine-dur: 7s;            /* time each shot stays on screen  */
  --cine-fade: 1.8s;         /* cross-dissolve between shots    */
  --cine-bar: 0px;           /* letterbox bars open fully (no black bands) */
  --cine-gold: #e9d8a6;
  --cine-accent: #86a900;
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: #050505;
  color: #fff;
  isolation: isolate;
}

/* ---------- Shots (slides) ---------- */
.cine-media { position: absolute; inset: 0; z-index: 0; will-change: transform; }
.cine-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--cine-fade) ease-in-out;
}
.cine-slide.is-active { opacity: 1; z-index: 1; }
.cine-slide.is-leaving { opacity: 0; z-index: 0; }
.cine-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.18);
  filter: saturate(1.05) contrast(1.08) brightness(.92);
  will-change: transform;
}
/* Ken Burns camera moves — keep running while the shot dissolves out */
.cine-slide.is-active img,
.cine-slide.is-leaving img {
  animation: var(--kb, cine-kb-in) calc(var(--cine-dur) + var(--cine-fade)) cubic-bezier(.25,.1,.25,1) forwards;
}
.cine-slide[data-kb="in"]    { --kb: cine-kb-in; }
.cine-slide[data-kb="out"]   { --kb: cine-kb-out; }
.cine-slide[data-kb="left"]  { --kb: cine-kb-left; }
.cine-slide[data-kb="right"] { --kb: cine-kb-right; }
.cine-slide[data-kb="up"]    { --kb: cine-kb-up; }

@keyframes cine-kb-in    { from { transform: scale(1.05) } to { transform: scale(1.22) } }
@keyframes cine-kb-out   { from { transform: scale(1.25) } to { transform: scale(1.06) } }
@keyframes cine-kb-left  { from { transform: scale(1.18) translate3d(3%,0,0) }  to { transform: scale(1.18) translate3d(-3%,0,0) } }
@keyframes cine-kb-right { from { transform: scale(1.18) translate3d(-3%,0,0) } to { transform: scale(1.18) translate3d(3%,0,0) } }
@keyframes cine-kb-up    { from { transform: scale(1.2) translate3d(0,3%,0) }   to { transform: scale(1.12) translate3d(0,-2%,0) } }

/* ---------- Colour grade, vignette, grain ---------- */
.cine-grade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 28%, rgba(0,0,0,0) 45%, rgba(0,0,0,.82) 100%),
    linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 60%),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,.6) 100%);
}
/* warm highlights / teal shadows — the classic film look */
.cine-tint {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,170,90,.16), rgba(0,90,110,.18));
  mix-blend-mode: soft-light;
}
.cine-grain {
  position: absolute; inset: -50%; z-index: 2; pointer-events: none;
  opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: cine-grain .9s steps(6) infinite;
}
@keyframes cine-grain {
  0% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) }
  40% { transform: translate(2%,-3%) } 60% { transform: translate(-2%,-1%) }
  80% { transform: translate(3%,3%) } 100% { transform: translate(0,0) }
}

/* ---------- Letterbox bars (open like a film starting) ---------- */
.cine-bar {
  position: absolute; left: 0; right: 0; z-index: 6;
  height: 50%;
  background: #000;
  transition: height 1.6s cubic-bezier(.77,0,.18,1);
  pointer-events: none;
}
.cine-bar--top { top: 0; }
.cine-bar--bottom { bottom: 0; }
.cine-hero.is-ready .cine-bar { height: var(--cine-bar); }

/* ---------- Navigation inside the hero ---------- */
.cine-nav {
  position: absolute; z-index: 7;
  top: var(--cine-bar); left: 0; right: 0;
  padding: 1.5rem clamp(1rem, 4vw, 3.5rem) 0;
  opacity: 0; transform: translateY(-12px);
  transition: opacity 1s ease 1.4s, transform 1s ease 1.4s;
}
.cine-hero.is-ready .cine-nav { opacity: 1; transform: none; }
.cine-hero .cine-nav nav { margin-top: 0 !important; }

/* ---------- Title card ---------- */
.cine-content {
  position: absolute; z-index: 5;
  left: clamp(1.25rem, 6vw, 6rem);
  right: clamp(1.25rem, 6vw, 6rem);
  bottom: calc(var(--cine-bar) + clamp(2.5rem, 8vh, 6rem));
  max-width: 900px;
}
.cine-eyebrow {
  display: inline-flex; align-items: center; gap: .9rem;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .78rem; letter-spacing: .38em; text-transform: uppercase;
  color: var(--cine-gold);
  margin: 0 0 1.4rem;
}
.cine-eyebrow::before {
  content: ""; width: 0; height: 1px; background: currentColor;
  transition: width 1.2s cubic-bezier(.77,0,.18,1) 1.8s;
}
.cine-hero.is-ready .cine-eyebrow::before { width: 3.5rem; }

.cine-title {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  font-weight: 300;
  font-size: clamp(3rem, 8.5vw, 7.5rem) !important;
  line-height: .95;
  letter-spacing: -.01em;
  margin: 0 0 1.5rem !important;
  color: #fff !important;
  text-shadow: 0 10px 40px rgba(0,0,0,.45);
}
.cine-title em { font-style: italic; color: var(--cine-gold); font-weight: 400; }
.cine-line { display: block; overflow: hidden; padding-bottom: .08em; }
.cine-line > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.4s cubic-bezier(.19,1,.22,1);
}
.cine-hero.is-ready .cine-line > span { transform: none; }
.cine-hero.is-ready .cine-line:nth-child(1) > span { transition-delay: 1.5s; }
.cine-hero.is-ready .cine-line:nth-child(2) > span { transition-delay: 1.75s; }

.cine-sub,
.cine-actions,
.cine-meta,
.cine-scroll {
  opacity: 0; transform: translateY(16px);
  transition: opacity 1.1s ease, transform 1.1s ease;
}
.cine-hero.is-ready .cine-sub     { opacity: 1; transform: none; transition-delay: 2.2s; }
.cine-hero.is-ready .cine-actions { opacity: 1; transform: none; transition-delay: 2.45s; }
.cine-hero.is-ready .cine-meta    { opacity: 1; transform: none; transition-delay: 2.7s; }
.cine-hero.is-ready .cine-scroll  { opacity: 1; transform: none; transition-delay: 3s; }

.cine-sub {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: clamp(.95rem, 1.3vw, 1.12rem);
  font-weight: 300; line-height: 1.7;
  color: rgba(255,255,255,.82);
  max-width: 34rem;
  margin: 0 0 2.2rem;
}

.cine-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.cine-btn {
  display: inline-flex; align-items: center; gap: .8rem;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .82rem; letter-spacing: .18em; text-transform: uppercase;
  padding: 1rem 1.6rem; border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background .35s ease, color .35s ease, border-color .35s ease, transform .35s ease;
}
.cine-btn--primary { background: #fff; color: #111; border: 1px solid #fff; }
.cine-btn--primary:hover { background: var(--cine-accent); border-color: var(--cine-accent); color: #fff; transform: translateY(-2px); }
.cine-btn--ghost { background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(255,255,255,.4); backdrop-filter: blur(6px); }
.cine-btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.14); color: #fff; transform: translateY(-2px); }
.cine-btn .cine-btn-icon {
  display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: #111; color: #fff; font-size: 1rem;
  transition: transform .35s ease, background .35s ease;
}
.cine-btn--primary:hover .cine-btn-icon { transform: rotate(45deg); background: #fff; color: var(--cine-accent); }

/* ---------- Chapter counter + progress ---------- */
.cine-meta {
  position: absolute; z-index: 5;
  right: clamp(1.25rem, 4vw, 3.5rem);
  bottom: calc(var(--cine-bar) + clamp(2.5rem, 8vh, 6rem));
  display: flex; flex-direction: column; align-items: flex-end; gap: .9rem;
  font-family: 'Poppins', system-ui, sans-serif;
}
.cine-count { font-size: .8rem; letter-spacing: .3em; color: rgba(255,255,255,.6); }
.cine-count-current { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 2.4rem; letter-spacing: 0; color: #fff; margin-right: .4rem; }
.cine-progress { display: flex; gap: .45rem; }
.cine-progress button {
  position: relative; width: 2.6rem; height: 2px; padding: 0; border: 0;
  background: rgba(255,255,255,.28); cursor: pointer; overflow: hidden;
}
.cine-progress button::before { content: ""; position: absolute; inset: -10px 0; } /* bigger tap target */
.cine-progress button span { position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
.cine-progress button.is-done span { transform: scaleX(1); }
.cine-progress button.is-active span { animation: cine-fill var(--cine-dur) linear forwards; }
.cine-hero.is-paused .cine-progress button.is-active span { animation-play-state: paused; }
@keyframes cine-fill { from { transform: scaleX(0) } to { transform: scaleX(1) } }

/* ---------- Scroll cue ---------- */
.cine-scroll {
  position: absolute; z-index: 5; left: 50%;
  bottom: calc(var(--cine-bar) + 1rem);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .65rem; letter-spacing: .35em; text-transform: uppercase;
  color: rgba(255,255,255,.65); text-decoration: none;
}
.cine-hero.is-ready .cine-scroll { transform: translateX(-50%); }
.cine-scroll i { display: block; width: 1px; height: 2.6rem; background: linear-gradient(rgba(255,255,255,0), #fff); animation: cine-drip 2.2s ease-in-out infinite; transform-origin: top; }
.cine-scroll:hover { color: #fff; }
@keyframes cine-drip { 0% { transform: scaleY(0) } 50% { transform: scaleY(1) } 100% { transform: scaleY(1); opacity: 0 } }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .cine-hero { --cine-bar: 0px; height: 82svh; min-height: 540px; }
  .cine-nav { display: none; }              /* mobile nav sits above the hero */
  .cine-content { bottom: calc(var(--cine-bar) + 5.5rem); text-align: left; }
  .cine-eyebrow { font-size: .66rem; letter-spacing: .28em; margin-bottom: 1rem; }
  .cine-sub { margin-bottom: 1.6rem; }
  .cine-btn { padding: .85rem 1.2rem; font-size: .72rem; }
  .cine-meta { left: clamp(1.25rem, 6vw, 6rem); right: auto; align-items: flex-start; bottom: calc(var(--cine-bar) + 1.5rem); flex-direction: row; align-items: center; gap: 1rem; }
  .cine-count-current { font-size: 1.6rem; }
  .cine-progress button { width: 1.6rem; }
  .cine-scroll { display: none; }
  .cine-eyebrow { letter-spacing: .22em; }
  /* the mobile navbar row was ~12px wider than the screen */
  .home-mobile-nav { margin-left: 0; margin-right: 0; }
  html, body { overflow-x: clip; }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cine-slide img, .cine-slide.is-active img, .cine-slide.is-leaving img { animation: none !important; transform: scale(1.05); }
  .cine-grain, .cine-scroll i { animation: none; }
  .cine-bar, .cine-line > span, .cine-sub, .cine-actions, .cine-meta, .cine-scroll, .cine-nav, .cine-eyebrow::before { transition-duration: .01s !important; transition-delay: 0s !important; }
}
