/* hero-reel — cinematic hero video + live typographic caption layer
 *
 * The mp4 carries picture only: no text is ever burned into the frame, because
 * burned-in Korean would be wrong for the other 15 locales and soft on hidpi.
 * Every word here is live DOM, so it stays vector-crisp and goes through the
 * normal data-i18n path.
 *
 * Token names are the ones both public/index.html and drumpath.css already
 * define (--accent-primary, --text-primary, --radius-xl, ...), so this file
 * themes itself to whichever page loads it.
 */

.reel {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    /* The same component sits in a 960px slot on the landing page and a 486px
       slot on DrumPath, so type is sized against the reel itself (cqw), never
       the viewport — 2.5vw would have been 36px inside a 486px box. */
    container-type: inline-size;
    border-radius: var(--radius-xl, 20px);
    overflow: hidden;
    background: #09090b;
    border: 1px solid var(--border-color, rgba(255, 255, 255, .06));
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, .03),
        0 32px 80px -16px rgba(0, 0, 0, .55),
        0 0 100px var(--accent-glow, rgba(249, 115, 22, .25));
    isolation: isolate;
}

.reel-v {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* the source is graded warm already; this only deepens the blacks so white
       type sits on top of it without a scrim slab */
    filter: saturate(1.04) contrast(1.03);
}

/* Vignette + bottom scrim. Two stacked gradients rather than one: the radial
   keeps the centre clean while the linear guarantees caption contrast. */
.reel-fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 78% 68% at 50% 42%, transparent 40%, rgba(9, 9, 11, .55) 100%),
        linear-gradient(180deg, rgba(9, 9, 11, .35) 0%, transparent 22%, transparent 46%, rgba(9, 9, 11, .82) 100%);
}

/* Very fine grain, so the AI-generated footage reads as film rather than as a
   clean render. Pure CSS — no image request. */
.reel-fx::after {
    content: '';
    position: absolute;
    inset: -50%;
    opacity: .05;
    background-image: repeating-conic-gradient(#fff 0% 25%, #000 0% 50%);
    background-size: 3px 3px;
    mix-blend-mode: overlay;
}

/* ---- caption block ------------------------------------------------- */
.reel-caps {
    position: absolute;
    left: clamp(20px, 4.2%, 44px);
    right: clamp(20px, 4.2%, 44px);
    bottom: clamp(18px, 6.5%, 46px);
    display: grid;               /* all cues stack in one cell; only one is lit */
    z-index: 2;
}

.reel-cap {
    grid-area: 1 / 1;
    margin: 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .5s cubic-bezier(.4, 0, .2, 1), transform .5s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
}

.reel-cap.is-on {
    opacity: 1;
    transform: none;
}

.reel-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px 5px 9px;
    margin-bottom: 12px;
    border-radius: 100px;                        /* the 100px pill is the house signature */
    background: var(--accent-soft, rgba(249, 115, 22, .1));
    border: 1px solid var(--accent-line, rgba(249, 115, 22, .2));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* JetBrains Mono has no Hangul; without Pretendard in the stack the Korean
       half of a kicker like "04 — 다음으로" drops to a monospace fallback and
       stops matching the rest of the reel. Latin/digits still get the mono. */
    font-family: 'JetBrains Mono', 'SF Mono', ui-monospace,
                 'Pretendard Variable', Pretendard, sans-serif;
    font-size: clamp(.54rem, 1.35cqw, .68rem);
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--accent-tertiary, #fdba74);
    white-space: nowrap;
}

.reel-kicker::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-primary, #f97316);
    box-shadow: 0 0 8px var(--accent-primary, #f97316);
}

.reel-line {
    display: block;
    /* Pretendard first: the Latin display faces this project loads (Plus Jakarta
       Sans / Outfit) carry no Hangul, so Korean would otherwise fall back to
       Malgun Gothic and undo the whole look. */
    font-family: 'Pretendard Variable', Pretendard, 'Plus Jakarta Sans', Outfit,
                 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: clamp(.98rem, 4.3cqw, 2.05rem);
    font-weight: 700;
    line-height: 1.33;
    letter-spacing: -.035em;
    color: #fff;
    text-wrap: balance;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .75), 0 1px 3px rgba(0, 0, 0, .5);
}

.reel-line em {
    font-style: normal;
    background: linear-gradient(135deg, var(--accent-secondary, #fb923c), var(--accent-tertiary, #fdba74));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---- chapter ticks --------------------------------------------------- */
.reel-ticks {
    position: absolute;
    left: clamp(20px, 4.2%, 44px);
    right: clamp(20px, 4.2%, 44px);
    bottom: 0;
    height: 2px;
    display: flex;
    gap: 5px;
    transform: translateY(-14px);
    z-index: 2;
}

.reel-tick {
    flex: 1;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .16);
    overflow: hidden;
}

.reel-tick i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-primary, #f97316), var(--accent-tertiary, #fdba74));
}

/* ---- play/pause toggle (also the affordance for reduced-motion users) ---- */
.reel-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 100px;
    border: 1px solid var(--border-hover, rgba(255, 255, 255, .12));
    background: rgba(9, 9, 11, .55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-secondary, #a1a1aa);
    cursor: pointer;
    transition: color .2s, border-color .2s, transform .2s;
}

.reel-toggle:hover { color: #fff; border-color: var(--border-strong, rgba(255, 255, 255, .18)); transform: translateY(-1px); }
.reel-toggle:focus-visible { outline: 2px solid var(--accent-primary, #f97316); outline-offset: 2px; }
.reel-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

/* Idle state stays quiet; it wakes on hover of the reel or on keyboard focus. */
.reel-toggle { opacity: 0; transition: opacity .25s, color .2s, border-color .2s, transform .2s; }
.reel:hover .reel-toggle,
.reel-toggle:focus-visible { opacity: 1; }
@media (hover: none) { .reel-toggle { opacity: 1; } }

/* ---- no-JS / reduced-motion fallbacks -------------------------------- */
/* Without JS nothing drives the cue timer, so the first line must already be
   readable. .js is set on <html> by an inline script on both pages. */
html:not(.js) .reel-cap:first-child { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .reel-cap { transition-duration: .01ms; }
    .reel-v { animation: none !important; }
}

/* Sizing is container-driven, so the only viewport rule left is the one that
   buys back vertical room on a phone. */
@container (max-width: 560px) {
    .reel-kicker { margin-bottom: 8px; padding: 4px 10px 4px 8px; letter-spacing: .12em; }
    .reel-ticks { transform: translateY(-10px); }
}
