:root {
    color-scheme: light dark;
    --paper: #faf9f5;
    --paper-2: #f2f0e9;
    --ink: #1b1b1a;
    --ink-soft: #57554f;
    --ink-muted: #8f8d84;
    --ink-faint: #bcbab0;
    --line: #e4e1d7;
    --accent: #5b4fc4;
    --selection: #1b1b1a;
    --selection-text: #faf9f5;
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --content-width: 720px;
    --header-height: 52px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0e0e11;
        --paper-2: #17171b;
        --ink: #e8e7e1;
        --ink-soft: #b7b5ac;
        --ink-muted: #807e77;
        --ink-faint: #4c4a45;
        --line: #26262a;
        --accent: #8f86ea;
        --selection: #e8e7e1;
        --selection-text: #0e0e11;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection {
    color: var(--selection-text);
    background: var(--selection);
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--ink-faint);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 120ms ease, text-decoration-color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

h1,
h2,
h3,
p,
ul,
ol,
dl {
    margin-top: 0;
}

h1,
h2,
h3,
strong {
    font-weight: 500;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(28px, 6vw, 34px);
    line-height: 1.1;
    letter-spacing: -0.025em;
}

h2 {
    margin-bottom: 12px;
    font-size: clamp(20px, 4vw, 24px);
    line-height: 1.3;
    letter-spacing: -0.015em;
}

h3 {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.5;
}

.page-width {
    width: min(var(--content-width), calc(100% - 44px));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    position: fixed;
    z-index: 100;
    top: 12px;
    left: 12px;
    padding: 8px 12px;
    color: var(--paper);
    background: var(--ink);
}

.site-header {
    position: sticky;
    z-index: 20;
    top: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    gap: 16px;
}

.wordmark {
    flex: 0 0 auto;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}

.wordmark:hover {
    color: var(--ink);
}

.wordmark > span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px;
}

.nav-links a {
    padding: 6px 9px;
    color: var(--ink-muted);
    font-size: 13.5px;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--ink);
    background: var(--paper-2);
}

.nav-links a[aria-current="page"] {
    color: var(--accent);
}

.site-main {
    min-height: calc(100vh - var(--header-height));
}

.site-main:focus {
    outline: none;
}

.terminal-command {
    margin-bottom: 16px;
    color: var(--ink-soft);
    font-weight: 500;
}

.terminal-command .terminal-prefix {
    color: var(--accent);
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--ink-muted);
    font-size: 13px;
    letter-spacing: 0.01em;
}

.eyebrow .terminal-prefix {
    color: var(--ink-faint);
}

.home-hero,
.page-heading,
.case-heading,
.cv-heading {
    padding: 62px 0 46px;
}

.home-hero .eyebrow {
    margin-bottom: 28px;
}

.home-hero .terminal-command {
    margin-bottom: 12px;
}

.home-hero h1::after {
    display: inline-block;
    width: 0.52em;
    height: 1.02em;
    margin-left: 5px;
    background: var(--accent);
    vertical-align: -0.12em;
    content: "";
    animation: terminal-blink 1.1s steps(1) infinite;
}

@keyframes terminal-blink {
    50% {
        opacity: 0;
    }
}

.hero-subtitle,
.case-heading__grid > div > p:not(.eyebrow),
.page-heading > p:last-child,
.project-card__copy > p,
.research-row p,
.case-challenge > p,
.case-decisions li p,
.timeline-copy > p:not(.timeline-organization),
.education-row > div:last-child > p:not(.timeline-organization),
.cv-project-card > p,
.skill-row p,
.interests-card > p:last-child {
    color: var(--ink-soft);
}

.hero-subtitle {
    margin: 0 0 4px;
    color: var(--ink-muted);
}

.discipline-list {
    display: block;
    max-width: 62ch;
    margin: 24px 0 0;
    padding: 0;
    color: var(--ink-soft);
    list-style: none;
}

.discipline-list li {
    display: inline;
}

