/* ---------- Tokens ---------- */
:root {
    --bg: #ffffff;
    --surface: #f6f8fa;
    --ink: #0f172a;
    --muted: #57606a;
    --line: #e5e7eb;
    --accent: #2563eb;
    --accent-ink: #ffffff;
    --grid: rgba(15, 23, 42, .13);
    --display: 'Space Grotesk', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
    --max: 1120px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d1117;
        --surface: #161b22;
        --ink: #e6edf3;
        --muted: #8b949e;
        --line: #30363d;
        --accent: #58a6ff;
        --accent-ink: #0d1117;
        --grid: rgba(230, 237, 243, .10);
    }
}

:root[data-theme="dark"] {
    --bg: #0d1117;
    --surface: #161b22;
    --ink: #e6edf3;
    --muted: #8b949e;
    --line: #30363d;
    --accent: #58a6ff;
    --accent-ink: #0d1117;
    --grid: rgba(230, 237, 243, .10);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.65 var(--sans);
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.label {
    font: 500 12px var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }

/* ---------- Header ---------- */
.site-header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 24px;
    padding-bottom: 24px;
}
.wordmark { font: 600 16px var(--display); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.site-header nav { display: flex; align-items: center; gap: 22px; }
.site-header nav a { text-decoration: none; font-size: 15px; color: var(--muted); }
.site-header nav a:hover, .site-header nav a.active { color: var(--ink); }
.theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 14px;
}
.theme-btn:hover { border-color: var(--ink); }
@media (max-width: 520px) { .site-header nav { gap: 14px; } .site-header nav a { font-size: 14px; } }

