/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --text-faint: #9ca3af;
    --border: #e8e8e8;
    --accent: #15803d;
    --accent-hover: #166534;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12141a;
        --text: #e8e8ea;
        --text-muted: #9ca3af;
        --text-faint: #6b7280;
        --border: #262a33;
        --accent: #4ade80;
        --accent-hover: #86efac;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    padding: 0 24px 80px;
    max-width: 720px;
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

/* === HEADER === */
header {
    padding: 32px 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 56px;
}

.header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

.site-title {
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--text);
}

/* === NAVIGATION === */
nav {
    display: flex;
    gap: 22px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease;
}

nav a:hover {
    color: var(--accent);
}

/* === SECTION HEADINGS === */
h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin-top: 48px;
    margin-bottom: 24px;
    font-weight: 600;
}

h2:first-of-type {
    margin-top: 0;
}

/* === BODY TEXT === */
main p {
    margin-bottom: 20px;
    color: var(--text);
    font-size: 15.5px;
}

/* === POSTS LIST === */
.post-list {
    list-style: none;
}

.post-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.post-list a {
    color: var(--text);
    text-decoration: none;
    font-size: 15.5px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.post-list a:hover {
    color: var(--accent);
}

.post-list .date {
    color: var(--text-faint);
    font-size: 13px;
    white-space: nowrap;
}

/* === BLOG POST === */
.post-title {
    font-size: 26px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 8px;
}

article .date {
    color: var(--text-faint);
    font-size: 13.5px;
    margin-bottom: 32px;
    display: block;
}

article h3 {
    font-size: 17px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 10px;
}

article p {
    margin-bottom: 20px;
    color: var(--text);
    font-size: 15.5px;
}

.back-link {
    display: inline-block;
    margin-top: 44px;
    color: var(--text-faint);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s ease;
}

.back-link:hover {
    color: var(--accent);
}

/* === BODY LINKS === */
main p a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

main p a:hover {
    color: var(--accent-hover);
}

/* === PUBLICATIONS === */
.pub-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 36px 0 14px;
}

.pub-section-title:first-of-type {
    margin-top: 0;
}

.publication-list {
    list-style: none;
}

.publication-list li {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.pub-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.pub-details {
    font-size: 13px;
    color: var(--text-faint);
    margin-bottom: 8px;
}

.pub-abstract {
    font-size: 14.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.pub-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
}

.pub-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* === SUBSCRIBE === */
/* Native <details> disclosure, so the form needs no JavaScript. */
.subscribe-toggle {
    position: relative;
}

.subscribe-toggle summary {
    list-style: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.subscribe-toggle summary::-webkit-details-marker {
    display: none;
}

.subscribe-toggle summary:hover,
.subscribe-toggle[open] summary {
    color: var(--accent);
}

.subscribe-toggle summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

.subscribe-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 14px);
    z-index: 10;
    width: 340px;
    max-width: calc(100vw - 40px);
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

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

.subscribe-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}

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

.subscribe-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.subscribe-button {
    flex: 0 0 auto;
    padding: 10px 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--bg);
    background: var(--accent);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.subscribe-button:hover {
    background: var(--accent-hover);
}

.subscribe-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Label kept for screen readers; the placeholder carries the visual cue. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === EMPTY STATE === */
.empty-note {
    color: var(--text-faint);
    font-size: 15px;
}

/* === FOOTER === */
footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 13px;
}

/* === RESPONSIVE === */
@media (max-width: 520px) {
    body {
        padding: 0 18px 60px;
    }

    header {
        padding: 24px 0 16px;
        margin-bottom: 40px;
    }

    .site-title {
        font-size: 24px;
    }

    .post-title {
        font-size: 22px;
    }
}
