/**
 * File: assets/css/index.css
 * Version: 1.0.0
 * Description: Mobile-first visual system for Chatting.im.
 */

:root {
    --bg: #f7f3ea;
    --bg-deep: #eee6d5;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #ffffff;
    --surface-soft: #fbf8f1;
    --text: #171411;
    --muted: #756f65;
    --line: rgba(31, 24, 17, 0.12);
    --line-strong: rgba(31, 24, 17, 0.18);
    --primary: #174f3f;
    --primary-2: #226a55;
    --primary-soft: #dfeee8;
    --gold: #d9a441;
    --peach: #f3c7a4;
    --danger: #a33a2e;
    --shadow: 0 24px 80px rgba(52, 39, 21, 0.12);
    --shadow-soft: 0 16px 40px rgba(52, 39, 21, 0.08);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --max: 1160px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background:
        radial-gradient(circle at 15% 8%, rgba(243, 199, 164, 0.55), transparent 28rem),
        radial-gradient(circle at 90% 15%, rgba(223, 238, 232, 0.95), transparent 26rem),
        linear-gradient(135deg, var(--bg), var(--bg-deep));
    overflow-x: hidden;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(23, 20, 17, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 20, 17, 0.035) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 80%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

textarea {
    resize: vertical;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0;
    backdrop-filter: blur(18px);
}

.site-header.slim {
    width: min(980px, calc(100% - 32px));
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 850;
    letter-spacing: -0.04em;
}

.brand-mark {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #fff;
    font-size: 21px;
    font-weight: 900;
    line-height: 1;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.28), transparent 26%),
        linear-gradient(135deg, var(--primary), var(--primary-2));
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(23, 79, 63, 0.24);
}

