* {
    box-sizing: border-box;
}

:root {
    --blue: #063763;
    --cyan: #0797c8;
    --magenta: #cc2f9c;
    --orange: #f3a51b;
    --green: #007c72;
    --text: #08345f;
    --muted: #777;
    --border: #ead9c8;
    --bg: #faead8;
    --card: #fff;
    --shadow: 0 12px 28px rgba(143, 83, 39, .18);
}

html,
body {
    margin: 0;
    font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, #fff 0%, var(--bg) 100%);
    min-height: 100%;
}

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

button,
input,
textarea {
    font: inherit;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--blue);
    font-size: 24px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
    background: conic-gradient(from 20deg, #f7c948, #cc2f9c, #0878be, #049e8b, #f7c948);
}

.btn {
    border: 1px solid #ddd;
    background: white;
    color: var(--blue);
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--magenta);
    color: white;
    border-color: var(--magenta);
    box-shadow: 0 5px 10px rgba(98, 25, 74, .22);
}

.btn-light {
    background: white;
}

.btn-soft {
    background: #e5f0ee;
    color: var(--green);
}

.btn-outline {
    color: var(--magenta);
    border-color: var(--magenta);
    background: white;
}

.btn-outline-blue {
    color: #0878be;
    border-color: #0878be;
    background: white;
}

.btn-large {
    min-width: 180px;
    padding: 16px 28px;
    font-size: 18px;
}

.btn-full {
    width: 100%;
    padding: 18px 28px;
    font-size: 22px;
}

.icon-button {
    border: 0;
    background: transparent;
    color: #b63b3b;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.public-header {
    height: 128px;
    background: white;
    border-bottom: 1px solid #d6d0ca;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 70px;
}

.public-nav,
.landing-actions {
    display: flex;
    gap: 16px;
}

.landing-main {
    min-height: calc(100vh - 128px);
    padding: 80px 7vw;
}

.landing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: start;
}

.landing-copy h1 {
    font-size: clamp(46px, 6vw, 76px);
    line-height: 1.15;
    margin: 0 0 35px;
    letter-spacing: -0.05em;
}

.landing-copy p {
    max-width: 560px;
    color: var(--muted);
    font-size: 25px;
    line-height: 1.8;
}

.stats-row {
    display: flex;
    gap: 110px;
    margin-top: 75px;
}

.stats-row strong {
    display: block;
    font-size: 30px;
    color: var(--blue);
}

.stats-row span {
    color: var(--muted);
    font-size: 20px;
}

.landing-cards {
    display: grid;
    gap: 26px;
}

.app-body {
    min-height: 100vh;
}

.shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    background: white;
    border-right: 1px solid #d0cbc5;
    box-shadow: 2px 0 4px rgba(0,0,0,.12);
    padding: 48px 52px;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-size: 22px;
}

.sidebar-nav {
    display: grid;
    gap: 24px;
    margin-top: 80px;
}

.sidebar-nav a {
    color: var(--blue);
    font-size: 18px;
    display: flex;
    gap: 18px;
    align-items: center;
}

.sidebar-nav a.is-active {
    color: #0797c8;
}

.sidebar-logout,
.sidebar-guest {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.shell-main {
    min-width: 0;
}

.topbar {
    height: 112px;
    background: white;
    border-bottom: 1px solid #d0cbc5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 52px;
}

.search-box {
    width: min(430px, 70vw);
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
}

.search-box span {
    color: #0c77bb;
    font-size: 30px;
}

.search-box input {
    border: 0;
    outline: 0;
    width: 100%;
    height: 54px;
    color: var(--text);
    box-shadow: none;
    min-height: auto;
    padding: 0;
}

.top-avatar,
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--magenta), var(--cyan));
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    overflow: hidden;
    flex: 0 0 auto;
}

.avatar img,
.top-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content {
    padding: 48px 44px 90px;
}

.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 650px) 300px;
    gap: 38px;
    align-items: start;
}

.feed-column,
.narrow-page,
.profile-page {
    max-width: 940px;
    margin: 0 auto;
}

