/* Nova voice: the full-screen conversation dialog. Every length is a board length times --vu. */

@keyframes nova-voice-pop {
    from { opacity: 0; transform: translateY(calc(12 * var(--vu))) scale(.96); }
    to { opacity: 1; transform: none; }
}

.nova-voice {
    --vu: min(1px, 100vw / 1440, 100dvh / 900);
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: transparent;
    color: var(--au-text);
    font-family: var(--au-font);
}

.nova-voice::backdrop {
    background: transparent;
}

html[data-au-overlay="voice"] {
    overflow: hidden;
}

/* The close button and the controls take the pointer from 1.71 s after the start, as the copy's controls do (m > 0.9).
   The dialog's fade and the blocks' rise are Web Animations that nova-voice.js runs and reverses. */
.nova-voice:not([data-ready]) .nova-voice-ctrls,
.nova-voice:not([data-ready]) .nova-voice-close {
    pointer-events: none;
}

.nova-voice[data-phase="connect"] { --nova-voice-dot: #74748C; }
.nova-voice[data-phase="idle"] { --nova-voice-dot: #74748C; }
.nova-voice[data-phase="listen"] { --nova-voice-dot: #6FF0B4; }
.nova-voice[data-phase="hear"] { --nova-voice-dot: #74748C; }
.nova-voice[data-phase="think"] { --nova-voice-dot: #B9A6FF; }
.nova-voice[data-phase="speak"] { --nova-voice-dot: var(--au-lime); }

.nova-voice :focus-visible {
    outline: 2px solid var(--au-accent);
    outline-offset: 3px;
}

.nova-voice .nova-voice-sr {
    position: absolute;
    width: calc(1 * var(--vu));
    height: calc(1 * var(--vu));
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.nova-voice button {
    font-family: var(--au-font);
}

/* Top bar and close */
.nova-voice .nova-voice-bar {
    position: absolute;
    left: calc(56 * var(--vu));
    top: calc(36 * var(--vu));
    display: flex;
    align-items: center;
    gap: calc(12 * var(--vu));
    font-family: var(--au-mono);
    font-size: calc(11 * var(--vu));
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--au-muted);
}

.nova-voice .nova-voice-dot {
    width: calc(7 * var(--vu));
    height: calc(7 * var(--vu));
    border-radius: 50%;
    background: var(--nova-voice-dot);
    box-shadow: 0 0 calc(10 * var(--vu)) var(--nova-voice-dot);
    transition: background .5s ease;
}

.nova-voice .nova-voice-clock {
    color: var(--au-dim);
}

.nova-voice .nova-voice-close {
    position: absolute;
    right: calc(48 * var(--vu));
    top: calc(24 * var(--vu));
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(48 * var(--vu));
    height: calc(48 * var(--vu));
    padding: 0;
    border-radius: 50%;
    border: calc(1 * var(--vu)) solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.02);
    cursor: pointer;
}

.nova-voice .nova-voice-close svg {
    width: calc(13 * var(--vu));
    height: calc(13 * var(--vu));
}

/* Caption block: above Nova in the dive, 96 px down */
.nova-voice .nova-voice-stack {
    position: absolute;
    left: calc(160 * var(--vu));
    right: calc(160 * var(--vu));
    top: calc(96 * var(--vu));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(12 * var(--vu));
}

.nova-voice .nova-voice-status {
    display: flex;
    align-items: center;
    gap: calc(10 * var(--vu));
    font-family: var(--au-mono);
    font-size: calc(11 * var(--vu));
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--au-muted);
}

.nova-voice .nova-voice-sdot {
    width: calc(5 * var(--vu));
    height: calc(5 * var(--vu));
    border-radius: 50%;
    background: var(--nova-voice-dot);
}

.nova-voice .nova-voice-user {
    margin: 0;
    min-height: calc(24 * var(--vu));
    max-width: calc(720 * var(--vu));
    text-align: center;
    font-size: calc(17 * var(--vu));
    font-weight: 300;
    line-height: 1.5;
    overflow-wrap: anywhere;
    color: var(--au-dim);
}

.nova-voice .nova-voice-caption {
    margin: 0;
    min-height: calc(84 * var(--vu));
    max-width: calc(760 * var(--vu));
    text-wrap: balance;
    text-align: center;
    font-size: calc(30 * var(--vu));
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: -0.015em;
    color: var(--au-text);
}

.nova-voice .nova-voice-word {
    opacity: .14;
    transition: opacity .45s ease;
}

.nova-voice .nova-voice-word.nova-voice-lit {
    opacity: 1;
}

/* The api's switch. Until nova-voice.js writes its answer on <html>, each row that holds a talk control is invisible
   and keeps its box, so nothing around it moves; with the answer off every talk control takes no space at all. */
html:not([data-nova-talk-switch]) [data-talk-row] {
    visibility: hidden;
}

html[data-nova-talk-switch="off"] [data-nova-talk] {
    display: none;
}

/* Bundle card: a child of the controls block taken out of its flow, centred across the page, its bottom 48 frame px
   above the block's top (50 on a phone), so a taller card grows upward and the block's note and the keyboard lift
   carry it. The card takes the width its parts need and only the page caps it, as the copy draws it (its row spans the
   page and centres the card, no cap of its own). */
.nova-voice .nova-voice-card {
    position: absolute;
    bottom: calc(100% + 48 * var(--vu));
    left: 50%;
    translate: -50% 0;
    width: max-content;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: calc(14 * var(--vu));
    padding: calc(10 * var(--vu)) calc(10 * var(--vu)) calc(10 * var(--vu)) calc(12 * var(--vu));
    border-radius: calc(18 * var(--vu));
    border: calc(1 * var(--vu)) solid color-mix(in srgb, var(--au-accent) 38%, transparent);
    background: rgba(12,12,32,0.9);
    box-shadow: 0 calc(24 * var(--vu)) calc(60 * var(--vu)) rgba(0,0,0,0.5), 0 0 calc(40 * var(--vu)) color-mix(in srgb, var(--au-accent) 16%, transparent);
    transform-origin: center;
    animation: nova-voice-pop .4s cubic-bezier(.2,.8,.2,1) both;
}

.nova-voice .nova-voice-mark {
    position: relative;
    flex-shrink: 0;
    width: calc(44 * var(--vu));
    height: calc(44 * var(--vu));
    border-radius: calc(12 * var(--vu));
    background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--au-accent) 45%, transparent) 0%, #0B0B24 70%);
    border: calc(1 * var(--vu)) solid rgba(255,255,255,0.10);
    overflow: hidden;
}

.nova-voice .nova-voice-mark-ring {
    position: absolute;
    left: calc(6 * var(--vu));
    top: calc(16 * var(--vu));
    width: calc(32 * var(--vu));
    height: calc(12 * var(--vu));
    box-sizing: border-box;
    border-radius: 50%;
    border: calc(1 * var(--vu)) solid rgba(230,232,255,0.7);
}

.nova-voice .nova-voice-mark-core {
    position: absolute;
    left: calc(18 * var(--vu));
    top: calc(18 * var(--vu));
    width: calc(8 * var(--vu));
    height: calc(8 * var(--vu));
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 0 calc(10 * var(--vu)) #FFFFFF;
}

.nova-voice .nova-voice-card-text {
    display: flex;
    flex-direction: column;
    gap: calc(3 * var(--vu));
    padding-right: calc(8 * var(--vu));
    text-align: left;
}

.nova-voice .nova-voice-kicker {
    font-family: var(--au-mono);
    font-size: calc(10 * var(--vu));
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--au-accent);
}