.header-link,
.header-pill {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 15px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 750;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.header-pill {
    max-width: 48vw;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-shell {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 70px;
}

.hero {
    display: grid;
    gap: 34px;
    align-items: center;
    min-height: calc(100svh - 116px);
}

.hero-copy {
    max-width: 680px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-bottom: 18px;
    padding: 8px 12px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(223, 238, 232, 0.72);
    border: 1px solid rgba(23, 79, 63, 0.12);
    border-radius: 999px;
}

.eyebrow::before {
    width: 8px;
    height: 8px;
    content: "";
    background: var(--gold);
    border-radius: 99px;
    box-shadow: 0 0 0 5px rgba(217, 164, 65, 0.16);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.hero h1 {
    margin-bottom: 20px;
    font-size: clamp(46px, 13vw, 106px);
    line-height: 0.9;
    letter-spacing: -0.085em;
}

.hero p {
    max-width: 620px;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: clamp(17px, 4vw, 22px);
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    font-weight: 850;
    letter-spacing: -0.02em;
    border: 0;
    border-radius: 999px;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.btn:active {
    transform: translateY(1px) scale(0.99);
}

.btn-primary {
    color: #fff;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.24), transparent 26%),
        linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 16px 36px rgba(23, 79, 63, 0.24);
}

.btn-primary:hover {
    box-shadow: 0 18px 46px rgba(23, 79, 63, 0.3);
}

.btn-ghost,
.btn-soft {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid var(--line);
}

.btn-soft {
    background: var(--primary-soft);
}

.btn-wide {
    width: 100%;
}

.btn-small {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
}

.hero-card {
    position: relative;
    min-height: 360px;
}

.hero-card::before {
    position: absolute;
    inset: 10px;
    content: "";
    background:
        radial-gradient(circle at 30% 20%, rgba(217, 164, 65, 0.42), transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(23, 79, 63, 0.22), transparent 32%),
        rgba(255, 255, 255, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 42px;
    filter: blur(0.2px);
    transform: rotate(-3deg);
}

.chat-window {
    position: relative;
    max-width: 460px;
    margin: 0 auto;
    padding: 18px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 32px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.chat-window-top {
    display: flex;
    gap: 7px;
    margin-bottom: 26px;
}

.chat-window-top span {
    width: 11px;
    height: 11px;
    background: var(--line-strong);
    border-radius: 99px;
}

.bubble {
    width: fit-content;
    max-width: 88%;
    margin-bottom: 12px;
    padding: 13px 15px;
    font-size: 14px;
    line-height: 1.45;
    border-radius: 18px;
}

.bubble.visitor {
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.bubble.owner {
    margin-left: auto;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.feature-strip {
    display: grid;
    gap: 14px;
    margin: 28px 0 70px;
}

.feature-strip article {
    padding: 22px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.feature-strip strong {
    display: block;
    margin-bottom: 8px;
    font-size: 17px;
    letter-spacing: -0.03em;
}

.feature-strip span {
    color: var(--muted);
    line-height: 1.5;
}

.create-panel {
    display: grid;
    gap: 24px;
    align-items: start;
    padding: 22px;
    background: rgba(255, 255, 255, 0.44);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.section-title span {
    display: block;
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-title h2 {
    margin-bottom: 12px;
    font-size: clamp(32px, 9vw, 58px);
    line-height: 0.95;
    letter-spacing: -0.065em;
}

.section-title p {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.55;
}

.card-form,
.message-form {
    display: grid;
    gap: 14px;
}

.card-form {
    padding: 16px;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    border-radius: 28px;
}

label {
    display: grid;
    gap: 7px;
}

label span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
textarea {
    width: 100%;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
    outline: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

input {
    height: 48px;
    padding: 0 14px;
}

textarea {
    padding: 13px 14px;
    line-height: 1.45;
}

input:focus,
textarea:focus {
    background: #fff;
    border-color: rgba(23, 79, 63, 0.35);
    box-shadow: 0 0 0 4px rgba(23, 79, 63, 0.1);
}

.slug-row {
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.slug-row span {
    flex: none;
    padding-left: 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
}

.slug-row input {
    min-width: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.form-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.form-result {
    padding: 12px 14px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.45;
    background: var(--primary-soft);
    border: 1px solid rgba(23, 79, 63, 0.12);
    border-radius: 16px;
}

.form-result.error {
    color: var(--danger);
    background: #fff0ec;
    border-color: rgba(163, 58, 46, 0.16);
}

.public-shell,
.center-shell {
    display: grid;
    width: min(980px, calc(100% - 32px));
    min-height: calc(100svh - 82px);
    margin: 0 auto;
    padding: 26px 0 56px;
    place-items: center;
}

.public-card {
    position: relative;
    display: grid;
    gap: 20px;
    width: 100%;
    overflow: hidden;
    padding: 18px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 34px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.public-orb {
    position: absolute;
    top: -90px;
    right: -80px;
    width: 220px;
    height: 220px;
    pointer-events: none;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.65), transparent 24%),
        linear-gradient(135deg, rgba(217, 164, 65, 0.34), rgba(23, 79, 63, 0.18));
    border-radius: 999px;
    filter: blur(2px);
}

.public-identity {
    position: relative;
    z-index: 1;
    text-align: center;
}

.public-avatar {
    display: grid;
    width: 72px;
    height: 72px;
    margin: 4px auto 16px;
    place-items: center;
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 24px;
    box-shadow: 0 18px 42px rgba(23, 79, 63, 0.22);
}

.public-identity h1 {
    margin-bottom: 10px;
    font-size: clamp(34px, 9vw, 58px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.public-identity p {
    max-width: 540px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.55;
}

.public-chat,
.conversation-panel,
.inbox-panel,
.site-list {
    position: relative;
    z-index: 1;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    border-radius: 26px;
}

.public-chat {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.messages {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 230px;
    max-height: 430px;
    overflow: auto;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 20px;
}

.message {
    width: fit-content;
    max-width: 88%;
    padding: 11px 13px;
    font-size: 14px;
    line-height: 1.45;
    border-radius: 16px;
}

.message.visitor {
    background: #fff;
    border: 1px solid var(--line);
}

.message.owner {
    margin-left: auto;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.message-time {
    display: block;
    margin-top: 5px;
    opacity: 0.68;
    font-size: 11px;
}

.empty-state {
    display: grid;
    min-height: 120px;
    place-items: center;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.notice-card {
    width: min(520px, 100%);
    padding: 28px;
    text-align: center;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    border-radius: 30px;
    box-shadow: var(--shadow-soft);
}

.notice-card h1 {
    margin-bottom: 10px;
    font-size: 34px;
    letter-spacing: -0.05em;
}

.notice-card p {
    color: var(--muted);
    line-height: 1.55;
}

.dashboard-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 56px;
}

.dashboard-top {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 18px;
}

.dashboard-top h1 {
    margin: 0;
    font-size: clamp(34px, 9vw, 64px);
    line-height: 0.95;
    letter-spacing: -0.065em;
}

.dashboard-grid {
    display: grid;
    gap: 16px;
}

.site-list {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.site-list h2 {
    margin: 0 0 4px;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.site-mini-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 20px;
}

.site-mini-card strong {
    letter-spacing: -0.03em;
}

.site-mini-card a {
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.site-mini-card textarea {
    min-height: 84px;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 12px;
}

.inbox-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.inbox-list {
    display: grid;
    gap: 10px;
}

.conversation-item {
    display: grid;
    gap: 6px;
    width: 100%;
    padding: 14px;
    text-align: left;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.conversation-item.active {
    border-color: rgba(23, 79, 63, 0.36);
    box-shadow: 0 0 0 4px rgba(23, 79, 63, 0.08);
}

.conversation-item strong {
    letter-spacing: -0.03em;
}

.conversation-item span,
.conversation-item small {
    color: var(--muted);
}

.conversation-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
}

@media (min-width: 720px) {
    .hero-actions {
        flex-direction: row;
    }

    .btn-wide {
        width: auto;
    }

    .feature-strip {
        grid-template-columns: repeat(3, 1fr);
    }

    .create-panel {
        grid-template-columns: 0.9fr 1.1fr;
        padding: 34px;
    }

    .card-form {
        padding: 22px;
    }

    .public-card {
        grid-template-columns: 0.9fr 1.1fr;
        align-items: center;
        padding: 28px;
    }

    .public-identity {
        text-align: left;
    }

    .public-avatar {
        margin-left: 0;
    }
}

@media (min-width: 960px) {
    .hero {
        grid-template-columns: 1fr 0.72fr;
    }

    .dashboard-grid {
        grid-template-columns: 340px 1fr;
        align-items: start;
    }

    .inbox-panel {
        grid-template-columns: 330px 1fr;
        min-height: 620px;
    }

    .messages {
        max-height: 520px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .hero-card::before {
        animation: ciFloat 8s ease-in-out infinite;
    }

    .public-orb {
        animation: ciPulse 7s ease-in-out infinite;
    }

    @keyframes ciFloat {
        0%,
        100% {
            transform: rotate(-3deg) translateY(0);
        }

        50% {
            transform: rotate(-1deg) translateY(-10px);
        }
    }

    @keyframes ciPulse {
        0%,
        100% {
            transform: scale(1);
            opacity: 0.88;
        }

        50% {
            transform: scale(1.06);
            opacity: 1;
        }
    }
}