:root {
    --bg: #ecf0ec;
    --ink: #17231f;
    --muted: #53625c;
    --line: #c3cdc6;
    --accent: #2b4bd6;
    --chip: #dde4de;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
	--bg: #121715;
	--ink: #e6ece8;
	--muted: #9aa8a1;
	--line: #2c3833;
	--accent: #8fa3ff;
	--chip: #1d2723;
	color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #121715;
    --ink: #e6ece8;
    --muted: #9aa8a1;
    --line: #2c3833;
    --accent: #8fa3ff;
    --chip: #1d2723;
    color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 1.0625rem/1.65 "Literata", Georgia, serif;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }

/* Hero */
header { padding: 5rem 0 3.5rem; }
.name { font: 400 1rem/1.4 "Bricolage Grotesque", system-ui, sans-serif; color: var(--muted); margin: 0 0 1.5rem; }
h1 {
    font: 800 clamp(2.4rem, 7.5vw, 5rem)/1.02 "Bricolage Grotesque", system-ui, sans-serif;
    letter-spacing: -0.03em;
    margin: 0;
    max-width: 16ch;
    min-height: 3.1em;
}
.lede { max-width: 34rem; margin: 1.75rem 0 0; color: var(--muted); }
.cursor {
    display: inline-block; width: .5ch; height: .9em; margin-left: .1em;
    background: var(--accent); vertical-align: -0.08em;
    animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Sections */
section { padding: 3rem 0; border-top: 1px solid var(--line); }
h2 { font: 700 1.5rem/1.2 "Bricolage Grotesque", system-ui, sans-serif; margin: 0 0 2rem; }

/* Projects */
.project {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem 2rem;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--line);
    animation: rise .6s ease backwards;
}
.project:last-child { border-bottom: none; }
.project:nth-child(2) { animation-delay: .08s; }
.project:nth-child(3) { animation-delay: .16s; }
.project:nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.project h3 { font: 700 1.5rem/1.2 "Bricolage Grotesque", system-ui, sans-serif; margin: 0; letter-spacing: -0.01em; }
.project h3 a { color: var(--ink); text-decoration: none; }
.project h3 a:hover { color: var(--accent); text-decoration: underline; }
.project p { margin: 0 0 .75rem; max-width: 38rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.tags li, .tags button {
    font: 400 .85rem/1 "Bricolage Grotesque", system-ui, sans-serif;
    background: var(--chip); padding: .35rem .6rem; border-radius: 4px;
}
.tags.interactive li {
    padding: 0;
    background: none;
}
@media (min-width: 56rem) {
    .project { grid-template-columns: 20rem 1fr; }
}

/* About / skills */
.cols { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .cols { grid-template-columns: 1fr 1fr; } }
.cols p { margin: 0 0 1rem; max-width: 34rem; }
dl { margin: 0; }
dt { font: 700 1rem/1.4 "Bricolage Grotesque", system-ui, sans-serif; }
dd { margin: 0 0 1rem; color: var(--muted); }

footer { padding: 3rem 0 4rem; border-top: 1px solid var(--line); }
footer ul { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; font-size: 1.125rem; }
footer small { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .project { animation: none; }
    .cursor { animation: none; }
}

@media (max-width: 40rem) {
    h1 {
	min-height: 4.2em;
    }
}

.cursor.busy {
    animation: none;
}

header { position: relative; }
.theme-toggle {
    position: absolute;
    top: 1.25rem;
    right: 0;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.theme-toggle .sun { display: none; }
.theme-toggle[aria-pressed="true"] .sun { display: block; }
.theme-toggle[aria-pressed="true"] .moon { display: none; }

body { transition: background-color .2s, color .2s; }
@media (prefers-reduced-motion: reduce) { body { transition: none; } }
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: .25rem 1rem; margin-bottom: 2rem;
}
.section-head h2 { margin: 0; }
.filter-status { margin: 0; font-size: .95rem; color: var(--muted); }
.filter-status button {
    font: inherit; color: var(--accent); background: none; border: 0;
    padding: 0; margin-left: .5rem; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
}

.tags button {
    color: inherit; border: 1px solid transparent; cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}
.tags button:hover { border-color: var(--accent); }
.tags button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tags button[aria-pressed="true"] {
    background: var(--accent); color: var(--bg); border-color: var(--accent);
}

.project { transition: opacity .25s; }
.project.dim { opacity: .3; }
@media (prefers-reduced-motion: reduce) {
    .project, .tags button { transition: none; }
}

.tip {
    position: fixed;
    z-index: 10;
    max-width: 16rem;
    padding: .55rem .75rem;
    border-radius: 6px;
    background: var(--ink);
    color: var(--bg);
    font: 400 .85rem/1.4 "Literata", Georgia, serif;
    pointer-events: none;
}

.actions { margin: 2rem 0 0; }
.btn {
    display: inline-block;
    font: 700 1rem/1 "Bricolage Grotesque", system-ui, sans-serif;
    padding: .85rem 1.25rem;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.btn:hover { background: transparent; color: var(--accent); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.project .links { margin: .75rem 0 0; font-size: .95rem; }

.copy {
    font: 400 .85rem/1 "Bricolage Grotesque", system-ui, sans-serif;
    color: var(--ink);
    background: var(--chip);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: .35rem .6rem;
    margin-left: .5rem;
    cursor: pointer;
}
.copy:hover { border-color: var(--accent); }
.copy:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.copy-status { margin-left: .5rem; font-size: .9rem; color: var(--muted); }
