/* Grok-Style Design System & AI Mind Sphere */
:root {
    --bg-black: #080808;
    --grok-gray: #1a1a1b;
    --grok-border: #2f3336;
    --accent-glow: rgba(255, 255, 255, 0.05);
    --text-white: #e7e9ea;
    --text-dim: #71767b;
    --ai-mind-start: #4285f4;
    --ai-mind-end: #a142f4;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-black);
    color: var(--text-white);
    margin: 0;
    overflow-x: hidden;
}

/* The AI Particle Wave is now entirely drawn in Canvas */

/* Grok-Style Input Console */
.grok-input-container {
    background: var(--grok-gray);
    border: 1px solid var(--grok-border);
    border-radius: 32px;
    padding: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.grok-input-container:focus-within {
    border-color: #1d9bf0;
    background: #000;
}

.grok-textarea {
    background: transparent;
    border: none;
    resize: none;
    color: var(--text-white);
    font-size: 1.1rem;
    line-height: 1.5;
    padding: 12px 8px;
    width: 100%;
    /* Fixed 3-row height */
    height: calc(3 * 1.1rem * 1.5);
    min-height: calc(3 * 1.1rem * 1.5);
    max-height: calc(3 * 1.1rem * 1.5);
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.grok-textarea::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.grok-textarea:focus {
    outline: none;
    box-shadow: none;
}

.grok-icon-btn {
    color: #1d9bf0;
    padding: 10px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.grok-icon-btn:hover {
    background-color: rgba(29, 155, 240, 0.1);
}

.grok-icon-btn.muted {
    color: var(--text-dim);
}

.grok-send-btn {
    background: white;
    color: black;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
}

.grok-send-btn:hover {
    transform: scale(1.05);
}

.grok-send-btn:active {
    transform: scale(0.95);
}

.send-btn-highlight {
    animation: sendBtnPulse 0.9s ease-in-out infinite !important;
    box-shadow: 0 0 0 0 rgba(99, 179, 255, 0.7);
}

@keyframes sendBtnPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 179, 255, 0.7);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(99, 179, 255, 0);
        transform: scale(1.08);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 179, 255, 0);
        transform: scale(1);
    }
}

.grok-send-btn:disabled {
    opacity: 0.3;
    transform: none;
}



/* ─── Subtitle character-reveal animation ────────────────────── */
/* Each character in a sentence blurs in with a per-char delay.   */
#subtitleOverlay {
    transition: opacity 0.45s ease;
    /* Fixed height = 4 lines × font-size(1rem) × line-height(1.6) */
    height: calc(4 * 1rem * 1.6);
    min-height: calc(4 * 1rem * 1.6);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Base text style for all subtitle phrases */
.subtitle-text {
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    line-height: 1.6;
    white-space: normal;
    /* wrap long intro phrases */
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    text-align: center;
}


.char-reveal {
    display: inline;
    opacity: 0;
    filter: blur(6px);
    animation: charBlurIn 0.45s ease forwards;
}

@keyframes charBlurIn {
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* ─── Ring Logo ──────────────────────────────────────────────── */
.logo-brand-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.logo-header-icon {
    width: 2rem;
    height: 2rem;
    color: rgba(255, 255, 255, 0.92);
    filter:
        drop-shadow(0 0 10px rgba(120, 190, 255, 0.85)) drop-shadow(0 0 28px rgba(80, 140, 255, 0.4));
    flex-shrink: 0;
}

.logo-header-text {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.92);
    text-shadow:
        0 0 14px rgba(120, 190, 255, 0.75),
        0 0 35px rgba(80, 140, 255, 0.3);
}

.logo-char {
    display: inline-block;
    white-space: pre;
    will-change: opacity, filter;
}

.logo-rocket-svg {
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.95);
    filter:
        drop-shadow(0 0 10px rgba(120, 190, 255, 0.9)) drop-shadow(0 0 28px rgba(80, 140, 255, 0.55));
}

@keyframes logoCharIn {
    from {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(0);
    }
}

@keyframes logoCharOut {
    from {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(0);
    }

    to {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(-5px);
    }
}

@keyframes logoRocketIn {
    from {
        opacity: 0;
        filter: blur(10px);
        transform: scale(0.75);
    }

    to {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

@keyframes logoRocketOut {
    from {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }

    to {
        opacity: 0;
        filter: blur(8px);
        transform: scale(0.8);
    }
}




/* Mobile Optimizations */
@media (max-width: 768px) {
    .grok-textarea {
        overflow-y: auto;
    }

    /* Ring container on mobile */
    #aiMind {
        margin-top: 0;
        padding-top: 0;
    }

    .subtitle-text {
        font-size: clamp(0.85rem, 3.5vw, 1rem);
    }
}