/* Wrap reveal: a pinned stage scrubbed by scroll, then one red wrap escapes and weaves down the page. */
#reveal { --rv-red: #c8102e; --rv-ink: #f2f2f2; --rv-muted: #b8b8b8; --rv-night: #050505;
  --rv-display: "Oswald", "Bebas Neue", Impact, "Arial Narrow", sans-serif; --rv-body: Inter, Arial, system-ui, sans-serif;
  position: relative; height: 320vh; height: 320dvh; color: var(--rv-ink); }
#reveal .stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--rv-night) center / cover no-repeat; }
#reveal .stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#reveal .stage::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(5,5,5,.6), rgba(5,5,5,0) 32%, rgba(5,5,5,0) 70%, rgba(5,5,5,.85)); }
/* the site's sticky header covers the top 74-88px, so the lines start below it */
#reveal .lines { position: absolute; z-index: 2; left: 0; right: 0; top: calc(92px + 3vh); margin: 0; padding: 0 20px;
  list-style: none; text-align: center; display: grid; gap: 4px; transform-origin: 50% 0; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
#reveal .lines li { font-family: var(--rv-display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  font-size: clamp(24px, 7.2vw, 72px); line-height: 1.06; text-shadow: 0 2px 24px rgba(0,0,0,.75);
  opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
@media (min-width: 760px) { #reveal .lines li { font-size: clamp(34px, 5vw, 72px); } }
#reveal .lines li.on { opacity: 1; transform: none; }
/* once the camera pulls back, the lines lift and shrink to clear Josh's face */
#reveal .lines.lift { transform: translateY(-4vh) scale(.7); }
#reveal .meter { position: absolute; z-index: 2; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; font: 600 11px/1.5 var(--rv-body); letter-spacing: .16em; text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0,0,0,.8); white-space: nowrap; transition: opacity .4s; }
#reveal .meter .track { width: 80px; height: 2px; background: rgba(242,242,242,.25); position: relative; overflow: hidden; }
#reveal .meter .fill { position: absolute; inset: 0; background: var(--rv-red); transform-origin: left; transform: scaleX(0); }
@media (max-width: 380px) { #reveal .meter { font-size: 10px; letter-spacing: .12em; } #reveal .meter .track { display: none; } }
#reveal .loading { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; color: var(--rv-muted);
  font: 600 12px var(--rv-body); letter-spacing: .25em; text-transform: uppercase; transition: opacity .6s; pointer-events: none; }

/* ribbon layers: back (1) / page content (2) / front (3); the header stays above all of them */
.ribbon { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#ribbon-back { z-index: 1; }
#ribbon-front { z-index: 3; }
main { position: relative; z-index: 2; }
/* sections let the ribbon show when it passes behind them (their old fills matched the page colour anyway) */
#home, .motion, .motivation { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  #reveal { height: auto; }
  #reveal .stage { position: relative; }
  #reveal .lines li { opacity: 1; transform: none; transition: none; }
  #reveal .meter { display: none; }
}

/* hero: blurred glow of the vertical clip fills the frame's sides on wide screens */
.hero > .hero-ambient { position: absolute; z-index: 0; pointer-events: none; filter: blur(28px) saturate(1.25) brightness(.62);
  transform: scale(1.04); border-radius: 2px; }
@media (min-width: 701px) { .hero > video, .hero > .cover-photo { background: transparent; } }

/* scroll cue: big and impossible to miss until the visitor starts scrolling */
#reveal .cue { position: absolute; z-index: 3; left: 50%; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 14px 24px 14px 18px; border: 1px solid rgba(200,16,46,.85); border-radius: 999px;
  background: rgba(10,10,10,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 0 0 rgba(200,16,46,.55), 0 10px 40px rgba(0,0,0,.5); animation: cue-pulse 2.2s ease-out infinite;
  transition: opacity .5s ease, transform .5s ease; white-space: nowrap; }
#reveal .cue.gone { opacity: 0; transform: translateX(-50%) translateY(12px); pointer-events: none; }
#reveal .cue-text { display: grid; gap: 2px; text-align: left; }
#reveal .cue-text b { font: 700 clamp(17px, 4.6vw, 22px)/1.1 var(--rv-display); letter-spacing: .08em; text-transform: uppercase; color: var(--rv-ink); }
#reveal .cue-text small { font: 600 11px/1.3 var(--rv-body); letter-spacing: .18em; text-transform: uppercase; color: var(--rv-muted); }
#reveal .cue-touch { display: none; }
@media (hover: none) and (pointer: coarse) { #reveal .cue-desk { display: none; } #reveal .cue-touch { display: inline; } }
/* a mouse outline with a scrolling wheel dot */
#reveal .cue-icon { position: relative; width: 24px; height: 38px; border: 2px solid var(--rv-ink); border-radius: 14px; flex: none; }
#reveal .cue-icon i { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--rv-red);
  animation: cue-wheel 1.6s ease-in-out infinite; }
@media (hover: none) and (pointer: coarse) {
  #reveal .cue-icon { width: 22px; height: 34px; border-radius: 11px; }
}
@keyframes cue-wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }
@keyframes cue-pulse { 0% { box-shadow: 0 0 0 0 rgba(200,16,46,.55), 0 10px 40px rgba(0,0,0,.5); } 70% { box-shadow: 0 0 0 18px rgba(200,16,46,0), 0 10px 40px rgba(0,0,0,.5); } 100% { box-shadow: 0 0 0 0 rgba(200,16,46,0), 0 10px 40px rgba(0,0,0,.5); } }
@media (prefers-reduced-motion: reduce) { #reveal .cue { display: none; } }

/* loading: a thin red bar instead of a word over Josh's fists */
#reveal .loading { place-items: end center; }
#reveal .loading span { display: block; width: 120px; height: 2px; margin-bottom: 30vh; background: linear-gradient(90deg, transparent, var(--rv-red), transparent);
  background-size: 200% 100%; animation: rv-load 1.1s linear infinite; }