/* ---------- Hero ---------- */
.hero { padding-top: 72px; padding-bottom: 96px; position: relative; isolation: isolate; }
/* Faint dot grid behind the hero, fading out toward the edges. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0 -6vw;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(var(--grid) 1.2px, transparent 1.4px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 70% 75% at 30% 40%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 75% at 30% 40%, #000 20%, transparent 75%);
}
/* Terminal-style greeting above the hero title. */
.prompt { text-transform: none; letter-spacing: .02em; font-size: 14px; color: var(--muted); }
.prompt .ps1 { color: var(--accent); margin-right: 6px; }
.cursor { display: inline-block; width: 8px; height: 15px; margin-left: 4px; vertical-align: -2px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero h1 {
    font: 600 clamp(40px, 7vw, 76px)/1.05 var(--display);
    letter-spacing: -.03em;
    margin: 22px 0 32px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: end; }
@media (max-width: 760px) { .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.hero-lede { font-size: clamp(18px, 2vw, 21px); line-height: 1.55; margin: 0; max-width: 600px; }
.hero-facts { display: grid; gap: 14px; margin: 0; }
.hero-facts div { border-top: 1px solid var(--line); padding-top: 10px; }
.hero-facts dt { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero-facts dd { margin: 2px 0 0; font-size: 15px; }

/* ---------- Sections ---------- */
.section { padding-top: 72px; padding-bottom: 72px; }
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 14px;
    margin-bottom: 8px;
}
.section-title h2 { font: 600 clamp(24px, 3vw, 32px)/1.2 var(--display); letter-spacing: -.02em; margin: 0; }
.section-title h2::before { content: "//" / ""; font: 500 .62em var(--mono); color: var(--accent); margin-right: .55em; vertical-align: .18em; }

/* ---------- Work index ---------- */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-row {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 220px 70px 28px;
    align-items: center;
    gap: 16px;
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: padding .25s ease;
}
.work-row .n { font: 500 13px var(--mono); color: var(--muted); align-self: start; padding-top: .9em; }
.work-row h3 { font: 600 clamp(20px, 2.6vw, 26px)/1.25 var(--display); letter-spacing: -.015em; margin: 0; }
.work-row p { margin: 6px 0 0; color: var(--muted); font-size: 15px; max-width: 560px; }
.work-row .cat, .work-row .yr { font-size: 14px; color: var(--muted); }
.work-row .arrow { font-size: 22px; color: var(--muted); transition: transform .25s ease, color .25s; }
.work-row::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 2px; background: var(--accent); transform: scaleY(0); transition: transform .25s ease; }
.work-row:hover::before { transform: scaleY(1); }
.work-row:hover { padding-left: 16px; }
.work-row:hover h3, .work-row:hover .arrow { color: var(--accent); }
.work-row:hover .arrow { transform: translateX(4px); }
@media (max-width: 760px) {
    .work-row { grid-template-columns: 36px minmax(0, 1fr) 24px; gap: 12px; padding: 22px 0; }
    .work-row .cat, .work-row .yr { display: none; }
    .work-row:hover { padding-left: 0; }
}
.work-row .mobile-meta { display: none; font: 500 12px var(--mono); color: var(--muted); margin-top: 6px; }
@media (max-width: 760px) { .work-row .mobile-meta { display: block; } }

/* ---------- Capabilities ---------- */
.caps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 28px; }
@media (max-width: 760px) { .caps { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.caps h3 { font: 500 14px var(--sans); margin: 0 0 10px; }
.caps h3 .n { font-family: var(--mono); color: var(--accent); margin-right: 8px; }
.caps ul { list-style: none; margin: 0; padding: 0; }
.caps li { padding: 8px 0; border-top: 1px solid var(--line); color: var(--muted); }
.caps li:last-child { border-bottom: 1px solid var(--line); }

/* ---------- Writing link ---------- */
.writing-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}
.writing-link > span:first-child { font: 500 clamp(18px, 2.2vw, 22px)/1.3 var(--display); }
.writing-link:hover span { color: var(--accent); }

/* ---------- Contact ---------- */
.contact { padding-top: 96px; padding-bottom: 96px; }
.contact a.big {
    display: inline-block;
    font: 600 clamp(28px, 4vw, 40px)/1.1 var(--display);
    letter-spacing: -.02em;
    text-decoration: none;
    margin-top: 18px;
    border-bottom: 2px solid var(--ink);
}
.contact a.big:hover { color: var(--accent); border-color: var(--accent); }
.contact p { color: var(--muted); max-width: 520px; margin: 20px 0 0; }

footer.site-footer .wrap {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 22px;
    padding-bottom: 40px;
    font-size: 13px;
    color: var(--muted);
}
footer.site-footer a { color: var(--muted); }

/* ---------- Inner pages ---------- */
.back { font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent); }
.page-title { padding-top: 40px; padding-bottom: 40px; }
.page-title h1 { font: 600 clamp(36px, 6vw, 60px)/1.08 var(--display); letter-spacing: -.03em; margin: 18px 0 18px; }
.page-title .lede { font-size: clamp(18px, 2vw, 21px); max-width: 680px; margin: 0; }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--line);
    margin-bottom: 48px;
}
.meta-grid > div { padding: 14px 16px 16px 0; }
.meta-grid > .wide { grid-column: 1 / -1; border-top: 1px solid var(--line); }
.meta-grid dt { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.meta-grid dd { margin: 0; font-size: 15px; }
.meta-grid dd a { color: var(--accent); }
@media (max-width: 760px) { .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: 500 15px var(--sans);
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid var(--ink);
}
.btn.solid { background: var(--ink); color: var(--bg); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:not(.solid):hover { border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.prose { max-width: 680px; font-size: 18px; padding-bottom: 96px; }
.prose h2 { font: 600 22px/1.3 var(--display); letter-spacing: -.01em; margin: 40px 0 12px; }
.prose p { margin: 0 0 18px; }
.prose ul { padding-left: 20px; margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }
.prose code { font: 15px var(--mono); background: var(--surface); padding: 1px 6px; border-radius: 4px; }
.prose.poem { font: 400 19px/1.85 var(--display); }

/* ---------- Writing list ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filter {
    font: 500 14px var(--sans);
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.filter:hover { color: var(--ink); border-color: var(--ink); }
.filter.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.poem-list { list-style: none; padding: 0; margin: 0 0 96px; border-top: 1px solid var(--ink); }
.poem-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: baseline;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}
.poem-row .t { font: 500 clamp(18px, 2.2vw, 22px)/1.3 var(--display); }
.poem-row .m { font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.poem-row:hover .t { color: var(--accent); }
.not-found { padding: 48px 0 120px; color: var(--muted); }

/* ---------- Motion ---------- */
.rise { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.rise.d1 { animation-delay: .08s; }
.rise.d2 { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .rise { animation: none; }
    .work-row, .work-row .arrow, .work-row::before { transition: none; }
    .cursor { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Screenshot gallery ---------- */
.prose .shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 8px 0 24px; }
@media (max-width: 640px) { .prose .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prose .shots figure { margin: 0; }
.prose .shots img { width: 100%; aspect-ratio: 9 / 20; object-fit: cover; object-position: top; border-radius: 14px; border: 1px solid var(--line); background: #0d0d0d; display: block; }
.prose .shots figcaption { font: 500 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }

/* ---------- Profile links ---------- */
.profile-links { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-top: 1px solid var(--line); }
.profile-links a { display: flex; flex-direction: column; gap: 2px; padding: 16px 16px 16px 0; text-decoration: none; font: 500 19px/1.25 var(--display); border-bottom: 1px solid var(--line); }
.profile-links a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 16px; }

/* ---------- Certifications ---------- */
.cert-groups { display: grid; gap: 32px; margin-top: 28px; }
.cert-group h3 { margin: 0 0 4px; }
.cert-group h3 span { color: var(--muted); }
.cert-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
@media (max-width: 760px) { .cert-list { grid-template-columns: minmax(0, 1fr); } }
.cert { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.cert img, .cert-mark { width: 48px; height: 48px; flex: none; object-fit: contain; }
.cert-mark { display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent); font-size: 18px; }
.cert-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cert-name { font: 500 16px/1.3 var(--display); }
.cert-meta { font-size: 13px; color: var(--muted); }
.cert-verify { font-size: 13px; color: var(--muted); white-space: nowrap; }
.cert:hover .cert-name, .cert:hover .cert-verify { color: var(--accent); }
@media (max-width: 420px) { .cert-verify { display: none; } }
@media (max-width: 600px) { .site-header nav a.nav-wide { display: none; } }

/* Personal writing sits apart from the professional sections, after contact. */
.off-clock { padding-top: 8px; padding-bottom: 56px; }
/* Long email address: smaller and allowed to wrap so it fits narrow screens. */
.profile-links .contact-value { font-size: 17px; overflow-wrap: anywhere; }
@media (min-width: 640px) { .profile-links li:first-child { grid-column: span 2; } }
.profile-links li { display: flex; }
.profile-links li > a { flex: 1; }
/* Links inside the intro: quiet underline, accent on hover. */
.hero-lede a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 4px; transition: text-decoration-color .15s, color .15s; }
.hero-lede a:hover { color: var(--accent); text-decoration-color: var(--accent); }
