/*
 * Triple e Digital — Branding & Design Service Page
 * branding-hero.css — this page's hero only, loads AFTER branding.css
 *
 * DEPLOY:
 * 1. Upload to /templates/wavo/css/branding-hero.css
 * 2. Load from the first Custom HTML addon on the page (the STYLES row in
 *    that page's sections file), in this order:
 *      <link rel="stylesheet" href="/templates/wavo/css/branding.css">
 *      <link rel="stylesheet" href="/templates/wavo/css/branding-hero.css">
 * 3. Menu item → Page Display → Page Class: te-branding-page
 *
 * The hero: two headlines swap through masks while one looping video plays
 * behind the yellow page. Two windows cut into the yellow show different parts
 * of that same video. The windows move with the text swap, merge into a
 * widescreen band, then open up to fill the screen.
 *
 * Section height sets the total scroll. 530vh includes two holds: one on the
 * finished headline (so the last line can be read) and one on the full-screen
 * video before the Hook section scrolls up. If you change the height, the
 * timeline numbers in branding-hero.js need to be recalculated to match.
 *
 * --te-header-h is set by branding.js to the real height of the site menu,
 * so the hero starts just under the blue nav instead of behind it.
 */

.hero-section { height:530vh; position:relative; z-index:2; }
.hero-section *, .hero-section *::before, .hero-section *::after { box-sizing:border-box; margin:0; padding:0; }
.hero-inner { position:fixed; top:var(--te-header-h, 0px); left:0; right:0; bottom:0; overflow:hidden; background:var(--y); visibility:hidden; }

/* headline rows */
.klines { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; padding:0 48px; z-index:3; pointer-events:none; will-change:opacity; }
.krow { display:flex; }
.kmask { overflow:hidden; display:grid; grid-template-areas:'c'; flex-shrink:0; }
/* Size is capped by width (11vw) AND by height: four rows always fit in the
   space under the menu with about 70px of breathing room above and below. */
.ktext { grid-area:c; font-family:'Bayon',sans-serif; font-size:clamp(40px, min(11vw, calc((100vh - var(--te-header-h, 0px) - 140px) / 4)), 190px); line-height:1.0; color:var(--k); white-space:nowrap; will-change:transform; display:block; }
.ks { transform:translateY(0%); }
.kr { transform:translateY(105%); }

/* the one video, full screen behind the yellow.
   JS clips it to the window shapes every frame, so only those parts show. */
.kvideo {
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; background:var(--k);
  z-index:2; pointer-events:none;
  clip-path:inset(50% 50% 50% 50%);   /* nothing shows until JS places the windows */
}
/* once the video takes over the screen it sits above the text */
.hero-inner.is-full .kvideo { z-index:8; }

.scroll-hint { position:absolute; bottom:28px; left:48px; z-index:5; font-size:10px; letter-spacing:3px; text-transform:uppercase; color:rgba(0,0,0,.3); display:flex; align-items:center; gap:10px; transition:opacity .3s; }
.scroll-hint-line { width:36px; height:1px; background:rgba(0,0,0,.2); }

@media (max-width:768px){
  .ktext { font-size:clamp(44px,14vw,130px); }
  .klines { padding:0 24px; }
}
@media (max-width:480px){
  .ktext { font-size:clamp(44px,16vw,80px); }
}

/* Reduced motion: release the fixed hero so it doesn't sit over the page,
   show the finished headline, and leave the video paused on its poster. */
@media (prefers-reduced-motion:reduce){
  .ktext { transition:none; }
  .hero-section { height:auto !important; min-height:100vh; }
  .hero-inner { visibility:visible !important; position:relative !important; top:auto; left:auto; right:auto; bottom:auto; height:100vh; }
}
