/* ── promo-video.css ───────────────────────────────────
   Module: nf--promo-video
   Config-driven kinetic brand-film inside a fixed 16:9 canvas
   (1280×720), scaled with the container width via CSS transform.
   Scene types: intro · word · punch · montage · outro.
   ──────────────────────────────────────────────────────── */

/* responsive scaler — wrapper height is set in JS to canvas*scale.
   The scaler also caps the module width so the canvas doesn't grow past
   a sensible 16:9 ceiling. (Module-level palette vars are scoped here
   too so they cascade to every BEM child.) */
.nf--promo-video__scaler {
    --pv-bg: #141210;
    --pv-ink: #ffffff;
    --pv-accent: var(--orange);
    --pv-dim: rgba(255, 255, 255, 0.66);
    --pv-ink-dark: #1d1d1b;

    position: relative;
    width: 100%;
    max-width: 108rem;
    margin: 0 auto;
    overflow: hidden;
    background: var(--pv-bg);
    border-radius: 1.6rem;
}

.nf--promo-video__canvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    overflow: hidden;
    color: var(--pv-ink);
    background: var(--pv-bg);
}

/* ── Backdrop ─────────────────────────────────────────── */
.nf--promo-video__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.nf--promo-video__bg-bloom {
    position: absolute;
    inset: 0;
    background: radial-gradient(46% 52% at 80% 22%, rgba(255, 102, 0, 0.16) 0%, transparent 62%);
    animation: nf--pv-breathe 9s ease-in-out infinite alternate;
}

.nf--promo-video__bg-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(125% 115% at 50% 42%, transparent 52%, rgba(0, 0, 0, 0.55) 100%);
}

.nf--promo-video__bg-rule {
    position: absolute;
    left: 8%;
    top: 8%;
    width: 40px;
    height: 3px;
    background: var(--pv-accent);
    border-radius: 2px;
    opacity: 0.9;
}

@keyframes nf--pv-breathe {
    from { opacity: 0.7; transform: scale(1); }
    to   { opacity: 1;   transform: scale(1.08); }
}

/* ── Stage + scene root ───────────────────────────────── */
.nf--promo-video__stage {
    position: absolute;
    inset: 0;
}

.nf--promo-video__sceneroot {
    position: absolute;
    inset: 0;
}

.nf--promo-video__scene {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 9%;
}

/* ── Eyebrow / kicker (intro) ─────────────────────────── */
.nf--promo-video__kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--pv-accent);
    margin-bottom: 26px;
    opacity: 0;
    animation: nf--pv-fade 0.6s ease 0.05s forwards;
}

.nf--promo-video__kicker-bar {
    width: 26px;
    height: 2px;
    background: var(--pv-accent);
    display: inline-block;
}

/* ── Headline — kinetic word reveal ───────────────────── */
.nf--promo-video__headline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 0.28em;
    line-height: 1.04;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--pv-ink);
    margin: 0;
}

.nf--promo-video__headline.is-left {
    justify-content: flex-start;
}

.nf--promo-video__word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding: 0.06em 0.03em 0.16em;
    white-space: nowrap;
    position: relative;
}

.nf--promo-video__word > span {
    display: inline-block;
    position: relative;
    transform: translateY(116%);
    animation: nf--pv-rise 0.74s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.nf--promo-video__word.is-accent > span {
    color: var(--pv-accent);
}

.nf--promo-video__word.is-accent > span::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.06em;
    height: 0.085em;
    background: var(--pv-accent);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    animation: nf--pv-wipe 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

@keyframes nf--pv-rise { to { transform: translateY(0); } }
@keyframes nf--pv-wipe { to { transform: scaleX(1); } }
@keyframes nf--pv-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Sub-line ─────────────────────────────────────────── */
.nf--promo-video__sub {
    color: var(--pv-dim);
    font-weight: 400;
    line-height: 1.45;
    margin: 0;
    opacity: 0;
    transform: translateY(10px);
    animation: nf--pv-rise-soft 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

@keyframes nf--pv-rise-soft { to { opacity: 1; transform: translateY(0); } }

/* ── Punch scene — orange brand moment, dark text ────── */
.nf--promo-video__scene--punch {
    background: radial-gradient(120% 130% at 28% 18%, #ff8124 0%, #ff6600 52%, #ec5d00 100%);
    color: var(--pv-ink-dark);
}
.nf--promo-video__scene--punch .nf--promo-video__headline { color: var(--pv-ink-dark); }
.nf--promo-video__scene--punch .nf--promo-video__word.is-accent > span { color: #fff; }
.nf--promo-video__scene--punch .nf--promo-video__word.is-accent > span::after { background: #fff; }
.nf--promo-video__scene--punch .nf--promo-video__sub {
    color: rgba(29, 29, 27, 0.78);
    font-weight: 500;
    letter-spacing: 0.04em;
}
.nf--promo-video__scene--punch .nf--promo-video__kicker { color: rgba(29, 29, 27, 0.7); }
.nf--promo-video__scene--punch .nf--promo-video__kicker-bar { background: var(--pv-ink-dark); }

/* ── Word scene — left-aligned headline + sub ────────── */
.nf--promo-video__scene--word {
    align-items: flex-start;
    text-align: left;
    padding: 0 8%;
}

.nf--promo-video__scene--word .nf--promo-video__word-inner {
    max-width: 58%;
}

/* When a word scene has no card, allow more text width */
.nf--promo-video__scene--word.has-no-card .nf--promo-video__word-inner {
    max-width: 76%;
}

/* ── Floating card (word scenes) ──────────────────────
   Editorial frame with slim dark titlebar, absolutely positioned
   in the scene's bottom-right (or bottom-left).
   ──────────────────────────────────────────────────────── */
.nf--promo-video__card {
    position: absolute;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translateY(34px) scale(0.97);
    animation: nf--pv-card 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
    color: var(--pv-ink-dark);
}

@keyframes nf--pv-card { to { opacity: 1; transform: translateY(0) scale(1); } }

.nf--promo-video__card--br { right: 7%; bottom: 13%; }
.nf--promo-video__card--bl { left: 7%; bottom: 13%; }

.nf--promo-video__card-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    background: #201d1a;
}

.nf--promo-video__card-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--pv-accent);
    box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.16);
    flex: none;
}

.nf--promo-video__card-label {
    font-size: 12px;
    letter-spacing: 0.02em;
    color: #9aa1a8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.nf--promo-video__card-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: top center;
}

/* ── Montage strip ────────────────────────────────────── */
.nf--promo-video__scene--montage {
    justify-content: flex-start;
    padding-top: 13%;
}

.nf--promo-video__montage {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 1.6%;
    justify-content: center;
    align-items: flex-end;
    padding: 0 7%;
    height: 40%;
}

.nf--promo-video__mcard {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(64px);
    animation: nf--pv-mcard 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    color: var(--pv-ink-dark);
}

@keyframes nf--pv-mcard { to { opacity: 1; transform: translateY(0); } }

.nf--promo-video__mcard-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    background: #201d1a;
    flex: none;
}

