/* ============================================
   JULIEN STEFANIZZI — Personal AI Chat
   Moto landing → Chat experience
   ============================================ */

:root {
    /* Backgrounds — lifted, not pure black */
    --bg-deep: #111111;
    --bg-base: #181818;
    --bg-raised: #212121;
    --bg-card: #262626;
    --bg-hover: #2E2E2E;

    /* Neutrals */
    --gray-700: #4A4A4A;
    --gray-600: #6A6A6A;
    --gray-500: #8A8A8A;
    --gray-400: #AAAAAA;
    --gray-300: #CCCCCC;

    /* Warm tones */
    --cream: #EDE6D6;
    --cream-soft: #D9CFC0;
    --cream-bright: #F7F3EC;
    --white: #FFFFFF;

    /* Accents */
    --gold: #C8A855;
    --bordeaux: #A83248;
    --bordeaux-bright: #C23D56;
    --bordeaux-muted: #8A2A3C;
    --bordeaux-glow: rgba(168, 50, 72, 0.3);
    --bordeaux-dim: rgba(168, 50, 72, 0.10);
    --bordeaux-surface: rgba(168, 50, 72, 0.14);

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-expo: cubic-bezier(0.87, 0, 0.13, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-700); }

/* ============================================
   LANDING — MOTO
   ============================================ */
.landing {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.landing.exiting {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
}

.landing.hidden {
    display: none;
}

.landing-bg {
    position: absolute;
    inset: 0;
    background: var(--bg-deep);
    overflow: hidden;
}

.landing-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 55%, transparent 30%, var(--bg-deep) 100%),
        linear-gradient(to top, var(--bg-deep) 0%, transparent 40%),
        linear-gradient(to bottom, rgba(17,17,17,0.6) 0%, transparent 30%);
    z-index: 1;
    pointer-events: none;
}

.bg-scene {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    opacity: 0;
    filter: blur(2px) saturate(0.35) brightness(0.65);
    user-select: none;
    pointer-events: none;
    animation: bgFadeIn 2s ease forwards;
}

@keyframes bgFadeIn {
    from { opacity: 0; }
    to { opacity: 0.32; }
}

.landing-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
    padding-top: 8vh;
}

/* --- Top text --- */
.landing-text-top {
    text-align: center;
}

.landing-hello {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    color: var(--gray-500);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.8s var(--ease-out) 0.2s forwards;
}

/* --- Moto zone --- */
.moto-zone {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.moto-zone::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
    width: min(520px, 82vw);
    height: min(220px, 36vw);
    background: radial-gradient(ellipse at center, rgba(168, 50, 72, 0.28) 0%, rgba(168, 50, 72, 0.1) 38%, rgba(168, 50, 72, 0) 75%);
    filter: blur(14px);
    opacity: 0;
    animation: auraIn 1.1s var(--ease-out) 0.9s forwards;
    pointer-events: none;
    z-index: 0;
}

@media (hover: hover) {
    .moto-zone:hover {
        transform: scale(1.03);
    }
    .moto-zone:hover::before {
        opacity: 1;
        filter: blur(16px);
    }
    .moto-zone:hover .moto-img {
        filter:
            saturate(1.1)
            contrast(1.08)
            brightness(1.05)
            drop-shadow(0 12px 30px rgba(0,0,0,0.5))
            drop-shadow(0 0 24px rgba(168, 50, 72, 0.32));
        transform: scale(1.02);
    }
    .moto-zone:hover .moto-click-hint {
        color: var(--bordeaux-bright);
    }
}

.moto-zone:active {
    transform: scale(0.98);
}

.moto-img {
    width: min(430px, 68vw);
    height: auto;
    opacity: 0;
    animation: motoAppear 1.4s var(--ease-out) 0.6s forwards;
    transition: filter 0.5s ease, transform 0.4s ease;
    user-select: none;
    -webkit-user-drag: none;
    filter:
        saturate(1.08)
        contrast(1.06)
        brightness(1.02)
        drop-shadow(0 12px 28px rgba(0,0,0,0.5))
        drop-shadow(0 0 18px rgba(168, 50, 72, 0.25));
    position: relative;
    z-index: 1;
}

