:root {
    --ink: #1a202c;
    --muted: #64748b;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --rule: #e2e8f0;
    --bg-soft: #f8fafc;
    --footer-bg: #0f172a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

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

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.02em; }

img { max-width: 100%; height: auto; }

/* Header */
.site-header {
    border-bottom: 1px solid var(--rule);
    background: #fff;
}
.site-header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 16px;
    padding-bottom: 16px;
}
.brand {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.nav-links a {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.95rem;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-cta {
    background: var(--accent);
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
}
.nav-cta:hover { background: var(--accent-dark); }

/* Hero */
.hero {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--rule);
    padding: 72px 0 64px;
}
.hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    margin: 0 0 16px;
}
.lede {
    font-size: 1.2rem;
    color: var(--muted);
    margin: 0 0 28px;
}
.lede strong { color: var(--ink); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.button {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
}
.button:hover { background: var(--accent-dark); text-decoration: none; }
.button.secondary {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--rule);
}
.button.secondary:hover { border-color: var(--muted); }

/* Article list (home) */
#writing, #projects { padding: 48px 20px 24px; }
#writing h2, #projects h2 { font-size: 1.6rem; }
#projects { padding-bottom: 0; }
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li {
    padding: 24px 0;
    border-bottom: 1px solid var(--rule);
}
.article-list li:last-child { border-bottom: none; }
.article-list a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
}
.article-list a:hover { color: var(--accent); text-decoration: none; }
.article-list p { margin: 6px 0; color: var(--muted); }
.meta {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Articles / prose pages */
.prose { padding-top: 48px; padding-bottom: 24px; }
.article-header { margin-bottom: 36px; }
.article-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 10px;
}
.subtitle {
    font-size: 1.15rem;
    color: var(--muted);
    margin: 0 0 10px;
}
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.8em; }
.prose img {
    display: block;
    margin: 28px auto;
    border: 1px solid var(--rule);
    border-radius: 8px;
}
.prose blockquote {
    margin: 24px 0;
    padding: 4px 20px;
    border-left: 4px solid var(--accent);
    background: var(--bg-soft);
    color: var(--muted);
    font-style: italic;
}

/* Article components (figures, callouts, checklist, comparisons) */
.prose figure { margin: 28px 0; }
.prose figure img { margin: 0 auto; }
.prose figure.phone img { max-width: 340px; }
.prose figcaption {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 10px;
    text-align: center;
    line-height: 1.5;
}
.prose .rs { color: #c1462b; font-weight: 600; }
.prose .hs { color: #1f7a4d; font-weight: 600; }
.prose .callout {
    background: var(--bg-soft);
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 20px 24px;
    margin: 28px 0;
}
.prose .callout p { margin: 0 0 12px; }
.prose .callout p:last-child { margin-bottom: 0; }
.prose .callout .lbl {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}
.prose .checklist { list-style: none; padding: 0; margin: 24px 0; }
.prose .checklist li {
    position: relative;
    padding: 14px 16px 14px 52px;
    margin: 0 0 10px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--bg-soft);
    font-size: 0.95rem;
    line-height: 1.5;
}
.prose .checklist li::before {
    content: "\2713";
    position: absolute;
    left: 14px;
    top: 14px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.prose .checklist li .phase {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
}
.prose .recap { counter-reset: step; list-style: none; padding: 0; margin: 24px 0; }
.prose .recap li { position: relative; padding: 0 0 0 46px; margin-bottom: 16px; }
.prose .recap li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: -2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.prose .vs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 28px 0; }
.prose .vs .col { border: 1px solid var(--rule); border-radius: 10px; padding: 16px 20px; }
.prose .vs .col h4 {
    margin: 0 0 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.prose .vs .then h4 { color: #c1462b; }
.prose .vs .now h4 { color: #1f7a4d; }
.prose .vs ul { margin: 0; padding-left: 18px; font-size: 0.92rem; line-height: 1.5; }
.prose .vs li { margin: 0 0 8px; }
@media (max-width: 560px) { .prose .vs { grid-template-columns: 1fr; } }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 44px 0 24px; }
.prose .endnote { font-size: 0.9rem; color: var(--muted); }

/* Resume */
.resume .job { margin-bottom: 28px; }
.job-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.resume .job ul { margin: 8px 0 0; }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 16px; max-width: 540px; }
.contact-form label { font-weight: 600; font-size: 0.95rem; display: flex; flex-direction: column; gap: 6px; }
.contact-form input,
.contact-form textarea {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    color: var(--ink);
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.contact-form .button { align-self: flex-start; border: none; cursor: pointer; font-size: 1rem; }
.form-banner { padding: 14px 16px; border-radius: 8px; margin-bottom: 20px; font-weight: 500; }
.form-banner.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.form-banner.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Footer */
.site-footer {
    background: var(--footer-bg);
    color: #cbd5e1;
    margin-top: 64px;
    padding: 48px 0 24px;
    font-size: 0.95rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 32px;
    max-width: 1080px;
}
.site-footer h3 {
    color: #fff;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px;
}
.site-footer a { color: #93c5fd; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.copyright {
    max-width: 960px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #1e293b;
    color: var(--muted);
}

@media (max-width: 640px) {
    .hero { padding: 48px 0 40px; }
    .hero h1 { font-size: 2rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .job-head { flex-direction: column; gap: 0; }
}