.composer-card,
.post-card,
.side-card,
.list-card,
.library-card,
.auth-card {
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.composer-card {
    padding: 28px;
    margin-bottom: 32px;
}

.composer-row {
    display: flex;
    gap: 18px;
}

.composer-row textarea {
    flex: 1;
    border: 0;
    resize: vertical;
    min-height: 90px;
    outline: 0;
    font-size: 18px;
    box-shadow: none;
    padding: 0;
}

.composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.composer-help {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.file-picker {
    display: inline-flex;
    font-size: 15px;
    color: #111;
    cursor: pointer;
}

.file-picker input {
    display: none;
}

.image-alt-fields {
    display: grid;
    gap: 10px;
    margin: 16px 0;
    padding-left: 66px;
}

.alt-field {
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
}

.alt-field input {
    min-height: 42px;
    border-radius: 10px;
    box-shadow: none;
    padding: 0 14px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin: 22px 0;
    flex-wrap: wrap;
}

.tab {
    border: 1px solid var(--border);
    background: white;
    color: var(--muted);
    border-radius: 8px;
    padding: 7px 16px;
    font-weight: 800;
    font-size: 13px;
}

.tab.active {
    background: var(--orange);
    color: white;
    border-color: var(--orange);
}

.post-card {
    padding: 28px 36px;
    margin-bottom: 28px;
}

.post-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.post-author {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.post-author strong {
    display: block;
    color: var(--blue);
}

.post-author span {
    display: block;
    color: #777;
    font-size: 13px;
}

.post-card p {
    color: #111;
    line-height: 1.7;
    word-break: break-word;
}

.post-actions {
    display: flex;
    gap: 30px;
    color: var(--magenta);
    margin-top: 20px;
}

.muted {
    color: #888;
}

.post-image-placeholder {
    height: 150px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0e7890, #9ed0c0);
    margin-top: 16px;
}

.post-images {
    display: grid;
    gap: 4px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 8px;
}

.post-images figure {
    margin: 0;
    background: #f2f2f2;
}

.post-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-height: 520px;
}

.post-images-1 {
    grid-template-columns: 1fr;
}

.post-images-1 img {
    max-height: 520px;
    object-fit: contain;
}

.post-images-2 {
    grid-template-columns: 1fr 1fr;
}

.post-images-2 figure {
    height: 280px;
}

.post-images-3,
.post-images-4 {
    grid-template-columns: 1fr 1fr;
}

.post-images-3 figure,
.post-images-4 figure {
    height: 190px;
}

.side-card {
    padding: 28px;
}

.narrow-page h1,
.profile-page h1 {
    font-size: 38px;
    margin: 0 0 4px;
}

.page-subtitle {
    color: var(--muted);
    font-size: 18px;
    margin-top: 0;
}

.list-card {
    overflow: hidden;
}

.list-row {
    min-height: 86px;
    padding: 22px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.list-row:last-child {
    border-bottom: 0;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.library-card {
    padding: 38px;
    min-height: 170px;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 70px 20px;
}

.auth-main {
    width: 100%;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(820px, 100%);
    padding: 64px 110px;
    text-align: center;
}

.auth-card-wide {
    width: min(1080px, 100%);
}

.auth-brand {
    justify-content: center;
    margin-bottom: 40px;
}

.auth-card h1 {
    font-size: 42px;
    margin: 0 0 8px;
}

.auth-card > p {
    color: var(--muted);
    font-size: 22px;
    margin-bottom: 48px;
}

.form-stack,
.form-grid {
    text-align: left;
}

.form-stack {
    display: grid;
    gap: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 34px;
}

.form-grid-full {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 10px;
    font-weight: 800;
    color: #666;
    font-size: 22px;
}

input,
textarea {
    border: 1px solid #ddd;
    border-radius: 14px;
    min-height: 68px;
    padding: 0 28px;
    box-shadow: 0 4px 10px rgba(0,0,0,.14);
    background: #fff;
}

.checkbox-line {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 18px;
    font-weight: 500;
}

.checkbox-line input {
    min-height: auto;
    width: 24px;
    height: 24px;
    box-shadow: none;
}

.form-link,
.auth-switch a {
    color: #0878be;
    font-weight: 700;
}

.form-link {
    justify-self: end;
}

.auth-switch {
    margin-top: 28px !important;
    font-size: 20px !important;
}

.auth-switch a {
    color: var(--magenta);
}

.alert {
    text-align: left;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.alert-success {
    background: #e9f7ef;
    color: #17643a;
}

.alert-error {
    background: #ffe8e8;
    color: #8a1b1b;
}

.profile-cover {
    height: 260px;
    background: linear-gradient(135deg, #0d6078, #12a1bd);
    border-radius: 0;
}

.profile-info {
    background: white;
    padding: 0 42px 50px;
    display: flex;
    gap: 28px;
    align-items: center;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--magenta), var(--cyan));
    color: white;
    display: grid;
    place-items: center;
    font-size: 54px;
    font-weight: 800;
    margin-top: -75px;
    border: 6px solid white;
}

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

    .sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        min-height: 70px;
        height: 70px;
        z-index: 20;
        padding: 0;
        border-right: 0;
        border-top: 1px solid #ddd;
    }

    .sidebar-brand,
    .sidebar-logout,
    .sidebar-guest {
        display: none;
    }

    .sidebar-nav {
        display: flex;
        justify-content: space-around;
        margin: 0;
        height: 100%;
        align-items: center;
    }

    .sidebar-nav a {
        font-size: 13px;
        flex-direction: column;
        gap: 2px;
    }

    .topbar {
        height: 82px;
        padding: 0 18px;
    }

    .content {
        padding: 26px 16px 100px;
    }

    .page-grid,
    .landing-grid,
    .library-grid {
        grid-template-columns: 1fr;
    }

    .right-column {
        display: none;
    }

    .public-header {
        height: auto;
        padding: 20px;
        gap: 18px;
        flex-wrap: wrap;
    }

    .landing-main {
        padding: 40px 20px;
    }

    .landing-copy h1 {
        font-size: 44px;
    }

    .landing-copy p {
        font-size: 18px;
    }

    .stats-row {
        gap: 40px;
        margin-top: 40px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 42px 24px;
    }

    .auth-card h1 {
        font-size: 34px;
    }

    label {
        font-size: 18px;
    }

    input {
        min-height: 58px;
    }

    .post-card {
        padding: 22px;
    }

    .post-images-2 figure,
    .post-images-3 figure,
    .post-images-4 figure {
        height: 150px;
    }

    .image-alt-fields {
        padding-left: 0;
    }
}
