:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --bg-accent: #edf7f5;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --surface-soft: #f2f6fb;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.12);
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --accent-soft: rgba(15, 118, 110, 0.12);
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 14px 40px rgba(15, 23, 42, 0.06);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --page-width: 1160px;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #07111c;
    --bg-accent: #0b1b21;
    --surface: rgba(10, 18, 28, 0.82);
    --surface-strong: #0c1723;
    --surface-soft: #0e1f2c;
    --border: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.22);
    --text: #e6eef8;
    --text-muted: #adc0d7;
    --text-dim: #90a4bd;
    --accent: #5eead4;
    --accent-strong: #2dd4bf;
    --accent-soft: rgba(94, 234, 212, 0.14);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 36%),
        radial-gradient(circle at top right, rgba(17, 94, 89, 0.08), transparent 30%),
        linear-gradient(180deg, var(--bg), var(--bg-accent));
    color: var(--text);
}

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

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

button {
    font: inherit;
}

.page-shell {
    width: min(var(--page-width), calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0 80px;
}

.topbar {
    width: min(var(--page-width), calc(100vw - 32px));
    margin: 18px auto 0;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    backdrop-filter: blur(18px) saturate(180%);
    box-shadow: var(--shadow-soft);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}

.brand-name span,
.eyebrow,
.section-kicker,
.post-kicker {
    color: var(--accent);
}

.brand-name {
    font-size: 1rem;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.topnav a {
    transition: color 180ms ease;
}

.topnav a:hover {
    color: var(--text);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-strong);
    background: var(--surface-strong);
    color: var(--text);
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.35);
}

.theme-toggle__icon {
    font-size: 1rem;
}

.hero {
    padding: 54px 8px 28px;
    max-width: 760px;
}

.eyebrow,
.section-kicker,
.post-kicker {
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero h1,
.post-article h1 {
    margin: 16px 0 14px;
    font-family: "Fraunces", Georgia, serif;
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.hero h1 {
    font-size: clamp(3rem, 7vw, 5.4rem);
    max-width: 12ch;
}

.hero p {
    margin: 0;
    max-width: 60ch;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

.featured-section,
.list-section,
.related-section {
    margin-top: 28px;
}

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

.section-head h2 {
    margin: 8px 0 0;
    font-size: clamp(1.35rem, 2vw, 2rem);
    letter-spacing: -0.03em;
}

.status {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.featured-post {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.featured-card {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 380px;
}

.featured-card__media {
    position: relative;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(15, 23, 42, 0.04));
    min-height: 320px;
}

.featured-card__media img,
.post-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-card__media::after,
.post-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.12));
    pointer-events: none;
}

.featured-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 4vw, 40px);
    gap: 14px;
}

.post-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    color: var(--text-dim);
    font-size: 0.92rem;
}

.meta-dot::before {
    content: "•";
    margin-right: 12px;
    color: var(--text-dim);
}

.featured-card h3,
.post-card h3 {
    margin: 0;
    font-family: "Source Serif 4", Georgia, serif;
    letter-spacing: -0.03em;
}

.featured-card h3 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1.02;
    max-width: 13ch;
}

.featured-card p,
.post-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 11px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
}

.card-link,
.post-link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: var(--text);
    font-weight: 700;
}

.card-link {
    color: var(--accent-strong);
}

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

.post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 118, 110, 0.28);
    box-shadow: var(--shadow);
}

.post-card__media {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(15, 23, 42, 0.04));
}

.post-card__content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.post-card h3 {
    font-size: 1.4rem;
    line-height: 1.06;
}

.back-link {
    display: inline-flex;
    margin-bottom: 22px;
    color: var(--text-muted);
    font-weight: 700;
}

.post-article {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 18px 8px 0;
}

.post-article h1 {
    font-size: clamp(2.7rem, 6vw, 4.8rem);
}

.post-hero {
    position: relative;
    margin: 24px 0 30px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    min-height: 280px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.prose {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-muted);
}

.prose > * + * {
    margin-top: 1.2rem;
}

.prose h2,
.prose h3,
.prose h4 {
    margin: 2rem 0 0.8rem;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.prose h2 {
    font-size: 1.8rem;
}

.prose h3 {
    font-size: 1.4rem;
}

.prose a {
    color: var(--accent-strong);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.prose ul,
.prose ol {
    padding-left: 1.3rem;
}

.prose li + li {
    margin-top: 0.5rem;
}

.prose blockquote {
    margin: 1.6rem 0;
    padding: 1rem 1.2rem;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 18px 18px 0;
    color: var(--text);
}

.prose pre {
    overflow-x: auto;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.prose code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.92em;
}

.prose p code,
.prose li code {
    padding: 0.15rem 0.35rem;
    border-radius: 8px;
    background: var(--surface-soft);
}

.prose img {
    border-radius: 18px;
}

.related-section {
    padding: 0 8px;
}

@media (max-width: 980px) {
    .featured-card,
    .post-grid {
        grid-template-columns: 1fr;
    }

    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar {
        width: min(var(--page-width), calc(100vw - 20px));
        padding: 14px 14px;
        flex-wrap: wrap;
        border-radius: 24px;
    }

    .topnav {
        width: 100%;
        order: 3;
        justify-content: space-between;
        gap: 12px;
        font-size: 0.88rem;
    }

    .page-shell {
        width: min(var(--page-width), calc(100vw - 20px));
    }

    .hero {
        padding-top: 40px;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .featured-card {
        min-height: auto;
    }
}