@keyframes rv-load { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* the scroll cue waits for the countdown */
#reveal .cue:not(.ready) { opacity: 0; transform: translateX(-50%) translateY(12px); pointer-events: none; }
#reveal .cue.ready:not(.gone) { animation: cue-pulse 2.2s ease-out infinite, cue-in .6s cubic-bezier(.2,.8,.2,1.2) both; }
@keyframes cue-in { from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(.9); } to { opacity: 1; transform: translateX(-50%); } }

/* 3, 2, 1 countdown: a bright number inside a glowing red ring */
#reveal .count { position: absolute; z-index: 4; left: 50%; top: 52%; width: 150px; height: 150px; margin: -75px 0 0 -75px;
  display: grid; place-items: center; pointer-events: none; opacity: 0; }
#reveal .count .ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--rv-red);
  box-shadow: 0 0 24px 4px rgba(200,16,46,.85), inset 0 0 24px 2px rgba(200,16,46,.6); background: radial-gradient(circle, rgba(10,10,10,.55) 55%, rgba(10,10,10,.15) 72%); }
#reveal .count b { font: 700 86px/1 var(--rv-display); color: #fff; text-shadow: 0 0 18px rgba(255,90,60,.95), 0 0 42px rgba(200,16,46,.9); }
#reveal .count small { position: absolute; bottom: -34px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 600 12px/1 var(--rv-body); letter-spacing: .3em; text-transform: uppercase; color: var(--rv-ink); text-shadow: 0 1px 8px #000; }
#reveal .count.show { animation: count-beat 1s ease-out both; }
#reveal .count.show .ring { animation: count-flash 1s ease-out both; }
@keyframes count-beat { 0% { opacity: 0; transform: scale(1.5); } 18% { opacity: 1; transform: scale(1); } 80% { opacity: 1; transform: scale(.96); } 100% { opacity: 0; transform: scale(.85); } }
@keyframes count-flash { 0% { box-shadow: 0 0 60px 22px rgba(255,60,40,1), inset 0 0 40px 6px rgba(255,80,60,.9); }
  100% { box-shadow: 0 0 18px 2px rgba(200,16,46,.6), inset 0 0 18px 2px rgba(200,16,46,.4); } }
/* the scene dims a touch while counting so the number pops */
#reveal .stage.counting video { filter: brightness(.7); transition: filter .4s; }
#reveal .stage video { transition: filter .6s; }
@media (max-width: 700px) { #reveal .count { width: 120px; height: 120px; margin: -60px 0 0 -60px; } #reveal .count b { font-size: 70px; } }