.nova-voice .nova-voice-title {
    font-size: calc(16 * var(--vu));
    font-weight: 500;
    overflow-wrap: anywhere;
}

.nova-voice .nova-voice-open {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: calc(8 * var(--vu));
    height: calc(44 * var(--vu));
    padding: 0 calc(16 * var(--vu));
    border: none;
    border-radius: calc(12 * var(--vu));
    background: var(--au-lime);
    color: #0A0A1A;
    text-decoration: none;
    font-size: calc(14 * var(--vu));
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--au-3d-rest);
}

.nova-voice .nova-voice-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: calc(8 * var(--vu));
}

.nova-voice .nova-voice-reel {
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(8 * var(--vu));
    height: calc(42 * var(--vu));
    padding: 0 calc(16 * var(--vu));
    border: calc(1 * var(--vu)) solid var(--au-accent);
    border-radius: calc(12 * var(--vu));
    background: transparent;
    color: var(--au-accent);
    font-size: calc(14 * var(--vu));
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: transform .25s ease, filter .25s ease;
}

.nova-voice .nova-voice-reel:hover {
    transform: translateY(calc(-1 * var(--vu)));
    filter: brightness(1.07);
}

.nova-voice .nova-voice-open:hover {
    transform: translateY(calc(-1 * var(--vu)));
    filter: brightness(1.08);
}

