/* DIGITHRONEX · home page, the storytelling layer: design C (on top of design B) and design D (on top of design A).
   The page reads as one film: thesis, problem, answer, proof, silence, turn, what we refuse, and an ending
   with the visitor in the credits. New pieces: caption beats (pinned scenes whose lines play with the scroll,
   each new line a hard cut), the claim beside the picture, the silence before the reel, the thread,
   the pitch we cut, the rushes line and the visitor's own credits. Self-contained, so it works over either
   design's stylesheets. Load after the page's own styles. */

/* ---------- Caption beats ---------- */
.beat { position: relative; }
.beat-track { position: relative; height: calc(100vh + var(--n, 1) * 75vh); }
.beat-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; isolation: isolate; }
.beat-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.beat-captions { position: relative; z-index: 2; display: grid; width: min(calc(100% - 2 * var(--margin)), 1240px); text-align: center; }
/* one caption at a time: lines share a cell and cut, never cross-fade */
.beat-line { grid-area: 1 / 1; display: grid; justify-items: center; align-content: center; gap: 18px; opacity: 0; }
.beat-line.is-on { opacity: 1; }
.beat-cue { color: rgba(241, 242, 244, .5); letter-spacing: .04em; white-space: nowrap; }
.studio .beat-cue { color: var(--s-text3); }
.beat-text { display: block; font-stretch: 75%; font-weight: 680; font-size: clamp(56px, 9.4vw, 172px); line-height: .92; letter-spacing: -.012em; color: #F1F2F4; text-wrap: balance; }
.beat-text .line { display: block; }
.beat-sub { max-width: 30em; font-size: clamp(17px, 1.4vw, 21px); line-height: 1.45; color: rgba(241, 242, 244, .84); }

/* The noise: our reels run fast and stay out of focus behind every caption */
.beat--noise .noise-wall .reel-wall { inset: -5%; filter: blur(var(--noise-blur, 14px)) saturate(1.25) brightness(.92); }
.beat-nd { position: absolute; inset: 0; background: radial-gradient(90% 75% at 50% 50%, rgba(11, 12, 14, .42), rgba(11, 12, 14, .86)); }
.beat-line--turn .beat-text { color: #fff; }
/* Design D has no film behind the page, so each caption scene carries its own footage, just as far out of focus.
   The blur and the grade are baked into the files (media/reels/bg), so the browser draws them as they are. */
.beat-film { position: absolute; inset: -5%; width: 110%; height: 110%; max-width: none; object-fit: cover; }

/* The claim: the huge line and the shot side by side, the picture right after the last letter, never over it */
.beat--claim .beat-stage { display: flex; align-items: center; justify-content: center; gap: clamp(32px, 3.4vw, 64px); padding-inline: var(--margin); }
.claim-captions { position: relative; z-index: 1; width: auto; flex: 0 1 auto; min-width: 0; text-align: left; pointer-events: none; }
.claim-captions .beat-line { justify-items: start; }
.claim-text { font-size: clamp(76px, min(15vw, 30vh), 280px); line-height: .86; white-space: nowrap; }
/* the shot sits in a thin edge of clear glass with the brand cut (drawn here too, for design D's older glass) */
.claim-bezel {
  position: relative; z-index: 2; flex: none; --bz: 7px; --c: var(--cut-l, 24px); will-change: transform;
  isolation: isolate; padding: var(--bz);
  background:
    linear-gradient(to top right, transparent calc(50% - .75px), rgba(255, 255, 255, .75) calc(50% - .75px), rgba(255, 255, 255, .75) calc(50% + .75px), transparent calc(50% + .75px)) right top / var(--c) var(--c) no-repeat,
    var(--glass-sheen), rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(14px) saturate(1.45) brightness(1.14); backdrop-filter: blur(14px) saturate(1.45) brightness(1.14);
  box-shadow: var(--glass-rim), var(--glass-disp), inset 0 0 18px rgba(1, 128, 255, .06);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%);
}
.claim-frame { position: relative; height: min(64vh, 680px); aspect-ratio: 9 / 16; overflow: hidden; background: #050607; clip-path: polygon(0 0, calc(100% - (var(--c) - var(--bz) * .6)) 0, 100% calc(var(--c) - var(--bz) * .6), 100% 100%, 0 100%); }
.claim-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.claim-note { position: absolute; right: var(--margin); bottom: 5vh; z-index: 3; color: rgba(241, 242, 244, .58); }
@media (max-width: 900px) {
  .beat--claim .beat-stage { flex-direction: column; align-items: flex-start; justify-content: center; gap: 28px; padding-bottom: 80px; }
  .claim-text { font-size: clamp(60px, 18vw, 120px); }
  .claim-frame { height: 42vh; }
  .claim-bezel { align-self: flex-end; }
  .claim-note { display: none; }
}

/* The thread: a lighter veil, so the property film behind the page shows through, out of focus like every caption */
.act.beat--thread { background: rgba(11, 12, 14, .42); }

/* ---------- What we cut from our pitch (studio, frosted) ---------- */
.pitch-stage { color: var(--s-text); }
.pitch { width: min(calc(100% - 2 * var(--margin)), 1140px); display: grid; gap: clamp(22px, 2.6vw, 40px); }
.pitch-title { font-size: clamp(32px, 4.2vw, 60px); }
.pitch-list { display: grid; gap: clamp(10px, 1.2vw, 18px); }
.pitch-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; }
.pitch-line { position: relative; font-stretch: 75%; font-weight: 680; font-size: clamp(44px, 6.4vw, 112px); line-height: 1; letter-spacing: -.012em; color: var(--s-text); transition: color calc(10 * var(--f)) var(--ease-focus); }
/* the cut mark from the draft in Case 00: a signal line corner to corner, drawn as you scroll */
.pitch-line::after {
  content: ""; position: absolute; left: -1.5%; right: -1.5%; top: 6%; bottom: 10%; pointer-events: none;
  background: linear-gradient(to bottom right, transparent calc(50% - 1.1px), var(--s-signal) calc(50% - 1.1px), var(--s-signal) calc(50% + 1.1px), transparent calc(50% + 1.1px));
  clip-path: inset(0 calc(100% - var(--p, 0) * 100%) 0 0);
}
.pitch-list li.is-cut .pitch-line { color: rgba(11, 12, 14, .3); }
.pitch-tag { color: var(--s-text3); }
.pitch-left { font-stretch: 112.5%; font-weight: 560; font-size: clamp(24px, 2.6vw, 40px); line-height: 1.15; letter-spacing: -.01em; max-width: 22em; opacity: 0; transform: translateY(14px); transition: opacity calc(16 * var(--f)) var(--ease-focus), transform calc(16 * var(--f)) var(--ease-focus); }
.pitch-left.is-on { opacity: 1; transform: none; }

/* ---------- From the rushes to the reel ---------- */
.rushes { margin-top: 22px; display: grid; gap: 8px; }
.rushes-bar { position: relative; height: 8px; }
.rushes-all { position: absolute; inset: 0; border: 1px dashed rgba(241, 242, 244, .32); }
.rushes-kept { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--kept, 1) * 100%); background: var(--brand-azure); transition: width calc(28 * var(--f)) var(--ease-ramp); }
.rushes-cap { color: var(--text3); }