.moto-zone::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.4) 0%, transparent 70%);
    filter: blur(6px);
    opacity: 0;
    animation: fadeIn 1.5s ease 1s forwards;
    pointer-events: none;
}

@keyframes motoAppear {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Ride-off animation */
.moto-img.riding {
    animation: rideOff 1s var(--ease-expo) forwards;
}

@keyframes rideOff {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    10% {
        transform: translateX(-8px);
        opacity: 1;
    }
    100% {
        transform: translateX(110vw);
        opacity: 0;
    }
}

/* Click hint */
.moto-click-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.6s var(--ease-out) 1.2s forwards;
    transition: color 0.3s ease;
}

.moto-click-hint svg {
    animation: nudgeRight 1.5s ease infinite;
}

@keyframes nudgeRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* --- Name --- */
.landing-name {
    text-align: center;
    opacity: 0;
    animation: fadeUp 0.8s var(--ease-out) 0.8s forwards;
}

.landing-name h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    color: var(--cream);
    letter-spacing: 1px;
    line-height: 1.1;
}

.landing-name p {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 8px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.landing-name p .dot {
    color: var(--bordeaux-bright);
    font-weight: 700;
}

/* --- Exhaust particles --- */
.exhaust-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 101;
}

.exhaust-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--cream-soft);
    opacity: 0;
}

.exhaust-particle:nth-child(odd) {
    background: var(--bordeaux-bright);
}

/* --- General keyframes --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes auraIn {
    from { opacity: 0; transform: translate(-50%, -48%) scale(0.94); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ============================================
   PASSWORD GATE
   ============================================ */
.password-gate {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s var(--ease-out);
}

.password-gate.visible {
    opacity: 1;
    pointer-events: auto;
}

.password-gate.exiting {
    opacity: 0;
    pointer-events: none;
}

.pw-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeUp 0.6s var(--ease-out) forwards;
}

.pw-lock {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bordeaux-surface);
    border: 1.5px solid rgba(168, 50, 72, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bordeaux-bright);
}

.pw-label {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.pw-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1.5px solid rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    padding: 4px 4px 4px 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 280px;
}

.pw-input-wrapper:focus-within {
    border-color: rgba(168, 50, 72, 0.4);
    box-shadow: 0 0 0 3px rgba(168, 50, 72, 0.08);
}

.pw-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--cream);
    padding: 10px 0;
    letter-spacing: 3px;
}

.pw-input::placeholder {
    color: var(--gray-600);
    letter-spacing: 1px;
}

.pw-submit {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bordeaux);
    color: var(--cream-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pw-submit:hover {
    background: var(--bordeaux-bright);
    transform: scale(1.05);
}

.pw-error {
    font-size: 12px;
    color: var(--bordeaux-bright);
    opacity: 0;
    transition: opacity 0.3s ease;
    height: 16px;
}

.pw-error.show {
    opacity: 1;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Light mode overrides */
body.light .password-gate { background: var(--bg-deep); }
body.light .pw-input-wrapper {
    background: #FFFFFF;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
}
body.light .pw-input-wrapper:focus-within {
    border-color: rgba(168, 50, 72, 0.35);
    box-shadow: 0 0 0 3px rgba(168, 50, 72, 0.06);
}

/* ============================================
   CHAT APP
   ============================================ */
.chat-app {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s var(--ease-out);
    z-index: 50;
}

.chat-app.visible {
    opacity: 1;
    pointer-events: auto;
}

/* --- Chat Header --- */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-raised);
    border-bottom: 1px solid rgba(168, 50, 72, 0.18);
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.back-btn:hover {
    color: var(--cream);
    background: rgba(255, 255, 255, 0.06);
}

.chat-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bordeaux-surface);
    border: 1.5px solid var(--bordeaux);
    color: var(--cream-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
}

.chat-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--cream);
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--gray-500);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* --- Chat Messages --- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-base);
}

.message {
    display: flex;
    gap: 10px;
    max-width: 680px;
    animation: msgIn 0.35s var(--ease-out);
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-display);
}

