/* Shared palette, typography, and spacing. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #172640;
  --muted: #52627b;
  --accent: #2258c5;
  --accent-hover: #16459f;
  --line: #dce3ef;
  --soft: #eaf0f8;
  --navy: #11243d;
  --aqua: #a5e7dc;
  --radius: 18px;
  --shadow: 0 12px 35px rgba(22, 43, 77, .06);
  color-scheme: light;
  font-family: 'Avenir Next', Avenir, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-synthesis: none;
}
:root[data-theme='dark'] {
  --bg: #0b1628;
  --surface: #14243c;
  --text: #f0f4fc;
  --muted: #acbad1;
  --accent: #a2beff;
  --accent-hover: #c4d5ff;
  --line: #2b3d59;
  --soft: #101f36;
  --shadow: 0 12px 35px rgba(0, 0, 0, .12);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 105px; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--accent); color: var(--bg); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
em { color: var(--accent); font-family: Georgia, 'Times New Roman', serif; font-weight: 400; }
.container { width: min(1240px, calc(100% - 96px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 12px 20px; background: var(--text); color: var(--bg); z-index: 50; border-radius: 6px; }
.skip-link:focus { top: 12px; }
.eyebrow { display: flex; align-items: center; gap: 12px; color: var(--accent); font-size: .75rem; font-weight: 650; letter-spacing: 1.3px; line-height: 1.7; margin: 0 0 18px; }
.eyebrow-line { width: 26px; height: 2px; background: currentColor; flex-shrink: 0; }
.body-copy { color: var(--muted); line-height: 1.85; font-size: 1rem; }
.text-link { color: var(--accent); font-size: .875rem; font-weight: 650; border-bottom: 1px solid currentColor; padding-bottom: 5px; display: inline-block; }
.text-link:hover { color: var(--accent-hover); }

/* Header and primary actions. */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { width: min(1240px, calc(100% - 96px)); margin: auto; min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.wordmark { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 2.875rem; height: 2.875rem; display: flex; align-items: center; justify-content: center; background: var(--navy); border-radius: 12px; color: #f2f6fe; font-size: 1.25rem; font-weight: 750; letter-spacing: -1px; flex-shrink: 0; }
.brand-dot { color: var(--aqua); }
.brand-name { font-size: .8125rem; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
nav { display: flex; align-items: center; gap: 26px; }
nav a { color: var(--muted); font-size: .875rem; padding: 10px 0; font-weight: 500; }
nav a:hover { color: var(--accent); }
.header-controls { display: flex; gap: 8px; flex-shrink: 0; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-button:hover { background: var(--soft); }
.theme-toggle, .menu-toggle { display: none; }
.js .theme-toggle { display: grid; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 14px 24px; min-height: 52px; border: 1px solid transparent; border-radius: 9px; font-size: .875rem; font-weight: 650; transition: background .2s, box-shadow .2s, transform .2s; }
.button-primary { background: var(--accent); color: var(--bg); box-shadow: 0 6px 18px rgba(34, 88, 197, .14); }
.button-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.button-secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.button-secondary:hover { background: var(--soft); }

/* Typography-led introduction and a framed personal profile. */
.hero { padding-top: 70px; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 48px 68px; }
.hero-copy { min-width: 0; align-self: center; }
.hero h1 { font-size: clamp(2.7rem, 5.65vw, 5rem); font-weight: 650; line-height: 1.06; letter-spacing: -.055em; margin-bottom: 26px; }
.hero h1 em { font-family: inherit; font-style: normal; font-weight: inherit; }
.accent { color: var(--accent); }
.hero-introduction { max-width: 650px; color: var(--muted); font-size: 1.0625rem; line-height: 1.85; margin-bottom: 28px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-note { align-self: center; background: var(--navy); color: #eef5ff; border: 1px solid #2d4260; border-radius: 20px; padding: 25px 26px; box-shadow: 0 18px 45px rgba(17, 36, 61, .13); }
.profile-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #b5c7df; font-family: ui-monospace, SFMono-Regular, monospace; font-size: .75rem; letter-spacing: .4px; }
.monogram { font-size: 7.7rem; font-weight: 700; letter-spacing: -.075em; line-height: 1.15; margin: 22px 0 12px; color: #edf4ff; }
.monogram > span { color: var(--aqua); }
.profile-disciplines { display: flex; gap: 8px; padding-bottom: 24px; border-bottom: 1px solid #3a4e68; }
.profile-disciplines span { font-family: ui-monospace, monospace; font-size: .75rem; letter-spacing: .8px; padding: 4px 9px; color: var(--aqua); border: 1px solid #486274; border-radius: 4px; }
.study-note { display: flex; flex-direction: column; align-items: flex-start; padding-top: 22px; }
.study-note .eyebrow { color: #b5c7df; font-size: .75rem; margin-bottom: 9px; }
.study-note strong { font-size: 1.25rem; font-weight: 550; line-height: 1.4; margin-bottom: 9px; }
.study-note > span:not(.eyebrow) { font-size: .8125rem; color: #b5c7df; }
.study-note .study-major { color: var(--aqua) !important; margin-top: 8px; }
.hero-bottom { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-family: ui-monospace, monospace; font-size: .75rem; letter-spacing: .7px; }
.hero-bottom a { font-family: inherit; letter-spacing: 0; color: var(--accent); }

/* Every project uses the same orientation and internal alignment. */
.section { padding: 80px 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 36px; }
.section-heading .eyebrow { margin-bottom: 12px; }
h2 { margin-bottom: 0; font-size: clamp(2rem, 3.3vw, 2.8rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.18; }
.section-heading > p { color: var(--muted); font-size: .9375rem; margin-bottom: 3px; }
.projects-section { background: var(--soft); border-block: 1px solid var(--line); }
.project-grid { --project-columns: 3; display: grid; grid-template-columns: repeat(var(--project-columns), minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.project-grid--paired { --project-columns: 2; }
.project-card { position: relative; isolation: isolate; min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: transform .22s, box-shadow .22s, border-color .22s; }
.project-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(22, 43, 77, .12); border-color: var(--accent); }
/* The title link covers the card; separate actions stay above it. */
.project-title-link::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); cursor: pointer; }
.project-title-link:focus-visible { outline: none; }
.project-title-link:focus-visible::after { outline: 3px solid var(--accent); outline-offset: -3px; }
.project-actions a { position: relative; z-index: 2; }
.project-copy { padding: 26px; display: flex; flex: 1; flex-direction: column; align-items: flex-start; min-width: 0; }
.project-meta { margin-bottom: 14px; color: var(--accent); font-size: .75rem; font-weight: 600; }
h3 { font-size: 1.5rem; line-height: 1.3; letter-spacing: -.03em; font-weight: 600; margin-bottom: 16px; }
.project-copy h3 { min-height: 3.9em; margin-bottom: 14px; }
.project-copy h3 a:hover { color: var(--accent); }
.project-copy > p { font-size: .9375rem; color: var(--muted); line-height: 1.8; min-height: 5.4em; margin-bottom: 18px; }
.tech-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; margin-bottom: 24px; }
.tech-list span { font-size: .75rem; font-weight: 500; border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px; color: var(--muted); background: var(--bg); }
.project-copy .tech-list { min-height: 5.5rem; }
.project-actions { width: 100%; min-height: 44px; margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding-top: 12px; border-top: 1px solid var(--line); }
.project-action { display: flex; flex: 1 1 160px; align-items: center; justify-content: space-between; gap: 16px; color: var(--accent); font-size: .875rem; font-weight: 650; }
.repository-link { color: var(--accent); font-size: .8125rem; font-weight: 650; white-space: nowrap; padding-block: 4px; }
.repository-link > span { color: var(--muted); font-weight: 500; }
.repository-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.action-mark { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--soft); font-size: 1.15rem; font-weight: 400; transition: background .2s; }
.project-action:hover .action-mark { background: var(--accent); color: var(--bg); }

/* Technical diagrams share one visual system. All are conceptual, not screenshots. */
.project-visual { padding: 23px 24px 18px; display: flex; flex-direction: column; height: auto; min-height: 280px; flex-shrink: 0; background: var(--navy); color: #edf5ff; }
.diagram-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-family: ui-monospace, SFMono-Regular, monospace; font-size: .75rem; letter-spacing: .6px; color: #b5c7df; }
.diagram-version { color: var(--aqua); border: 1px solid #4c667e; padding: 0 6px; border-radius: 4px; }
.visual-stage { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 18px; min-width: 0; }
.flight-flow { display: flex; align-items: center; gap: 10px; }
.flow-step { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.flow-label { color: #b5c7df; font-family: ui-monospace, monospace; font-size: .75rem; line-height: 1.5; }
.flow-step strong { font-size: clamp(1.55rem, 2.5vw, 2.2rem); line-height: 1.3; font-weight: 550; letter-spacing: -.05em; margin: 6px 0 3px; }
.flow-step:last-child strong { color: var(--aqua); }
.flow-caption { color: #b5c7df; font-size: .75rem; }
.flow-connector { height: 1px; background: #648098; flex: 0 1 22px; min-width: 8px; }
.model-row { display: flex; align-items: center; gap: 10px; border: 1px solid #39516f; border-radius: 7px; padding: 10px; background: #19314c; flex-wrap: wrap; }
.model-symbol { width: 28px; height: 30px; display: grid; place-items: center; color: var(--aqua); font-family: Georgia, serif; font-size: 1.4rem; background: #28465e; border-radius: 4px; }
.model-row > div { display: flex; flex: 1; flex-direction: column; min-width: 115px; }
.model-row strong { font-size: .8125rem; font-weight: 550; }
.model-row div span { color: #b5c7df; font-size: .75rem; line-height: 1.4; }
.model-tag { font-size: .75rem; color: var(--aqua); margin-left: auto; }
.visual-caption { font-size: .75rem; color: #b5c7df; margin: 0; padding-top: 13px; border-top: 1px solid #354b67; line-height: 1.5; }
.database-count { display: flex; align-items: center; gap: 18px; }
.database-count > strong { font-size: 4.4rem; color: var(--aqua); font-weight: 500; letter-spacing: -.065em; line-height: 1; }
.database-count > div { display: flex; flex-direction: column; }
.database-count div span { font-size: 1.1rem; font-weight: 500; }
.database-count small { font-size: .75rem; color: #b5c7df; margin-top: 4px; }
.database-flow { display: flex; align-items: center; gap: 7px; }
.database-flow > span:not(.flow-connector) { font-family: ui-monospace, monospace; font-size: .75rem; border: 1px solid #39516f; background: #19314c; border-radius: 5px; padding: 7px 8px; }
.database-flow > .flow-connector { flex: 1; min-width: 4px; }
.contribution-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; padding-top: 10px; border-top: 1px solid #354b67; }
.contribution-strip span { font: .6875rem ui-monospace, monospace; letter-spacing: .5px; color: #b5c7df; }
.contribution-strip strong { color: var(--aqua); font-size: .75rem; font-weight: 500; }
.retailer-row { display: flex; gap: 8px; }
.retailer-row span { font-size: .75rem; padding: 6px; border: 1px solid #39516f; background: #19314c; border-radius: 4px; flex: 1; text-align: center; }
.recommendation-node { display: flex; flex-direction: column; align-items: center; text-align: center; }
.recommendation-node > span { font-family: ui-monospace, monospace; color: #b5c7df; font-size: .75rem; margin-bottom: 3px; }
.recommendation-node strong { font-size: 1.5rem; font-weight: 500; letter-spacing: -.035em; color: var(--aqua); }
.recommendation-branches { display: flex; justify-content: space-around; text-align: center; gap: 12px; font-size: .75rem; color: #b5c7df; line-height: 1.6; }
.recommendation-branches strong { font-weight: 500; color: #edf5ff; }
.wakeline-title { display: flex; flex-direction: column; gap: 5px; }
.wakeline-title > span { color: #b5c7df; font: .75rem ui-monospace, monospace; letter-spacing: .5px; }
.wakeline-title > strong { font-size: 1.85rem; color: var(--aqua); font-weight: 500; line-height: 1.2; letter-spacing: -.035em; }
.terminal-snippet { border: 1px solid #39516f; border-radius: 7px; background: #19314c; padding: 11px 14px; }
.terminal-snippet > span { display: block; color: #b5c7df; font-size: .75rem; margin-bottom: 6px; }
.terminal-snippet code { color: #edf5ff; font-size: .8125rem; line-height: 1.65; white-space: normal; }
.wakeline-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.wakeline-metrics > span { padding: 3px 8px; border: 1px solid #39516f; border-radius: 4px; color: #b5c7df; font-size: .75rem; }

/* Background sections use a consistent two-column rhythm. */
.about-grid, .detail-grid, .education-grid, .contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }
.about-grid > div, .detail-grid > *, .contact-grid > * { min-width: 0; }
.about-lead { font-size: 1.3rem; line-height: 1.65; letter-spacing: -.02em; }
.skills-panel { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.skills-panel > .eyebrow { margin-bottom: 4px; }
.skill-group { padding: 18px 0; border-bottom: 1px solid var(--line); }
.skill-group:last-child { border: 0; padding-bottom: 0; }
.skill-group h3 { font-size: .875rem; font-weight: 650; margin-bottom: 7px; letter-spacing: 0; }
.skill-group p { color: var(--muted); font-size: .875rem; line-height: 1.9; margin: 0; }
.skill-group p span { color: var(--accent); padding: 0 2px; }
.experience-section { border-top: 1px solid var(--line); }
.experience-card { border-left: 2px solid var(--accent); padding-left: 30px; }
.experience-card h3 { font-size: 1.6rem; }
.company { font-size: 1.0625rem; margin-bottom: 3px; }
.location { color: var(--muted); font-size: .8125rem; margin-bottom: 22px; }
.content-list { padding-left: 18px; color: var(--muted); }
.content-list li { padding-left: 5px; margin-bottom: 15px; }
.content-list li::marker { color: var(--accent); }
.experience-card .tech-list { margin: 22px 0 0; }
.education-section { padding-top: 20px; }
.education-grid { gap: 24px; }
.education-card { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.education-top { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 24px; }
.education-number { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 7px; color: var(--accent); font-size: .75rem; background: var(--soft); }
.education-date { font-size: .75rem; color: var(--muted); text-align: right; }
.education-card h3 { min-height: 2.6em; margin-bottom: 12px; }
.degree { font-size: 1rem; line-height: 1.6; margin-bottom: 5px; }
.education-detail { font-size: .875rem; color: var(--muted); margin-bottom: 5px; }
.academic-result { margin-top: auto; display: flex; flex-direction: column; gap: 3px; border-top: 1px solid var(--line); padding: 20px 0; }
.academic-result strong { font-size: 1.75rem; font-weight: 600; letter-spacing: -.04em; }
.academic-result span { color: var(--muted); font-size: .75rem; }
.recognition { border-top: 1px solid var(--line); padding-top: 20px; }
.recognition .eyebrow { font-size: .75rem; margin-bottom: 12px; }
.recognition ul { list-style: none; padding: 0; margin: 0; }
.recognition li { position: relative; padding-left: 20px; color: var(--muted); font-size: .875rem; margin-bottom: 8px; }
.recognition li:before { content: '+'; color: var(--accent); position: absolute; left: 0; }
.research-section { background: var(--soft); border-block: 1px solid var(--line); }
.research-section .body-copy { max-width: 370px; margin-top: 25px; }
.research-card { padding: 30px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.research-card h3 { font-size: 1.5rem; line-height: 1.45; }
.authors, .conference { color: var(--muted); font-size: .875rem; line-height: 1.8; }
.authors strong { color: var(--text); }
.research-meta { color: var(--muted); font-size: .75rem; margin-bottom: 20px; }
.doi { color: var(--muted); font-size: .75rem; margin: 16px 0 0; overflow-wrap: anywhere; }
.activities-section { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 35px 0; }
.activities-section .eyebrow { margin-bottom: 0; }
.activity { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.activity h3 { font-size: 1rem; margin: 0; }
.activity > span { color: var(--muted); font-size: .75rem; text-align: right; }
.contact-section { margin-top: 30px; background: var(--navy); color: #eef5ff; padding: 75px 0; }
.contact-section .eyebrow, .contact-section em { color: var(--aqua); }
.contact-section .body-copy, .contact-label, .contact-location { color: #b5c7df; }
.contact-grid { align-items: center; }
.contact-grid .body-copy { max-width: 360px; margin-top: 24px; margin-bottom: 0; }
.contact-details { padding: 25px 0; border-top: 1px solid #3a4e68; }
.contact-label { font-size: .75rem; letter-spacing: .9px; margin-bottom: 18px; }
.contact-email { color: var(--aqua); font-size: clamp(1rem, 1.85vw, 1.55rem); font-weight: 550; border-bottom: 1px solid #71988f; padding-bottom: 9px; overflow-wrap: anywhere; display: inline-block; }
.contact-email:hover { color: #d3fff4; }
.contact-location { font-size: .8125rem; margin-top: 20px; }
.contact-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 22px; }
.contact-actions:empty { display: none; }
.contact-actions .text-link { color: var(--aqua); }
.site-footer { padding: 30px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .75rem; }
.site-footer a { color: var(--accent); }

/* Dedicated case-study pages. */
.case-hero { padding: 55px 0 45px; }
.case-hero > .eyebrow { margin-top: 40px; }
.case-hero h1 { max-width: 1000px; font-size: clamp(2.5rem, 5.2vw, 4.3rem); line-height: 1.1; font-weight: 650; letter-spacing: -.05em; margin-bottom: 25px; }
.case-hero > p:not(.eyebrow) { max-width: 700px; color: var(--muted); font-size: 1.15rem; line-height: 1.8; }
.case-overview { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 30px; border-block: 1px solid var(--line); margin-top: 32px; padding: 25px 0; }
.case-overview .eyebrow { color: var(--muted); font-size: .75rem; margin-bottom: 9px; }
.case-overview p { font-size: .875rem; margin: 0; }
.case-overview .tech-list { margin: 0; }
.case-visual { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 36px; overflow: hidden; }
.case-visual .project-visual { height: auto; min-height: 320px; padding: 30px; }
.case-visual .flow-step strong { font-size: 2.7rem; }
.case-visual .visual-stage { max-width: 470px; width: 100%; margin-inline: auto; }
.case-visual-note { padding: 40px; align-self: center; }
.case-visual-note h2 { font-size: 2rem; }
.case-visual-note > p:last-child { font-size: .875rem; color: var(--muted); margin: 20px 0 0; }
.case-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 24px 0 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.case-highlights > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 22px 26px; gap: 6px; min-width: 0; }
.case-highlights > div + div { border-left: 1px solid var(--line); }
.case-highlights dt { color: var(--muted); font-size: .8125rem; }
.case-highlights dd { color: var(--accent); font-size: 1.75rem; font-weight: 600; letter-spacing: -.04em; line-height: 1.2; margin: 0; }
.case-highlights dt, .case-highlights dd { min-width: 0; }
.case-gallery { padding-top: 10px; padding-bottom: 48px; }
.case-gallery h2 { font-size: 1.85rem; margin-bottom: 25px; }
.case-gallery-intro { max-width: 740px; margin: -10px 0 25px; color: var(--muted); font-size: .9375rem; }
.screenshot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.screenshot-grid figure { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.screenshot-frame { display: flex; align-items: center; aspect-ratio: 4 / 3; background: #fff; padding: 18px; }
.screenshot-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.screenshot-frame:hover { background: #f5f7fb; }
.screenshot-grid figcaption { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding: 20px 24px; }
.screenshot-grid figcaption strong { font-size: 1rem; font-weight: 600; }
.screenshot-grid figcaption span { color: var(--muted); font-size: .8125rem; line-height: 1.7; }
.screenshot-grid--wide { grid-template-columns: minmax(0, 1fr); }
.screenshot-grid--wide .screenshot-frame { aspect-ratio: auto; padding: 0; }
.screenshot-grid--wide .screenshot-frame img { height: auto; object-fit: initial; }
.evaluation-panel { margin: 25px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.evaluation-table-scroll { overflow-x: auto; max-width: 100%; }
.evaluation-table-scroll:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.evaluation-panel table { border-collapse: collapse; width: 100%; min-width: 430px; font-size: .8125rem; text-align: left; font-variant-numeric: tabular-nums; }
.evaluation-panel caption { padding: 18px; text-align: left; color: var(--text); font-weight: 600; font-size: .875rem; }
.evaluation-panel thead { background: var(--soft); }
.evaluation-panel th, .evaluation-panel td { padding: 14px 18px; border-top: 1px solid var(--line); }
.evaluation-panel th { font-weight: 600; }
.evaluation-panel td { color: var(--muted); }
.case-content .evaluation-note { padding: 18px; margin: 0; border-top: 1px solid var(--line); font-size: .8125rem; line-height: 1.8; }
.case-links { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 25px; margin-top: 25px; }
.case-links:empty { display: none; }
.case-link-note { color: var(--muted); font-size: .8125rem; margin: 0; }
.case-body { display: grid; grid-template-columns: 2.2fr 1fr; gap: 90px; padding-top: 15px; }
.case-content { min-width: 0; }
.case-content > section { padding: 35px 0 45px; border-bottom: 1px solid var(--line); }
.case-content > section:first-child { padding-top: 0; }
.case-content h2 { font-size: 1.85rem; margin-bottom: 20px; }
.case-content p { color: var(--muted); font-size: 1.0625rem; line-height: 1.9; }
.case-content .contribution-note { border-left: 2px solid var(--line); padding-left: 18px; margin-top: 24px; font-size: .875rem; }
.case-aside { padding: 25px; border: 1px solid var(--line); border-radius: 12px; align-self: start; background: var(--surface); }
.case-aside p:not(.eyebrow) { color: var(--muted); font-size: .875rem; margin-bottom: 10px; }
.approach-list article { display: flex; gap: 22px; margin-top: 26px; }
.approach-number { font-family: ui-monospace, monospace; font-size: .75rem; padding-top: 5px; color: var(--accent); }
.approach-list h3 { font-size: 1.25rem; margin-bottom: 8px; }
.approach-list p { font-size: 1rem; margin: 0; }
.outcome-list { list-style: none; padding: 0; margin: 0; }
.outcome-list li { position: relative; padding: 18px 0 18px 25px; color: var(--muted); border-top: 1px solid var(--line); }
.outcome-list li:first-child { border: 0; }
.outcome-list li:before { content: '+'; position: absolute; left: 0; color: var(--accent); }
.next-project { padding: 55px 0; display: flex; justify-content: space-between; align-items: center; gap: 40px; }
.next-project h2 { font-size: 2rem; max-width: 760px; }
.next-project h2 a:hover { color: var(--accent); }
.next-project .button { flex-shrink: 0; }
.case-contact { padding: 25px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 25px; }
.case-contact p { color: var(--muted); font-size: .875rem; margin-bottom: 0; }
.not-found { padding: 110px 0 150px; }
.not-found h1 { font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1.1; letter-spacing: -.05em; }
.not-found p { color: var(--muted); }

@media (max-width: 1150px) {
  .container, .header-inner { width: calc(100% - 64px); }
  nav { gap: 18px; }
  .hero { grid-template-columns: minmax(0, 1fr) 300px; column-gap: 35px; }
  .project-grid { gap: 18px; }
  .project-copy { padding: 23px; }
  .project-visual { padding-inline: 20px; }
  .about-grid, .detail-grid, .contact-grid { gap: 40px; }
}
@media (max-width: 1024px) {
  .header-inner { min-height: 78px; }
  .js .menu-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
  .menu-toggle span { width: 17px; height: 1px; background: currentColor; display: block; }
  .js nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 18px 32px; border-bottom: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
  .js nav.is-open { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
  .js nav a { padding: 9px 0; font-size: 1rem; }
  html:not(.js) .header-inner { flex-wrap: wrap; padding-block: 15px; }
  html:not(.js) nav { flex-wrap: wrap; gap: 8px 18px; }
  .hero h1 { font-size: clamp(2.5rem, 5.5vw, 4rem); }
  .hero-note { padding: 22px; }
  .monogram { font-size: 6.5rem; }
  .project-grid { grid-template-columns: minmax(0, 1fr); max-width: 680px; margin-inline: auto; gap: 28px; }
  .project-visual { height: auto; min-height: 300px; padding: 26px 30px 20px; }
  .project-copy { padding: 30px; }
  .project-copy h3, .project-copy > p, .project-copy .tech-list { min-height: 0; }
  .project-copy h3 { font-size: 1.7rem; }
  .project-copy > p { margin-bottom: 20px; }
  .project-copy .tech-list { margin-bottom: 25px; }
  .flow-step strong { font-size: 2.4rem; }
  .database-flow { max-width: 440px; }
  .case-aside { display: none; }
  .case-body { display: block; max-width: 800px; }
  .case-visual-note { padding: 28px; }
  .case-visual-note h2 { font-size: 1.8rem; }
  .activities-section { gap: 40px; }
  .activity { flex-direction: column; align-items: flex-start; gap: 5px; }
}
@media (max-width: 760px) {
  .container, .header-inner { width: calc(100% - 40px); }
  .header-inner { min-height: 76px; gap: 16px; padding-block: 10px; }
  .brand-mark { width: 2.625rem; height: 2.625rem; border-radius: 10px; }
  .brand-name { font-size: .75rem; }
  .hero { padding-top: 44px; grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero h1 { font-size: clamp(2.45rem, 8.9vw, 3.8rem); }
  .hero .eyebrow { font-size: .75rem; letter-spacing: .4px; flex-wrap: wrap; }
  .hero-introduction { font-size: 1rem; }
  .hero-note { display: none; }
  .hero-bottom { padding-block: 18px; gap: 10px; flex-wrap: wrap; font-size: .75rem; letter-spacing: 0; }
  .hero-actions .button { padding-inline: 19px; }
  .section { padding: 55px 0; }
  .section-heading { display: block; margin-bottom: 28px; }
  .section-heading > p { margin: 17px 0 0; }
  .section-heading > p br { display: none; }
  h2 { font-size: 2.15rem; }
  .project-copy { padding: 25px; }
  .project-copy h3 { font-size: 1.6rem; }
  .project-visual { padding: 23px; height: auto; min-height: 280px; }
  .flow-step strong { font-size: 2.1rem; }
  .diagram-top { letter-spacing: .2px; }
  .flight-flow { gap: 10px; }
  .flow-label { letter-spacing: 0; }
  .model-row > div { min-width: 105px; }
  .database-flow { gap: 5px; flex-wrap: wrap; }
  .database-flow > span:not(.flow-connector) { padding: 6px; }
  .recommendation-node strong { font-size: 1.5rem; }
  .about-grid, .detail-grid, .education-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .about-lead { font-size: 1.2rem; }
  .skills-panel, .education-card, .research-card { padding: 25px; }
  .experience-card { padding-left: 22px; }
  .experience-section .section-heading { margin-bottom: 0; }
  .education-card h3 { min-height: 0; }
  .research-section .body-copy { max-width: none; margin-bottom: 0; }
  .activities-section { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 30px 0; }
  .activity { flex-direction: row; align-items: center; gap: 16px; }
  .activity > span { max-width: 140px; }
  .contact-section { margin-top: 10px; padding: 55px 0; }
  .contact-email { font-size: 1.1rem; }
  .site-footer { flex-wrap: wrap; font-size: .75rem; gap: 12px; }
  .site-footer span:nth-child(2) { display: none; }
  .case-hero { padding-top: 32px; }
  .case-hero h1 { font-size: clamp(2.2rem, 8.5vw, 3rem); }
  .case-hero > .eyebrow { margin-top: 30px; font-size: .75rem; }
  .case-overview { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .case-visual { grid-template-columns: minmax(0, 1fr); }
  .case-visual .project-visual { min-height: 300px; padding: 24px; }
  .case-visual .flow-step strong { font-size: 2.1rem; }
  .case-visual-note { padding: 26px; }
  .case-visual-note h2 { font-size: 1.75rem; }
  .case-highlights { grid-template-columns: minmax(0, 1fr); }
  .case-highlights > div { flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; }
  .case-highlights > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .case-highlights dd { font-size: 1.5rem; }
  .screenshot-grid { grid-template-columns: minmax(0, 1fr); }
  .screenshot-grid figcaption { padding: 18px 22px; }
  .case-gallery { padding-bottom: 30px; }
  .case-gallery h2 { font-size: 1.7rem; }
  .case-content h2 { font-size: 1.7rem; }
  .case-content p { font-size: 1rem; }
  .case-content > section { padding: 30px 0; }
  .next-project { flex-direction: column; align-items: flex-start; gap: 25px; padding: 40px 0; }
  .next-project h2 { font-size: 1.8rem; }
  .case-contact { flex-wrap: wrap; gap: 10px 25px; }
}
@media (max-width: 360px) {
  .brand-name { display: none; }
  .hero h1 { font-size: 2.2rem; }
  .project-visual { padding-inline: 19px; }
  .flow-step strong { font-size: 1.9rem; }
  .model-symbol { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Shared content rows keep desktop cards precisely aligned within each row,
   even when titles, summaries, or technology lists wrap differently. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 901px) {
    .project-grid { grid-template-columns: repeat(var(--project-columns), minmax(0, 1fr)); grid-template-rows: minmax(280px, auto) repeat(5, auto); row-gap: 0; max-width: none; margin-inline: 0; }
    .project-grid--paired { grid-template-rows: repeat(var(--project-rows), minmax(350px, auto) auto minmax(77px, auto) minmax(99px, auto) minmax(88px, auto) auto 24px) minmax(350px, auto) auto minmax(77px, auto) minmax(99px, auto) minmax(88px, auto) auto; }
    .project-grid--paired .project-card { grid-row: var(--project-row) / span 6; }
    .project-card { display: grid; grid-row: span 6; grid-template-rows: subgrid; row-gap: 0; }
    .project-copy { display: contents; }
    .project-copy .project-meta { padding: 24px 26px 14px; margin: 0; }
    .project-copy h3 { min-height: 0; padding: 0 26px 14px; margin: 0; }
    .project-copy > p { min-height: 0; padding: 0 26px 18px; margin: 0; }
    .project-copy .tech-list { min-height: 0; padding: 0 26px 24px; margin: 0; }
    .project-actions { width: auto; margin: 0 26px 26px; }
  }
}
@media (min-width: 761px) and (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-note { display: none; }
  .hero h1 { font-size: 3.8rem; }
}

@media (min-width: 901px) and (max-width: 1150px) {
  .project-card .project-visual { padding: 22px 20px 18px; height: auto; min-height: 280px; }
  .project-copy h3 { font-size: 1.375rem; }
  .project-card .model-symbol { display: none; }
  .project-card .model-row > div { min-width: 100px; }
  .project-card .database-flow { gap: 4px; }
  .project-card .database-flow > span:not(.flow-connector) { padding: 6px 3px; }
  .project-card .flow-step strong { font-size: 1.6rem; }
  .project-card .flow-label { font-size: .75rem; }
  .project-card .recommendation-node strong { font-size: 1.3rem; }
}

/* Preserve reflow when a visitor increases their browser text size. */
nav { min-width: 0; flex: 1; flex-wrap: wrap; justify-content: center; }
.flow-step strong, .flow-label, .model-row > div, .retailer-row span { overflow-wrap: anywhere; }
.database-count { flex-wrap: wrap; }
.database-count > div { min-width: 0; overflow-wrap: anywhere; }
.database-flow { flex-wrap: wrap; }
body { overflow-wrap: anywhere; }
.diagram-top { flex-wrap: wrap; }
.tech-list span { max-width: 100%; min-width: 0; }
.retailer-row span { min-width: 0; }