/* Pressed: the canvas's pressed shadow, after the hover rule so it wins at the same weight; the 2 px move needs motion */
.nova-voice .nova-voice-open:active,
.nova-voice .nova-voice-send:active {
    box-shadow: var(--au-3d-press);
}

@media (prefers-reduced-motion: no-preference) {
    .nova-voice .nova-voice-open,
    .nova-voice .nova-voice-send {
        transition: var(--au-3d-transition);
    }

    .nova-voice .nova-voice-open:active,
    .nova-voice .nova-voice-send:active {
        transform: translateY(var(--au-3d-press-y));
    }
}

.nova-voice .nova-voice-open svg {
    width: calc(13 * var(--vu));
    height: calc(13 * var(--vu));
}

/* Controls column */
.nova-voice .nova-voice-ctrls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(30 * var(--vu) + var(--nova-voice-kb, calc(0 * var(--vu))));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(16 * var(--vu));
}

.nova-voice .nova-voice-chips {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--vu));
    opacity: .3;
    transition: opacity .4s ease;
}

.nova-voice:not([data-phase="listen"]) .nova-voice-chips {
    pointer-events: none;
}

.nova-voice[data-phase="listen"] .nova-voice-chips {
    opacity: 1;
}

.nova-voice .nova-voice-try {
    margin-right: calc(4 * var(--vu));
    font-family: var(--au-mono);
    font-size: calc(10 * var(--vu));
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--au-dim);
}

.nova-voice .nova-voice-chip {
    height: calc(38 * var(--vu));
    padding: 0 calc(15 * var(--vu));
    border-radius: calc(999 * var(--vu));
    border: calc(1 * var(--vu)) solid rgba(255,255,255,0.11);
    background: rgba(10,10,24,0.6);
    color: var(--au-muted);
    font-size: calc(13 * var(--vu));
    cursor: pointer;
}

.nova-voice .nova-voice-row {
    display: flex;
    align-items: center;
    gap: calc(12 * var(--vu));
}

.nova-voice .nova-voice-mic {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(54 * var(--vu));
    height: calc(54 * var(--vu));
    padding: 0;
    border-radius: 50%;
    border: calc(1 * var(--vu)) solid rgba(255,255,255,0.16);
    background: var(--nova-voice-mic-bg, rgba(255,255,255,0.03));
    box-shadow: none;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.nova-voice .nova-voice-mic[data-ring] {
    box-shadow: 0 0 0 var(--nova-voice-ring) rgba(124,131,255,0.14);
}

.nova-voice .nova-voice-mic[aria-pressed="true"] {
    background: rgba(255,77,109,0.14);
}

.nova-voice .nova-voice-mic svg {
    width: calc(19 * var(--vu));
    height: calc(19 * var(--vu));
}

.nova-voice .nova-voice-slash {
    opacity: 0;
}

.nova-voice .nova-voice-mic[aria-pressed="true"] .nova-voice-slash {
    opacity: 1;
}

.nova-voice .nova-voice-form {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--vu));
    height: calc(54 * var(--vu));
    box-sizing: border-box;
    padding: 0 calc(7 * var(--vu)) 0 calc(20 * var(--vu));
    border-radius: calc(999 * var(--vu));
    border: calc(1 * var(--vu)) solid rgba(255,255,255,0.12);
    background: rgba(10,10,28,0.7);
}