.message.assistant .msg-avatar {
    background: var(--bg-card);
    border: 1px solid rgba(168, 50, 72, 0.25);
    color: var(--cream);
}

.message.user .msg-avatar {
    background: var(--bordeaux);
    color: var(--cream-bright);
}

.msg-body {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.message.assistant .msg-body {
    background: var(--bg-card);
    color: var(--cream);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top-left-radius: 4px;
}

.message.user .msg-body {
    background: var(--bordeaux);
    color: var(--cream-bright);
    border-top-right-radius: 4px;
}

.msg-body p { margin-bottom: 8px; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body strong { color: var(--cream-bright); font-weight: 600; }
.msg-body ul, .msg-body ol { margin: 6px 0 6px 18px; font-size: 13px; }
.msg-body li { margin-bottom: 4px; }
.msg-body em { color: var(--gray-400); font-style: italic; }
.msg-body a { color: var(--bordeaux-bright); text-decoration: underline; text-underline-offset: 2px; transition: color 0.2s ease; }
.msg-body a:hover { color: var(--cream-bright); }

.msg-time {
    font-size: 10px;
    color: var(--gray-600);
    margin-top: 4px;
    display: block;
}

.message.user .msg-time {
    text-align: right;
}

/* Quick actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.quick-action {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--cream);
    background: var(--bordeaux-surface);
    border: 1px solid rgba(168, 50, 72, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-action:hover {
    background: rgba(168, 50, 72, 0.25);
    border-color: var(--bordeaux);
    color: var(--cream-bright);
    transform: translateY(-1px);
}

/* Typing indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bordeaux-bright);
    opacity: 0.4;
    animation: typeDot 1.4s ease infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typeDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* --- Chat Input --- */
.chat-input-area {
    padding: 12px 20px 20px;
    background: var(--bg-raised);
    border-top: 1px solid rgba(168, 50, 72, 0.12);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    background: var(--bg-card);
    border: 1.5px solid rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: rgba(168, 50, 72, 0.4);
    box-shadow: 0 0 0 3px rgba(168, 50, 72, 0.08);
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--cream);
    padding: 10px 0;
    resize: none;
    max-height: 120px;
    min-height: 40px;
}

.chat-input::placeholder {
    color: var(--gray-600);
}

.send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--bordeaux);
    color: var(--cream-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--bordeaux-bright);
    transform: scale(1.05);
    box-shadow: 0 0 16px var(--bordeaux-glow);
}

.send-btn:active {
    transform: scale(0.95);
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--cream);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.08);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { transition: opacity 0.3s ease, transform 0.3s ease; position: absolute; }
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

/* ============================================
   LIGHT MODE
   ============================================ */
body.light {
    --bg-deep: #F5F2ED;
    --bg-base: #FAFAF8;
    --bg-raised: #FFFFFF;
    --bg-card: #F0EDE8;
    --bg-hover: #E8E4DE;

    --gray-700: #C5C0B8;
    --gray-600: #A09A90;
    --gray-500: #787068;
    --gray-400: #5A5248;
    --gray-300: #3A3530;

    --cream: #2A2520;
    --cream-soft: #3A3530;
    --cream-bright: #1A1510;
    --white: #FFFFFF;

    --bordeaux: #A83248;
    --bordeaux-bright: #C23D56;
    --bordeaux-muted: #8A2A3C;
    --bordeaux-glow: rgba(168, 50, 72, 0.2);
    --bordeaux-dim: rgba(168, 50, 72, 0.06);
    --bordeaux-surface: rgba(168, 50, 72, 0.08);
}

body.light .theme-toggle {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
    color: var(--gray-400);
}

body.light .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--cream);
    border-color: rgba(0, 0, 0, 0.15);
}

body.light .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
body.light .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

body.light .landing-bg { background: var(--bg-deep); }
body.light .landing-bg::after {
    background:
        radial-gradient(ellipse 80% 60% at 50% 55%, transparent 30%, var(--bg-deep) 100%),
        linear-gradient(to top, var(--bg-deep) 0%, transparent 40%),
        linear-gradient(to bottom, rgba(245,242,237,0.6) 0%, transparent 30%);
}
body.light .bg-scene { filter: blur(2px) saturate(0.45) brightness(1.1); }

