/* ============================================================================
   REBOX — Cinematic homepage (index.html only)
   Split-screen pinned scrollytelling: each panel pins as a two-column split —
   a portrait video pane on one side (alternating), a light content column with
   the green card on the other. The video scrubs to scroll; content reveals in
   stages. Desktop only pins/splits; mobile falls back to a video background
   with the card over it (portrait video suits a portrait phone screen).
   Self-contained .cine-* selectors, no !important (footer wins on specificity).
   ========================================================================== */

:root{
  --cine-ink:#FAFAF7;
  --cine-ink-soft:rgba(250,250,247,.86);
  --cine-ink-mute:rgba(250,250,247,.60);
  --cine-gold:#d4c896;
  --cine-card:rgba(45,90,39,0.92);   /* more opaque now — sits on a solid column */
  --cine-line:rgba(255,255,255,.12);
  --s1:8px; --s2:16px; --s3:24px; --s4:32px; --s5:48px; --s6:64px; --s7:96px;
  --cine-maxw:1200px;
}

.cine-panel, .cine-panel *{ box-sizing:border-box; }

/* Global "MOBILE OVERHAUL" rule in style.css targets every bare <section> with
   `padding-left/right:16px!important` (meant for other page sections). Our
   .cine-panel elements ARE <section>s, so they inherited that 16px side
   padding — the visible white gutter down the left/right edge of every
   full-bleed video. A class selector (.cine-panel) is more specific than a
   bare element selector (section), so this wins over the !important rule
   without needing a broader/riskier reset — and it only ever matches this
   page, since home-cinema.css is only linked from index.html. */
@media (max-width:768px){
  .cine-panel{ padding-left:0!important; padding-right:0!important; width:100%!important; max-width:100%!important; }
}

/* Three.js particle overlay retired in the split layout (it fought the solid
   content column's stacking + read poorly on the light background). */
#global-three-canvas{ display:none; }

/* ── Panel + pin shell ───────────────────────────────────────────────────
   Section has no fixed height (GSAP inserts the pin spacer). .cine-pin is the
   pinned viewport. Off-scrub (mobile / no-JS) it's a normal block. */
.cine-panel{ position:relative; }
.cine-pin{ position:relative; min-height:100vh; overflow:hidden; }

/* Desktop split grid: video 45% LEFT / content 55% RIGHT on every panel, with
   no alternation. A fixed reading rhythm — the eye finds the video and the
   text in the same place on every panel — reads as more deliberate than
   flipping sides, which made each panel feel like a separate page. */
.cine-scrub .cine-pin{
  height:100vh; min-height:0;
  display:grid; grid-template-columns:45% 55%;
}
.cine-scrub .cine-video-col{ grid-column:1; }
.cine-scrub .cine-content-col{ grid-column:2; }

/* ── No diagonal seam: panels are flush ───────────────────────────────────
   A previous iteration clipped a 72px diagonal off each pinned panel. It
   cannot work in a PINNED layout and was the dark green band between panels:
   consecutive panels never overlap — each section owns its own scroll range
   and its .cine-pin is position:fixed within it — so the wedge cut off the
   panel had nothing behind it but the section's own background, which read as
   a solid buffer bar rather than a seam. The usual negative-margin overlap fix
   is not available either: GSAP's pinSpacing inserts a spacer whose height is
   the scroll math, and pulling panels together with negative margins desyncs
   every trigger's start/end below it. Flush edges, no clip, no gap. */
.cine-panel{ margin:0; }

