/* Paper, ink, and a small amount of motion.
   Stageshow references and attribution: DESIGN-SOURCES.md. */
:root {
    color-scheme: light;
    --bg: #fbfaf8;
    --ink: #2f2c29;
    --ink-soft: #6d6862;
    --ink-faint: #77716a;
    --rule: #e3dfd9;
    --rule-soft: #efece7;
    --link-ul: #b8b2aa;
    --accent: #b4553f;
    --measure: 608px;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-arrive: cubic-bezier(0.25, 0.8, 0.25, 1);
}
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141416;
    --ink: #ececef;
    --ink-soft: #aaa7ae;
    --ink-faint: #949098;
    --rule: #35343a;
    --rule-soft: #29282d;
    --link-ul: #69656f;
    --accent: #e08a72;
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #141416;
        --ink: #ececef;
        --ink-soft: #aaa7ae;
        --ink-faint: #949098;
        --rule: #35343a;
        --rule-soft: #29282d;
        --link-ul: #69656f;
        --accent: #e08a72;
    }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
html:has(.project-drawer[open]) { overflow: hidden; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .9375rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
.wrap {
    max-width: var(--measure);
    margin-inline: auto;
    padding: max(76px, env(safe-area-inset-top)) 24px max(40px, env(safe-area-inset-bottom));
}
p, li, dd { text-wrap: pretty; }
a, button, summary { touch-action: manipulation; }
a {
    color: inherit;
    text-decoration-color: var(--link-ul);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 160ms ease, text-decoration-color 160ms ease;
}
button { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { user-select: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--bg); }
.skip-link { position: absolute; left: -9999px; top: 12px; padding: 10px 16px; background: var(--ink); color: var(--bg); z-index: 10; }
.skip-link:focus { left: 12px; }
h1 { font-size: 1.125rem; font-weight: 500; line-height: 1.4; letter-spacing: -.025em; }
.role { color: var(--ink-soft); font-size: .8125rem; margin-top: 3px; }
.bio { margin-top: 25px; }
.bio p + p { margin-top: 15px; }
.bio .personal { color: var(--ink-soft); font-size: .875rem; }
.fans { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: 6px 0 0 -7px; }
.fans a { display: inline-grid; place-items: center; width: 36px; height: 36px; text-decoration: none; }
.fans img { width: 22px; height: 22px; object-fit: contain; opacity: .7; filter: grayscale(1) contrast(.95); transition: opacity 160ms ease; }
html[data-theme="dark"] .fans img { filter: grayscale(1) brightness(2.4); }
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .fans img { filter: grayscale(1) brightness(2.4); }
}
.fans a:focus-visible img { opacity: 1; filter: none; }
.text-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 20px; font-size: .8125rem; }
.text-links a { display: inline-flex; align-items: center; min-height: 40px; }
.intro .text-links { margin-top: 13px; }
.selected-work { margin-top: 43px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 20px; margin-bottom: 5px; }
h2 { color: var(--ink-soft); font-size: .8125rem; font-weight: 400; line-height: 1.5; }
.archive-link { font-size: .75rem; color: var(--ink-soft); min-height: 36px; display: inline-flex; align-items: center; gap: 6px; }
.work-list { list-style: none; }
.work-list > li { border-top: 1px solid var(--rule-soft); }
.work-list > li:last-child { border-bottom: 1px solid var(--rule-soft); }
.work-link { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 14px; text-decoration: none; }
.work-copy { min-width: 0; }
.work-name { display: block; font-size: .875rem; font-weight: 500; line-height: 1.5; }
.work-description { display: block; color: var(--ink-soft); font-size: .8125rem; line-height: 1.55; margin-top: 3px; }
.link-arrow { display: inline-block; color: var(--ink-faint); font-size: 1rem; flex: none; transition: transform 160ms var(--ease-out); }
.availability { margin-top: 23px; color: var(--ink-soft); font-size: .8125rem; }
.page-footer { margin-top: 51px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink-faint); font-size: .75rem; }
.local-time { font-variant-numeric: tabular-nums; }
.local-time > span[aria-hidden] { padding-inline: 4px; }
/* Adapted from Stageshow States: both labels share one stable grid slot.
   Only the changing label moves, keeping the surrounding layout still. */
.theme-toggle {
    display: inline-grid;
    align-items: center;
    justify-items: end;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font-size: .75rem;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    transition: transform 160ms var(--ease-out), color 160ms ease;
}
.theme-state { grid-area: 1 / 1; opacity: 0; transform: translateY(4px); transition: opacity 100ms ease, transform 200ms var(--ease-out); }
.theme-toggle[data-next-theme="dark"] [data-theme-label="dark"],
.theme-toggle[data-next-theme="light"] [data-theme-label="light"] { opacity: 1; transform: translateY(0); transition-delay: 40ms; }
.theme-toggle:active { transform: scale(.97); }
/* A composition arrives once in reading order, then stays still. No library,
   scroll listeners, or persistent GPU layers. Content is visible without JS. */
