:root {
    color-scheme: dark;
    --paper: #0a0a0a;
    --ink: #f2f0e9;
    --muted: #969690;
    --line: #292927;
    --accent: #e06445;
    --intro: #b7b7b0;
    --status: #62a675;
    --status-ring: rgba(98, 166, 117, 0.12);
    --content: 1120px;
}
:root[data-theme="light"] {
    color-scheme: light;
    --paper: #f4f3ef;
    --ink: #181917;
    --muted: #666861;
    --line: #d1d0c9;
    --accent: #b84a32;
    --intro: #464842;
    --status: #3d7b50;
    --status-ring: rgba(61, 123, 80, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    min-width: 320px;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--paper);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

.site-header, .page, footer {
    width: min(calc(100% - 64px), var(--content));
    margin-inline: auto;
}
.site-header {
    position: absolute;
    z-index: 2;
    inset: 0 0 auto;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}
.wordmark {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1;
}
.wordmark span { color: var(--accent); }
nav { display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2.5rem); }
nav a, .text-action {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 180ms ease;
}
nav a:hover, .text-action:hover { color: var(--accent); }
.theme-toggle {
    position: relative;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-icon { grid-area: 1 / 1; font-size: 1rem; line-height: 1; }
.theme-icon-moon, [data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: block; }

.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-block: 8rem 5rem;
}
.hero-copy { width: 100%; min-width: 0; }
.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--status);
    box-shadow: 0 0 0 4px var(--status-ring);
}
h1, h2, h3 { font-family: 'Newsreader', Georgia, serif; font-weight: 500; }
h1 {
    margin: 1.15rem 0 1.35rem;
    font-size: clamp(3rem, 5.2vw, 4.8rem);
    line-height: 0.98;
}
.intro {
    max-width: 620px;
    color: var(--intro);
    font-size: clamp(0.95rem, 1.3vw, 1.08rem);
    line-height: 1.75;
}
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem; margin-top: 2rem; }
.primary-action {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0.6rem 1.1rem;
    color: var(--paper);
    background: var(--ink);
    font-size: 0.83rem;
    font-weight: 600;
    transition: background-color 180ms ease;
}
.primary-action:hover { background: var(--accent); }
.hero-expertise { margin-top: clamp(3.5rem, 7vh, 5rem); }
.hero-expertise > h2 { margin-bottom: 0.9rem; font-size: 1.15rem; }
.section { min-height: 100svh; padding-block: clamp(5.5rem, 9vw, 8rem); border-top: 1px solid var(--line); }
.work {
    display: grid;
    grid-template-columns: minmax(180px, 0.28fr) minmax(0, 0.72fr);
    gap: clamp(3rem, 8vw, 7rem);
}
.work-intro h2 {
    margin-top: 0.65rem;
    font-size: clamp(2.15rem, 3.4vw, 3.2rem);
    line-height: 1;
}
.work-content { min-width: 0; }
.section-heading h3 { margin-bottom: 1rem; font-size: clamp(1.35rem, 2vw, 1.65rem); line-height: 1.15; }
.experience-list { border-top: 1px solid var(--line); }
.experience-list details { border-bottom: 1px solid var(--line); }
.experience-list summary {
    position: relative;
    display: grid;
    grid-template-columns: 110px 1fr 1.5fr 18px;
    gap: 1rem;
    align-items: baseline;
    padding: 1.05rem 0;
    list-style: none;
    cursor: pointer;
}
.experience-list summary::-webkit-details-marker { display: none; }
.experience-list summary::after { content: '+'; grid-column: 4; color: var(--muted); font-size: 1rem; line-height: 1; }
.experience-list details[open] summary::after { content: '−'; }
.experience-list .year, .experience-list summary > span:nth-child(3) {
    color: var(--muted);
    font-size: 0.76rem;
}
.experience-list strong { font-size: 0.84rem; font-weight: 600; }
.experience-list details > p { max-width: 620px; padding: 0 28px 1.15rem 126px; color: var(--muted); font-size: 0.82rem; }
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
}
.expertise-grid article {
    min-width: 0;
    padding: 1.25rem 1.5rem 0 0;
}
.expertise-grid article + article { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.expertise-grid article > span { color: var(--accent); font-size: 0.72rem; font-weight: 600; }
.expertise-grid h3 { margin: 1rem 0 0.45rem; font-size: 1.05rem; }
.expertise-grid p { color: var(--muted); font-size: 0.78rem; line-height: 1.7; }
.random { margin-top: clamp(4rem, 7vw, 6rem); }
.random-details { border-block: 1px solid var(--line); }
.random-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.05rem 0;
    list-style: none;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
}
.random-details summary::-webkit-details-marker { display: none; }
.random-details summary::after { content: '+'; color: var(--muted); font-size: 1rem; font-weight: 400; }
.random-details[open] summary::after { content: '−'; }
.random-details p { padding: 0 0 1.15rem; color: var(--muted); font-size: 0.82rem; }
footer {
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 0.75rem;
}
@media (max-width: 780px) {
    .work { grid-template-columns: 1fr; gap: 3rem; }
}
@media (max-width: 620px) {
    .site-header, .page, footer { width: min(calc(100% - 36px), var(--content)); }
    .site-header { min-height: 68px; }
    nav { gap: 1.25rem; }
    .hero {
        padding-block: 7rem 4rem;
    }
    h1 { font-size: clamp(2.75rem, 13vw, 3.8rem); }
    .hero-actions { gap: 1.1rem; }
    .section { padding-block: 4.5rem; }
    .experience-list summary { grid-template-columns: 1fr 20px; gap: 0.2rem 0.8rem; }
    .experience-list summary::after { grid-column: 2; grid-row: 1 / 3; align-self: center; }
    .experience-list summary > span:nth-child(3) { grid-column: 1; }
    .experience-list .year { grid-column: 1; grid-row: 3; margin-top: 0.35rem; }
    .experience-list details > p { padding: 0 28px 1.1rem 0; }
    .expertise-grid { grid-template-columns: 1fr; }
    .expertise-grid article { padding: 1.25rem 0; }
    .expertise-grid article + article { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
    .expertise-grid h3 { margin-top: 0.8rem; }
    footer {
        min-height: 120px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 0.3rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}