/* ---------- You're in the credits ---------- */
.you-roll { margin-top: 22px; display: grid; gap: 4px; }
.you-roll div { display: grid; grid-template-columns: minmax(8em, auto) 1fr; gap: 18px; align-items: baseline; }
.you-roll dt { font-stretch: 125%; font-weight: 620; font-size: 11px; line-height: 1.3; letter-spacing: .09em; text-transform: uppercase; color: rgba(241, 242, 244, .56); text-align: right; }
.you-roll dd { margin: 0; font-size: 17px; line-height: 1.5; color: #F1F2F4; }
.you-me { font-size: clamp(72px, 6.4vw, 104px); line-height: 1.05; color: #fff; }
.you-quiet { margin-top: 8px; font-size: 15px; line-height: 1.5; color: rgba(241, 242, 244, .72); }
.credits-card .credits-lead { margin-top: 26px; }
@media (max-width: 900px) {
  .you-roll div { grid-template-columns: 1fr; gap: 0; }
  .you-roll dt { text-align: left; }
}

/* ---------- Sound for the director's cut (desktop bar) ---------- */
/* its own clear glass, so it holds up in either design's bar */
.topbar-sound {
  --c: 6px; position: relative; isolation: isolate; overflow: hidden; appearance: none; border: 0; border-radius: 0; cursor: pointer; color: inherit;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; font-family: var(--font-sans); font-stretch: 125%; font-weight: 620; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; line-height: 1;
  background: var(--sweep, none) 100% 0 / 280% 100% no-repeat, var(--glass-sheen), var(--btn-fill, rgba(255, 255, 255, .08));
  -webkit-backdrop-filter: blur(12px) saturate(1.4) brightness(1.1); backdrop-filter: blur(12px) saturate(1.4) brightness(1.1);
  box-shadow: var(--glass-rim), var(--glass-disp);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%);
}
.topbar-sound i { width: 12px; height: 10px; opacity: .45; background: linear-gradient(currentColor, currentColor) 0 100% / 2px 35% no-repeat, linear-gradient(currentColor, currentColor) 5px 100% / 2px 70% no-repeat, linear-gradient(currentColor, currentColor) 10px 100% / 2px 50% no-repeat; }
.topbar-sound[aria-pressed="true"] i { opacity: 1; color: var(--d-signal); }
.topbar[data-room="studio"] .topbar-sound { color: var(--s-text); --btn-fill: rgba(255, 255, 255, .5); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(11, 12, 14, .08); }
.topbar[data-room="studio"] .topbar-sound[aria-pressed="true"] i { color: var(--s-signal); }
@media (max-width: 900px) { .topbar-sound { display: none; } }

/* ---------- Silence before the reel: the glass waits while the film plays alone ---------- */
.reel.is-silent .prog-panel, .reel.is-silent .reel-tab, .reel.is-silent .reel-play { visibility: hidden; }

/* ---------- Reduced motion: the story is all there at rest ---------- */
.beats-static .beat-track { height: auto; }
.beats-static .beat-stage { position: relative; height: auto; min-height: 0; padding-block: clamp(96px, 14vw, 200px); }
.beats-static .beat-captions { gap: 40px; }
.beats-static .beat-line { grid-area: auto; opacity: 1; }
.beats-static.beat--claim .beat-stage { flex-wrap: wrap; justify-content: flex-start; }
.beats-static .pitch-left { opacity: 1; transform: none; }
