/* SmartCantina / LEVI — pixel-near mockup overlay (city-bg + live orb).
   Extends levi.css. Chat, quota, dialog and conversation styles stay in levi.css. */

:root {
    --red: #ee1133;
    --red-glow: #ff424e;
}

/* Full-bleed city window. Drop the 5px blur that hid the old 16 KB room plate. */
.room {
    filter: none !important;
    transform: none !important;
    background-image:
        linear-gradient(90deg, rgba(2, 5, 10, .46), rgba(2, 5, 10, .08) 36%, rgba(2, 5, 10, .22) 72%, rgba(2, 5, 10, .38)),
        url("assets/city-bg.png?v=20260914-orb");
    background-size: cover;
    background-position: center 18%;
}
.room::after {
    background: linear-gradient(180deg, rgba(0, 0, 0, .10), transparent 32%, rgba(4, 8, 13, .10) 62%, #04080de8 100%);
}

/* Never use the baked screenshot stage — compose the live orb on the city. */
.hero-scene { display: none !important; }
@media (min-width: 1121px) {
    body:not(.has-conversation) .hero > .levi-visual,
    body:not(.has-conversation) .hero > .telemetry,
    body:not(.has-conversation) .hero > .hero-manifesto,
    body:not(.has-conversation) .hero > .levi-caption {
        visibility: visible !important;
    }
}

/* Mug / notepad already live in city-bg. */
.desk-detail { display: none !important; }

/* Stronger neon on the active Chat item. */
.nav-item.is-active {
    background: linear-gradient(90deg, rgba(180, 18, 42, .62), rgba(67, 20, 36, .42));
    box-shadow: inset 2px 0 #ff2a3c, 0 0 22px rgba(255, 36, 60, .18);
}
.nav-item.is-active::before {
    background: #ff2d40;
    box-shadow: 0 0 16px 4px rgba(255, 40, 60, .45);
}

/* Orb: the new HAL sphere is already circular with alpha. */
.levi-eye {
    filter: drop-shadow(0 0 28px rgba(255, 30, 50, .22)) drop-shadow(0 18px 40px rgba(0, 0, 0, .45));
}
.orb-glow {
    background: radial-gradient(circle at 48% 47%, rgba(255, 16, 48, .34) 0, transparent 64%);
}
.core-pulse {
    box-shadow: 0 0 28px 8px rgba(255, 28, 52, .32);
}

/* Always-on histogram near the orb; livelier while thinking / speaking. */
.signal-bars {
    height: 36px;
    gap: 3px;
    align-items: flex-end;
}
.signal-bars i {
    width: 2px;
    height: 8px;
    background: linear-gradient(180deg, #f3fbff, #8ec4e0);
    opacity: .8;
    transform-origin: center bottom;
    animation: wave-idle 1.6s ease-in-out infinite;
}
.signal-bars i:nth-child(1) { height: 7px; animation-delay: -1.1s; }
.signal-bars i:nth-child(2) { height: 14px; animation-delay: -.9s; }
.signal-bars i:nth-child(3) { height: 22px; animation-delay: -.3s; }
.signal-bars i:nth-child(4) { height: 11px; animation-delay: -1.4s; }
.signal-bars i:nth-child(5) { height: 28px; animation-delay: -.6s; }
.signal-bars i:nth-child(6) { height: 16px; animation-delay: -.2s; }
.signal-bars i:nth-child(7) { height: 9px; animation-delay: -1.0s; }
.signal-bars i:nth-child(8) { height: 24px; animation-delay: -.7s; }
.signal-bars i:nth-child(9) { height: 13px; animation-delay: -.1s; }
.signal-bars i:nth-child(10) { height: 20px; animation-delay: -.5s; }
.signal-bars i:nth-child(11) { height: 8px; animation-delay: -1.2s; }
.signal-bars i:nth-child(12) { height: 18px; animation-delay: -.4s; }
.signal-bars i:nth-child(13) { height: 12px; animation-delay: -.8s; }

body[data-levi-state="thinking"] .signal-bars i,
body[data-levi-state="speaking"] .signal-bars i,
body.is-busy .signal-bars i {
    animation-name: wave-live;
    animation-duration: .55s;
    background: linear-gradient(180deg, #ffe4e8, #ff3a4e);
}

/* Composer histogram — visual only, no microphone. */
.composer-wave {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 18px;
    padding: 0 2px 1px;
    flex: 0 0 auto;
}
.composer-wave i {
    display: block;
    width: 2px;
    height: 5px;
    background: #c5d5e4;
    opacity: .55;
    transform-origin: center bottom;
    animation: wave-idle 1.8s ease-in-out infinite;
}
.composer-wave i:nth-child(2) { height: 9px; animation-delay: -.4s; }
.composer-wave i:nth-child(3) { height: 14px; animation-delay: -.9s; }
.composer-wave i:nth-child(4) { height: 8px; animation-delay: -.2s; }
.composer-wave i:nth-child(5) { height: 16px; animation-delay: -.7s; }
.composer-wave i:nth-child(6) { height: 7px; animation-delay: -1.1s; }
.composer-wave i:nth-child(7) { height: 12px; animation-delay: -.3s; }
.composer-wave i:nth-child(8) { height: 6px; animation-delay: -.8s; }
.composer-wave i:nth-child(9) { height: 10px; animation-delay: -.5s; }

body[data-levi-state="thinking"] .composer-wave i,
body[data-levi-state="speaking"] .composer-wave i,
body.is-busy .composer-wave i {
    animation-name: wave-live;
    animation-duration: .45s;
    background: #ff5a68;
    opacity: .9;
}

@keyframes wave-idle {
    0%, 100% { transform: scaleY(.45); opacity: .45; }
    50% { transform: scaleY(1); opacity: .85; }
}
@keyframes wave-live {
    0% { transform: scaleY(.25); }
    50% { transform: scaleY(1.15); }
    100% { transform: scaleY(.35); }
}

/* Context placeholders look real; aria-disabled items stay clickable for the "bald" toast. */
.context-item[aria-disabled="true"] { opacity: .92; cursor: pointer; }
.inspiration-card blockquote {
    font-weight: 300;
    letter-spacing: -.3px;
}

/* Tablet / mobile: context rail becomes a right drawer. */
.context-toggle { display: none; }
.context-backdrop { display: none; }

@media (max-width: 1120px) {
    .context-toggle { display: inline-grid; }
    .connection { display: flex !important; }
    .context-rail {
        display: none;
        position: fixed;
        z-index: 30;
        right: 12px;
        top: 80px;
        width: min(300px, calc(100vw - 24px));
        max-height: calc(100svh - 100px);
        overflow: auto;
        padding: 16px 14px 20px;
        background: #0d1623f7;
        border: 1px solid #a0b9cf44;
        border-radius: 15px;
        box-shadow: 0 20px 80px #000b;
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
        min-width: 0;
    }
    body.context-open .context-rail { display: flex; }
    .context-backdrop {
        position: fixed;
        inset: 78px 0 0;
        z-index: 25;
        border: 0;
        background: #0005;
        backdrop-filter: blur(4px);
        border-radius: 0;
    }
    body.context-open .context-backdrop { display: block; }
}

@media (max-width: 850px) {
    .connection { display: none !important; }
}

@media (max-width: 680px) {
    .context-toggle { width: 30px; height: 36px; }
    .context-rail {
        top: 80px;
        right: 12px;
        left: auto;
        width: min(280px, calc(100vw - 24px));
    }
    .composer-wave { height: 16px; }
    .levi-visual {
        /* Keep the orb centered over the city on phones. */
        max-width: 92vw;
        max-height: 92vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .signal-bars i,
    .composer-wave i {
        animation: none !important;
    }
}


/* ===== Full-site section views (shell beyond /chat) ===== */
.site-view[hidden] { display: none !important; }
.site-view.is-active { display: contents; }
body:not([data-site-view="chat"]) .site-view.is-active {
    display: block;
    width: 100%;
    min-height: min(70svh, 720px);
    overflow: auto;
    padding: 8px 4px 24px;
    position: relative;
    z-index: 3;
}
body:not([data-site-view="chat"]) .workspace {
    display: block;
}
/* When chat view is active, keep original layout via display:contents */
body[data-site-view="chat"] #view-chat.is-active { display: contents; }

.section-panel {
    width: min(920px, 100%);
    margin: 12px auto 24px;
    padding: 28px 28px 32px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(36, 49, 67, 0.42), rgba(14, 28, 45, 0.55));
    border: 1px solid rgba(210, 220, 235, 0.22);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
    color: #d7e4f0;
}
.section-head { margin-bottom: 22px; }
.section-kicker {
    margin: 0 0 8px;
    font-size: 11px;
    letter-spacing: .22em;
    color: #ff4a5c;
    font-weight: 600;
}
.section-head h1 {
    margin: 0 0 10px;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 500;
    letter-spacing: -.02em;
    color: #f3f7fb;
}
.section-lead {
    margin: 0;
    max-width: 54ch;
    color: #9eb4c8;
    line-height: 1.55;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.info-card {
    padding: 16px 16px 18px;
    border-radius: 14px;
    background: linear-gradient(140deg, rgba(47, 47, 61, 0.28), rgba(8, 14, 24, 0.45));
    border: 1px solid rgba(193, 179, 199, 0.28);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}
.info-card.accent {
    border-color: #ff3a4e66;
    box-shadow: inset 0 0 0 1px #ff3a4e22, 0 0 28px #ff2a3c14;
}
.info-card.wide { margin-top: 14px; }
.info-card h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 560;
    color: #eef5fb;
}
.info-card h2 a { color: inherit; text-decoration: none; border-bottom: 1px solid #ff4a5c66; }
.info-card h2 a:hover { border-bottom-color: #ff6a78; color: #fff; }
.info-card p, .info-card li {
    margin: 0 0 8px;
    color: #b7c8d8;
    line-height: 1.5;
    font-size: .94rem;
}
.info-card ul { margin: 0; padding-left: 1.1rem; }
.info-card li { margin-bottom: 6px; }
.section-cta, .section-cta-btn {
    display: inline-flex;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #ff4a5c88;
    background: linear-gradient(90deg, rgba(180,18,42,.45), rgba(67,20,36,.35));
    color: #ffe8eb;
    text-decoration: none;
    font-size: .86rem;
    cursor: pointer;
    font: inherit;
}
.section-cta:hover, .section-cta-btn:hover {
    border-color: #ff6a78;
    box-shadow: 0 0 18px #ff2a3c33;
}
.section-note {
    margin: 18px 0 0;
    font-size: .82rem;
    color: #7f95a8;
    line-height: 1.45;
}
.section-note code {
    font-size: .8em;
    color: #c5d5e4;
}
.timeline { display: flex; flex-direction: column; gap: 12px; }

body:not([data-site-view="chat"]) .hero,
body:not([data-site-view="chat"]) .conversation-stack {
    /* chat pieces live inside #view-chat which is hidden */
}
body:not([data-site-view="chat"]) .context-rail {
    opacity: .55;
}
body:not([data-site-view="chat"]) .quota-panel {
    /* keep quotas visible even off chat — still relevant for return */
}

button.back-home {
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

@media (max-width: 850px) {
    .section-panel { padding: 20px 16px 24px; margin-top: 4px; }
}


/* ===== Empty home entry (not chat) ===== */
body[data-site-view="home"] #view-chat,
body[data-site-view="home"] .site-view {
    display: none !important;
}
body[data-site-view="home"] .conversation-stack,
body[data-site-view="home"] #chatForm,
body[data-site-view="home"] .chat-privacy,
body[data-site-view="home"] .workspace-signature,
body[data-site-view="home"] .hero-manifesto,
body[data-site-view="home"] .telemetry,
body[data-site-view="home"] .levi-caption {
    display: none !important;
}
body[data-site-view="home"] .hero {
    height: min(72svh, 640px);
    pointer-events: none;
}
body[data-site-view="home"] .workspace {
    display: block;
    min-height: min(70svh, 720px);
}
body[data-site-view="home"] .context-rail {
    opacity: 0.45;
}
body[data-site-view="home"] .primary-nav .nav-item.is-active {
    /* none should be active; belt-and-suspenders */
}


/* ===== Live radar brand sigil ===== */
.brand-sigil.radar {
    transform: none;
    overflow: visible;
    border-color: rgba(216, 175, 175, 0.55);
    border-top-color: #fa6370;
    border-right-color: rgba(146, 56, 62, 0.85);
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 70, 90, 0.08), transparent 55%),
        radial-gradient(ellipse at 30% 54%, rgba(126, 15, 33, 0.12), transparent 70%);
}
.brand-sigil.radar::before,
.brand-sigil.radar::after,
.brand-sigil.radar > i {
    display: none !important;
    content: none !important;
}
.brand-sigil.radar .radar-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.brand-sigil.radar .radar-ring {
    fill: none;
    stroke: rgba(230, 210, 215, 0.55);
    stroke-width: 1.2;
}
.brand-sigil.radar .radar-ring-soft {
    stroke: rgba(250, 90, 105, 0.22);
    stroke-width: 0.8;
}
.brand-sigil.radar .radar-hub {
    fill: rgba(12, 16, 24, 0.85);
    stroke: rgba(180, 70, 80, 0.9);
    stroke-width: 1.2;
}
.brand-sigil.radar .radar-hub-core {
    fill: #ff5a68;
    filter: drop-shadow(0 0 3px #ff3344);
}
.brand-sigil.radar .radar-sweep {
    /* driven by JS SVG transform */
}
.brand-sigil.radar .radar-beam {
    stroke: #ff8a90;
    stroke-width: 1.4;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px #ff3344);
}
.brand-sigil.radar .radar-wedge {
    fill: url(#radarEchoGrad);
    stroke: none;
}
.brand-sigil.radar .radar-head { display: none; }
.brand-sigil.radar .radar-blip {
    fill: #fff;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: radar-blip-ping 3.6s linear infinite;
    animation-delay: var(--blip-delay, 0s);
    filter: drop-shadow(0 0 3px #ff4a5c);
}
@keyframes radar-sweep {
    to { transform: rotate(360deg); }
}
@keyframes radar-blip-ping {
    0%, 6% { opacity: 0; transform: scale(0.6); }
    9% { opacity: 1; transform: scale(1.35); }
    22% { opacity: 0.55; transform: scale(1); }
    48% { opacity: 0.08; transform: scale(0.85); }
    100% { opacity: 0; transform: scale(0.6); }
}
@media (prefers-reduced-motion: reduce) {
    .brand-sigil.radar .radar-sweep,
    .brand-sigil.radar .radar-blip {
        animation: none !important;
    }
    .brand-sigil.radar .radar-blip {
        opacity: 0.55;
    }
}


/* JS-driven radar blips (synced to sweep) */
.brand-sigil.radar .radar-sweep {
    animation: none !important;
    /* rotation via SVG attribute around translated hub (0,0) */
}
.brand-sigil.radar .radar-blip {
    animation: none !important;
    opacity: 0;
    fill: #ff8a90;
    transition: opacity .12s linear, transform .12s linear;
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(0.7);
    filter: drop-shadow(0 0 3px #ff3344);
}
.brand-sigil.radar .radar-blip.is-lit {
    opacity: 1;
    transform: scale(1.55);
    fill: #ff8a90;
    filter: drop-shadow(0 0 4px #ff3344) drop-shadow(0 0 12px #ee293b);
}


/* Section panel close → empty home */
.section-panel {
    position: relative;
}
.section-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(210, 220, 235, 0.28);
    background: rgba(8, 14, 24, 0.45);
    color: #e8eef6;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: inline-grid;
    place-items: center;
    padding: 0;
}
.section-close:hover {
    border-color: rgba(255, 74, 92, 0.55);
    color: #fff;
    box-shadow: 0 0 16px rgba(255, 42, 60, 0.25);
}
.section-head {
    padding-right: 44px;
}
