/* Original portfolio design. Shared by the homepage and selected case studies. */
:root {
  color-scheme: light;
  --paper: #f6f5f1;
  --surface: #ffffff;
  --ink: #262d29;
  --muted: #62675f;
  --accent: #994426;
  --accent-soft: #f0e0d5;
  --line: #d8dad0;
  --sage: #e7e9df;
  --forest: #243c33;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 7rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.7 var(--sans); overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .24em; }
button { font: inherit; color: inherit; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
[tabindex='-1']:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--accent-soft); color: var(--ink); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.15; }
h1, h2 { font-weight: 560; letter-spacing: -.055em; }
h1 em, h2 em { font-family: var(--serif); font-weight: 400; color: var(--accent); letter-spacing: -.055em; }
h2 { font-size: clamp(2.4rem, 4.1vw, 3.55rem); }
h3 { font-weight: 600; letter-spacing: -.035em; }
p + p { margin-top: 1rem; }
img { display: block; max-width: 100%; height: auto; }
.container { width: min(1180px, calc(100% - 6rem)); margin-inline: auto; }
.section { padding-block: 7rem; }
.eyebrow, .project-meta, .status-label, .board-topline, .layer-index, .board-code, .visual-topline, .focus-strip, .case-label {
  font-family: var(--mono); font-size: .72rem; font-weight: 500; line-height: 1.6; letter-spacing: .075em;
}
.eyebrow { margin-bottom: 1.2rem; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: .7rem; min-height: 44px; padding: .3rem 0; font-weight: 600; font-size: .93rem; text-decoration: none; border-bottom: 1px solid currentColor; background: none; border-top: 0; border-right: 0; border-left: 0; text-align: left; }
.text-link > [aria-hidden] { transition: transform 160ms ease; }
.text-link:hover { color: var(--accent); }
.text-link:hover > [aria-hidden] { transform: translate(2px, -2px); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 1.8rem; min-height: 52px; padding: .7rem 1.3rem; text-decoration: none; font-size: .93rem; font-weight: 600; border-radius: 3px; border: 1px solid transparent; transition: background 160ms ease; }
.button-primary { color: #fff; background: var(--forest); }
.button-primary:hover { background: #344f43; }
.button-secondary { border-color: var(--line); }
.button-secondary:hover { background: var(--sage); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 1rem; left: 1rem; transform: translateY(-160%); z-index: 100; padding: .6rem 1rem; background: var(--ink); color: #fff; border-radius: 3px; }
.skip-link:focus { transform: none; }
.anchor-alias { display: block; height: 0; scroll-margin-top: 7rem; }

/* Navigation remains usable without JavaScript. */
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.wordmark { display: inline-flex; align-items: center; gap: .85rem; flex-shrink: 0; min-height: 44px; font-size: .97rem; font-weight: 600; text-decoration: none; }
.monogram { font-size: 2rem; line-height: 1; font-weight: 650; letter-spacing: -.12em; padding-right: .13em; }
.monogram > span { color: var(--accent); }
.primary-nav { display: flex; align-items: center; gap: 2.2rem; }
.primary-nav a { min-height: 44px; display: inline-flex; align-items: center; gap: .8rem; font-size: .89rem; text-decoration: none; position: relative; }
.primary-nav a:hover, .primary-nav a[aria-current] { color: var(--accent); }
.primary-nav a[aria-current]::after { content: ''; position: absolute; bottom: 3px; height: 2px; left: 0; right: 0; background: currentColor; }
.primary-nav .nav-contact { border-left: 1px solid var(--line); padding-left: 2rem; font-weight: 600; }
.language-toggle { min-height: 36px; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--ink); font: .67rem/1 var(--mono); letter-spacing: .04em; cursor: pointer; }
.language-toggle:hover { border-color: var(--accent); color: var(--accent); }
.language-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.menu-toggle { min-height: 44px; min-width: 78px; background: none; border: 1px solid var(--line); border-radius: 3px; padding: .4rem .75rem; }
.menu-toggle > span { display: inline-block; margin-left: .6rem; font-size: 1.2rem; transition: transform 160ms ease; }
.menu-toggle[aria-expanded='true'] > span { transform: rotate(45deg); }

/* Hero: a typographic introduction paired with a code-native visual. */
.hero { display: grid; grid-template-columns: 1.08fr 1fr; align-items: center; gap: 5rem; padding-top: 5.4rem; padding-bottom: 4.8rem; }
.hero h1 { font-size: clamp(3.6rem, 6.85vw, 6.25rem); line-height: 1.015; }
.hero .eyebrow { font-size: .69rem; display: flex; align-items: center; gap: .7rem; letter-spacing: .04em; }
.small-mark { width: 9px; height: 9px; display: inline-block; background: var(--accent); flex: 0 0 auto; }
.hero-description { margin-top: 1.7rem; max-width: 31rem; color: var(--muted); font-size: 1.05rem; line-height: 1.75; }
/* Invisible full phrases reserve the longest line, including at larger text sizes. */
.hero-identity { display: flex; align-items: start; gap: .25rem; width: fit-content; max-width: 100%; margin-top: 1.5rem; }
.hero-role { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .3em; min-width: 0; padding-block: .25rem; font-size: clamp(1.05rem, 1.7vw, 1.35rem); font-weight: 500; line-height: 1.6; }
.typing-stage { display: inline-grid; grid-template-columns: minmax(0, 1fr); max-width: 100%; min-width: 0; color: var(--accent); }
.typing-stage > span { grid-area: 1 / 1; min-width: 0; }
.typing-measure { visibility: hidden; user-select: none; padding-inline-end: .65em; }
.typing-current { align-self: start; }
.typing-cursor { display: inline-block; width: .65em; font-weight: 400; opacity: 0; }
.hero-identity + .hero-description { margin-top: .8rem; }
/* This one decorative loop remains animated under the site's reduced-motion rules. */
[data-typing-state='running'] .typing-cursor { opacity: 1; animation: typing-caret 1s step-end infinite !important; }
@keyframes typing-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@media print { .typing-cursor { display: none !important; } }
.hero-actions { margin-top: 1.8rem; display: flex; align-items: center; gap: 1.65rem; flex-wrap: wrap; }
.current-focus { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .77rem; color: var(--muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--forest); }
.focus-divider { margin-inline: .15rem; color: #777c70; }
.hero-board { min-width: 0; padding: 1.5rem 1.6rem 1.35rem; border: 1px solid #d1d6c7; border-radius: 5px; background-color: var(--sage); background-image: linear-gradient(#cdd3c54a 1px, transparent 1px), linear-gradient(90deg, #cdd3c54a 1px, transparent 1px); background-size: 24px 24px; }
.board-topline, .visual-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.board-topline { color: #4e5c4f; font-size: .67rem; }
.board-topline > :last-child { font-size: 1.4rem; }
.stack-diagram { padding: 2.4rem 0 2.2rem; display: grid; gap: .85rem; }
.stack-layer { position: relative; border-radius: 3px; padding: 1.3rem 1.2rem; }
.layer-python { margin-right: 2rem; background: #fafbf7; border: 1px solid #c7ccbf; }
.layer-systems { margin-left: 1rem; margin-right: 1rem; background: var(--forest); color: #fff; box-shadow: 0 8px 18px #243c3312; }
.layer-hardware { margin-left: 2rem; border: 1px solid #d5bca7; background: #ebd5c3; color: #473d30; }
.layer-index { margin-bottom: .4rem; font-size: .64rem; }
.layer-title { display: flex; align-items: start; justify-content: space-between; gap: 1rem; font-weight: 580; letter-spacing: -.035em; font-size: clamp(1rem, 1.6vw, 1.36rem); line-height: 1.3; }
.layer-title > span { font-size: 1.1rem; }
.stack-layer p { margin-top: .4rem; font-size: .73rem; line-height: 1.5; }
.layer-python p { color: var(--muted); }
.layer-systems p, .layer-systems .layer-index { color: #d0dfd1; }
.board-caption { display: flex; align-items: center; gap: .9rem; color: #4e5c4f; font-size: .8rem; line-height: 1.5; }
.crosshair { font: 1.7rem var(--mono); }
.board-code { margin-left: auto; font-size: .65rem; }
.focus-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 0; padding-block: 1.15rem; border-block: 1px solid var(--line); color: var(--ink); font-size: .66rem; letter-spacing: .08em; }
.focus-strip span { display: inline-flex; align-items: center; justify-content: center; justify-self: center; min-width: 9.5rem; min-height: 34px; padding: .38rem 1.15rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; }
.focus-strip span + span::before { content: none; }
html[lang='zh-CN'] .focus-strip { letter-spacing: .04em; }

/* Progressive disclosure: three selected studies, then earlier work. */
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 3rem; margin-bottom: 2.8rem; }
.section-intro { max-width: 24rem; color: var(--muted); font-size: 1rem; }
.featured-project { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border: 1px solid var(--line); border-radius: 5px; overflow: clip; }
.model-visual { position: relative; min-height: 445px; padding: 1.8rem 2rem 1.25rem; color: #f2f2e8; background: var(--forest); display: flex; flex-direction: column; }
.visual-topline { font-size: .67rem; color: #c7d8cb; }
.visual-topline > :first-child { color: #fff; font: 600 1.1rem var(--mono); letter-spacing: -.03em; }
.token-line { display: flex; gap: .55rem; margin: 2.2rem auto 1.2rem; font-family: var(--mono); font-size: 1.1rem; }
.token-line > span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #789080; background: #ffffff06; border-radius: 3px; }
.token-line .token-next { border-color: transparent; background: transparent; }
.attention-grid { display: grid; grid-template-columns: repeat(5, 25px); gap: 7px; margin: 0 auto 2rem; }
.attention-grid i { width: 25px; height: 25px; border-radius: 2px; background: #b7c7a2; }
.attention-grid i:nth-child(3n) { background: #d8a888; }
.attention-grid i.off { background: #ffffff06; border: 1px solid #536d60; }
.model-caption { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-top: auto; font-size: 1.2rem; line-height: 1.4; }
.model-caption strong { font-weight: 450; font-family: var(--serif); font-style: italic; color: #ebc8ad; font-size: 1.75rem; }
.visual-arrow { font-size: 2.5rem; line-height: 1; }
.diagram-note { font: .63rem/1.5 var(--mono); color: #c5d6c8; margin-top: 1rem; }
.project-copy { padding: 2.6rem 2.5rem; display: flex; flex-direction: column; align-items: start; }
.project-meta { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; color: var(--muted); font-size: .64rem; letter-spacing: .055em; }
.project-copy h3 { font-size: 2.5rem; margin-top: 1.7rem; }
.project-lede { font-size: 1.4rem; letter-spacing: -.03em; line-height: 1.4; margin-top: .9rem; }
.project-copy > p:not(.project-meta):not(.project-lede) { color: var(--muted); margin-top: 1rem; }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 1.3rem 0 1.5rem; }
.tag-list li { border: 1px solid var(--line); background: var(--paper); border-radius: 3px; padding: .25rem .6rem; font-size: .7rem; line-height: 1.5; color: #515c51; }
.project-copy > .text-link { margin-top: auto; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.project-card { min-width: 0; border: 1px solid var(--line); border-radius: 5px; padding: 1.7rem 2rem 2rem; display: flex; flex-direction: column; align-items: start; background: #fcfcf9; transition: border-color 160ms ease, box-shadow 160ms ease; }
.project-card:hover, .project-card:focus-within { border-color: #9ca591; box-shadow: 0 6px 22px #262d2906; }
.project-card-top { display: flex; justify-content: space-between; align-items: start; gap: 1rem; width: 100%; }
.project-number { font: .75rem var(--mono); color: #626b5c; }
.mini-visual { width: 100%; display: flex; justify-content: center; align-items: center; margin: 1.6rem 0; min-height: 108px; font: .74rem/1.5 var(--mono); border-radius: 3px; gap: .65rem; }
.python-visual { background: #e9ece3; color: #425540; }
.python-visual span { border: 1px solid #aab69e; border-radius: 3px; padding: .5rem .6rem; background: #f7f8f2; }
.python-visual b { font-weight: normal; }
.tracker-visual { background: #f0e4d9; color: #6a4931; gap: 0; padding: 1rem .7rem; }
.tracker-visual span { flex: 1; text-align: center; position: relative; font-size: .66rem; padding: .8rem .15rem; }
.timeline-point::after, .future-point::after { content: ''; position: absolute; left: 5%; right: 5%; bottom: 0; border-top: 1px solid #927459; }
.future-point::after { border-top-style: dashed; }
.time-boundary { border-inline: 1px dashed #926e4e; }
.project-card h3 { font-size: 1.8rem; line-height: 1.2; margin-bottom: 1rem; }
.project-card > p { color: var(--muted); }
.project-card > .text-link { margin-top: auto; }
.earlier-work { margin-top: 2rem; border-block: 1px solid var(--line); }
.earlier-work summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem 0; font-size: 1.05rem; font-weight: 500; list-style: none; }
.earlier-work summary::-webkit-details-marker { display: none; }
.earlier-work .eyebrow { display: block; margin-bottom: .2rem; font-size: .65rem; }
.details-symbol { font: 1.6rem var(--mono); transition: transform 160ms ease; }
.earlier-work[open] .details-symbol { transform: rotate(45deg); }
.earlier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding: .8rem 0 2rem; }
.earlier-grid h3 { font-size: 1.4rem; margin: .7rem 0; }
.earlier-grid p:not(.project-meta) { color: var(--muted); }
.earlier-grid .text-link { margin-top: .9rem; }

/* Experience and background. Dates are shown only where confirmed. */
.experience-section { padding-block: 6rem; background: #eeeee7; border-block: 1px solid var(--line); }
.experience-layout { display: grid; grid-template-columns: .87fr 1.13fr; gap: 6rem; }
.experience-heading h2 { font-size: clamp(2.2rem, 3.6vw, 3.1rem); }
.experience-heading > p:not(.eyebrow) { color: var(--muted); margin-top: 1.5rem; }
.experience-heading .scope-note { font-size: .8rem; max-width: 22rem; }
.experience-list { border-left: 1px solid #c8cec0; padding-left: 2rem; }
.experience-item { position: relative; padding-bottom: 2.5rem; }
.experience-item + .experience-item { border-top: 1px solid #d3d7cb; padding-top: 2rem; }
.experience-item::before { content: ''; position: absolute; top: .6rem; left: calc(-2rem - 5px); width: 9px; height: 9px; background: var(--forest); border: 2px solid #eeeee7; outline: 1px solid #88977f; border-radius: 50%; }
.experience-item + .experience-item::before { top: 2.6rem; }
.experience-item:last-child { padding-bottom: 0; }
.experience-topline { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.experience-topline h3 { font-size: 1.5rem; }
.status-label { font-size: .62rem; color: #4d614a; background: #e2e6da; padding: .25rem .6rem; border-radius: 2px; }
.experience-item h4 { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
.experience-context { color: var(--muted); font-size: .83rem; margin-top: .25rem; }
.experience-points { margin: 1rem 0 .8rem; padding-left: 1.1rem; color: #555f51; font-size: .93rem; }
.experience-points li + li { margin-top: .65rem; }
.experience-points li::marker { color: #7b8972; }
.experience-item > p:last-child { color: var(--muted); font-size: .93rem; margin-top: .75rem; }
.about-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 7rem; }
.about-lede { margin-top: 1.6rem; font-size: 1.15rem; font-weight: 500; letter-spacing: -.02em; }
.about-intro > p:not(.eyebrow):not(.about-lede) { color: var(--muted); }
.about-intro .text-link { margin-top: 1.5rem; }
.about-details { padding-top: .2rem; }
.about-details h3 { font-size: 1.1rem; margin-bottom: 1.25rem; }
.capabilities { margin: 0; }
.capabilities > div { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.capabilities dt { font-size: .75rem; color: var(--muted); }
.capabilities dd { margin: .2rem 0 0; font-size: .91rem; }
.education-group { margin-top: 2.4rem; scroll-margin-top: 7rem; }
.education-item { display: flex; align-items: center; gap: 1rem; margin-top: 1.3rem; }
.school-mark { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 4px; flex-shrink: 0; }
.school-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.school-mark--cmu img { object-fit: cover; }
.school-mark--vt img { padding: 5px; }
.education-item h4 { font-size: .96rem; font-weight: 600; line-height: 1.4; }
.education-item p { font-size: .79rem; color: var(--muted); margin-top: .2rem; }
.academic-note { font-size: .84rem; color: var(--muted); margin-top: 1.5rem; }

/* Contact: one clear address, no stale personal information or dead form. */
.contact-section { background: var(--forest); color: #f6f5ee; padding-block: 5rem; }
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 5rem; }
.contact-section .eyebrow { color: #c7d6c7; }
.contact-section h2 { font-size: clamp(2.4rem, 4vw, 3.5rem); }
.contact-section h2 em { color: #e9bb9b; }
.contact-section p:not(.eyebrow):not(.copy-status) { max-width: 27rem; margin-top: 1.3rem; color: #d3dfd3; font-size: .94rem; }
.email-link { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 52px; font-size: clamp(1rem, 1.75vw, 1.45rem); letter-spacing: -.02em; text-decoration: none; padding-bottom: .8rem; border-bottom: 1px solid #9fae9b; overflow-wrap: anywhere; }
.email-link:hover { color: #edc6a9; }
.contact-secondary { display: flex; align-items: center; gap: 2rem; margin-top: .7rem; }
.contact-secondary .text-link { font-size: .83rem; border-color: transparent; }
.contact-secondary .text-link:hover { color: #edc6a9; border-color: currentColor; }
.contact-section :focus-visible { outline-color: #edc6a9; }
.copy-status { min-height: 2.8em; font-size: .78rem; margin-top: .7rem; color: #d3dfd3; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 88px; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; font-size: .76rem; color: var(--muted); }
.footer-inner p + p { margin: 0; }
.footer-inner a { display: inline-flex; align-items: center; gap: .7rem; min-height: 44px; text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }

/* Case-study pages share the same navigation, rhythm, and reading styles. */
.case-hero { padding-block: 3rem 3.5rem; border-bottom: 1px solid var(--line); }
.back-link { margin-bottom: 3rem; color: var(--muted); font-size: .85rem; }
.case-hero h1 { max-width: 56rem; font-size: clamp(2.7rem, 5.8vw, 5rem); line-height: 1.075; }
.case-deck { max-width: 47rem; margin-top: 1.5rem; font-size: 1.2rem; color: var(--muted); line-height: 1.7; }
.case-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.5rem; margin-top: 1.5rem; }
.case-actions > a { max-width: 100%; }
.case-site-note { max-width: 47rem; margin-top: .8rem; color: var(--muted); font-size: .8rem; }
.case-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; border-top: 1px solid var(--line); padding-top: 1.5rem; margin: 2.5rem 0 0; }
.case-facts dt { font: .67rem/1.5 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.case-facts dd { margin: .5rem 0 0; font-size: .95rem; }
.case-body { display: grid; grid-template-columns: 220px minmax(0, 700px); justify-content: space-between; gap: 4rem; padding-block: 4rem 5rem; }
.case-aside { align-self: start; position: sticky; top: 7.5rem; }
.case-aside h2 { font: .7rem/1.5 var(--mono); letter-spacing: .07em; color: var(--muted); text-transform: uppercase; margin-bottom: .7rem; }
.case-aside nav { display: flex; flex-direction: column; align-items: start; }
.case-aside nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; text-decoration: none; }
.case-aside nav a:hover { color: var(--accent); text-decoration: underline; }
.case-aside .text-link { margin-top: 1.8rem; font-size: .83rem; }
.case-prose { min-width: 0; }
.case-prose section + section { margin-top: 3.1rem; }
.case-prose h2 { font-size: 1.9rem; margin-bottom: 1.25rem; letter-spacing: -.035em; }
.case-prose h3 { margin: 1.5rem 0 .65rem; font-size: 1.1rem; line-height: 1.4; letter-spacing: -.02em; }
.case-prose p, .case-prose li { color: #555e52; }
.case-prose p { max-width: 67ch; }
.case-prose ul { margin-block: 1rem; padding-left: 1.3rem; }
.case-prose li + li { margin-top: .6rem; }
.case-prose strong { color: var(--ink); font-weight: 600; }
.case-callout { padding: 1.4rem 1.6rem; border-left: 3px solid var(--accent); background: #efeee6; margin-block: 2rem; }
.case-callout p { font-size: .95rem; }
.case-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 1.5rem 0 2rem; }
.case-flow > div { padding: 1rem; background: var(--sage); border: 1px solid #d0d7c6; border-radius: 3px; }
.case-flow span { display: block; color: #5b6e52; font: .67rem var(--mono); margin-bottom: .8rem; }
.case-flow h3 { font-size: .95rem; margin: 0 0 .55rem; }
.case-flow p { font-size: .8rem; line-height: 1.6; }
.case-note { font-size: .83rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.case-next { padding-block: 2.5rem; border-top: 1px solid var(--line); background: #eeeee7; }
.case-next-inner { display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
.case-next .eyebrow { margin-bottom: .4rem; font-size: .65rem; }
.case-next h2 { font-size: 1.7rem; letter-spacing: -.04em; }
.case-next .text-link { flex-shrink: 0; }

@media (max-width: 1100px) {
  .container { width: calc(100% - 4rem); }
  .hero { gap: 2.5rem; padding-block: 4rem; }
  .hero .eyebrow { max-width: 24rem; }
  .hero h1 { font-size: clamp(3.5rem, 7.2vw, 5.6rem); }
  .hero-board { padding-inline: 1.15rem; }
  .stack-layer { padding: 1.1rem .9rem; }
  .layer-python { margin-right: 1.2rem; }
  .layer-systems { margin-inline: .6rem; }
  .layer-hardware { margin-left: 1.2rem; }
  .project-copy { padding: 2rem; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card { padding-inline: 1.5rem; }
  .python-visual { gap: .45rem; font-size: .66rem; }
  .python-visual span { padding-inline: .4rem; }
  .experience-layout, .about-layout { gap: 3rem; }
  .contact-layout { gap: 3rem; }
  .case-body { grid-template-columns: 180px minmax(0, 1fr); gap: 2.5rem; }
}
@media (max-width: 48rem) {
  html { scroll-padding-top: 6rem; }
  .container { width: calc(100% - 2.5rem); }
  .header-inner { min-height: 72px; flex-wrap: wrap; gap: 0 1rem; padding-block: .6rem; }
  .wordmark { font-size: .88rem; }
  .monogram { font-size: 1.8rem; }
  .primary-nav { flex-basis: 100%; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1.1rem; padding: .8rem 0 .2rem; border-top: 1px solid var(--line); margin-top: .5rem; }
  .primary-nav a { font-size: .85rem; }
  .primary-nav .nav-contact { border: 0; padding-left: 0; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-block: 3.2rem 2.5rem; }
  .hero .eyebrow { font-size: .65rem; max-width: none; }
  .hero h1 { font-size: clamp(3.3rem, 11.5vw, 5.7rem); }
  .hero-description { font-size: 1rem; max-width: 35rem; }
  .hero-actions { margin-top: 1.5rem; }
  .current-focus { font-size: .74rem; margin-top: 1.5rem; }
  .hero-board { padding: 1.2rem; }
  .stack-diagram { padding-block: 1.5rem; gap: .65rem; }
  .stack-layer { padding: .95rem 1.1rem; }
  .layer-title { font-size: 1.15rem; }
  .stack-layer p { font-size: .75rem; }
  .layer-python { margin-right: 2rem; }
  .layer-systems { margin-inline: 1rem; }
  .layer-hardware { margin-left: 2rem; }
  .focus-strip { display: flex; flex-wrap: wrap; justify-content: center; font-size: .58rem; letter-spacing: .025em; padding-block: 1rem; gap: .5rem; }
  .focus-strip span { min-height: 32px; padding: .34rem .68rem; }
  .focus-strip span:first-child, .focus-strip span:nth-child(2), .focus-strip span:last-child { justify-self: auto; }
  .section { padding-block: 4rem; }
  .section-heading { display: block; margin-bottom: 2rem; }
  .section-intro { max-width: 35rem; margin-top: 1.3rem; font-size: .94rem; }
  .eyebrow { font-size: .68rem; }
  .featured-project { grid-template-columns: minmax(0, 1fr); }
  .model-visual { min-height: 390px; padding: 1.5rem; }
  .model-caption { margin-top: .5rem; }
  .project-copy { padding: 1.7rem; }
  .project-copy h3 { margin-top: 1rem; font-size: 2.15rem; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .project-card { padding: 1.5rem; }
  .project-card h3 { font-size: 1.7rem; }
  .project-meta { font-size: .65rem; }
  .python-visual { font-size: .75rem; }
  .python-visual span { padding-inline: .6rem; }
  .tracker-visual span { font-size: .7rem; }
  .earlier-work summary { font-size: .95rem; }
  .earlier-grid { grid-template-columns: 1fr; gap: 2rem; }
  .experience-section { padding-block: 4rem; }
  .experience-layout, .about-layout { grid-template-columns: minmax(0, 1fr); gap: 2.7rem; }
  .experience-heading h2 { font-size: 2.4rem; max-width: 30rem; }
  .experience-heading > p:not(.eyebrow) { max-width: 34rem; }
  .experience-list { padding-left: 1.4rem; }
  .experience-item::before { left: calc(-1.4rem - 5px); }
  .contact-section { padding-block: 3.5rem; }
  .contact-layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .email-link { font-size: clamp(1rem, 4.8vw, 1.6rem); }
  .footer-inner { min-height: 100px; display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding-block: 1rem; }
  .footer-inner p:nth-child(2) { grid-column: 1; grid-row: 2; font-size: .68rem; }
  .footer-inner > a { grid-column: 2; grid-row: 1 / 3; }
  .case-hero { padding-block: 1.5rem 2rem; }
  .back-link { margin-bottom: 2rem; }
  .case-hero h1 { font-size: clamp(2.4rem, 9vw, 4rem); }
  .case-deck { font-size: 1.03rem; }
  .case-facts { grid-template-columns: 1fr; gap: 1rem; margin-top: 2rem; }
  .case-facts > div { display: grid; grid-template-columns: 90px 1fr; gap: 1rem; }
  .case-facts dd { margin: 0; }
  .case-body { grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-block: 2rem 3rem; }
  .case-aside { position: static; border-bottom: 1px solid var(--line); padding-bottom: 1.5rem; }
  .case-aside nav { flex-direction: row; flex-wrap: wrap; gap: 0 1.2rem; }
  .case-aside .text-link { margin-top: .6rem; }
  .case-flow { grid-template-columns: minmax(0, 1fr); }
  .case-flow > div { padding: 1rem 1.2rem; }
  .case-flow span { margin-bottom: .5rem; }
  .case-callout { padding: 1.2rem; }
  .case-next-inner { align-items: start; flex-direction: column; gap: 1rem; }
}
@media (max-width: 370px) {
  .container { width: calc(100% - 2rem); }
  .hero .eyebrow { font-size: .6rem; }
  .hero-actions { gap: 1rem; }
  .hero-actions .button { gap: 1rem; padding-inline: 1rem; }
  .hero-actions .text-link { font-size: .85rem; }
  .hero-board { padding: 1rem; }
  .stack-layer { padding: .85rem .8rem; }
  .layer-title { font-size: 1.03rem; }
  .layer-index { font-size: .6rem; }
  .stack-layer p { font-size: .66rem; }
  .layer-python { margin-right: 1rem; }
  .layer-systems { margin-inline: .5rem; }
  .layer-hardware { margin-left: 1rem; }
  .board-topline { font-size: .59rem; }
  .board-code { display: none; }
  .project-copy, .project-card { padding: 1.25rem; }
  .python-visual { font-size: .62rem; gap: .3rem; }
  .python-visual span { padding-inline: .35rem; }
  .tracker-visual span { font-size: .6rem; }
  .token-line { gap: .35rem; }
  .token-line > span { width: 30px; height: 30px; }
  .model-caption strong { font-size: 1.4rem; }
  .visual-topline { font-size: .57rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .status-dot, .small-mark, .attention-grid i { border: 1px solid CanvasText; }
  .button, .status-label, .tag-list li { border: 1px solid ButtonText; }
}
@media print {
  :root { --paper: #fff; --ink: #000; --muted: #333; --accent: #333; }
  html { scroll-behavior: auto; }
  body { font-size: 10pt; }
  .container { width: 100%; }
  .site-header, .skip-link, .hero-board, .focus-strip, .model-visual, .mini-visual, .menu-toggle, .copy-email, .copy-status, .case-aside, .case-next, .hero-actions { display: none !important; }
  .hero, .section, .experience-section, .contact-section, .case-hero, .case-body { padding: 1.5rem 0; }
  .hero, .featured-project, .project-grid, .experience-layout, .about-layout, .contact-layout, .case-body { display: block; }
  .hero h1, .case-hero h1 { font-size: 34pt; }
  h2, .experience-heading h2, .contact-section h2 { font-size: 23pt; }
  .contact-section, .experience-section { background: #fff; color: #000; }
  .contact-section p, .contact-section .eyebrow, .contact-section h2 em { color: #333 !important; }
  .project-copy, .project-card { padding: 1rem; }
  .project-card { margin-top: 1rem; }
  .experience-list { margin-top: 1.5rem; }
  .project-card, .experience-item, .education-item, .case-flow > div { break-inside: avoid; }
  .about-details { margin-top: 1.5rem; }
  a { text-decoration: underline; }
}
