:root {
    --navy: #0c1d36;
    --navy-soft: #132c4f;
    --blue: #1f6feb;
    --line: #d9e4f2;
    --paper: #ffffff;
    --muted: #64748b;
    --text: #132033;
    --bg: #f6f9fd;
    --danger: #c2410c;
    --success: #0f766e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Arial, "Noto Sans KR", sans-serif;
    background: linear-gradient(180deg, var(--navy) 0, var(--navy) 280px, var(--bg) 280px);
}

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

button,
input,
textarea {
    font: inherit;
}

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    min-height: 72px;
    gap: 24px;
    color: var(--paper);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--navy);
    background: var(--paper);
    border-radius: 8px;
}

.main-nav {
    display: flex;
    gap: 18px;
    margin-right: auto;
    color: #dbeafe;
    font-weight: 700;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
}

.primary-button {
    color: var(--paper);
    background: var(--blue);
}

.ghost-button {
    color: var(--paper);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.24);
}

.full-width {
    width: 100%;
}

.hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 28px;
    align-items: end;
    min-height: 260px;
    padding: 46px 0 34px;
    color: var(--paper);
}

.hero-copy h1,
.auth-copy h1,
.article-view h1 {
    margin: 8px 0 14px;
    font-size: 44px;
    line-height: 1.15;
    letter-spacing: 0;
}

.hero-copy p,
.auth-copy p,
.lead {
    max-width: 640px;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.7;
}

.eyebrow {
    margin: 0;
    color: #82b4ff;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.hero-panel {
    display: grid;
    gap: 6px;
    padding: 22px;
    color: var(--navy);
    background: var(--paper);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(4, 19, 40, 0.22);
}

.hero-panel strong {
    font-size: 52px;
}

.content-section,
.article-view,
.comment-panel,
.auth-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 44px rgba(16, 42, 80, 0.08);
}

.content-section {
    padding: 26px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 4px 0 0;
    font-size: 28px;
}

.section-heading.compact {
    align-items: center;
}

.text-link {
    color: var(--blue);
    font-weight: 800;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.post-card {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.post-card h3 {
    margin: 16px 0 10px;
    font-size: 22px;
    line-height: 1.35;
}

.post-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.card-meta,
.card-footer,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.card-meta span,
.article-meta span,
.user-badge,
.comment-count {
    padding: 6px 10px;
    background: #eef5ff;
    border-radius: 999px;
}

.user-badge {
    color: #111827;
    font-weight: 900;
}

.card-footer {
    margin-top: auto;
    padding-top: 22px;
    justify-content: space-between;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    padding-top: 34px;
}

.form-layout {
    padding-top: 34px;
}

.article-view,
.comment-panel,
.auth-card {
    padding: 28px;
}

.article-view h1 {
    color: var(--navy);
}

.article-view .lead {
    color: var(--muted);
}

.article-body {
    color: #334155;
    font-size: 17px;
    line-height: 1.8;
}

.comment-form,
.post-form,
.auth-card form {
    display: grid;
    gap: 12px;
}

label {
    color: var(--navy);
    font-weight: 800;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    background: #fbfdff;
}

textarea {
    resize: vertical;
}

.form-message {
    min-height: 20px;
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.form-message.is-error {
    color: var(--danger);
}

.form-message.is-success {
    color: var(--success);
}

.comment-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.comment-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.comment-author {
    margin: 0 0 8px;
    color: var(--navy);
    font-weight: 900;
}

.empty-state {
    margin: 0;
    padding: 18px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 8px;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 38px;
    align-items: start;
    min-height: calc(100vh - 150px);
    padding-top: 140px;
    color: var(--text);
}

.auth-copy h1 {
    color: var(--navy);
}

.auth-copy .auth-hero-title {
    color: var(--paper);
    font-size: 56px;
    margin: 0;
}

.auth-copy p {
    color: #334155;
}

.auth-card {
    color: var(--text);
}

.auth-card h2 {
    margin: 0 0 20px;
    font-size: 28px;
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
}

.auth-switch a {
    color: var(--blue);
    font-weight: 800;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 28px 0;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 860px) {
    .site-header,
    .auth-actions {
        flex-wrap: wrap;
    }

    .hero-section,
    .detail-layout,
    .auth-layout {
        grid-template-columns: 1fr;
    }

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

    .hero-copy h1,
    .auth-copy h1,
    .article-view h1 {
        font-size: 34px;
    }

    .auth-layout {
        padding-top: 28px;
    }
}

@media (max-width: 560px) {
    .page-shell {
        width: min(100% - 20px, 1120px);
    }

    .site-header {
        align-items: flex-start;
        padding: 14px 0;
    }

    .main-nav {
        order: 3;
        width: 100%;
    }

    .auth-actions {
        margin-left: auto;
    }

    .content-section,
    .article-view,
    .comment-panel,
    .auth-card {
        padding: 20px;
    }

    .section-heading,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