.discipline-separator {
    color: var(--ink-faint);
}

.hero-lead {
    max-width: 62ch;
    margin: 24px 0 0;
    color: var(--ink);
}

.hero-availability {
    margin: 16px 0 0;
    color: var(--ink-muted);
    font-size: 13px;
}

.hero-availability .terminal-prefix {
    color: var(--ink-faint);
}

.hero-actions,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-actions {
    margin-top: 28px;
}

.button {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--line);
    color: var(--ink);
    background: transparent;
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.button:hover {
    color: var(--paper);
    background: var(--ink);
    border-color: var(--ink);
}

.section-block,
.terminal-section,
.case-challenge,
.case-decisions,
.cv-section,
.cv-bottom-grid,
.contact-strip {
    padding: 46px 0;
    border-top: 1px dashed var(--line);
}

.section-heading,
.section-label-row,
.cv-heading,
.footer-meta,
.project-meta,
.next-project {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
}

.section-heading {
    margin-bottom: 8px;
}

.section-heading .terminal-command {
    margin-bottom: 8px;
}

.section-heading .eyebrow,
.section-label-row .eyebrow {
    margin-bottom: 4px;
}

.section-heading > .text-link,
.section-label-row > span,
.section-label-row > a {
    flex: 0 0 auto;
    color: var(--ink-muted);
    font-size: 13px;
}

.project-card {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.project-card:last-child {
    border-bottom: 0;
}

.project-meta {
    margin-bottom: 6px;
    color: var(--ink-muted);
    font-size: 12.5px;
}

.technical-label {
    color: var(--ink-soft);
}

.project-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
}

.project-name {
    margin-bottom: 0;
    font-size: 16px;
}

.project-prefix {
    color: var(--ink-faint);
}

