/* The third screen: Nova's star, the coming-soon pill, the headline, the line, the email box, the Talk row, the Instagram link and the foot.
   The phone values are the base and the desktop values sit under (min-width: 900px). Nothing scales with
   the window width, except the frame unit --lu on .live, which the column and the foot are drawn in:
   calc(N * var(--lu)) is the board's N px at 390 by 844 and at 1440 by 900 and shrinks with a shorter
   window, as --hu in hero.css and --bu in builds.css do. A shared vertical inset keeps the
   figure and copy with the footer on tall screens, without wrapping the film's art anchor. */
.live {
    position: relative;
    overflow: hidden;
    height: 100dvh;
    --lu: min(1px, 100vw / 390, 100lvh / 844);
    --live-inset: max(0px, (100lvh - 844 * var(--lu)) / 2);
}

/* The star part: laid out at its size in frame units, never scaled, so the film measures the size it draws */
.live-star {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(72 * var(--lu));
    width: calc(280 * var(--lu));
    height: calc(280 * var(--lu));
    margin: 0 auto;
    margin-top: var(--live-inset);
    pointer-events: none;
}

.live-neb {
    position: absolute;
    border-radius: 50%;
}

.live-arc-back,
.live-arc-front {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    fill: none;
}

.live-arc-back {
    stroke: #9BA1FF;
    stroke-opacity: 0.28;
    stroke-width: 1.2;
    filter: drop-shadow(0 0 5px rgba(124, 131, 255, 0.7));
}

.live-arc-front {
    stroke: #9BA1FF;
    stroke-opacity: 0.8;
    stroke-width: 1.4;
    filter: drop-shadow(0 0 6px rgba(124, 131, 255, 0.85));
}

.live-dash {
    stroke: #FFFFFF;
    stroke-opacity: 0.95;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: .07 .93;
}

.live-art {
    position: absolute;
    inset: 0;
    -webkit-mask-image: radial-gradient(ellipse 52% 56% at 50% 46%, #000 70%, transparent 100%);
    mask-image: radial-gradient(ellipse 52% 56% at 50% 46%, #000 70%, transparent 100%);
}

.live-art img {
    display: block;
    width: 100%;
    height: 100%;
}

/* Nova's pixels (assets/nova-pixels.js): the board's 1000 px frame in screen blend over the bust, scaled with the star as
   one piece (280 frame units on a phone, 400 on desktop) */
.live-pixels {
    position: absolute;
    left: 0;
    top: 0;
    width: 1000px;
    height: 1000px;
    transform-origin: 0 0;
    transform: scale(tan(atan2(calc(280 * var(--lu)), 1000px)));
    mix-blend-mode: screen;
}

.live-column {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(390 * var(--lu));
    /* The board's top, unless the column would come within its gap of the footer: film.js then writes --live-lift, how far the
       column must rise, so its top is min(board top, footer top - gap - column height) */
    margin-top: calc(var(--live-inset) - var(--live-lift, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(10 * var(--lu));
    padding: 0 calc(22 * var(--lu));
    text-align: center;
}

/* film.js writes --live-gap when the column is too tall to stack up from the footer inside the window: the parts and the footer share
   what is left. The arrival wrapper takes the column's gap (film.css) unless it is written. */
.live-column .live-arrival {
    gap: var(--live-gap, inherit);
}

.live-heading {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
    max-width: 100%;
    gap: var(--live-gap, inherit);
}

/* The footer fit also reserves a real layout box for Nova. The particle
   renderer measures this same box, including after an email notice appears. */
.live[style*="--live-art-size"] .live-star {
    top: var(--live-art-top);
    width: var(--live-art-size);
    height: var(--live-art-size);
    margin-top: 0;
}

.live[style*="--live-art-size"] .live-pixels {
    transform: scale(tan(atan2(var(--live-art-size), 1000px)));
}

.live-art-beside .live-heading {
    padding-right: var(--live-art-room);
    min-height: calc(var(--live-art-size) + 8px);
}

.live-art-beside .live-star {
    left: var(--live-art-left);
    right: auto;
    margin-left: 0;
    margin-right: 0;
}

.live-pill {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--lu));
    height: calc(26 * var(--lu));
    padding: 0 calc(12 * var(--lu));
    border-radius: 999px;
    border: 1px solid rgba(255, 77, 109, 0.35);
    background: rgba(255, 77, 109, 0.08);
    font-family: var(--au-mono);
    font-size: calc(9 * var(--lu));
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #FFB3C1;
}

.live-pill-dot {
    width: calc(7 * var(--lu));
    height: calc(7 * var(--lu));
    border-radius: 50%;
    background: var(--au-live);
}

.live-title {
    margin: 0;
    font-size: calc(30 * var(--lu));
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -.045em;
}

.live-title .au-serif {
    font-size: 1.08em;
    color: var(--au-lime);
}

.live-line {
    margin: 0;
    max-width: min(100%, 340px);
    font-size: max(12px, calc(14 * var(--lu)));
    font-weight: 300;
    line-height: 1.5;
    color: var(--au-muted);
}

.live-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(8 * var(--lu));
    margin-top: calc(4 * var(--lu));
}

.live-talk {
    position: relative;
    display: flex;
    align-items: center;
    gap: calc(8 * var(--lu));
    height: calc(44 * var(--lu));
    box-sizing: border-box;
    padding: 0 calc(18 * var(--lu)) 0 calc(6 * var(--lu));
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--au-lime) 82%, #FFFFFF) 0%, var(--au-lime) 100%);
    color: #0A0A1A;
    font-family: var(--au-font);
    font-size: max(12px, calc(13 * var(--lu)));
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 12px 40px color-mix(in srgb, var(--au-lime) 30%, transparent), var(--au-3d-rest);
}