@media (prefers-reduced-motion: no-preference) {
    [data-entry] { animation: arrive 480ms var(--ease-arrive) both; animation-delay: var(--entry-delay, 0ms); }
    @keyframes arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
}
@media (hover: hover) and (pointer: fine) {
    a:hover { color: var(--accent); text-decoration-color: var(--accent); }
    .work-link:hover .link-arrow { transform: translate(2px, -2px); color: var(--accent); }
    .theme-toggle:hover { color: var(--ink); }
    .proj > summary:hover .pname { color: var(--accent); }
    .fans a:hover img { opacity: 1; filter: none; }
    .drawer-close:hover { color: var(--accent); }
}
/* The browser owns modality, focus containment, Escape, and focus restoration.
   Discrete transitions retain the top layer through the closing motion. */
.project-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    margin: 0;
    width: min(560px, 100%);
    height: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--rule);
    background: var(--bg);
    color: var(--ink);
    transform: translateX(100%);
    transition: transform 260ms var(--ease-out), display 260ms allow-discrete, overlay 260ms allow-discrete;
}
.project-drawer[open] { transform: translateX(0); }
.project-drawer::backdrop {
    background: rgb(0 0 0 / 0);
    transition: background-color 200ms ease, display 260ms allow-discrete, overlay 260ms allow-discrete;
}
.project-drawer[open]::backdrop { background: rgb(0 0 0 / .18); }
@starting-style {
    .project-drawer[open] { transform: translateX(100%); }
    .project-drawer[open]::backdrop { background: rgb(0 0 0 / 0); }
}
.drawer-layout { display: flex; flex-direction: column; height: 100%; }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: max(27px, env(safe-area-inset-top)) 28px 22px; border-bottom: 1px solid var(--rule-soft); }
.drawer-header h2 { color: var(--ink); font-size: 1.0625rem; font-weight: 500; line-height: 1.4; }
.drawer-header p { color: var(--ink-soft); font-size: .8125rem; margin-top: 6px; }
.drawer-close { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: -8px; border: 0; background: transparent; color: var(--ink-soft); font-size: .8125rem; cursor: pointer; white-space: nowrap; }
.drawer-close span { font-size: 1.125rem; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 28px max(28px, env(safe-area-inset-bottom)); }
.drawer-body .projects { border-top: 0; }
.drawer-status, .drawer-fallback { margin-top: 16px; font-size: .8125rem; color: var(--ink-soft); }
.drawer-status:empty { display: none; }
html[data-input="keyboard"] .project-drawer,
html[data-input="keyboard"] .project-drawer::backdrop { transition: none; }
/* Secondary pages share the same quiet reading column. */
.back-link { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: .8125rem; min-height: 40px; margin-bottom: 25px; text-decoration: none; }
.page-description { margin-top: 9px; color: var(--ink-soft); font-size: .875rem; }
.page-intro { margin-bottom: 33px; }
.end-links { margin-top: 28px; }
.projects { border-top: 1px solid var(--rule-soft); }
.proj { border-bottom: 1px solid var(--rule-soft); scroll-margin-top: 24px; }
.proj > summary { display: grid; grid-template-columns: minmax(0, 1fr) 14px; gap: 0 16px; padding-block: 16px; cursor: pointer; list-style: none; }
.proj > summary::-webkit-details-marker { display: none; }
.phead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.pname { font-size: .875rem; font-weight: 500; transition: color 160ms ease; }
.ptag { color: var(--ink-faint); font-size: .6875rem; }
.pline { grid-column: 1; color: var(--ink-soft); font-size: .8125rem; line-height: 1.55; margin-top: 3px; }
.chev { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--ink-faint); transition: transform 200ms var(--ease-out); }
.proj[open] > summary .chev { transform: rotate(180deg); }
.proj[open] > summary .pname { color: var(--accent); }
.pbody { padding: 0 0 22px; color: var(--ink-soft); font-size: .8125rem; }
.pbody ul, .job ul { padding-left: 17px; margin-top: 10px; }
.pbody li + li, .job li + li { margin-top: 4px; }
.tech { margin-top: 10px; color: var(--ink-faint); font-size: .75rem; }
.plinks { display: flex; flex-wrap: wrap; gap: 2px 20px; margin-top: 9px; }
.plinks a { display: inline-flex; align-items: center; min-height: 36px; }
/* Native details provide keyboard and no-JS behavior. Supporting browsers
   ease the content and its neighbors together; older ones open instantly. */