.project-link {
    flex: 0 0 auto;
    color: var(--ink-muted);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.project-link:hover {
    color: var(--accent);
}

.project-desc {
    max-width: 64ch;
    margin: 9px 0 11px;
    color: var(--ink-soft);
}

.tag-row {
    color: var(--ink-muted);
    font-size: 12.5px;
}

.tag-row i {
    color: var(--ink-faint);
    font-style: normal;
}

.contact-strip {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.contact-strip .terminal-command {
    margin-bottom: 8px;
}

.contact-strip h2 {
    margin-bottom: 0;
}

.contact-block {
    padding: 46px 0;
    border-top: 1px dashed var(--line);
}

.contact-block .terminal-command {
    margin-bottom: 8px;
}

.contact-block .eyebrow {
    margin-bottom: 18px;
}

.contact-list {
    display: grid;
    gap: 7px;
}

.contact-row {
    display: grid;
    grid-template-columns: 88px 16px minmax(0, 1fr);
    align-items: baseline;
}

.contact-key {
    color: var(--ink-muted);
}

.contact-arrow {
    color: var(--ink-faint);
}

.page-heading {
    max-width: 68ch;
}

.page-heading .terminal-command {
    margin-bottom: 28px;
}

.page-heading > p:last-child {
    margin: 18px 0 0;
}

.research-section {
    padding-bottom: 54px;
}

.research-list {
    margin-top: 12px;
    border-bottom: 1px solid var(--line);
}

.research-row {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 3px 18px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
}

.research-row time {
    color: var(--ink-muted);
    font-size: 13px;
}

.research-row h3 {
    margin-bottom: 4px;
}

.research-row p {
    margin-bottom: 0;
    font-size: 14px;
}

.research-row > span:last-child {
    color: var(--ink-faint);
}

.case-study {
    padding-bottom: 54px;
}

.case-heading .back-link {
    display: inline-block;
    margin-bottom: 28px;
    color: var(--ink-muted);
    font-size: 13px;
    text-decoration: none;
}

.case-heading .terminal-command {
    margin-bottom: 16px;
}

.case-heading__grid {
    display: grid;
    gap: 28px;
}

.case-heading__grid > div > p:not(.eyebrow) {
    max-width: 64ch;
    margin-bottom: 0;
}

.case-product-link {
    margin-top: 24px;
}

.case-meta {
    margin: 0;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.case-meta > div {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 18px;
    padding: 5px 0;
}

.case-meta dt,
.case-meta dd {
    margin: 0;
}

.case-meta dt {
    color: var(--ink-muted);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 18px;
}

.metric-grid > .eyebrow {
    grid-column: 1 / -1;
    margin-bottom: 14px;
}

.metric-grid > div {
    display: grid;
    align-content: start;
    gap: 3px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.metric-grid strong {
    color: var(--accent);
    font-size: 19px;
}

.metric-grid span {
    color: var(--ink-muted);
    font-size: 13px;
}

.workflow-card .terminal-command {
    margin-bottom: 18px;
}

.workflow-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.workflow-step {
    display: flex;
    gap: 8px;
}

.workflow-step > span,
.workflow-arrow {
    color: var(--ink-faint);
    font-weight: 400;
}

.case-challenge {
    display: grid;
    gap: 12px;
}

.case-challenge > div,
.case-challenge > p {
    max-width: 64ch;
}

.case-challenge > p {
    margin-bottom: 0;
}

.case-decisions .section-label-row {
    margin-bottom: 8px;
}

.case-decisions .section-label-row .terminal-command {
    margin-bottom: 0;
}

.case-decisions ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.case-decisions li {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.case-decisions li > span {
    color: var(--ink-muted);
}

.case-decisions li h3 {
    margin-bottom: 5px;
}

.case-decisions li p {
    margin-bottom: 0;
}

.next-project {
    padding: 18px 0;
    border-top: 1px dashed var(--line);
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}

.next-project > span {
    color: var(--ink-muted);
    font-size: 13px;
}

.next-project > strong {
    margin-left: auto;
}

.next-project > i {
    color: var(--ink-faint);
    font-style: normal;
}

.cv-heading {
    align-items: flex-end;
}

.cv-heading .terminal-command {
    margin-bottom: 24px;
}

.cv-heading h1 {
    margin-bottom: 8px;
}

.cv-heading > div > p:last-child {
    margin-bottom: 0;
    color: var(--ink-muted);
}

.print-button {
    flex: 0 0 auto;
}

.cv-contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 13px;
    font-style: normal;
}

.cv-section {
    padding-bottom: 0;
}

.cv-section .section-label-row {
    margin-bottom: 10px;
}

.timeline-row,
.education-row,
.cv-project-card {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 18px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.timeline-marker {
    display: none;
}

.timeline-date,
.education-date {
    color: var(--ink-muted);
    font-size: 13px;
}

.timeline-date {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0 4px;
}

.timeline-copy h3,
.education-row h3,
.cv-project-card h3 {
    margin-bottom: 4px;
}

.timeline-organization {
    margin-bottom: 8px;
    color: var(--ink-muted);
    font-size: 13px;
}

.timeline-copy > p:not(.timeline-organization),
.education-row > div:last-child > p:not(.timeline-organization),
.cv-project-card > p {
    margin-bottom: 10px;
}

.education-list,
.cv-project-grid {
    border-bottom: 1px solid var(--line);
}

.education-row {
    grid-template-columns: 10rem minmax(0, 1fr);
}

.cv-project-card time {
    color: var(--ink-muted);
    font-size: 13px;
}

.cv-project-card > *:not(time) {
    grid-column: 2;
}

.cv-project-card h3 {
    margin-top: -2.25rem;
}

.cv-bottom-grid {
    display: grid;
    gap: 46px;
}

.skills-card,
.languages-card,
.interests-card {
    padding-top: 0;
}

.skill-row,
.languages-card > div {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 16px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.skill-row p,
.languages-card > div > * {
    margin: 0;
}

.skill-row strong,
.languages-card > div > span {
    color: var(--ink-muted);
    font-weight: 400;
}

.cv-side-stack {
    display: grid;
    gap: 46px;
}

.interests-card > p:last-child {
    margin-bottom: 0;
    padding-top: 9px;
    border-top: 1px solid var(--line);
}

.site-footer {
    padding: 34px 0 50px;
    border-top: 1px dashed var(--line);
    color: var(--ink-muted);
    font-size: 13px;
}

.footer-inner {
    display: grid;
    gap: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.footer-meta p {
    margin: 0;
}

@media (max-width: 620px) {
    body {
        font-size: 14px;
    }

    .page-width {
        width: min(var(--content-width), calc(100% - 32px));
    }

    .site-nav {
        align-items: flex-start;
        flex-direction: column;
        padding: 10px 0;
    }

    .nav-links {
        justify-content: flex-start;
        margin-left: -9px;
    }

    .home-hero,
    .page-heading,
    .case-heading,
    .cv-heading {
        padding-top: 48px;
    }

    .section-heading,
    .section-label-row,
    .contact-strip,
    .cv-heading,
    .footer-meta,
    .project-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .section-heading > .text-link,
    .section-label-row > span,
    .section-label-row > a {
        margin-top: 6px;
    }

    .contact-strip {
        align-items: flex-start;
    }

    .research-row,
    .case-meta > div,
    .metric-grid,
    .timeline-row,
    .education-row,
    .cv-project-card,
    .skill-row,
    .languages-card > div {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .research-row > span:last-child {
        display: none;
    }

    .metric-grid > .eyebrow {
        grid-column: 1;
    }

    .workflow-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .workflow-arrow {
        transform: rotate(90deg);
    }

    .cv-project-card > *:not(time) {
        grid-column: 1;
    }

    .cv-project-card h3 {
        margin-top: 0;
    }

    .next-project {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .next-project > strong {
        margin-left: 0;
    }

    .project-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .contact-row {
        grid-template-columns: 72px 14px minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .home-hero h1::after {
        opacity: 1;
    }
}

@media print {
    @page {
        size: A4;
        margin: 13mm;
    }

    :root {
        color-scheme: light;
        --paper: #fff;
        --paper-2: #fff;
        --ink: #111;
        --ink-soft: #333;
        --ink-muted: #555;
        --ink-faint: #777;
        --line: #ccc;
        --accent: #111;
    }

    body {
        color: #111;
        background: #fff;
        font-size: 8.5pt;
        line-height: 1.42;
    }

    .site-header,
    .site-footer,
    .print-button,
    .skip-link {
        display: none !important;
    }

    .site-main {
        min-height: auto;
    }

    .page-width {
        width: 100%;
    }

    .cv-heading {
        padding: 0 0 5mm;
    }

    .cv-heading .terminal-command,
    .cv-heading .eyebrow {
        margin-bottom: 2mm;
    }

    .cv-heading h1 {
        font-size: 24pt;
    }

    .cv-contact-row {
        padding: 2.5mm 0;
    }

    .cv-section,
    .cv-bottom-grid {
        margin-top: 0;
        padding: 5mm 0 0;
        border-top-style: solid;
    }

    .cv-section .section-label-row {
        margin-bottom: 1mm;
    }

    .timeline-row,
    .education-row,
    .cv-project-card {
        grid-template-columns: 27mm 1fr;
        gap: 4mm;
        padding: 2.5mm 0;
        break-inside: avoid;
    }

    .timeline-copy > p:not(.timeline-organization),
    .education-row > div:last-child > p:not(.timeline-organization),
    .cv-project-card > p {
        margin-bottom: 1.5mm;
    }

    .tag-row {
        gap: 1mm 3mm;
        font-size: 7pt;
    }

    .cv-bottom-grid,
    .cv-side-stack {
        gap: 4mm;
    }

    .skill-row,
    .languages-card > div {
        grid-template-columns: 25mm 1fr;
        padding: 1.5mm 0;
    }

    a {
        text-decoration: none;
    }
}