.live-talk-avatar {
    width: calc(32 * var(--lu));
    height: calc(32 * var(--lu));
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(10, 10, 26, 0.35);
}

/* The dot sits at the avatar's lower right: the avatar starts 6 px in and is 32 px square */
.live-talk-dot {
    position: absolute;
    left: calc(31 * var(--lu));
    bottom: calc(6 * var(--lu));
    width: calc(8 * var(--lu));
    height: calc(8 * var(--lu));
    border-radius: 50%;
    background: #6FF0B4;
    box-shadow: 0 0 0 2px var(--au-lime);
}

/* The email box (assets/live-email.js shows it). Existing type, colour and pill styles only; every control keeps a 44 px floor in px so
   it stays a tap box in a short window. The label, the box and its button, the two messages and the notice stack in one column. */
.live-email {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* As wide as its row, not the column: the label (flex-start) then sits over the box's left edge, inside the window */
    width: min(100%, 310px);
    margin-top: calc(4 * var(--lu));
}

.live-email[hidden] {
    display: none;
}

.live-email-label {
    align-self: flex-start;
    padding: 0 0 calc(6 * var(--lu)) 16px;
    font-family: var(--au-mono);
    font-size: max(10px, calc(10 * var(--lu)));
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--au-muted);
}

.live-email-row {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.live-email-row[hidden] {
    display: none;
}

.live-email-input {
    box-sizing: border-box;
    width: 100%;
    height: calc(44 * var(--lu));
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(10, 10, 24, 0.7);
    color: var(--au-text);
    font-family: var(--au-font);
    font-size: 16px;
    min-width: 0;
    flex: 1;
}

.live-email-input::placeholder {
    color: var(--au-dim);
}

.live-email-input[aria-invalid="true"] {
    border-color: rgba(255, 77, 109, 0.6);
}

/* The trap field for bots: clipped off screen, not display: none, so a bot still fills it and a reader never lands on it */
.live-email-hp {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.live-email-button {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: calc(44 * var(--lu));
    min-height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--au-lime) 82%, #FFFFFF) 0%, var(--au-lime) 100%);
    color: #0A0A1A;
    font-family: var(--au-font);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 calc(10 * var(--lu)) calc(30 * var(--lu)) color-mix(in srgb, var(--au-lime) 26%, transparent), var(--au-3d-rest);
    flex-shrink: 0;
}

.live-email-button:disabled {
    cursor: progress;
    filter: brightness(.9);
}

/* The two messages hold their place in the page from the start, empty, so a screen reader hears the words arrive; each takes
   room only while it has words */
.live-email-error,
.live-email-thanks {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
}

.live-email-error {
    color: #FFB3C1;
}

.live-email-thanks {
    color: var(--au-text);
    font-weight: 500;
}

.live-email-error:not(:empty),
.live-email-thanks:not(:empty) {
    margin-top: calc(10 * var(--lu));
}

.live-email-note {
    margin: calc(8 * var(--lu)) 0 0;
    font-size: max(11px, calc(12 * var(--lu)));
    font-weight: 300;
    line-height: 1.5;
    color: var(--au-muted);
    padding-bottom: max(0px, calc((44px - 1.5em) / 2));
}

.live-email-note a {
    text-decoration: underline;
    /* A tap box of at least 44 px tall: the padding of an inline link adds to its box and to where a press lands, not to the
       lines of the sentence, so the notice reads as it did. The link stays on one line, as one box: a link that wrapped
       would have its centre in the gap between its two pieces, and a press there would land on the paragraph. */
    padding: calc((44px - 1.2em) / 2) 0;
    white-space: nowrap;
}

/* Instagram: a quiet text link, last in the column (board :193). No pill, no fill, no shadow. */
.live-follow {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--lu));
    min-height: 44px;
    font-size: max(12px, calc(13 * var(--lu)));
    color: #B9BCD6;
}

