/* ====== demo.aicrowd.hu — global ====== */
:root {
    --ink: #1c1917; --paper: #faf9f6; --coral: #e85d40; --coral-deep: #c44530;
    --clay: #a3836a; --sand: #e7e0d6; --chalk: #f5f0eb;
    --ink-soft: rgba(28, 25, 23, 0.06);
    --font-display: 'Sora', sans-serif;
    --font-body: 'Source Sans 3', sans-serif;
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

code {
    background: var(--chalk);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

a { color: var(--coral-deep); }
a:hover { color: var(--coral); }

.container {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ====== Hero ====== */
.hero {
    background: var(--ink);
    color: var(--paper);
    padding: 4rem 0 3rem;
    border-bottom: 1px solid rgba(232, 93, 64, 0.15);
}
.hero__badge {
    display: inline-block;
    border: 1px solid rgba(232, 93, 64, 0.5);
    color: var(--coral);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.35rem 1rem;
    border-radius: 100px;
    margin-bottom: 1.5rem;
}
.hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    margin-bottom: 1rem;
    max-width: 22ch;
}
.hero h1 .coral { color: var(--coral); }
.hero__sub {
    font-size: 1.05rem;
    color: rgba(250, 249, 246, 0.7);
    max-width: 60ch;
    margin-bottom: 1.25rem;
}
.hero__meta {
    font-size: 0.85rem;
    color: rgba(250, 249, 246, 0.45);
}
.hero__meta code {
    background: rgba(255, 255, 255, 0.08);
    color: var(--coral);
}

/* ====== Cards ====== */
main { padding: 3rem 0 4rem; }
.card {
    background: white;
    border: 1px solid var(--ink-soft);
    border-radius: 12px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
}
.card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--ink);
}
.card ul { padding-left: 1.5rem; }
.card li { margin-bottom: 0.35rem; }
.card p { margin-bottom: 0.5rem; max-width: 64ch; }
.card--note {
    background: var(--chalk);
    border-left: 4px solid var(--coral);
}

/* ====== Footer ====== */
.footer {
    background: var(--ink);
    color: rgba(250, 249, 246, 0.6);
    padding: 1.75rem 0;
    text-align: center;
    font-size: 0.88rem;
}
.footer a { color: var(--coral); }

/* ====== Chat widget ====== */
#aicrowd-chat { display: none; }
.acw {
    font-family: var(--font-body);
    font-size: 0.96rem;
    color: var(--ink);
}
.acw__btn {
    position: fixed;
    z-index: 9999;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--coral);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(232, 93, 64, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: transform 0.2s var(--ease-out), background 0.2s;
}
.acw__btn:hover { background: var(--coral-deep); transform: scale(1.05); }
.acw__btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.acw__btn .acw__close { display: none; }
.acw--open .acw__btn .acw__open { display: none; }
.acw--open .acw__btn .acw__close { display: inline; }

.acw__panel {
    position: fixed;
    bottom: 6.5rem;
    right: 1.5rem;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 540px;
    max-height: calc(100vh - 8rem);
    background: white;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(28, 25, 23, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}
.acw--open .acw__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.acw__header {
    background: var(--ink);
    color: var(--paper);
    padding: 1rem 1.25rem;
    font-family: var(--font-display);
}
.acw__header h3 {
    font-size: 1rem;
    margin-bottom: 0.15rem;
    color: var(--paper);
}
.acw__header p {
    font-size: 0.78rem;
    color: rgba(250, 249, 246, 0.6);
    margin: 0;
}

.acw__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    background: var(--chalk);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.acw__msg {
    max-width: 85%;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.acw__msg--bot {
    background: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--ink-soft);
}
.acw__msg--user {
    background: var(--coral);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.acw__msg--system {
    background: rgba(232, 93, 64, 0.08);
    color: var(--coral-deep);
    font-size: 0.85rem;
    align-self: center;
    text-align: center;
    border-radius: 8px;
    max-width: 95%;
    border: 1px dashed rgba(232, 93, 64, 0.3);
}
.acw__typing {
    background: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--ink-soft);
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
}
.acw__typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--clay);
    border-radius: 50%;
    margin: 0 2px;
    animation: acw-dot 1.2s infinite ease-in-out;
}
.acw__typing span:nth-child(2) { animation-delay: 0.15s; }
.acw__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes acw-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.acw__form {
    border-top: 1px solid var(--ink-soft);
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    background: white;
}
.acw__input {
    flex: 1;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--ink-soft);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--chalk);
    resize: none;
    line-height: 1.4;
    max-height: 100px;
}
.acw__input:focus { outline: 2px solid var(--coral); outline-offset: 0; background: white; }
.acw__send {
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 10px;
    padding: 0 0.95rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}
.acw__send:hover:not(:disabled) { background: var(--coral-deep); }
.acw__send:disabled { opacity: 0.4; cursor: not-allowed; }

.acw__footer {
    font-size: 0.7rem;
    color: var(--clay);
    text-align: center;
    padding: 0.4rem 0.5rem 0.65rem;
    background: white;
}
.acw__footer a { color: var(--clay); text-decoration: underline; }

@media (max-width: 480px) {
    .acw__btn { bottom: 1rem; right: 1rem; }
    .acw__panel {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .acw__btn, .acw__panel { transition: none; }
    .acw__typing span { animation: none; }
}
