:root {
    --ink: #0f1f46;
    --ink-soft: #607095;
    --line: rgba(15, 31, 70, 0.1);
    --blue: #1547b7;
    --blue-strong: #0b2d78;
    --red: #e30613;
    --bg: #f4f7ff;
    --surface: rgba(255, 255, 255, 0.94);
    --shadow: 0 22px 50px rgba(18, 52, 126, 0.1);
    --radius: 8px;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Barlow", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(21, 71, 183, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(227, 6, 19, 0.08), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #eef3ff 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(15, 31, 70, 0.12);
    border-radius: var(--radius);
    background: #fff;
    padding: 14px 16px;
    color: var(--ink);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(21, 71, 183, 0.45);
    box-shadow: 0 0 0 4px rgba(21, 71, 183, 0.12);
}

.demo-shell,
.app-shell {
    width: min(1220px, calc(100vw - 36px));
    margin: 0 auto;
}

.demo-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(380px, 0.98fr);
    gap: 28px;
    align-items: center;
    padding: 34px 0;
}

.demo-side,
.panel-card,
.app-card,
.stat-card {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.demo-side {
    padding: 34px;
    background:
        linear-gradient(180deg, rgba(11, 45, 120, 0.98), rgba(227, 6, 19, 0.9)),
        var(--blue-strong);
    color: #fff;
}

.demo-wordmark,
.app-wordmark {
    width: 182px;
    margin-bottom: 20px;
}

.demo-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.demo-side h1,
.app-topbar h1 {
    margin: 18px 0 14px;
    font-size: clamp(1.65rem, 2.8vw, 2.35rem);
    line-height: 1.12;
}

.demo-side p,
.app-topbar p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.55;
}

.demo-feature-list {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.demo-feature-list div {
    padding: 16px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.demo-feature-list strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1rem;
}

.demo-feature-list span {
    display: block;
    color: rgba(255, 255, 255, 0.78);
}

.demo-panel {
    display: flex;
    align-items: center;
}

.panel-card,
.app-card {
    padding: 28px;
}

.panel-card h2,
.app-card h2 {
    margin: 0 0 8px;
    font-size: 1.55rem;
    line-height: 1.1;
}

.panel-copy,
.section-head span {
    color: var(--ink-soft);
}

.demo-roles {
    display: grid;
    gap: 10px;
    margin: 22px 0;
}

.role-row,
.feed-item,
.note-item {
    padding: 14px 16px;
    border-radius: var(--radius);
    background: #f5f8ff;
    border: 1px solid rgba(21, 71, 183, 0.1);
}

.role-row--button {
    appearance: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.role-row--button:hover,
.role-row--button:focus {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(21, 71, 183, 0.12);
    border-color: rgba(21, 71, 183, 0.22);
}

.role-row strong,
.feed-item strong,
.note-item strong {
    display: block;
    margin-bottom: 4px;
}

.role-row span,
.feed-item span,
.note-item span {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.demo-form,
.stack-form {
    display: grid;
    gap: 14px;
}

.demo-form label,
.stack-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.demo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(120deg, var(--red), var(--blue));
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(21, 71, 183, 0.18);
}

.demo-button--ghost {
    background: transparent;
    color: var(--blue);
    box-shadow: inset 0 0 0 1px rgba(21, 71, 183, 0.18);
}

.demo-link {
    display: inline-flex;
    margin-top: 16px;
    color: var(--blue);
    font-weight: 800;
}

.demo-alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: rgba(21, 71, 183, 0.08);
    color: var(--blue);
    font-weight: 700;
}

.demo-alert--error {
    background: rgba(227, 6, 19, 0.1);
    color: #a21220;
}

.app-body {
    padding: 28px 0 34px;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: start;
    padding: 26px 0 18px;
}

.app-topbar p {
    color: var(--ink-soft);
    max-width: 44rem;
}

.app-meta {
    display: grid;
    gap: 12px;
    justify-items: end;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(21, 71, 183, 0.08);
    color: var(--ink);
    font-weight: 700;
}

.stats-grid,
.app-grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.stat-card {
    padding: 22px;
}

.stat-card span {
    display: block;
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 2rem;
    line-height: 1;
}

.app-grid {
    grid-template-columns: 1.15fr 0.85fr;
    margin-bottom: 18px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
    margin-bottom: 18px;
}

.demo-table {
    width: 100%;
    border-collapse: collapse;
}

.demo-table th,
.demo-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #ebf0fb;
    text-align: left;
}

.demo-table th {
    color: var(--ink-soft);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.feed-list,
.note-list {
    display: grid;
    gap: 12px;
}

.feed-item p,
.note-item p {
    margin: 8px 0 0;
    color: var(--ink-soft);
}

@media (max-width: 980px) {
    .demo-shell,
    .stats-grid,
    .app-grid {
        grid-template-columns: 1fr;
    }

    .app-topbar {
        flex-direction: column;
    }

    .app-meta {
        justify-items: start;
    }
}

@media (max-width: 760px) {
    .demo-shell,
    .app-shell {
        width: min(100vw - 20px, 100%);
    }

    .demo-side,
    .panel-card,
    .app-card,
    .stat-card {
        padding: 22px;
    }

    .demo-button,
    .demo-button--ghost {
        width: 100%;
    }

    .demo-table,
    .demo-table thead,
    .demo-table tbody,
    .demo-table tr,
    .demo-table th,
    .demo-table td {
        display: block;
    }

    .demo-table thead {
        display: none;
    }

    .demo-table tr {
        padding: 10px 0;
        border-bottom: 1px solid #ebf0fb;
    }

    .demo-table td {
        border: 0;
        padding: 6px 0;
    }
}