/* A control of the column is never under 44 px on screen: a px floor, not frame units, so it stays a tap box in a short window */
.live-actions > .live-talk {
    min-height: 44px;
}

.live-foot {
    position: absolute;
    left: calc(22 * var(--lu));
    right: calc(22 * var(--lu));
    bottom: calc(20 * var(--lu) + 100lvh - 100dvh);
    margin-bottom: var(--live-inset);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 calc(18 * var(--lu));
    padding-top: calc(16 * var(--lu));
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-family: var(--au-mono);
    font-size: max(10px, calc(10 * var(--lu)));
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--au-dim);
}

.live-foot-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 calc(16 * var(--lu));
    flex-basis: 100%;
    order: -1;
}

/* Each link is a tap box of at least 44 by 44 px: the padding makes the box, the side margins give the side padding back so
   the row keeps its width, and the 1.2em line plus the padding is 44 px tall at any type size up to 36 px. A wrapped row sits
   directly under the one above, so no box covers another link's centre, and the row clears the © line below it. */
.live-foot-links a {
    box-sizing: border-box;
    min-width: 44px;
    padding: calc((44px - 1.2em) / 2) 8px;
    margin: 0 -8px;
    line-height: 1.2;
    text-align: center;
    color: var(--au-muted);
}

.live-foot-note {
    display: none;
}

@keyframes live-neb {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(var(--nx), var(--ny)) scale(1.12); }
}

@keyframes live-onair {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.55); }
    50% { box-shadow: 0 0 0 6px rgba(255, 77, 109, 0); }
}

@keyframes live-dash {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@media (min-width: 900px) {
    .live {
        --lu: min(1px, 100vw / 1440, 100lvh / 900);
        --live-inset: max(0px, (100lvh - 900 * var(--lu)) / 2);
    }

    .live-star {
        top: calc(88 * var(--lu));
        width: calc(400 * var(--lu));
        height: calc(400 * var(--lu));
    }

    .live-pixels {
        transform: scale(tan(atan2(calc(400 * var(--lu)), 1000px)));
    }

    .live-column {
        top: calc(500 * var(--lu));
        gap: calc(10 * var(--lu));
        padding: 0;
    }

    .live-title {
        font-size: calc(42 * var(--lu));
    }

    .live-actions {
        flex-direction: row;
        gap: calc(10 * var(--lu));
    }

    .live-email {
        width: calc(440 * var(--lu));
    }

    .live-email-row {
        flex-direction: row;
        align-items: flex-end;
        gap: 10px;
        width: 100%;
    }

    .live-email-input {
        width: calc(280 * var(--lu));
        height: calc(44 * var(--lu));
    }

    .live-email-button {
        height: calc(44 * var(--lu));
    }

    .live-line {
        max-width: calc(480 * var(--lu));
        font-size: max(12px, calc(15 * var(--lu)));
    }

    .live-foot {
        left: calc(96 * var(--lu));
        right: calc(96 * var(--lu));
        bottom: calc(44 * var(--lu) + 100lvh - 100dvh);
        flex-wrap: nowrap;
        justify-content: space-between;
        padding-top: calc(28 * var(--lu));
    }

    .live-foot-links {
        gap: calc(28 * var(--lu));
        flex-basis: auto;
        order: 0;
    }

    .live-foot-note {
        display: inline;
    }
}

/* A short, wide window (under 500 px tall, wider than 3 to 2: a phone held sideways): the stacked column is taller than the window,
   so the film would scale the screen down and the footer links would fall under 44 px. The box lays its input and button side by
   side, as on desktop, which takes the second stacked row (44 px floor and its gap) out of the column. The condition names no
   width, so the sheet's one width stop stays (min-width: 900px) (home-live-builds AC-030). */
@media (max-height: 500px) and (min-aspect-ratio: 3/2) {
    .live-email {
        width: auto;
    }

    .live-email-row {
        flex-direction: row;
        align-items: flex-end;
        gap: 12px;
        width: auto;
    }

    .live-email-input {
        width: max(260px, calc(330 * var(--lu)));
    }
}

@media (hover: hover) {
    .live-foot-links a:hover {
        color: #FFFFFF;
    }

    .live-talk:hover {
        filter: brightness(1.08);
    }

    /* the Instagram link's hover changes only its colour */
    .live-follow:hover {
        color: #FFFFFF;
    }

    .live-email-button:hover {
        filter: brightness(1.08);
    }
}

/* The lift moves, so it needs motion as well as a hover; the brightness above shows with reduce motion on */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .live-talk:hover,
    .live-email-button:hover {
        transform: translateY(-1px);
    }
}

