/* Abertura cinematográfica Narita → Porto Alegre
   O HUD é independente do mapa e usa apenas transform/opacity por quadro. */
:root {
    --iv-cyan: #5ad5ff;
    --iv-mint: #77f2cf;
    --iv-ink: #020711;
    --iv-paper: #f4fbff;
    --iv-muted: rgba(222, 239, 248, .68);
}

.iv-hud,
.iv-hud * { box-sizing: border-box; }

.iv-hud {
    --iv-progress: 0;
    --iv-cut: 0;
    position: fixed;
    inset: 0;
    z-index: 90000;
    pointer-events: none;
    overflow: hidden;
    color: var(--iv-paper);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    opacity: 1;
    transition: opacity .48s ease;
}

.iv-shot-cut {
    position: absolute;
    z-index: 3;
    inset: 0;
    opacity: var(--iv-cut);
    background:
        radial-gradient(circle at 50% 44%, rgba(13, 38, 55, .96), rgba(1, 5, 11, .995) 68%),
        #01050b;
    pointer-events: none;
    will-change: opacity;
}

.iv-hud::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(2, 7, 17, .80) 0, transparent 25%, transparent 61%, rgba(2, 7, 17, .91) 100%),
        linear-gradient(90deg, rgba(2, 7, 17, .52), transparent 34%, transparent 70%, rgba(2, 7, 17, .18));
}

.iv-hud::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .12;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}

