:root {
    color-scheme: dark;
    --bg: #030303;
    --text: rgba(255,255,255,.96);
    --muted: rgba(255,255,255,.55);
    --line: rgba(255,255,255,.09);
    --panel: rgba(13,13,15,.78);
    --orange: #ff6900;
    --orange2: #ff9b3d;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    min-width: 320px;
    min-height: 100dvh;
    overflow-x: hidden;

    background:
        radial-gradient(
            circle at 50% 18%,
            rgba(255,94,0,.12),
            transparent 29rem
        ),
        #030303;

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: default;
    opacity: .45;
}

.home {
    width: min(100%, 1080px);
    min-height: 100dvh;
    margin: 0 auto;

    padding:
        22px
        clamp(15px,4vw,42px)
        calc(
            22px
            + env(
                safe-area-inset-bottom,
                0px
            )
        );

    display: grid;

    grid-template-rows:
        auto
        minmax(0,1fr)
        auto;

    gap: 18px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;

    font-size: 14px;
    font-weight: 700;
}

.brand-dot {
    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: var(--orange);

    box-shadow:
        0 0 16px
        rgba(255,91,0,.9);
}

.badge {
    padding: 7px 10px;

    border: 1px solid var(--line);
    border-radius: 999px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .07em;
    text-transform: uppercase;
}

.stage {
    min-height: 0;

    display: grid;
    align-content: center;
    justify-items: center;

    gap: 16px;
}

.orb-wrap {
    position: relative;

    width:
        clamp(
            112px,
            19vw,
            174px
        );

    aspect-ratio: 1;
}

.orb {
    position: absolute;
    inset: 0;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 34% 28%,
            #ffd292 0%,
            #ffb047 8%,
            #ff8600 27%,
            #ff6500 53%,
            #e64400 78%,
            #8e1e00 100%
        );

    box-shadow:
        0 0 12px rgba(255,111,0,.95),
        0 0 32px rgba(255,91,0,.75),
        0 0 70px rgba(255,74,0,.45),
        0 0 120px rgba(255,67,0,.22);

    animation:
        idle 3.2s
        ease-in-out
        infinite;
}

.orb::before {
    content: "";

    position: absolute;
    inset: -15px;

    border:
        1px solid
        rgba(255,120,30,.28);

    border-radius: inherit;

    box-shadow:
        0 0 26px
        rgba(255,90,0,.25);
}

.orb-text {
    color: #fff;

    font-size:
        clamp(
            30px,
            5vw,
            48px
        );

    font-weight: 720;
    letter-spacing: -.07em;
}

body[data-state="listening"] .orb {
    animation:
        listening .75s
        ease-in-out
        infinite;
}

body[data-state="thinking"] .orb {
    animation:
        thinking 1s
        linear
        infinite;
}

body[data-state="speaking"] .orb {
    animation:
        speaking .6s
        ease-in-out
        infinite;
}

h1 {
    margin: 5px 0 0;

    text-align: center;

    font-size:
        clamp(
            26px,
            5.5vw,
            46px
        );

    line-height: 1.05;
    letter-spacing: -.045em;
}

.sub {
    max-width: 620px;
    margin: 0;

    color: var(--muted);

    text-align: center;

    font-size:
        clamp(
            13px,
            2vw,
            16px
        );

    line-height: 1.55;
}

.status {
    min-height: 22px;

    color:
        rgba(255,255,255,.68);

    text-align: center;
    font-size: 12px;
}

.dialogue {
    width: min(100%,760px);
    max-height: min(30vh,270px);

    overflow-y: auto;

    display: grid;
    gap: 10px;

    padding: 2px;
}

.msg {
    max-width: 86%;

    padding: 11px 14px;

    border: 1px solid var(--line);
    border-radius: 16px;

    font-size: 14px;
    line-height: 1.5;

    white-space: pre-wrap;
    word-break: break-word;
}

.msg-user {
    justify-self: end;

    background:
        rgba(255,106,0,.11);

    border-color:
        rgba(255,119,24,.18);
}

.msg-ai {
    justify-self: start;

    background:
        rgba(255,255,255,.045);
}

.bottom {
    width: min(100%,820px);
    margin: 0 auto;
}

