@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --color-bg: #efefef;
    --color-text: #1c1c1c;
    --color-accent: #32ff00;
    --color-muted: #6f6f6f;
    --color-white: #ffffff;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'DM Sans', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    overflow: hidden;
}

/* Shared community toy template */

.portfolio-page {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 24px;
}

.ask-cio-page {
    min-height: 100vh;
}

/* Back link - same as Wall */

.interact-cta {
    position: relative;
    z-index: 260;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: var(--color-text);
    text-decoration: none;

    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.03em;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.interact-cta:hover {
    transform: translateX(-6px);
    opacity: 0.7;
}

.cta-arrow {
    transition: transform 0.25s ease;
}

.interact-cta:hover .cta-arrow {
    transform: translateX(-6px);
}

/* Center intro - same as Wall */

.wall-center {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 50;

    width: min(720px, calc(100vw - 48px));

    transform: translate(-50%, -50%);

    text-align: center;

    pointer-events: none;
}

.portfolio-kicker {
    font-size: clamp(1rem, 1.6vw, 1.5rem);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.portfolio-title {
    max-width: 20ch;
    margin: 0 auto;

    font-size: clamp(4rem, 5vw, 9rem);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--color-text);
}

.portfolio-highlight {
    display: inline;
    background: var(--color-accent);
    color: var(--color-text);
    font-size: 0.7em;
    padding: 0.02em 0.12em 0.08em;

    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;

    line-height: 1.25;
}

.wall-note-trigger {
    margin-top: 28px;

    border: none;
    background: transparent;

    font: inherit;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;

    color: var(--color-text);

    cursor: pointer;

    pointer-events: auto;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.wall-note-trigger:hover {
    opacity: 0.65;
    transform: translateY(-2px);
}

/* Ask Cio only */

.ask-chat-shell {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 40;

    width: min(820px, calc(60vw - 48px));
    height: min(720px, calc(100vh - 140px));

    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: column;
}

.chat-thread {
    flex: 1;

    display: flex;
    flex-direction: column;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 60px 0 140px;

    scrollbar-width: none;
    -ms-overflow-style: none;

    mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.2) 4%,
    rgba(0, 0, 0, 0.65) 8%,
    rgba(0, 0, 0, 1) 14%,
    rgba(0, 0, 0, 1) 100%
    );

    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.2) 4%,
        rgba(0, 0, 0, 0.65) 8%,
        rgba(0, 0, 0, 1) 14%,
        rgba(0, 0, 0, 1) 100%
    );
}

.chat-thread::-webkit-scrollbar {
    display: none;
}

.chat-message {
    display: flex;
    width: 100%;
    margin-bottom: 14px;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.cio {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: min(75%, 620px);

    padding: 12px 16px;

    border-radius: 18px;

    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -0.02em;

    color: var(--color-text);

    animation: messageIn 0.22s ease both;
}

.chat-message.user .chat-bubble {
    background: var(--color-accent);
    border-top-right-radius: 6px;
}

.chat-message.cio .chat-bubble {
    background: var(--color-white);
    border-top-left-radius: 6px;
}

.chat-bubble a {
    color: inherit;
    font-weight: 800;
    text-decoration: none;
}

.chat-bubble a:hover {
    opacity: 0.7;
}

.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 14px 16px;

    border-radius: 18px;
    border-top-left-radius: 6px;

    background: var(--color-white);
}

.typing-dot {
    width: 6px;
    height: 6px;

    border-radius: 999px;

    background: var(--color-text);

    animation: typingBounce 1s infinite ease-in-out;
}

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

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

.question-pills {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;

    padding-top: 12px;
}

.question-pills:not([hidden]) {
    display: flex;
}

.question-pills.is-disabled {
    pointer-events: none;
    opacity: 0.55;
}

.question-pill {
    border: none;
    outline: none;

    background: var(--color-white);
    color: var(--color-text);

    padding: 10px 14px;

    border-radius: 999px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;

    cursor: pointer;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        background 0.25s ease;
}

.question-pill:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

.question-pill-row-break {
    display: none;
}

/* Animations */

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

@keyframes typingBounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Responsive - same base padding as Wall */

@media (max-width: 768px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .portfolio-page {
        width: 100%;
        min-height: 100svh;
        padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
        overflow: hidden;
    }

    .interact-cta {
        position: fixed;
        left: 18px;
        top: calc(18px + env(safe-area-inset-top));
        z-index: 260;
        font-size: 1.5rem;
    }

    .wall-center {
        width: calc(100vw - 32px);
    }

    .wall-note-trigger {
        margin-top: 0;
        font-size: 1.5rem;
    }

    .ask-chat-shell {
        inset: 0;
        left: 0;
        top: 0;
        width: 100%;
        height: 100svh;
        padding:
            calc(62px + env(safe-area-inset-top))
            16px
            calc(18px + env(safe-area-inset-bottom));
        transform: none;
        z-index: 40;
    }

    .chat-thread {
        padding: 56px 0 150px;
        mask-image: linear-gradient(
            to bottom,
            transparent 0%,
            rgba(0, 0, 0, 0.35) 5%,
            rgba(0, 0, 0, 1) 13%,
            rgba(0, 0, 0, 1) 94%,
            rgba(0, 0, 0, 0.35) 98%,
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(
            to bottom,
            transparent 0%,
            rgba(0, 0, 0, 0.35) 5%,
            rgba(0, 0, 0, 1) 13%,
            rgba(0, 0, 0, 1) 94%,
            rgba(0, 0, 0, 0.35) 98%,
            transparent 100%
        );
    }

    .chat-message {
        margin-bottom: 10px;
    }

    .chat-bubble {
        width: fit-content;
        max-width: min(78%, 320px);
        padding: 11px 14px;
        border-radius: 17px;
        font-size: 20px;
        line-height: 1.42;
    }

    .chat-message.user .chat-bubble {
        border-top-right-radius: 6px;
    }

    .chat-message.cio .chat-bubble,
    .typing-bubble {
        border-top-left-radius: 6px;
    }

    .typing-bubble {
        gap: 7px;
        padding: 16px 18px;
        border-radius: 17px;
        border-top-left-radius: 6px;
    }

    .typing-dot {
        width: 8px;
        height: 8px;
    }

    .question-pills {
        flex: 0 0 auto;
        justify-content: center;
        gap: 8px 10px;
        width: min(100%, 430px);
        margin-inline: auto;
        padding: 12px 0 0;
        overflow: visible;
        flex-wrap: wrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .question-pills::-webkit-scrollbar {
        display: none;
    }

    .question-pill {
        flex: 0 0 auto;
        padding: 10px 14px;
        font-size: 20px;
        white-space: normal;
    }

    .question-pill-row-break {
        display: block;
        flex: 0 0 100%;
        width: 100%;
        height: 0;
        margin: -8px 0 0;
        pointer-events: none;
    }
}
