:root {
    --bg: #fafaf7;
    --text: #1a1a1a;
    --text-muted: #6b6b6b;
    --text-faint: #999;
    --border: #e8e7e1;
    --max-width: 880px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: "Iowan Old Style", "Apple Garamond", Baskerville, "Times New Roman", serif;
    --font-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--text-faint);
    transition: border-color 0.15s ease;
}
a:hover { border-bottom-color: var(--text); }

/* Header */
.site-header {
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.site-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    border-bottom: none;
}
.site-nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.site-nav a {
    font-size: 0.95rem;
    color: var(--text-muted);
    border-bottom: none;
}
.site-nav a:hover { color: var(--text); }

main { flex: 1; }

/* Hero */
.hero {
    padding: 5rem 0 4rem;
}
.hero-inner {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    align-items: center;
}
.hero-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    filter: grayscale(15%);
}
.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 500;
    letter-spacing: -0.025em;
    line-height: 1.02;
    margin-bottom: 0.5rem;
}
.hero h1 em {
    font-style: italic;
    color: var(--text-muted);
    font-weight: 400;
}
.tagline {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.bio {
    font-size: 1.08rem;
    line-height: 1.65;
    max-width: 60ch;
    color: var(--text);
    margin-bottom: 1.5rem;
}
.hero-actions {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
}
.hero-actions a {
    color: var(--text);
    border-bottom: 1px solid var(--text);
    padding-bottom: 2px;
}
.hero-actions a:hover {
    color: var(--text-muted);
    border-bottom-color: var(--text-muted);
}

/* Sections */
.section {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}
.section-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.section h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
}

/* Card grid (What I'm building) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.card {
    border: 1px solid var(--border);
    padding: 1.75rem 1.5rem 1.75rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover {
    border-color: var(--text);
    transform: translateY(-2px);
}
.card-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-faint);
}
.card-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 0.4rem;
}
.card > p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.card > a {
    font-size: 0.9rem;
    color: var(--text);
    border-bottom: 1px solid var(--text-faint);
    align-self: flex-start;
}
.card-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.card-item + .card-item {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 0.25rem;
}
.card-item-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.005em;
}
.card-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.card-item a {
    font-size: 0.85rem;
    color: var(--text);
    border-bottom: 1px solid var(--text-faint);
    align-self: flex-start;
    margin-top: 0.2rem;
}

/* Item list (Research, code) */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}
.item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
}
.item-meta {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
}
.item-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.3;
}
.item-title a { border-bottom: none; }
.item-title a:hover { border-bottom: 1px solid var(--text); }
.item-desc {
    color: var(--text-muted);
    font-size: 0.97rem;
    line-height: 1.6;
    max-width: 65ch;
}
.item-links {
    margin-top: 0.25rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.item-links a {
    color: var(--text-muted);
    border-bottom: 1px solid var(--text-faint);
}
.item-links a:hover { color: var(--text); border-bottom-color: var(--text); }

/* Writing CTA */
.writing-cta {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}
.writing-cta h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.writing-cta p {
    color: var(--text-muted);
    max-width: 60ch;
    margin-bottom: 1rem;
}
.cta-link {
    display: inline-block;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--text);
}

/* Coaching note (quiet) */
.quiet-note {
    padding: 2.5rem 0 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.92rem;
    color: var(--text-muted);
    max-width: 60ch;
    font-style: italic;
}

/* Generic page (Funspan, etc.) */
.page {
    padding: 5rem 0 4rem;
    text-align: center;
}
.page-eyebrow {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    margin-bottom: 2rem;
}
.page h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 16ch;
    margin-left: auto;
    margin-right: auto;
}
.page h1 em {
    font-style: italic;
    font-weight: 400;
}
.page-lede {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 55ch;
    margin: 0 auto 2.5rem;
}
.formula {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    padding: 1rem 1.5rem;
    border-left: 2px solid var(--text);
    display: inline-block;
    text-align: left;
    background: #fff;
    margin: 0 auto 2.5rem;
    color: var(--text);
}
.formula .var { color: var(--text-muted); }

/* Work page hero */
.page-header {
    padding: 4rem 0 1rem;
}
.page-header-eyebrow {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.page-header h1 {
    font-family: var(--font-serif);
    font-size: 2.75rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}
.page-header .lede {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 60ch;
    line-height: 1.6;
}

/* Footer */
.site-footer {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.social-links {
    display: flex;
    gap: 1rem;
}
.social-links a {
    color: var(--text-muted);
    display: inline-flex;
    border-bottom: none;
}
.social-links a:hover { color: var(--text); }
.copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mobile */
@media (max-width: 720px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .site-nav { gap: 1.25rem; }
    .hero { padding: 2.5rem 0 2rem; }
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        justify-items: start;
    }
    .hero-photo { width: 140px; height: 140px; }
    .hero h1 { font-size: 2rem; }
    .card-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; text-align: center; gap: 1.25rem; }
    .page { padding: 3rem 0 2.5rem; }
}