.composer {
    display: grid;

    grid-template-columns:
        auto
        minmax(0,1fr)
        auto;

    align-items: end;

    gap: 9px;

    padding: 9px;

    border:
        1px solid
        var(--line);

    border-radius: 21px;

    background: var(--panel);

    box-shadow:
        0 18px 60px
        rgba(0,0,0,.38);

    backdrop-filter:
        blur(18px);
}

textarea {
    width: 100%;

    min-height: 44px;
    max-height: 130px;

    resize: none;

    padding: 11px 5px;

    border: 0;
    outline: 0;

    background: transparent;
    color: var(--text);

    line-height: 1.45;
}

textarea::placeholder {
    color:
        rgba(255,255,255,.35);
}

.mic,
.send {
    width: 44px;
    height: 44px;

    border: 0;
    border-radius: 14px;

    display: grid;
    place-items: center;
}

.mic {
    background:
        rgba(255,255,255,.07);

    color: #fff;
}

.mic[data-active="true"] {
    background:
        rgba(255,104,0,.18);

    box-shadow:
        inset 0 0 0 1px
        rgba(255,120,30,.22);
}

.send {
    background:
        linear-gradient(
            145deg,
            var(--orange2),
            var(--orange)
        );

    color: #fff;

    font-size: 20px;
}

.note {
    margin: 8px 2px 0;

    color:
        rgba(255,255,255,.34);

    text-align: center;

    font-size: 10px;
}

.sr {
    position: absolute;

    width: 1px;
    height: 1px;

    overflow: hidden;

    clip:
        rect(0,0,0,0);
}

@keyframes idle {
    0%,100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.035);
    }
}

@keyframes listening {
    0%,100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.09);
    }
}

@keyframes thinking {
    0% {
        filter: brightness(1);
        transform: rotate(0deg);
    }

    50% {
        filter: brightness(1.22);
    }

    100% {
        filter: brightness(1);
        transform: rotate(360deg);
    }
}

@keyframes speaking {
    0%,100% {
        transform: scale(1.01);
    }

    50% {
        transform: scale(1.075);
    }
}

