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

:root {
    --bg: #0a0a0b;
    --bg2: #111113;
    --bg3: #1a1a1e;
    --border: rgba(255,255,255,0.07);
    --border2: rgba(255,255,255,0.12);
    --text: #f0ede8;
    --text2: #9a9691;
    --text3: #5a5753;
    --accent: #e8d5b0;
    --accent2: #c4a96d;
    --green: #4caf78;
    --pulse: rgba(76,175,120,0.4);
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Figtree", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
}

    /* GRAIN */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
        pointer-events: none;
        z-index: 1000;
        opacity: 0.6;
    }

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 0;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
}

.logo {
    font-family: "Figtree", sans-serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.02em;
    font-weight: bold;
}

.logo span {
    color: var(--accent2);
}
.logo-icon {
    width: 35px;
    vertical-align: middle;
    padding-right: 5px;
}
.myai {
    text-decoration: none;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
    color: var(--green);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: bold;
}

.live-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 var(--pulse);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--pulse);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(76,175,120,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76,175,120,0);
    }
}

/* HERO */
.hero {
    padding: 56px 0 20px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.15s forwards;
}

.avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    /*margin-bottom: 28px;*/
}
.avatar-text {
    font-size: 40px;
    flex-shrink: 0;
    color: var(--accent2);
    font-weight: bold;
}

.avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a2520, #3d3428);
    border: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Figtree", sans-serif;
    font-size: 20px;
    color: var(--accent);
    flex-shrink: 0;
}

.avatar-info {
}

.avatar-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.2;
}

.avatar-title {
    font-size: 12px;
    color: var(--text3);
    margin-top: 2px;
}

.avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a2520, #3d3428);
    border: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--accent);
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}
.avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-headline {
    font-family: "Figtree", sans-serif;
    font-size: clamp(34px, 6vw, 52px);
    line-height: 1.12;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

    .hero-headline em {
        font-style: italic;
        color: var(--accent2);
    }

.hero-sub {
    font-size: 15px;
    color: var(--text2);
    font-weight: 300;
    max-width: 480px;
}

/* CHIPS */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0 40px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.3s forwards;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border: 0.5px solid var(--border2);
    border-radius: 100px;
    font-size: 12.5px;
    color: var(--text2);
    background: var(--bg2);
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

    .chip:hover {
        border-color: var(--accent2);
        color: var(--accent);
        background: rgba(196,169,109,0.06);
    }

    .chip.active {
        border-color: var(--accent2);
        color: var(--accent);
        background: rgba(196,169,109,0.1);
    }

/* CHAT */
.chat-area {
    flex: 1;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.45s forwards;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
    min-height: 120px;
}

.msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fadeUp 0.35s ease forwards;
}

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
}

.msg.ai .msg-avatar {
    background: rgba(196,169,109,0.12);
    border: 0.5px solid rgba(196,169,109,0.25);
    color: var(--accent2);
    font-family: "Figtree", sans-serif;
    font-size: 13px;
}
.msg.ai .msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.msg.user .msg-avatar {
    background: var(--bg3);
    border: 0.5px solid var(--border2);
    color: var(--text3);
}
.msg.user .msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.msg.user {
    flex-direction: row-reverse;
}

.msg-bubble {
    max-width: 78%;
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.65;
}

.msg.ai .msg-bubble {
    background: var(--bg2);
    border: 0.5px solid var(--border);
    color: var(--text);
    border-radius: 4px 16px 16px 16px;
}

.msg.user .msg-bubble {
    background: rgba(196,169,109,0.1);
    border: 0.5px solid rgba(196,169,109,0.2);
    color: var(--text);
    border-radius: 16px 4px 16px 16px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 4px 0;
}

.typing-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text3);
    animation: typing 1.2s infinite;
}

    .typing-dot:nth-child(2) {
        animation-delay: 0.2s;
    }

    .typing-dot:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* INPUT */
.input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--bg2);
    border: 0.5px solid var(--border2);
    border-radius: 14px;
    padding: 10px 10px 10px 16px;
    transition: border-color 0.2s;
}

    .input-row:focus-within {
        border-color: rgba(196,169,109,0.35);
    }

.chat-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: "Figtree", sans-serif;
    font-size: 14px;
    font-weight: 300;
    resize: none;
    max-height: 120px;
    min-height: 27px;
    line-height: 1.5;
    placeholder-color: var(--text3);
}

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

.send-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: none;
    background: var(--accent2);
    color: #1a1410;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.18s;
    font-size: 15px;
}

    .send-btn:hover {
        background: var(--accent);
        transform: scale(1.04);
    }

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

    .send-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none;
    }

/* FOOTER */
.footer {
    text-align: center;
    padding: 20px 0 28px;
    font-size: 11.5px;
    color: var(--text3);
    opacity: 0;
    animation: fadeUp 0.6s ease 0.6s forwards;
}

    .footer a {
        color: var(--accent2);
        text-decoration: none;
        opacity: 0.7;
        transition: opacity 0.15s;
    }

        .footer a:hover {
            opacity: 1;
        }

/* DIVIDER */
.section-sep {
    border: none;
    border-top: 0.5px solid var(--border);
    margin: 0 0 24px;
}

/* CONTEXT PILLS */
.context-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--bg2);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    margin-bottom: 20px;
}

.ctx-tag {
    font-size: 11px;
    color: var(--text3);
    background: var(--bg3);
    padding: 3px 9px;
    border-radius: 100px;
    border: 0.5px solid var(--border);
}
#custom-mobile-layer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.layer-content {
    width: 100%;
    max-width: 480px;
    background: #fff;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    text-align: center;
    position: relative;
    animation: slideUp 0.3s ease;
}

    .layer-content h2 {
        font-size: 18px;
        margin-bottom: 8px;
        color: #000000;
    }

    .layer-content p {
        font-size: 14px;
        margin-bottom: 16px;
        color: #555;
    }

.layer-btn {
    display: block;
    background: #000;
    color: #fff;
    padding: 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}

.layer-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 20px;
    cursor: pointer;
}
.media-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 78%;
}

.media-item {
    border-radius: 10px;
    overflow: hidden;
    display: block;
}

.media-image img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    border: 0.5px solid var(--border2);
    display: block;
}

.media-video {
    width: 100%;
    max-width: 400px;
}

.media-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg2);
    border: 0.5px solid var(--border2);
    border-radius: 8px;
    font-size: 13px;
    color: var(--accent2);
    text-decoration: none;
    transition: border-color 0.15s;
}

    .media-link:hover {
        border-color: var(--accent2);
    }
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}
@media (max-width: 480px) {
    .hero {
        padding: 40px 0 28px;
    }

    .hero-headline {
        font-size: 36px;
    }

    .msg-bubble {
        max-width: 88%;
    }
    .avatar-text {
        font-size: 25px;
    }
    .avatar-large {
        width: 40px;
        height: 40px;
    }
}