body.light .moto-img {
    filter:
        saturate(1.08)
        contrast(1.06)
        brightness(1.02)
        drop-shadow(0 10px 22px rgba(0,0,0,0.22))
        drop-shadow(0 0 14px rgba(168, 50, 72, 0.18));
}

body.light .moto-zone::after {
    background: radial-gradient(ellipse, rgba(0,0,0,0.12) 0%, transparent 70%);
}

body.light .chat-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light .back-btn:hover {
    color: var(--cream);
    background: rgba(0, 0, 0, 0.05);
}

body.light .message.assistant .msg-body {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.light .message.user .msg-body {
    background: var(--bordeaux);
    color: #FFFFFF;
}

body.light .message.user .msg-avatar {
    color: #FFFFFF;
}

body.light .message.assistant .msg-avatar {
    border: 1px solid rgba(168, 50, 72, 0.2);
}

body.light .quick-actions {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body.light .quick-action {
    color: var(--cream);
    background: rgba(168, 50, 72, 0.06);
    border: 1px solid rgba(168, 50, 72, 0.15);
}

body.light .quick-action:hover {
    background: rgba(168, 50, 72, 0.12);
    border-color: var(--bordeaux);
}

body.light .chat-input-area {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body.light .chat-input-wrapper {
    background: #FFFFFF;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
}

body.light .chat-input-wrapper:focus-within {
    border-color: rgba(168, 50, 72, 0.35);
    box-shadow: 0 0 0 3px rgba(168, 50, 72, 0.06);
}

body.light .msg-body a { color: var(--bordeaux); }
body.light .msg-body a:hover { color: var(--bordeaux-bright); }

body.light ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); }
body.light ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }

body.light .exhaust-particle { background: var(--gray-500); }
body.light .exhaust-particle:nth-child(odd) { background: var(--bordeaux); }

/* ============================================
   RESPONSIVE
   ============================================ */

/* Mobile-first safe area handling */
.chat-input-area {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
    .landing-content {
        padding: 20px 16px;
        padding-top: 6vh;
        gap: 14px;
    }

    .landing-hello {
        font-size: 11px;
    }

    .moto-img {
        width: min(360px, 82vw);
    }

    .moto-zone {
        gap: 14px;
    }

    .landing-name h1 {
        font-size: 24px;
    }

    .landing-name p {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .moto-click-hint {
        font-size: 11px;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .theme-toggle svg {
        width: 15px;
        height: 15px;
    }

    /* Chat */
    .chat-header {
        padding: 10px 14px;
    }

    .chat-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .chat-name {
        font-size: 14px;
    }

    .chat-messages {
        padding: 14px 10px;
        gap: 12px;
    }

    .message {
        max-width: 100%;
        gap: 8px;
    }

    .msg-avatar {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .msg-body {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 14px;
    }

    .chat-input-area {
        padding: 8px 10px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .chat-input-wrapper {
        border-radius: 20px;
        padding: 3px 3px 3px 14px;
    }

    .chat-input {
        font-size: 16px; /* prevents iOS zoom on focus */
        min-height: 36px;
        padding: 8px 0;
    }

    .send-btn {
        width: 34px;
        height: 34px;
    }

    .quick-actions {
        gap: 5px;
        margin-top: 8px;
        padding-top: 8px;
    }

    .quick-action {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Password gate */
    .pw-content {
        gap: 16px;
    }

    .pw-lock {
        width: 52px;
        height: 52px;
    }

    .pw-lock svg {
        width: 26px;
        height: 26px;
    }

    .pw-input-wrapper {
        width: 260px;
    }

    .pw-input {
        font-size: 16px; /* prevents iOS zoom */
    }
}

@media (max-width: 380px) {
    .landing-name h1 {
        font-size: 20px;
    }

    .msg-body {
        padding: 8px 10px;
        font-size: 12px;
    }

    .pw-input-wrapper {
        width: 240px;
    }
}

/* Tall phones — adjust landing vertical spacing */
@media (max-height: 700px) {
    .landing-content {
        gap: 8px;
    }

    .landing-name {
        margin-top: 0;
    }
}