@supports (interpolate-size: allow-keywords) and (content-visibility: hidden) {
    .proj { interpolate-size: allow-keywords; }
    .proj::details-content { block-size: 0; overflow: clip; opacity: 0; transition: block-size 240ms var(--ease-out), opacity 200ms ease, content-visibility 240ms allow-discrete; }
    .proj[open]::details-content { block-size: auto; opacity: 1; }
}
.resume-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; }
.linkbtn { border: 0; padding: 0; background: none; color: var(--ink-soft); font-size: .8125rem; cursor: pointer; min-height: 40px; text-decoration: underline; text-decoration-color: var(--link-ul); text-underline-offset: 3px; }
.resume-summary { margin-top: 21px; font-size: .875rem; }
.resume-contact { margin-top: 17px; color: var(--ink-soft); font-size: .8125rem; overflow-wrap: anywhere; }
.resume-content section { margin-top: 32px; }
.resume-content h2 { margin-bottom: 17px; border-bottom: 1px solid var(--rule); padding-bottom: 9px; }
.job + .job { margin-top: 25px; }
.job h3 { font-size: .875rem; font-weight: 500; line-height: 1.5; }
.when { display: block; color: var(--ink-faint); font-size: .75rem; font-weight: 400; margin-top: 3px; }
.org { font-size: .8125rem; color: var(--ink-soft); margin-top: 4px; }
.jline { font-size: .8125rem; margin-top: 10px; }
.job li, .resume-projects li { color: var(--ink-soft); font-size: .8125rem; }
.chip { font: inherit; }
.skills dt { font-size: .8125rem; font-weight: 500; margin-top: 13px; }
.skills dd { font-size: .8125rem; color: var(--ink-soft); line-height: 1.65; margin-top: 3px; }
.certs { list-style: none; font-size: .8125rem; color: var(--ink-soft); }
.certs li + li { margin-top: 10px; }
.certs strong, .resume-projects strong { color: var(--ink); font-weight: 500; }
.resume-projects { padding-left: 17px; }
.resume-projects li + li { margin-top: 8px; }
.resume-content .screen-only { margin-top: 13px; font-size: .8125rem; }
html[data-input="keyboard"] .theme-state,
html[data-input="keyboard"] .theme-toggle,
html[data-input="keyboard"] .chev,
html[data-input="keyboard"] .proj::details-content { transition: none; }
@media (max-width: 480px) {
    .wrap { padding: max(39px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); }
    .selected-work { margin-top: 34px; }
    .page-footer { margin-top: 34px; }
    .work-link { gap: 14px; }
    .drawer-header { padding-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right)); }
    .drawer-body { padding-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right)); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .theme-state, .link-arrow { transform: none !important; }
}
@page { size: letter; margin: 14mm 16mm; }
@media print {
    html, html[data-theme] { color-scheme: light; --bg: #fff; --ink: #000; --ink-soft: #222; --ink-faint: #444; --rule: #aaa; --rule-soft: #ccc; --accent: #000; }
    html { font-size: 12px; }
    body { background: white; color: black; line-height: 1.4; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .wrap { max-width: none; padding: 0; }
    .skip-link, .page-footer, .back-link, .js-print, .end-links, .screen-only, .chev, .fans, .project-drawer { display: none !important; }
    h1 { font-size: 18pt; }
    h2 { color: black; }
    a { text-decoration: none; }
    .resume-intro { margin-bottom: 10pt; }
    .resume-summary, .resume-contact { margin-top: 7pt; }
    .resume-content section { margin-top: 12pt; }
    .resume-content h2 { margin-bottom: 6pt; padding-bottom: 3pt; }
    .job + .job { margin-top: 9pt; }
    .job, .resume-projects li, .certs li { break-inside: avoid; }
    .job h3 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
    .when { margin-top: 0; }
    .jline { margin-top: 4pt; }
    .job ul { margin-top: 4pt; }
    .tech { margin-top: 3pt; }
    .skills dt { margin-top: 6pt; break-after: avoid; }
    .skills dd { margin-top: 1pt; }
    .resume-projects a::after, .resume-contact a:not([href^="mailto:"])::after, .plinks a::after { content: " (" attr(href) ")"; font-size: .9em; overflow-wrap: anywhere; }
    .proj { break-inside: avoid; }
    .proj::details-content { content-visibility: visible; block-size: auto; overflow: visible; opacity: 1; }
    .pbody { padding-bottom: 9pt; }
    .plinks a { min-height: 0; }
}