.cine-video-col{ position:relative; height:100vh; overflow:hidden; background:#12240f; }
.cine-video{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover; object-position:center;
}
/* Desktop scrub draws to this instead — canvas drawImage has zero seek
   latency, unlike video.currentTime, which is what actually removes stutter.
   Hidden until JS confirms the frame sequence has loaded (see home-cinema.js);
   the <video> (showing its poster) stays visible as the fallback until then. */
.cine-video-canvas{ position:absolute; inset:0; width:100%; height:100%; display:none; }

/* Top padding clears the fixed nav. Bottom padding is deliberately small: the
   column is a fixed 100vh box, so every pixel spent on padding is a pixel the
   card cannot use before overflow:hidden starts cutting text off. */
.cine-content-col{
  position:relative; height:100vh; overflow:hidden;
  display:flex; align-items:flex-start; justify-content:flex-start;
  padding:clamp(88px,12vh,132px) clamp(32px,5vw,80px) clamp(32px,5vh,56px);
  background:#FAFAF7;
}
/* Auto margins centre the card when there is room, but — unlike
   align-items:center — they never push its top edge above the container when
   content is taller than the box. With overflow:hidden that difference is the
   difference between losing a line off the bottom and losing the headline off
   the top. */
.cine-scrub .cine-inner{ margin-top:auto; margin-bottom:auto; }
/* Desktop-scoped: on mobile the content column must stay transparent so the
   full-bleed video and its gradient wash show through behind the text. */
.cine-scrub .cine-panel--vright .cine-content-col{ background:#F2EDE6; }

.cine-inner{ position:relative; width:100%; max-width:600px; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.cine-card{
  width:100%;
  background:var(--cine-card);
  backdrop-filter:blur(10px) saturate(1.15);
  -webkit-backdrop-filter:blur(10px) saturate(1.15);
  border:1px solid var(--cine-line);
  border-radius:16px;
  padding:clamp(28px,2.6vw,44px);
  color:var(--cine-ink);
  box-shadow:0 24px 60px rgba(20,40,16,.18);
}

/* ── Stages ───────────────────────────────────────────────────────────────
   Reveal is a single class toggle driven by an IntersectionObserver (see
   home-cinema.js) — never inline opacity tied to scroll progress. The hidden
   state is gated behind .cine-reveal, which that same script sets, so content
   can never be left invisible by a script that failed to run. */
.cine-stage{ position:relative; }
.cine-stage + .cine-stage{ margin-top:var(--s3); }
.cine-reveal .cine-stage{
  opacity:0; transform:translateY(24px);
  transition:opacity .6s ease, transform .6s ease;
  will-change:opacity, transform;
}
.cine-reveal .cine-stage.is-active{ opacity:1; transform:translateY(0); }
@media (prefers-reduced-motion:reduce){
  .cine-reveal .cine-stage{ opacity:1; transform:none; transition:none; }
}

/* ── Typography ───────────────────────────────────────────────────────────
   Eyebrow reads as a small tracked-out index line — number, label, then a
   hairline rule running to the edge — so the headline below it is
   unambiguously the single focal element on the panel. */
body{ counter-reset:cinepanel; }
.cine-panel[data-pin]{ counter-increment:cinepanel; }

.cine-eyebrow{
  display:flex; align-items:center; gap:12px;
  margin:0 0 var(--s3);
  font:600 11px/1 'Inter',system-ui,sans-serif;
  letter-spacing:.28em; text-transform:uppercase;
  color:var(--cine-gold);
}
.cine-panel[data-pin] .cine-eyebrow::before{
  content:counter(cinepanel,decimal-leading-zero);
  font-variant-numeric:tabular-nums;
  letter-spacing:.12em;
  color:var(--cine-gold);
  opacity:.7;
}
.cine-eyebrow::after{
  content:''; flex:1 1 auto; height:1px; min-width:24px;
  background:linear-gradient(90deg, rgba(212,200,150,.45), rgba(212,200,150,0));
}
.cine-title{
  margin:0;
  font:700 clamp(34px,3.3vw,58px)/1.04 'Inter',system-ui,sans-serif;
  letter-spacing:-.025em;
  color:var(--cine-ink);
}
.cine-accent{
  font-family:'Playfair Display',Georgia,serif;
  font-weight:400; font-style:italic; letter-spacing:0;
  color:var(--cine-gold);
}
.cine-body{
  margin:0;
  font:400 clamp(15px,1.05vw,17px)/1.6 'Inter',system-ui,sans-serif;
  color:var(--cine-ink-soft);
}
.cine-note{
  margin:var(--s3) 0 0;
  font:400 13px/1.5 'Inter',system-ui,sans-serif;
  color:var(--cine-ink-mute);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.cine-actions{ display:flex; flex-wrap:wrap; gap:var(--s2); }
.cine-btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:13px 26px; border-radius:8px;
  font:600 13px/1 'Inter',system-ui,sans-serif;
  letter-spacing:.06em; text-transform:uppercase;
  background:var(--cine-ink); color:#1a2e16;
  border:1px solid var(--cine-ink);
  cursor:pointer;
  transition:transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.cine-btn:hover{ transform:translateY(-2px); }
.cine-btn--ghost{ background:transparent; color:var(--cine-ink); border-color:rgba(250,250,247,.42); }
.cine-btn--ghost:hover{ background:rgba(250,250,247,.12); border-color:var(--cine-ink); }

.cine-textlink{
  display:inline-block;
  font:600 13px/1 'Inter',system-ui,sans-serif;
  letter-spacing:.04em; color:var(--cine-gold);
  text-decoration:none; border-bottom:1px solid transparent;
  transition:border-color .25s ease;
}
.cine-textlink:hover{ border-color:var(--cine-gold); }

/* ── Impact pillars ─────────────────────────────────────────────────────── */
.cine-pillars{ display:grid; grid-template-columns:1fr 1fr; gap:var(--s3) var(--s4); margin-top:var(--s4); }
.cine-pillar{ padding-top:13px; border-top:1px solid rgba(212,200,150,.4); }
.cine-pillar-title{ margin:0 0 5px; font:600 14.5px/1.2 'Inter',system-ui,sans-serif; color:var(--cine-ink); }
.cine-pillar-desc{ margin:0; font:400 13px/1.5 'Inter',system-ui,sans-serif; color:var(--cine-ink-mute); }

/* ── Category grid ──────────────────────────────────────────────────────── */
.cine-cats{
  display:grid; grid-template-columns:1fr 1fr; gap:1px;
  margin-top:var(--s4);
  background:var(--cine-line); border:1px solid var(--cine-line);
  border-radius:12px; overflow:hidden;
}
.cine-cat{ display:flex; flex-direction:column; gap:3px; padding:13px 16px; background:rgba(30,52,24,.6); text-decoration:none; transition:background .25s ease; }
.cine-cat:hover{ background:rgba(212,200,150,.16); }
.cine-cat-name{ font:600 15px/1.2 'Inter',system-ui,sans-serif; color:var(--cine-ink); }
.cine-cat-desc{ font:400 12px/1.35 'Inter',system-ui,sans-serif; color:var(--cine-ink-mute); }

/* ── Stats (2×2 in the narrower column) ─────────────────────────────────── */
.cine-stats{ display:grid; grid-template-columns:1fr 1fr; gap:var(--s4) var(--s3); margin-top:var(--s4); }
.cine-stat-num{ font:400 clamp(32px,2.8vw,46px)/1 'Playfair Display',Georgia,serif; color:var(--cine-gold); }
.cine-stat-label{ margin-top:6px; font:600 10.5px/1.3 'Inter',system-ui,sans-serif; letter-spacing:.14em; text-transform:uppercase; color:var(--cine-ink-mute); }

/* ── Testimonials ───────────────────────────────────────────────────────── */
.cine-quotes{ display:grid; grid-template-columns:1fr 1fr; gap:var(--s3); margin-top:var(--s4); }
.cine-quote{ margin:0; }
.cine-quote-text{ margin:0; font:400 13px/1.55 'Inter',system-ui,sans-serif; color:var(--cine-ink-soft); }
.cine-quote-author{ margin-top:9px; font:600 12px/1.4 'Inter',system-ui,sans-serif; color:var(--cine-ink); }
.cine-quote-role{ font-weight:400; color:var(--cine-ink-mute); }

/* DNA clip graded toward green (mute the teal, nudge hue to green, lift) so it
   reads as abstract green energy rather than a clinical biotech helix. */
.cine-panel--trust .cine-video,
.cine-panel--trust .cine-video-canvas{ filter:saturate(.5) hue-rotate(-32deg) brightness(1.06); }

/* ── Footer panel (ambient, full-width — no split) ──────────────────────── */
.cine-panel--footer{ position:relative; min-height:100vh; overflow:hidden; display:flex; align-items:center; padding:clamp(96px,13vh,140px) 0 clamp(40px,6vh,72px); }
.cine-panel--footer .cine-video{ filter:none; }
.cine-panel--footer .cine-inner{ max-width:var(--cine-maxw); margin:0 auto; padding:0 clamp(24px,5vw,64px); }
.cine-panel--footer .cine-card{ max-width:var(--cine-maxw); width:100%; padding:clamp(28px,3vw,46px); }
.cine-panel--footer .footer-grid{ border-bottom-color:rgba(255,255,255,.14); }
.cine-panel--footer .footer-tag{ color:var(--cine-ink-soft); }
.cine-panel--footer .footer-col h5{ color:var(--cine-gold); }
.cine-panel--footer .footer-col a{ color:rgba(250,250,247,.80); }
.cine-panel--footer .footer-col a:hover{ color:var(--cine-ink); }
.cine-panel--footer .fci{ color:var(--cine-ink-soft); }
.cine-panel--footer .fci a{ color:rgba(250,250,247,.86); }
.cine-panel--footer .footer-bottom{ color:var(--cine-ink-mute); border-top-color:rgba(255,255,255,.14); }

/* ── a11y / motion ──────────────────────────────────────────────────────── */
.cine-btn:focus-visible, .cine-cat:focus-visible, .cine-textlink:focus-visible{ outline:2px solid var(--cine-gold); outline-offset:3px; }
@media (prefers-reduced-motion:reduce){ .cine-btn{ transition:none; } }

/* ── Mobile: full-bleed video that dissolves into solid green ─────────────
   No pin, no scrub — just an ambient looping video (see home-cinema.js). The
   video fills the entire panel edge-to-edge; instead of a separate floating
   rounded card (which left hard-edged strips of video visible around it), a
   gradient wash on the panel itself carries the video from clear at the top
   into solid green by the point the text needs to sit on it. Text sits
   directly on that wash, left-aligned, full width, no boxed container. ── */
@media (max-width:768px){
  /* Same scope-leak as the padding rule above: style.css's mobile block sets
     `section p{display:block!important}`, and .cine-eyebrow is a <p> inside a
     <section> — which flattened its flex row, collapsing the gap between the
     index number and the label and killing the hairline rule. */
  .cine-eyebrow{ display:flex!important; }

  .cine-pin{ display:block; height:auto; min-height:100vh; }
  .cine-video-col{ position:absolute; inset:0; height:100%; z-index:0; }

  /* Sized via inset:0 on .cine-panel (already position:relative), so it always
     spans exactly as far as that panel's content-driven height goes. */
  .cine-panel:not(.cine-panel--footer)::after{
    content:''; position:absolute; inset:0; z-index:1; pointer-events:none;
    background:linear-gradient(180deg,
      rgba(18,32,15,0) 0%,
      rgba(18,32,15,.32) 38%,
      rgba(18,32,15,.82) 68%,
      rgba(18,32,15,.95) 100%);
  }

  .cine-content-col{
    position:relative; z-index:2; height:auto; min-height:100vh; overflow:visible;
    display:flex; align-items:center;
    background:transparent; padding:96px 22px 64px;
  }
  .cine-inner{ max-width:none; }

  /* Text sits directly on the gradient now — the card is no longer a
     separately-boxed element floating over the video. */
  .cine-card{
    width:100%; background:transparent; border:none; border-radius:0;
    box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none;
    padding:0;
  }

  .cine-pillars, .cine-cats, .cine-quotes{ grid-template-columns:1fr; }
  .cine-stats{ grid-template-columns:1fr 1fr; }
  .cine-panel--footer{ min-height:auto; padding:80px 0 56px; }

  /* Nav is transparent over the video until scrolled solid; the hamburger's
     default dark-green strokes (styled for a light background elsewhere on
     the site) need to read against the video, then revert once solid. */
  #nav:not(.solid) .ham span{ background:#fff; }
}