.iv-hud.is-preparing::before {
    background:
        radial-gradient(circle at 18% 38%, rgba(17, 70, 96, .24), transparent 34%),
        linear-gradient(135deg, #020711 0%, #06111d 55%, #020711 100%);
}

.iv-hud.is-loading,
.iv-hud.is-leaving { opacity: 0; }

.iv-hud.is-preparing .iv-route,
.iv-hud.is-preparing .iv-arrival { opacity: 0; }
.iv-hud.is-preparing .iv-kicker::after {
    content: '';
    display: block;
    width: 128px;
    height: 2px;
    margin-top: 12px;
    transform-origin: left center;
    background: linear-gradient(90deg, var(--iv-cyan), var(--iv-mint));
    box-shadow: 0 0 12px rgba(90, 213, 255, .55);
    animation: ivPreparing 1.6s ease-in-out infinite;
}
@keyframes ivPreparing {
    0%, 100% { opacity: .32; transform: scaleX(.20); }
    50% { opacity: 1; transform: scaleX(1); }
}

.iv-cinema-bars::before,
.iv-cinema-bars::after {
    content: '';
    position: absolute;
    z-index: 4;
    left: 0;
    right: 0;
    height: clamp(10px, 2.1vh, 24px);
    background: #01040a;
}
.iv-cinema-bars::before { top: 0; }
.iv-cinema-bars::after { bottom: 0; }

.iv-top {
    position: absolute;
    z-index: 8;
    top: max(34px, calc(env(safe-area-inset-top, 0px) + 28px));
    left: clamp(20px, 4vw, 64px);
    right: clamp(20px, 4vw, 64px);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.iv-brand { display: flex; align-items: center; gap: 13px; }
.iv-brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(90, 213, 255, .46);
    border-radius: 10px;
    background: rgba(3, 14, 27, .70);
    box-shadow: 0 0 26px rgba(56, 189, 248, .19), inset 0 0 18px rgba(56, 189, 248, .08);
    color: var(--iv-cyan);
    font: 800 11px/1 'Space Grotesk', sans-serif;
    letter-spacing: -.02em;
}
.iv-brand > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.iv-brand b {
    font: 700 12px/1.2 'Space Grotesk', sans-serif;
    letter-spacing: .18em;
}
.iv-brand small {
    color: var(--iv-muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .16em;
}

.iv-skip {
    min-width: 92px;
    min-height: 46px;
    padding: 0 17px;
    pointer-events: auto;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    background: rgba(2, 9, 18, .66);
    color: rgba(245, 251, 255, .86);
    font: 700 10px/1 'Space Grotesk', sans-serif;
    letter-spacing: .16em;
    backdrop-filter: blur(14px);
    transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.iv-skip span { color: var(--iv-cyan); margin-left: 5px; }
.iv-skip:hover,
.iv-skip:focus-visible {
    color: #fff;
    border-color: var(--iv-cyan);
    background: rgba(5, 22, 38, .88);
    outline: 2px solid rgba(90, 213, 255, .28);
    outline-offset: 3px;
    transform: translateY(-1px);
}

.iv-origin {
    position: absolute;
    z-index: 7;
    left: clamp(20px, 5.5vw, 88px);
    top: 32%;
    display: flex;
    flex-direction: column;
    padding-left: 18px;
    border-left: 2px solid var(--iv-cyan);
    text-shadow: 0 2px 20px rgba(0, 0, 0, .92);
    opacity: 1;
    transform: translateX(0);
    transition: opacity .5s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
}
.iv-kicker {
    color: var(--iv-cyan);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .24em;
    margin-bottom: 8px;
}
.iv-origin strong {
    font: 600 clamp(25px, 3.2vw, 48px)/.98 'Space Grotesk', sans-serif;
    letter-spacing: -.035em;
}
.iv-place { margin-top: 9px; color: var(--iv-muted); font-size: 12px; letter-spacing: .08em; }
.iv-hud[data-phase='flight'] .iv-origin,
.iv-hud[data-phase='arrival'] .iv-origin { opacity: 0; transform: translateX(-28px); }

.iv-flight-status {
    position: absolute;
    z-index: 8;
    left: clamp(20px, 4vw, 64px);
    bottom: max(105px, calc(env(safe-area-inset-bottom, 0px) + 96px));
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(420px, calc(100vw - 40px));
    color: rgba(242, 250, 255, .84);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.iv-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--iv-mint);
    box-shadow: 0 0 12px rgba(119, 242, 207, .9);
}
.iv-status-sep { flex: 1; height: 1px; background: rgba(255, 255, 255, .18); }
.iv-distance,
.iv-time { font-variant-numeric: tabular-nums; }
.iv-time { color: var(--iv-cyan); min-width: 23px; text-align: right; }

.iv-route {
    position: absolute;
    z-index: 8;
    left: clamp(20px, 4vw, 64px);
    right: clamp(20px, 4vw, 64px);
    bottom: max(43px, calc(env(safe-area-inset-bottom, 0px) + 34px));
    display: grid;
    grid-template-columns: auto minmax(80px, 1fr) auto;
    align-items: end;
    gap: 16px;
}
.iv-route-city { display: flex; flex-direction: column; }
.iv-route-city--dest { text-align: right; }
.iv-route-city small { color: var(--iv-cyan); font: 800 9px/1 'Space Grotesk', sans-serif; letter-spacing: .20em; }
.iv-route-city strong { margin-top: 4px; font: 700 11px/1 'Space Grotesk', sans-serif; letter-spacing: .13em; }
.iv-route-line { position: relative; height: 22px; border-bottom: 1px solid rgba(255, 255, 255, .22); }
.iv-route-line i {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: calc(var(--iv-progress) * 100%);
    height: 2px;
    background: linear-gradient(90deg, var(--iv-cyan), var(--iv-mint));
    box-shadow: 0 0 12px rgba(90, 213, 255, .55);
}
.iv-plane {
    position: absolute;
    left: calc(var(--iv-progress) * 100%);
    bottom: -8px;
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    color: #dff8ff;
    filter: drop-shadow(0 0 7px rgba(90, 213, 255, .95));
    transform: translateX(-50%) rotate(90deg);
}
.iv-plane svg { width: 18px; height: 18px; fill: currentColor; }

.iv-arrival {
    position: absolute;
    z-index: 9;
    top: 50%;
    right: clamp(20px, 5vw, 80px);
    display: grid;
    grid-template-columns: 1.4fr repeat(3, minmax(112px, 1fr));
    width: min(760px, calc(100vw - 40px));
    border: 1px solid rgba(90, 213, 255, .28);
    border-radius: 18px;
    background: rgba(2, 10, 21, .86);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .56), inset 0 1px rgba(255, 255, 255, .06);
    backdrop-filter: blur(20px) saturate(145%);
    opacity: 0;
    transform: translate(30px, -42%) scale(.96);
    transition: opacity .6s ease, transform .7s cubic-bezier(.16, 1, .3, 1);
}
.iv-hud.is-arriving .iv-arrival { opacity: 1; transform: translate(0, -50%) scale(1); }
.iv-arrival > div { min-width: 0; padding: 20px 22px; }
.iv-arrival > div + div { border-left: 1px solid rgba(255, 255, 255, .10); }
.iv-arrival-head { display: flex; flex-direction: column; justify-content: center; }
.iv-arrival-head span { color: var(--iv-mint); font-size: 8px; font-weight: 800; letter-spacing: .20em; }
.iv-arrival-head strong { margin-top: 6px; font: 650 23px/1 'Space Grotesk', sans-serif; letter-spacing: -.025em; }
.iv-arrival-head small { margin-top: 7px; color: var(--iv-muted); font-size: 9px; }
.iv-stat { display: flex; flex-direction: column; justify-content: center; }
.iv-stat b {
    color: var(--iv-cyan);
    font: 650 clamp(23px, 2.4vw, 36px)/1 'Space Grotesk', sans-serif;
    letter-spacing: -.04em;
    font-variant-numeric: tabular-nums;
}
.iv-stat span { margin-top: 8px; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.iv-stat small { margin-top: 4px; color: var(--iv-muted); font-size: 8px; }
.iv-hud.is-landed .iv-arrival { border-color: rgba(119, 242, 207, .52); }
.iv-hud.is-holding .iv-arrival {
    box-shadow: 0 30px 90px rgba(0, 0, 0, .66), 0 0 44px rgba(90, 213, 255, .10), inset 0 1px rgba(255, 255, 255, .06);
}

@media (max-width: 760px) {
    .iv-brand small { display: none; }
    .iv-brand-mark { width: 38px; height: 38px; }
    .iv-top { top: max(28px, calc(env(safe-area-inset-top, 0px) + 22px)); }
    .iv-origin { top: 24%; }
    .iv-origin strong { font-size: clamp(24px, 8vw, 36px); max-width: 290px; }
    .iv-flight-status {
        bottom: max(101px, calc(env(safe-area-inset-bottom, 0px) + 92px));
        min-width: 0;
        width: calc(100vw - 40px);
        font-size: 8px;
        gap: 7px;
    }
    .iv-distance { display: none; }
    .iv-route { gap: 9px; }
    .iv-route-city strong { font-size: 9px; letter-spacing: .07em; }
    .iv-arrival {
        top: auto;
        right: 20px;
        bottom: max(145px, calc(env(safe-area-inset-bottom, 0px) + 136px));
        grid-template-columns: repeat(3, 1fr);
        width: calc(100vw - 40px);
        transform: translateY(24px) scale(.97);
    }
    .iv-hud.is-arriving .iv-arrival { transform: translateY(0) scale(1); }
    .iv-arrival-head { grid-column: 1 / -1; border-bottom: 1px solid rgba(255, 255, 255, .10); }
    .iv-arrival > div { padding: 13px 12px; }
    .iv-arrival > div:nth-child(2) { border-left: 0; }
    .iv-arrival-head strong { font-size: 19px; }
    .iv-arrival-head small { display: none; }
    .iv-stat b { font-size: clamp(20px, 7vw, 30px); }
    .iv-stat span { font-size: 7px; letter-spacing: .07em; }
    .iv-stat small { display: none; }
}

@media (max-height: 620px) and (orientation: landscape) {
    .iv-origin { top: 28%; }
    .iv-arrival { top: 49%; transform: translate(20px, -50%) scale(.94); }
    .iv-hud.is-arriving .iv-arrival { transform: translate(0, -50%) scale(1); }
    .iv-flight-status { bottom: 82px; }
    .iv-route { bottom: 29px; }
    .iv-arrival > div { padding-block: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .iv-hud,
    .iv-origin,
    .iv-arrival,
    .iv-skip { transition-duration: .01ms !important; }
    .iv-hud::after { display: none; }
    .iv-hud.is-preparing .iv-kicker::after { animation: none; transform: scaleX(1); }
}