/* Pressed: the canvas's pressed shadow, after the hover rules so it wins at the same weight; the 2 px move is in the motion block below */
.live-talk:active,
.live-email-button:active {
    box-shadow: var(--au-3d-press);
}

@media (prefers-reduced-motion: no-preference) {
    .live-art {
        animation: au-breathe 8s ease-in-out infinite alternate;
    }

    .live-neb {
        animation: live-neb ease-in-out infinite alternate;
    }

    .live-dash {
        animation: live-dash 7s linear infinite;
    }

    .live-pill-dot {
        animation: live-onair 1.6s ease-in-out infinite;
    }

    .live-talk,
    .live-email-button {
        transition: var(--au-3d-transition);
    }

    .live-talk:active,
    .live-email-button:active {
        transform: translateY(var(--au-3d-press-y));
    }

    .live-foot-links a {
        transition: color 0.2s ease;
    }
}

/* The film writes --film-p on this screen and the rules key on its style attribute, as builds.css does: with
   --film-p unset, or with reduce motion on, none of them applies and the screen shows at once. The star
   arrives over 1000 to 1720 px (--film-p 1.1111 to 1.9111). The copy arrives
   earlier, while the outgoing bundles still provide context. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
    [data-film] .live[style*="--film-p"] {
        --l-in: 1.1111;
        --l-out: 1.9111;
        --l-scale: .94;
        --l-blur: 10px;
        --l-rise: 24px;
        --l-rise-in: 1.1;
        --l-rise-out: 1.35;
        --l-p: clamp(0, (var(--film-p) - var(--l-in)) / (var(--l-out) - var(--l-in)), 1);
        --l-e: calc(var(--l-p) * var(--l-p) * (3 - 2 * var(--l-p)));
        --l-b0: clamp(0, (var(--l-e) - .55) / .45, 1);
        --l-b: calc(var(--l-b0) * var(--l-b0) * (3 - 2 * var(--l-b0)));
        --l-r0: clamp(0, (var(--film-p) - var(--l-rise-in)) / (var(--l-rise-out) - var(--l-rise-in)), 1);
        --l-v: calc(var(--l-r0) * var(--l-r0) * (3 - 2 * var(--l-r0)));
    }

    /* The figure arrives with b: its arcs and pixels come in with it, and the film writes no opacity of its own */
    .live[style*="--film-p"] .live-arc-back,
    .live[style*="--film-p"] .live-pixels,
    .live[style*="--film-p"] .live-arc-front {
        opacity: var(--l-b);
    }

    .live[style*="--film-p"] .live-art {
        opacity: var(--l-b);
        transform-origin: 50% 62%;
        scale: calc(var(--l-scale) + (1 - var(--l-scale)) * var(--l-b));
        filter: blur(calc((1 - var(--l-b)) * var(--l-blur)));
    }

    .live[style*="--film-p"] .live-column {
        opacity: var(--l-v);
        translate: 0 calc((1 - var(--l-v)) * var(--l-rise));
    }

    /* Copy can introduce Live early; controls appear once its screen owns
       input at 1.5H, so no visible button is still inert. */
    .live[style*="--film-p"] :is(.live-email, .live-actions, .live-follow, .live-foot) {
        --controls-in: clamp(0, (var(--film-p) - 1.5) / 0.08, 1);
        opacity: calc(var(--controls-in) * var(--controls-in) * (3 - 2 * var(--controls-in)));
    }

    .live[style*="--film-p"] :is(.live-email, .live-actions, .live-follow, .live-foot):focus-within {
        opacity: 1;
    }
}

/* film.js makes every screen but the current one inert, so the loops run only while the screen shows; the animations
   exist only under the no-preference gate above, so reduce motion still leaves none to run */
#live[inert] *,
#live[inert] *::before,
#live[inert] *::after {
    animation-play-state: paused;
}

/* Keyboard focus on a lime pill: the shared ring, in a colour that reads over the pill's lime glow */
.live-talk:focus-visible,
.live-email-button:focus-visible {
    outline-color: var(--au-ring-lime);
}
