:root {
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: dark;

    /* dark theme (default) */
    --bg: #09090b;
    --card: #111114;
    --line: #232329;
    --line-strong: #3a3a42;
    --fg: #ededef;
    --body: #c9c9cf;
    --muted: #8b8b94;
    --accent: #7dd3c0;
    --accent-rgb: 125, 211, 192;
    --grid-opacity: .55;
    --avatar-bg: #05050d;
}

/* light theme: used when the visitor picks it, or when their system is light and they haven't picked */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #fafaf9;
    --card: #ffffff;
    --line: #e7e5e4;
    --line-strong: #c9c6c3;
    --fg: #18181b;
    --body: #3f3f46;
    --muted: #6b6b73;
    --accent: #0f766e;
    --accent-rgb: 15, 118, 110;
    --grid-opacity: .7;
    --avatar-bg: #10101c;
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;
        --bg: #fafaf9;
        --card: #ffffff;
        --line: #e7e5e4;
        --line-strong: #c9c6c3;
        --fg: #18181b;
        --body: #3f3f46;
        --muted: #6b6b73;
        --accent: #0f766e;
        --accent-rgb: 15, 118, 110;
        --grid-opacity: .7;
        --avatar-bg: #10101c;
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    position: relative;
    transition: background-color .2s, color .2s;
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.65 "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* faint dot grid behind the hero, fading out as it goes down */
body::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 720px;
    z-index: -1;
    background-image: radial-gradient(var(--line-strong) 1px, transparent 1.5px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
    opacity: var(--grid-opacity);
}

a { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }
html { scrollbar-color: var(--line-strong) var(--bg); }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 24px; padding: 22px 0; }
.brand { font: 500 14px var(--mono); text-decoration: none; margin-right: auto; }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 24px; font-size: 14px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--fg); }
.lang {
    font: 500 12px var(--mono);
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
}
.lang:hover, .theme:hover { color: var(--fg); border-color: var(--line-strong); }
.theme {
    display: grid;
    place-items: center;
    width: 30px;
    height: 28px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}
.theme svg { width: 15px; height: 15px; }
/* show the sun in dark mode (switch to light) and the moon in light mode */
.theme .moon { display: none; }
:root[data-theme="light"] .theme .sun { display: none; }
:root[data-theme="light"] .theme .moon { display: block; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .theme .sun { display: none; }
    :root:not([data-theme="dark"]) .theme .moon { display: block; }
}

/* ---------- hero ---------- */
.hero { padding: 96px 0 72px; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; }
.avatar {
    width: 64px;   /* the source is 64px: 1:1 here, exact 2x on retina, so every pixel stays square */
    height: 64px;
    border-radius: 14px;
    image-rendering: pixelated;
    background: var(--avatar-bg);
    box-shadow: 0 0 0 1px var(--line), 0 0 40px rgba(var(--accent-rgb), .14);
}
.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 500 12px var(--mono);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), .3);
    background: rgba(var(--accent-rgb), .07);
    padding: 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2);
}
h1 {
    font-size: clamp(40px, 7vw, 68px);
    line-height: 1.02;
    letter-spacing: -.035em;
    font-weight: 600;
    margin: 32px 0 20px;
}
h1 em { font-style: normal; color: var(--muted); }
.intro { font-size: 19px; color: var(--muted); max-width: 620px; margin: 0; }
.intro + .intro { margin-top: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card);
    transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--line-strong); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn .meta { font: 400 12px var(--mono); opacity: .65; margin-left: 4px; }

/* ---------- sections ---------- */
section[id] { padding: 64px 0; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
/* short accent dash above each section title */
.label { width: 28px; height: 3px; margin: 0 0 18px; background: var(--accent); font-size: 0; }
h2 { font-size: 28px; letter-spacing: -.02em; font-weight: 600; margin: 0 0 36px; }

.inline-link { color: var(--accent); text-decoration: none; white-space: nowrap; }
.inline-link::after { content: ""; display: inline-block; width: .5em; height: .5em; margin-left: .35em; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-.2em) rotate(45deg); }
.inline-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.about p:not(.label) { font-size: 18px; color: var(--body); margin: 0 0 16px; max-width: 700px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 24px;
    padding: 22px 0;
    border-bottom: 1px dashed var(--line);
}
.timeline > li:last-child { border-bottom: 0; }
.when { font: 400 13px var(--mono); color: var(--muted); padding-top: 3px; }
.timeline h3 { margin: 0; font-size: 17px; font-weight: 600; }
.timeline h3 span { color: var(--muted); font-weight: 400; }
.timeline p { margin: 4px 0 12px; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li {
    font: 400 12px var(--mono);
    color: var(--body);
    border: 1px solid var(--line);
    background: var(--card);
    padding: 2px 8px;
    border-radius: 6px;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    transition: border-color .2s, transform .2s;
}
.card:hover { border-color: rgba(var(--accent-rgb), .5); transform: translateY(-2px); }
.card h3 { margin: 0; font: 600 18px var(--mono); display: flex; justify-content: space-between; align-items: center; }
.card .arrow { width: 16px; height: 16px; color: var(--muted); transition: color .2s; }
.card:hover .arrow { color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }

.contact-box {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 36px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
}
.contact-box h2 { margin: 0 0 10px; }
.contact-box p { margin: 0; color: var(--muted); }
.contact-box ul { list-style: none; margin: 0; padding: 0; }
.contact-box > ul > li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
}
.contact-box > ul > li:last-child { border-bottom: 0; }
.contact-box li span { color: var(--muted); }
.contact-box li a { text-decoration: none; overflow-wrap: anywhere; }
.contact-box li a:hover { color: var(--accent); }
.contact-link { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.copy {
    font: 500 11px var(--mono);
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
}
.copy:hover { color: var(--fg); border-color: var(--line-strong); }
.copy.done { color: var(--accent); border-color: var(--accent); }

footer { padding: 40px 0 56px; color: var(--muted); font: 400 13px var(--mono); }

/* no-JS fallback (index.html) */
.contact-box:has(> div > ul) { align-items: start; }
.contact-box > div > ul > li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
/* without JS the theme/language buttons and section links can't work */
:root:not(.js) .top nav, :root:not(.js) .theme, :root:not(.js) .lang { display: none; }
.contact-box > div:has(> ul) h2 { margin-bottom: 16px; }

/* touch screens: buttons at least 44px so they're easy to hit */
@media (pointer: coarse) {
    .theme, .lang { min-width: 44px; height: 44px; }
    .top nav a { display: inline-flex; align-items: center; min-height: 44px; }
    .copy { min-height: 36px; padding: 0 12px; }
}

@media (max-width: 720px) {
    /* the section links move to their own row under the brand */
    .top { flex-wrap: wrap; row-gap: 4px; padding-bottom: 8px; }
    .top nav { order: 1; width: 100%; justify-content: space-between; gap: 0; font-size: 15px; }
    .hero { padding: 56px 0 48px; }
    .timeline > li { grid-template-columns: 1fr; gap: 4px; }
    .contact-box { grid-template-columns: 1fr; padding: 24px; }
    .contact-box > ul > li { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .card, .btn { transition: none; }
    .card:hover { transform: none; }
}