.nova-voice .nova-voice-input {
    width: calc(300 * var(--vu));
    height: calc(40 * var(--vu));
    padding: calc(1 * var(--vu)) calc(2 * var(--vu));
    border: none;
    background: transparent;
    color: var(--au-text);
    font-family: var(--au-font);
    font-size: calc(15 * var(--vu));
}

.nova-voice .nova-voice-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(40 * var(--vu));
    height: calc(40 * var(--vu));
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--au-lime);
    cursor: pointer;
    box-shadow: var(--au-3d-rest);
}

.nova-voice .nova-voice-send svg {
    width: calc(14 * var(--vu));
    height: calc(14 * var(--vu));
}

.nova-voice .nova-voice-end {
    display: flex;
    align-items: center;
    gap: calc(10 * var(--vu));
    height: calc(54 * var(--vu));
    padding: 0 calc(22 * var(--vu));
    border-radius: calc(999 * var(--vu));
    border: calc(1 * var(--vu)) solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.02);
    color: #C9CAE0;
    font-size: calc(15 * var(--vu));
    cursor: pointer;
}

.nova-voice .nova-voice-end-mark {
    width: calc(7 * var(--vu));
    height: calc(7 * var(--vu));
    border-radius: calc(2 * var(--vu));
    background: var(--au-live);
}

.nova-voice .nova-voice-note,
.nova-voice .nova-voice-privacy {
    font-size: calc(12 * var(--vu));
    color: var(--au-dim);
}

.nova-voice .nova-voice-notes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(4 * var(--vu));
}

/* Phone frame */
@media not all and (min-width: 900px) {
    .nova-voice {
        --vu: min(1px, 100vw / 390, 100dvh / 844);
    }

    .nova-voice .nova-voice-bar {
        left: calc(20 * var(--vu));
        top: calc(24 * var(--vu));
    }

    .nova-voice .nova-voice-close {
        right: calc(14 * var(--vu));
        top: calc(10 * var(--vu));
    }

    .nova-voice .nova-voice-stack {
        left: calc(20 * var(--vu));
        right: calc(20 * var(--vu));
        top: calc(72 * var(--vu));
    }

    .nova-voice .nova-voice-caption {
        max-width: calc(350 * var(--vu));
        font-size: calc(21 * var(--vu));
    }

    .nova-voice .nova-voice-card {
        bottom: calc(100% + 50 * var(--vu));
    }

    .nova-voice .nova-voice-actions {
        flex-direction: column;
    }

    .nova-voice .nova-voice-ctrls {
        bottom: calc(22 * var(--vu) + var(--nova-voice-kb, calc(0 * var(--vu))));
    }

    .nova-voice .nova-voice-chips {
        display: none;
    }

    .nova-voice .nova-voice-input {
        width: calc(128 * var(--vu));
    }

    .nova-voice .nova-voice-end {
        padding: 0 calc(16 * var(--vu));
    }

    .nova-voice .nova-voice-note,
    .nova-voice .nova-voice-privacy {
        padding: 0 calc(24 * var(--vu));
        text-align: center;
        font-size: calc(11 * var(--vu));
        line-height: 1.4;
    }
}

/* Touch screens: iOS zooms the page when a field under 16px takes focus, so the typed field is 16px there. */
@media (pointer: coarse) {
    .nova-voice .nova-voice-input {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nova-voice .nova-voice-card {
        animation: none;
    }

    .nova-voice .nova-voice-word {
        transition: none;
    }

    .nova-voice .nova-voice-mic[data-ring] {
        box-shadow: none;
    }

    /* A pressed pill sits still: the hover lift would float it over the collapsed lip */
    .nova-voice .nova-voice-open:active {
        transform: none;
    }
}

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

.nova-voice .nova-voice-send:focus-visible {
    outline-color: var(--au-ring-lime);
}
