/* ============================================
           Header Structure
           ============================================ */
.lx-hdr {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    /* Add controlled spacing */
    padding: 0 24px;
    z-index: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* ============================================
           Brand Section
           ============================================ */
.lx-brand {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.lx-brand__main {
    font-size: var(--lx-text-2xl);
    font-weight: var(--lx-font-bold);
    color: var(--lx-color-neutral-700);
    display: flex;
    align-items: baseline;
    letter-spacing: -0.02em;
}

.lx-brand__stem {
    display: inline-block;
}

.lx-brand__sfx {
    display: inline-block;
    position: relative;
    overflow: hidden;
    height: 1.35em;
    vertical-align: baseline;
    margin-bottom: -0.05em;
}

.lx-brand__sfx-txt {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lx-brand__sfx-txt--init {
    position: absolute;
    left: 0;
    top: 0;
}

.lx-brand__sfx-txt--final {
    opacity: 0;
    transform: translateY(100%);
}

/* State: Initial (Bot) Visible */
.lx-brand.is-init .lx-brand__sfx-txt--init {
    opacity: 1;
    transform: translateY(0);
}

.lx-brand.is-init .lx-brand__sfx-txt--final {
    opacity: 0;
    transform: translateY(100%);
}

/* State: Final (Speak) Visible */
.lx-brand.is-final .lx-brand__sfx-txt--init {
    opacity: 0;
    transform: translateY(-100%);
}

.lx-brand.is-final .lx-brand__sfx-txt--final {
    opacity: 1;
    transform: translateY(0);
}

/* Secondary text (Tagline / Nav) */
.lx-brand__sec {
    display: flex;
    align-items: center;
    margin-left: 8px;
    position: relative;
    min-width: 200px;
}

.lx-brand__div {
    color: var(--lx-color-neutral-300);
    margin-right: 10px;
    font-weight: var(--lx-font-light);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lx-brand__wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 1.5rem;
}

.lx-brand__tag,
.lx-brand__nav {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.lx-brand__tag {
    font-size: var(--lx-text-base);
    color: var(--lx-color-neutral-500);
    font-weight: var(--lx-font-semibold);
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateX(-20px);
    display: flex;
    align-items: center;
    height: auto;
    /* Remove `height: 100%` */
    position: relative;
    top: 0;
    /* Remove `top: 1px` */
    line-height: 1;
}

.lx-brand__nav {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.lx-brand__link {
    font-size: var(--lx-text-sm);
    color: var(--lx-color-neutral-700);
    text-decoration: none;
    font-weight: var(--lx-font-medium);
    position: relative;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.lx-brand__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--lx-color-neutral-900);
    transition: width 0.2s ease;
}

.lx-brand__link:hover {
    color: var(--lx-color-neutral-900);
}

.lx-brand__link:hover::after {
    width: 100%;
}

/* Brand Revealed State */
.lx-brand.is-revealed .lx-brand__div {
    opacity: 1;
    transform: translateX(0);
}

.lx-brand.is-revealed .lx-brand__tag {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Brand Nav Active State */
.lx-brand.is-nav-active .lx-brand__tag {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.lx-brand.is-nav-active .lx-brand__nav {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ============================================
           Flash Animation
           ============================================ */
@keyframes flashAnim {
    0% {
        opacity: 1;
        filter: brightness(1);
    }

    50% {
        opacity: 0.4;
        filter: brightness(2);
    }

    100% {
        opacity: 1;
        filter: brightness(1);
    }
}

.lx-brand.is-flashing .lx-brand__sfx-txt--init {
    animation: flashAnim 0.3s ease-in-out;
}

/* ============================================
           Auth Section
           ============================================ */
.lx-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    margin-left: auto;
    /* Push to the right while maintaining proper alignment */
    line-height: 1;
}

.lx-auth.is-hidden {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

.lx-auth__link {
    font-size: var(--lx-text-sm);
    color: var(--lx-color-neutral-700);
    text-decoration: none;
    font-weight: var(--lx-font-medium);
    padding: 8px 12px;
    border-radius: var(--lx-rounded-md);
    transition: color 0.2s ease, background 0.2s ease;
}

.lx-auth__link:hover {
    color: var(--lx-color-neutral-900);
    background: var(--lx-color-neutral-100);
}

.lx-auth__div {
    color: var(--lx-color-neutral-300);
    font-weight: var(--lx-font-light);
}

.lx-auth__link--prim {
    color: var(--lx-color-neutral-900);
    font-weight: var(--lx-font-bold);
}

.lx-auth__link--prim:hover {
    background: var(--lx-color-neutral-100);
}

/* User Display (Logged In) */
.lx-auth__user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--lx-text-sm);
    color: var(--lx-color-neutral-700);
    text-decoration: none;
    font-weight: var(--lx-font-medium);
    padding: 8px 12px;
    border-radius: var(--lx-rounded-md);
    transition: color 0.2s ease, background 0.2s ease;
}

.lx-auth__user:hover {
    color: var(--lx-color-neutral-900);
    background: var(--lx-color-neutral-100);
}

.lx-auth__user-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.lx-auth__user-email {
    white-space: nowrap;
}

/* ============================================
           Mobile Styles
           ============================================ */
@media (max-width: 768px) {
    .lx-hdr {
        padding: 0 16px;
    }

    .lx-brand__main {
        font-size: var(--lx-text-xl);
    }

    .lx-brand__tag {
        font-size: var(--lx-text-base);
    }

    .lx-brand__sec {
        margin-left: 6px;
        min-width: auto;
        /* Remove min-width constraint */
    }

    .lx-brand__nav {
        gap: 16px;
    }

    .lx-brand__link {
        font-size: var(--lx-text-sm);
    }

    /* Hide Sign up and divider on tablet/mobile */
    .lx-auth__link:not(.lx-auth__link--prim),
    .lx-auth__div {
        display: none;
    }

    /* Hide email on mobile, show icon only */
    .lx-auth__user-email {
        display: none;
    }

    .lx-auth__user {
        padding: 8px;
    }
}

@media (max-width: 480px) {

    /* Keep divider visible on mobile when revealed */
    .lx-brand.is-revealed .lx-brand__div {
        opacity: 1;
    }

    .lx-brand__nav {
        left: 0;
        gap: 12px;
    }

    .lx-brand.is-nav-active .lx-brand__div {
        opacity: 1;
    }
}

/* ============================================
           Demo Content
           ============================================ */
.demo-content {
    padding-top: calc(var(--hdr-height) + 40px);
    max-width: 800px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.demo-content h1 {
    font-size: var(--lx-text-5xl);
    font-weight: var(--lx-font-bold);
    color: var(--lx-color-neutral-900);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.demo-content p {
    font-size: var(--lx-text-base);
    color: var(--lx-color-neutral-500);
    line-height: 1.7;
    margin-bottom: 24px;
}

.demo-content .instructions {
    background: linear-gradient(135deg, var(--lx-color-neutral-50) 0%, var(--lx-color-neutral-100) 100%);
    border-radius: var(--lx-rounded-xl);
    padding: 24px;
    margin-top: 32px;
}

.demo-content .instructions h2 {
    font-size: var(--lx-text-lg);
    font-weight: var(--lx-font-semibold);
    color: var(--lx-color-neutral-700);
    margin-bottom: 16px;
}

.demo-content .instructions ul {
    list-style: none;
    padding: 0;
}

.demo-content .instructions li {
    font-size: var(--lx-text-sm);
    color: var(--lx-color-neutral-500);
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.demo-content .instructions li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--lx-color-secondary-700);
}

.replay-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 12px 24px;
    font-size: var(--lx-text-sm);
    font-weight: var(--lx-font-bold);
    color: white;
    background: linear-gradient(135deg, var(--lx-color-neutral-900) 0%, var(--lx-color-neutral-700) 100%);
    border: none;
    border-radius: var(--lx-rounded-lg);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.replay-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--lx-shadow-lg);
}

.replay-btn:active {
    transform: translateY(0);
}

.replay-btn svg {
    width: 18px;
    height: 18px;
}