:root {
    --bg: #f7f5f0;
    --surface: #fffefa;
    --text: #25231f;
    --muted: #6f6a60;
    --line: #d8d1c4;
    --accent: #1f6f78;
    --accent-dark: #164f56;
    --warm: #9b4f2f;
    --shadow: 0 18px 48px rgba(49, 43, 34, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Helvetica Neue", Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.7;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(37, 35, 31, 0.035) 1px, transparent 1px),
        linear-gradient(rgba(37, 35, 31, 0.028) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.32), transparent 38%);
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

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

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

.site-shell {
    width: min(1040px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.site-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 58px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.site-header--compact {
    margin-bottom: 28px;
}

.site-title {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.93rem;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--text);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 44px;
    align-items: start;
    margin-bottom: 58px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--warm);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    color: var(--text);
    line-height: 1.15;
}

h1 {
    max-width: 760px;
    margin: 0 0 24px;
    font-size: clamp(2.35rem, 6vw, 4.9rem);
    font-weight: 700;
}

h2 {
    margin: 0 0 16px;
    font-size: 1.5rem;
}

h3 {
    margin: 0;
    font-size: 1.08rem;
}

p {
    margin: 0 0 18px;
}

.lead {
    max-width: 710px;
    color: #34312c;
    font-size: 1.1rem;
}

.home-intro {
    max-width: 760px;
}

.home-intro h1 {
    margin-bottom: 10px;
    font-size: 2.15rem;
}

.home-nav {
    margin-bottom: 24px;
}

.home-intro p {
    max-width: 720px;
    color: #34312c;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 24px;
    font-size: 0.96rem;
}

.secret-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.profile-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.profile-panel img {
    aspect-ratio: 4 / 3;
    width: 100%;
    object-fit: cover;
    border-bottom: 1px solid var(--line);
}

.profile-panel__body {
    padding: 18px;
}

.profile-panel__body p {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.section {
    margin-top: 52px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.writing-archive {
    max-width: 820px;
}

.writing-archive h1 {
    margin-bottom: 8px;
    font-size: 2rem;
}

.featured-section {
    margin-top: 18px;
}

.page-note {
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 0.98rem;
}

.archive-heading {
    margin: 34px 0 18px;
    font-size: 1.25rem;
}

.article-shell {
    width: min(860px, calc(100% - 40px));
}

.article {
    max-width: 800px;
    margin: 0 auto;
    background: var(--surface);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.article h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text);
}

.article h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text);
}

.article h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text);
}

.article h4 {
    margin: 0 0 10px;
    font-size: 1.15rem;
    color: var(--text);
}

.article p {
    margin-bottom: 20px;
    font-size: 1rem;
}

.article a {
    color: var(--accent);
    text-decoration: none;
}

.article a:hover {
    text-decoration: underline;
}

.article img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px 0;
}

.article ul,
.article ol {
    margin: 20px 0 20px 40px;
}

.article li {
    margin-bottom: 10px;
}

.article blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-left: 5px solid #ccc;
    font-style: italic;
}

.article pre,
.article code {
    background-color: #eef;
    padding: 5px;
    overflow-x: auto;
    font-family: "Courier New", Courier, monospace;
    font-size: 1em;
    border: 2px solid #c8b8ee;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    margin: 1em 0;
}

.article table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.article th,
.article td {
    border: 1px solid #ddd;
    padding: 8px;
}

.article th {
    background-color: #f2f2f2;
    text-align: left;
}

.article iframe {
    max-width: 100%;
}

.writing-archive .item {
    padding: 8px 0;
    border-bottom: 0;
}

.writing-archive .item a {
    text-decoration: none;
}

.writing-archive .item a:hover {
    color: var(--accent-dark);
}

.featured-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.featured-card {
    min-width: 0;
}

.featured-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.featured-card__thumb {
    aspect-ratio: 16 / 9;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
    background: #f8f6f1;
}

.featured-card__body {
    padding-top: 10px;
}

.featured-card__body h3 {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.35;
}

.featured-card__link:hover .featured-card__thumb {
    border-color: rgba(31, 111, 120, 0.35);
}

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

.section-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

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

.item-list {
    display: grid;
    gap: 14px;
}

.item {
    padding: 18px 0;
    border-bottom: 1px solid rgba(216, 209, 196, 0.82);
}

.item:first-child {
    padding-top: 0;
}

.item p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.55;
}

.item-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
}

.item-date {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

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

.project-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.project-card img {
    aspect-ratio: 16 / 9;
    width: 100%;
    object-fit: cover;
    border-bottom: 1px solid var(--line);
}

.project-card__body {
    padding: 18px;
}

.project-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.plain-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.plain-list li {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(216, 209, 196, 0.72);
}

.plain-list li::before {
    content: "/";
    color: var(--warm);
}

.footer {
    margin-top: 64px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 780px) {
    body {
        font-size: 16px;
    }

    .site-shell {
        width: min(100% - 28px, 1040px);
        padding-top: 26px;
    }

    .site-header,
    .section-header {
        display: block;
    }

    .site-nav {
        margin-top: 12px;
    }

    .hero,
    .two-column,
    .project-grid {
        grid-template-columns: 1fr;
    }

    .featured-row {
        grid-template-columns: 1fr;
    }

    .article {
        padding: 20px;
    }

    .article h1 {
        font-size: 2rem;
    }

    .article h2 {
        font-size: 1.75rem;
    }

    .article h3 {
        font-size: 1.35rem;
    }

    .item-heading {
        display: block;
    }

    .item-date {
        display: block;
        margin-top: 4px;
    }

    .hero {
        gap: 28px;
        margin-bottom: 42px;
    }

    .profile-panel {
        max-width: 420px;
    }
}