@media (min-width: 700px) {
    .home {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .stage {
        gap: 20px;
    }

    .msg {
        font-size: 15px;
    }
}

@media (min-width: 1000px) {
    .dialogue {
        max-height: 300px;
    }
}

@media (max-height: 700px) {
    .home {
        gap: 10px;
        padding-top: 12px;
    }

    .stage {
        gap: 10px;
    }

    .orb-wrap {
        width:
            clamp(
                82px,
                16vh,
                125px
            );
    }

    .dialogue {
        max-height: 22vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .orb {
        animation: none !important;
    }
}

/* Stage034-B1 Navigation Mode */

.mode-switcher {
    display: inline-grid;
    grid-template-columns: repeat(2, auto);

    gap: 4px;

    padding: 4px;

    border:
        1px solid
        rgba(255,255,255,.08);

    border-radius: 999px;

    background:
        rgba(255,255,255,.035);
}

.mode-button {
    min-width: 82px;

    padding: 8px 14px;

    border: 0;
    border-radius: 999px;

    background: transparent;

    color:
        rgba(255,255,255,.50);

    font-size: 12px;
    font-weight: 700;

    transition:
        background .18s ease,
        color .18s ease;
}

.mode-button.active {
    background:
        rgba(255,105,0,.15);

    color: #ffad6b;

    box-shadow:
        inset 0 0 0 1px
        rgba(255,120,32,.18);
}

.mode-panel {
    width: 100%;

    display: grid;
    justify-items: center;

    gap: 16px;
}

.mode-panel[hidden] {
    display: none !important;
}

.navigation-panel {
    width:
        min(
            100%,
            760px
        );

    padding:
        clamp(
            16px,
            3vw,
            24px
        );

    border:
        1px solid
        rgba(255,255,255,.085);

    border-radius: 22px;

    background:
        rgba(12,12,14,.68);

    box-shadow:
        0 18px 70px
        rgba(0,0,0,.34);

    backdrop-filter:
        blur(18px);
}

.navigation-heading {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 12px;
}

.navigation-heading h2 {
    margin: 0 0 4px;

    font-size:
        clamp(
            22px,
            4vw,
            32px
        );

    letter-spacing: -.035em;
}

.navigation-heading p {
    margin: 0;

    color:
        rgba(255,255,255,.48);

    font-size: 12px;
    line-height: 1.45;
}

.navigation-icon {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    display: grid;
    place-items: center;

    border-radius: 14px;

    background:
        radial-gradient(
            circle at 35% 30%,
            #ffbc72,
            #ff6900 62%,
            #a72d00
        );

    box-shadow:
        0 0 28px
        rgba(255,91,0,.28);

    color: #fff;
}

.navigation-status {
    width: 100%;

    padding: 10px 12px;

    border:
        1px solid
        rgba(255,255,255,.07);

    border-radius: 11px;

    background:
        rgba(255,255,255,.035);

    color:
        rgba(255,255,255,.59);

    font-size: 11px;
}

.navigation-location-button,
.navigation-primary,
.navigation-secondary {
    min-height: 42px;

    padding: 10px 14px;

    border-radius: 12px;

    font-size: 12px;
    font-weight: 700;
}

.navigation-location-button {
    width: 100%;

    border:
        1px solid
        rgba(255,255,255,.09);

    background:
        rgba(255,255,255,.055);

    color: #fff;
}

.navigation-destination {
    width: 100%;

    display: grid;
    gap: 6px;

    color:
        rgba(255,255,255,.56);

    font-size: 11px;
    font-weight: 650;
}

.navigation-destination input {
    width: 100%;

    min-height: 46px;

    padding: 11px 13px;

    border:
        1px solid
        rgba(255,255,255,.10);

    border-radius: 12px;

    outline: 0;

    background:
        rgba(255,255,255,.05);

    color: #fff;

    font-size: 14px;
}

.navigation-destination input::placeholder {
    color:
        rgba(255,255,255,.30);
}

.navigation-actions {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0,1fr)
        auto;

    gap: 8px;
}

.navigation-primary {
    border: 0;

    background:
        linear-gradient(
            145deg,
            #ff9b3d,
            #ff6900
        );

    color: #fff;

    box-shadow:
        0 8px 24px
        rgba(255,89,0,.20);
}

.navigation-secondary {
    border:
        1px solid
        rgba(255,255,255,.09);

    background:
        rgba(255,255,255,.045);

    color:
        rgba(255,255,255,.72);
}

.map-placeholder {
    position: relative;

    width: 100%;

    min-height:
        clamp(
            220px,
            37vh,
            390px
        );

    overflow: hidden;

    border:
        1px solid
        rgba(255,255,255,.07);

    border-radius: 18px;

    background:
        #0c0d0e;
}

.map-placeholder-grid {
    position: absolute;
    inset: 0;

    opacity: .32;

    background-image:
        linear-gradient(
            rgba(255,255,255,.045) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255,255,255,.045) 1px,
            transparent 1px
        );

    background-size:
        36px 36px;

    transform:
        rotate(-7deg)
        scale(1.2);
}

.map-placeholder-content {
    position: absolute;
    inset: 0;

    padding: 24px;

    display: grid;
    place-content: center;

    gap: 7px;

    text-align: center;
}

.map-placeholder-content strong {
    font-size: 16px;
}

.map-placeholder-content span {
    color: #ff9b57;

    font-size: 12px;
    font-weight: 700;
}

.map-placeholder-content small {
    max-width: 410px;

    color:
        rgba(255,255,255,.43);

    font-size: 10px;
    line-height: 1.5;
}

.navigation-privacy {
    margin: 0;

    color:
        rgba(255,255,255,.34);

    font-size: 10px;
    text-align: center;
}

@media (max-width: 520px) {
    .mode-switcher {
        width: 100%;

        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            );
    }

    .mode-button {
        width: 100%;
    }

    .navigation-actions {
        grid-template-columns: 1fr;
    }
}

/*
 * Grounded Talk sources.
 *
 * Kept visually secondary to Louie's answer.
 */
.talk-web-sources {
    box-sizing: border-box;
    width: min(92%, 720px);
    margin: 4px 0 16px;
    padding: 10px 12px;
    border: 1px solid rgba(127, 127, 127, 0.28);
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.4;
    color: inherit;
    opacity: 0.9;
}

.talk-web-sources-title {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.72;
}

.talk-web-sources-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.talk-web-source-link {
    display: block;
    max-width: 100%;
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.talk-web-source-link:hover,
.talk-web-source-link:focus-visible {
    opacity: 0.76;
}

@media (max-width: 640px) {
    .talk-web-sources {
        width: 96%;
        padding: 9px 10px;
        font-size: 11px;
    }
}
