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

:root {
    --bg: #f9f7f4;
    --bg-card: #ffffff;
    --text: #1a1917;
    --text-muted: #6b6860;
    --text-faint: #9e9b95;
    --border: #e2dfd8;
    --accent: #c10e0e;
    --accent-light: #f5ede8;
    --tag-bg: #eeece8;
    --font-serif: 'Poppins', Georgia, serif;
    --font-sans: 'Poppins', system-ui, sans-serif;
    --font-mono: 'Poppins', monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #131210;
        --bg-card: #1c1b18;
        --text: #f0ece6;
        --text-muted: #9b9890;
        --text-faint: #66635c;
        --border: #2e2c28;
        --accent: #e8673a;
        --accent-light: #2a1a12;
        --tag-bg: #252320;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

/* NAV */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 max(2rem, calc(50% - 380px));
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 2rem;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text);
}

.nav-logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    font-size: 13px;
    color: var(--text-muted);
    transition: color 0.15s;
}

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

/* WRAPPER */
.wrapper {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* HERO */
.hero {
    padding: 5rem 2rem 3.5rem;
    max-width: 760px;
    margin: 0 auto;
    border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.hero p {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 540px;
    line-height: 1.75;
}

/* ARTICLE LIST */
.articles {
    padding: 3rem 2rem;
    max-width: 760px;
    margin: 0 auto;
}

.month-group {
    margin-bottom: 3rem;
}

.month-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.article-item {
    display: block;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    cursor: pointer;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item:hover .article-title {
    color: var(--accent);
}

.article-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--tag-bg);
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 3px;
}

.article-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--text);
    margin-bottom: 0.5rem;
    transition: color 0.15s;
}

.article-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 600px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.article-author {
    font-size: 12px;
    color: var(--text-faint);
    font-family: var(--font-mono);
}

.article-read {
    font-size: 12px;
    color: var(--text-faint);
    font-family: var(--font-mono);
}

/* ABOUT */
.about {
    padding: 3rem 2rem 4rem;
    max-width: 760px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
}

.about h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--text);
}

.about p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 580px;
    margin-bottom: 1rem;
}

.about p a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* SUBSCRIBE */
.subscribe {
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    max-width: 760px;
    margin: 0 auto 4rem;
}

.subscribe h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.subscribe p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.subscribe-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.subscribe-form input {
    flex: 1;
    min-width: 200px;
    height: 38px;
    padding: 0 12px;
    font-size: 14px;
    font-family: var(--font-sans);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    outline: none;
}

.subscribe-form input:focus {
    border-color: var(--accent);
}

.subscribe-form input::placeholder {
    color: var(--text-faint);
}

.btn {
    height: 38px;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.btn:hover {
    opacity: 0.85;
}

/* MODAL / ARTICLE VIEW */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.modal-overlay.open {
    display: block;
}

.modal {
    background: var(--bg);
    border-radius: 10px;
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 2.5rem 3rem;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--tag-bg);
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.modal-close:hover {
    background: var(--border);
}

.modal-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.modal h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.modal-byline {
    font-size: 13px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-body {
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--text);
}

.modal-body p {
    margin-bottom: 1.25rem;
}

.modal-body h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 400;
    margin: 2rem 0 0.75rem;
    color: var(--text);
}

.modal-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
    font-family: var(--font-serif);
    font-size: 1.1rem;
}

/* FOOTER */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    max-width: 760px;
    margin: 0 auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    list-style: none;
}

.footer-links a {
    font-size: 12px;
    color: var(--text-faint);
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--text-muted);
}

/* ANIMATIONS */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero,
.month-group,
.about,
.subscribe {
    animation: fadeUp 0.5s ease both;
}

.month-group:nth-child(2) {
    animation-delay: 0.05s;
}

.month-group:nth-child(3) {
    animation-delay: 0.1s;
}

.month-group:nth-child(4) {
    animation-delay: 0.15s;
}

@media (max-width: 600px) {
    .nav-links {
        display: none;
    }

    .hero {
        padding: 3rem 1.25rem 2.5rem;
    }

    .articles,
    .about {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .subscribe {
        margin-left: 1.25rem;
        margin-right: 1.25rem;
    }

    .modal {
        padding: 1.75rem 1.25rem 2rem;
    }
}

.red {
    color: #c10e0e;
}