/* ==========================================================================
   Matthew Kenney — Personal Site
   Warm Parchment palette · Source Serif 4 · JetBrains Mono
   ========================================================================== */

:root {
    --bg:           #FAFAF7;
    --text:         #2C2C2C;
    --text-secondary:#6B6560;
    --accent:       #8B4513;
    --accent-line:  #C4956A;
    --border:       #E5E2DC;
    --code-bg:      #F0EFEB;
    --serif:        'Source Serif 4', Georgia, 'Times New Roman', serif;
    --mono:         'JetBrains Mono', 'Courier New', monospace;
    --content-width: 780px;
    --side-width:    3px;
    --side-offset:   60px;
}

/* ---------- Reset ---------- */

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

/* ---------- Base ---------- */

body {
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

::selection {
    background: var(--accent-line);
    color: var(--text);
}

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

/* ---------- Side decoration ---------- */

.side-decoration {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--side-width);
    height: 100%;
    background: var(--accent);
}

/* ---------- Layout ---------- */

.main-content {
    margin-left: var(--side-offset);
    max-width: var(--content-width);
    padding: 80px 40px;
}

/* ---------- Links (global) ---------- */

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-line);
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

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

/* ---------- Section labels ---------- */

.section-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ---------- Homepage: Intro ---------- */

.intro {
    margin-bottom: 48px;
}

.name {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
    color: var(--text);
}

.links {
    font-family: var(--mono);
    font-size: 14px;
    margin-bottom: 0;
}

.links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.links li {
    display: flex;
    align-items: center;
}

.links li:not(:last-child)::after {
    content: "/";
    margin: 0 10px;
    color: var(--border);
}

.links a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

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

.separator {
    margin: 0 10px;
    color: var(--border);
}

/* ---------- Homepage: Story / Bio ---------- */

.story {
    font-size: 21px;
    line-height: 1.7;
}

.story p {
    margin-bottom: 24px;
}

.story.lead,
.story.lead p {
    font-size: 23px;
    line-height: 1.65;
}

.story a {
    text-decoration-color: var(--accent-line);
}

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

/* ---------- Homepage: Sections ---------- */