.nf--promo-video__mcard-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--pv-accent);
    box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.16);
    flex: none;
}

.nf--promo-video__mcard-label {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.01em;
    color: #e8eaed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Image variant inside montage card */
.nf--promo-video__mcard-img {
    display: block;
    width: 100%;
    flex: 1;
    min-height: 0;
    object-fit: cover;
    object-position: top center;
}

/* Text fallback when no image is provided */
.nf--promo-video__mcard-text {
    flex: 1;
    min-height: 0;
    padding: 16px 14px;
    font-size: 13px;
    line-height: 1.4;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ── Outro scene ──────────────────────────────────────── */
.nf--promo-video__outro-meta {
    color: var(--pv-dim);
    letter-spacing: 0.05em;
    opacity: 0;
    animation: nf--pv-fade 0.6s ease 0.55s forwards;
    margin: 0;
}

.nf--promo-video__cta {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(12px);
    animation: nf--pv-rise-soft 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.72s forwards;
}

/* CTA buttons are <a> tags and the host site usually styles `a` (orange links,
   underline). Scope to the scaler ancestor + tag selector for enough specificity
   to win without resorting to !important. */
.nf--promo-video__scaler a.nf--promo-video__btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: 160ms;
    cursor: pointer;
}

.nf--promo-video__scaler a.nf--promo-video__btn-cta--primary {
    background: var(--pv-accent);
    color: #fff;
}

.nf--promo-video__scaler a.nf--promo-video__btn-cta--primary:hover { background: #e65a00; color: #fff; }

.nf--promo-video__scaler a.nf--promo-video__btn-cta--ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.nf--promo-video__scaler a.nf--promo-video__btn-cta--ghost:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* ── Progress segments ────────────────────────────────── */
.nf--promo-video__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 5px;
    padding: 16px;
    z-index: 8;
}

.nf--promo-video__prog-seg {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.24);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.nf--promo-video__prog-seg.is-done > i { width: 100%; }

.nf--promo-video__prog-seg.is-active > i {
    width: 0;
    animation-name: nf--pv-fill;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.nf--promo-video__prog-seg > i {
    display: block;
    height: 100%;
    width: 0;
    background: #ffffff;
}

@keyframes nf--pv-fill { to { width: 100%; } }

/* ── Pause / play control ─────────────────────────────── */
.nf--promo-video__ctrl {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 9;
    display: flex;
    gap: 8px;
}

.nf--promo-video__btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.32);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: 160ms;
}

.nf--promo-video__btn:hover {
    border-color: #fff;
    background: rgba(0, 0, 0, 0.5);
}

/* ── Reduced motion + locked-visible safety ──────────── */
@media (prefers-reduced-motion: reduce) {
    .nf--promo-video * { animation: none !important; }
    .nf--promo-video__word > span,
    .nf--promo-video__sub,
    .nf--promo-video__kicker,
    .nf--promo-video__card,
    .nf--promo-video__mcard,
    .nf--promo-video__outro-meta,
    .nf--promo-video__cta { opacity: 1 !important; transform: none !important; }
    .nf--promo-video__word.is-accent > span::after { transform: scaleX(1) !important; }
}

.nf--promo-video__sceneroot.is-locked .nf--promo-video__word > span,
.nf--promo-video__sceneroot.is-locked .nf--promo-video__sub,
.nf--promo-video__sceneroot.is-locked .nf--promo-video__kicker,
.nf--promo-video__sceneroot.is-locked .nf--promo-video__card,
.nf--promo-video__sceneroot.is-locked .nf--promo-video__mcard,
.nf--promo-video__sceneroot.is-locked .nf--promo-video__outro-meta,
.nf--promo-video__sceneroot.is-locked .nf--promo-video__cta {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.nf--promo-video__sceneroot.is-locked .nf--promo-video__word.is-accent > span::after {
    animation: none !important;
    transform: scaleX(1) !important;
}