.homepage-section {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

/* ---------- Projects: homepage list ---------- */

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

.project-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.project-list a {
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    transition: color 0.2s ease;
}

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

.project-tag {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ---------- Projects: dedicated page grid ---------- */

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.project-card {
    display: block;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    border-color: var(--accent-line);
    box-shadow: 0 2px 12px rgba(139, 69, 19, 0.08);
}

.project-card--featured {
    grid-column: 1 / -1;
    border-color: var(--accent-line);
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}

.project-card:hover .project-title {
    color: var(--accent);
}

.project-desc {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.project-meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent-line);
    letter-spacing: 0.02em;
}

/* ---------- Project detail page ---------- */

.project-hero {
    margin-bottom: 32px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.project-hero img {
    display: block;
    width: 100%;
    height: auto;
}

.project-links {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.project-link {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.project-link:hover {
    color: var(--text);
}

/* ---------- Project card image ---------- */

.project-card-image {
    margin: -24px -24px 16px -24px;
    border-radius: 5px 5px 0 0;
    overflow: hidden;
}

.project-card-image img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
}

/* ---------- Talks list ---------- */

.talks-list ul {
    list-style: none;
}

.talks-list li {
    margin-bottom: 14px;
    font-size: 17px;
    line-height: 1.5;
}

/* ---------- Teaching list ---------- */

.teaching-list ul {
    list-style: none;
}

.teaching-list li {
    margin-bottom: 14px;
    font-size: 17px;
    line-height: 1.5;
}

/* ---------- Grants list ---------- */

.grants-list ul {
    list-style: none;
}

.grants-list li {
    margin-bottom: 14px;
    font-size: 17px;
    line-height: 1.5;
}

/* ---------- Exhibitions list ---------- */

.exhibitions-list ul {
    list-style: none;
}

.exhibitions-list li {
    margin-bottom: 14px;
    font-size: 17px;
    line-height: 1.5;
}

/* ---------- Post list (shared) ---------- */

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

.post-list li {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.post-list a {
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    transition: color 0.2s ease;
}

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

.post-date {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.see-all {
    display: inline-block;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.see-all:hover {
    color: var(--text);
}

/* ---------- Page header (blog, tags, categories, archives) ---------- */

.page-header {
    margin-bottom: 56px;
}

.page-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 12px;
    color: var(--text);
}

.page-nav {
    font-family: var(--mono);
    font-size: 14px;
}

.page-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* ---------- Blog listing ---------- */

.post-preview {
    margin-bottom: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

.post-preview:last-child {
    border-bottom: none;
}

.post-preview h2 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

.post-preview h2 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.post-meta {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.post-tags a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 8px;
    transition: color 0.2s ease;
}

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

.post-summary {
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 16px;
}

.read-more {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: var(--text);
}

/* ---------- Tags page ---------- */

.tag-group {
    margin-bottom: 40px;
}

.tag-group h2 {
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 12px;
}

/* ---------- Categories page ---------- */

.category-group {
    margin-bottom: 40px;
}

.category-group h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ---------- Archives page ---------- */

.archive-entry {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 18px;
}

.archive-entry .post-date {
    min-width: 140px;
}

.archive-entry a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.archive-entry a:hover {
    color: var(--accent);
}

/* ---------- Article ---------- */

.full-article header {
    margin-bottom: 48px;
}

.breadcrumb {
    font-family: var(--mono);
    font-size: 13px;
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.breadcrumb .separator {
    margin: 0 6px;
    color: var(--border);
}

.article-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    color: var(--text);
}

.article-meta {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-secondary);
}

.article-content {
    font-size: 19px;
    line-height: 1.8;
}

.article-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 48px 0 20px;
    letter-spacing: -0.3px;
}

.article-content h2 {
    font-size: 26px;
    font-weight: 600;
    margin: 40px 0 16px;
}

.article-content h3 {
    font-size: 21px;
    font-weight: 600;
    margin: 32px 0 12px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content ul, .article-content ol {
    margin: 20px 0 20px 32px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 24px;
    margin: 32px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-content pre {
    background: var(--code-bg);
    padding: 20px 24px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 28px 0;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid var(--border);
}

.article-content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 0.88em;
}

.article-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 28px 0;
}

.article-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

/* ---------- Article footer: prev/next ---------- */

.article-footer {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 32px;
}

.article-footer .prev,
.article-footer .next {
    flex: 1;
}

.article-footer .next {
    text-align: right;
}

.article-footer .nav-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.article-footer a {
    color: var(--text);
    text-decoration: none;
    font-size: 17px;
    transition: color 0.2s ease;
}

.article-footer a:hover {
    color: var(--accent);
}

/* ---------- Site footer ---------- */

.site-footer {
    margin-left: var(--side-offset);
    max-width: var(--content-width);
    padding: 40px 40px 60px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

/* ---------- Responsive: Tablet ---------- */

@media (max-width: 768px) {
    :root {
        --side-offset: 32px;
        --side-width: 3px;
    }

    .main-content {
        padding: 48px 24px;
    }

    .name {
        font-size: 40px;
    }

    .page-title {
        font-size: 36px;
    }

    .article-title {
        font-size: 32px;
    }

    .story {
        font-size: 18px;
    }

    .story.lead,
    .story.lead p {
        font-size: 20px;
    }

    .links {
        font-size: 13px;
    }

    .separator {
        margin: 0 6px;
    }

    .project-grid,
    .creative-grid {
        grid-template-columns: 1fr;
    }

    .project-card--featured {
        grid-column: auto;
    }

    .post-list li {
        flex-direction: column;
        gap: 4px;
    }

    .article-footer {
        flex-direction: column;
    }

    .article-footer .next {
        text-align: left;
    }

    .site-footer {
        margin-left: var(--side-offset);
        padding: 32px 24px 48px;
    }
}

/* ---------- Responsive: Phone ---------- */

@media (max-width: 480px) {
    :root {
        --side-offset: 24px;
    }

    body {
        font-size: 17px;
    }

    .main-content {
        padding: 32px 16px;
    }

    .name {
        font-size: 32px;
        letter-spacing: -1px;
    }

    .page-title {
        font-size: 28px;
    }

    .article-title {
        font-size: 26px;
    }

    .article-content {
        font-size: 17px;
    }

    .archive-entry {
        flex-direction: column;
        gap: 2px;
    }

    .site-footer {
        margin-left: var(--side-offset);
        padding: 24px 16px 40px;
    }
}

/* ---------- Creative: intro ---------- */

.creative-intro {
    font-size: 19px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* ---------- Creative: listing grid ---------- */

.creative-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.creative-card {
    display: block;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.creative-card:hover {
    border-color: var(--accent-line);
    box-shadow: 0 2px 12px rgba(139, 69, 19, 0.08);
}

.creative-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}

.creative-card:hover .creative-card-title {
    color: var(--accent);
}

.creative-card-desc {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.creative-card-meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent-line);
    letter-spacing: 0.02em;
}

/* ---------- Creative: detail page ---------- */

.creative-collaborators {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.creative-detail .article-content iframe {
    max-width: 100%;
    margin: 28px 0;
    border-radius: 4px;
}

/* ---------- Print ---------- */

@media print {
    .side-decoration,
    .site-footer,
    .breadcrumb,
    .article-footer {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
        max-width: 100%;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .article-content pre {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}
