:root {
  color-scheme: light;
  --paper: #f6f4ed;
  --surface: #ecebdd;
  --ink: #292d25;
  --muted: #616656;
  --line: #d9dacb;
  --accent: #536047;
  --accent-soft: #e6e9db;
  --on-accent: #fdfcf8;
  --body-ink: #474c42;
  --panel: #fdfcf8;
  --control-border: #7b806d;
  --scroll-thumb: #969d89;
  --button-bg: #536047;
  --button-ink: #fdfcf8;
  --button-hover-bg: #536047;
  --dialog-backdrop: rgb(25 29 23 / .48);
  --shadow: 0 20px 70px rgb(31 35 28 / .18);
  --text-body: 1rem;
  --text-lead: 1.0625rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans CJK JP", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --container: 1120px;
  --gutter: clamp(22px, 5vw, 64px);
  --radius: 6px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121416;
  --surface: #1a1d21;
  --ink: #eceef1;
  --muted: #abb2bd;
  --line: #353b43;
  --accent: #b8c49d;
  --accent-soft: #2b3227;
  --on-accent: #1b2117;
  --body-ink: #cbd0d8;
  --panel: #1b1f24;
  --control-border: #79816f;
  --scroll-thumb: #747d6a;
  --button-bg: #b8c49d;
  --button-ink: #1b2117;
  --button-hover-bg: #cbd5b6;
  --dialog-backdrop: rgb(0 0 0 / .72);
  --shadow: 0 24px 90px rgb(0 0 0 / .55);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-offset, 100px); scrollbar-gutter: stable; scrollbar-color: var(--scroll-thumb) var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-sans); font-size: var(--text-body); line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; text-underline-offset: 5px; }
img, svg { max-width: 100%; }
img { display: block; height: auto; }
svg { flex-shrink: 0; vertical-align: middle; }
button { border: 0; background: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 650; overflow-wrap: break-word; }
h1 { letter-spacing: -.045em; }
h2 { letter-spacing: -.035em; }
h3, h4 { letter-spacing: -.018em; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
::selection { color: var(--ink); background: var(--accent-soft); }
.hero-copy, .header-actions, .project-copy, .project-meta, .archive-name, .career-company, .career-description, .about-copy, .about-aside, .contact-option, .case-body, .case-prose { min-width: 0; }
.container { width: calc(100% - var(--gutter) * 2); max-width: var(--container); margin-inline: auto; }
.icon { width: 19px; height: 19px; }
.eyebrow { display: block; font-size: .75rem; line-height: 1.6; letter-spacing: .085em; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--accent); font-size: .9375rem; font-weight: 550; }
.text-link:hover { text-decoration: underline; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; padding: 11px 19px; border-radius: var(--radius); border: 1px solid transparent; font-size: .9375rem; font-weight: 600; }
.button-primary { background: var(--button-bg); color: var(--button-ink); border-color: var(--button-bg); }
.button-primary:hover { background: var(--button-hover-bg); border-color: var(--button-hover-bg); color: var(--button-ink); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--radius); color: var(--muted); }
.icon-button:hover { background: var(--surface); color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; list-style: none; }
.tags li { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 3px 9px; font-size: .8125rem; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.skip-link { position: fixed; z-index: 100; top: -100px; left: 20px; background: var(--ink); color: var(--paper); padding: 12px 20px; }
.skip-link:focus { top: 12px; }

.site-header { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; min-height: 76px; align-items: center; gap: 32px; }
.wordmark { font-size: 23px; font-weight: 750; letter-spacing: -.055em; padding-block: 8px; line-height: 1.3; margin-right: auto; }
.wordmark span { color: var(--accent); }
.desktop-nav, .header-actions, .language-switch { display: flex; align-items: center; }
.desktop-nav { gap: 8px; }
.desktop-nav a { padding: 10px 12px; border-radius: 5px; font-size: .875rem; font-weight: 500; color: var(--muted); }
.desktop-nav a:hover:not([aria-current]) { color: var(--ink); background: var(--surface); }
.desktop-nav [aria-current] { color: var(--accent); background: var(--accent-soft); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.site-header.is-scrolled { box-shadow: 0 3px 12px rgb(0 0 0 / .045); }
.header-actions > .nav-resume { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 12px; border: 1px solid var(--control-border); border-radius: var(--radius); background: var(--panel); color: var(--accent); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.header-actions > .nav-resume:hover { background: var(--accent-soft); border-color: var(--accent); }
.header-actions { gap: 12px; }
.header-preferences { display: flex; align-items: center; gap: inherit; min-width: 0; }
.theme-label { display: none; }
.language-switch { gap: 1px; padding-right: 7px; border-right: 1px solid var(--line); }
.language-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 40px; font-size: .75rem; font-weight: 500; color: var(--muted); }
.language-switch [aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.language-switch a:hover { color: var(--accent); }
.menu-button, .mobile-nav, .theme-sun { display: none; }
html[data-theme="dark"] .theme-sun { display: inline-flex; }
html[data-theme="dark"] .theme-moon { display: none; }
.menu-close-icon, .menu-label-close { display: none; }
.menu-button { width: auto; min-height: 44px; padding-inline: 10px; gap: 7px; border: 1px solid var(--control-border); font-size: .8125rem; }
.menu-button[aria-expanded="true"] .menu-label-open { display: none; }
.menu-button[aria-expanded="true"] .menu-label-close { display: inline; }
.menu-button[aria-expanded="true"] .menu-open-icon { display: none; }
.menu-button[aria-expanded="true"] .menu-close-icon { display: inline; }

.hero { padding-top: 56px; }
.hero-layout { display: grid; grid-template-columns: minmax(0, 1fr) 202px; gap: 90px; align-items: start; }
.hero-copy, .hero-aside { min-width: 0; }
.hero-eyebrow { margin-bottom: 20px; }
.hero h1 { font-size: clamp(38px, 4.5vw, 58px); line-height: 1.08; font-weight: 700; }
.hero-role { display: flex; flex-wrap: wrap; gap: 5px 18px; align-items: baseline; margin: 19px 0 22px; }
.hero-role strong { font-size: 1.4375rem; font-weight: 550; letter-spacing: -.025em; }
.hero-role > span { font-size: 1rem; color: var(--muted); border-left: 1px solid var(--line); padding-left: 18px; }
.hero-intro { max-width: 62ch; font-size: var(--text-lead); line-height: 1.85; color: var(--body-ink); }
.hero-actions > .text-link { border: 1px solid var(--control-border); border-radius: var(--radius); padding: 10px 16px; background: var(--panel); min-height: 46px; }
.hero-actions > .text-link:hover { background: var(--accent-soft); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 27px; margin-top: 28px; }
.hero-aside { border: 1px solid var(--line); border-radius: 8px; padding: 20px; background: var(--surface); margin-top: 9px; }
.profile-facts { display: grid; gap: 20px; }
.profile-facts dt { font-size: .75rem; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
.profile-facts dd { font-size: .9375rem; line-height: 1.8; }
.profile-facts > div:first-child dd { font-size: 1.25rem; font-weight: 550; }
.hero-bottom { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 19px 23px; margin-top: 16px; }
.availability { display: flex; align-items: flex-start; gap: 10px; font-size: .8125rem; color: var(--muted); }
.status-dot { display: inline-block; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--accent); margin-top: .55em; }
.hero-bottom .text-link { font-size: .8125rem; }
.engineering-highlights { padding: 24px 0 29px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.highlights-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 17px; }
.highlights-heading .text-link { min-height: 34px; font-size: .8125rem; }
.highlights-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.highlight-card { position: relative; display: block; padding: 0 28px; border-left: 1px solid var(--line); }
.highlight-card:first-child { padding-left: 0; border-left: 0; }
.highlight-card:last-child { padding-right: 0; }
.highlight-company { font-size: .8125rem; color: var(--muted); }
.highlight-card h3 { font-size: 1.0625rem; margin-top: 8px; margin-bottom: 8px; padding-right: 10px; }
.highlight-card > p { font-size: var(--text-body); line-height: 1.75; color: var(--body-ink); }
.highlight-card .highlight-detail { font-size: .75rem; margin-top: 10px; line-height: 1.7; color: var(--accent); }
.highlight-arrow { position: absolute; top: 0; right: 14px; color: var(--muted); }
.highlight-arrow .icon { width: 15px; height: 15px; }
.highlight-card:last-child .highlight-arrow { right: 0; }
.highlight-card:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }

.work-section, .experience-section, .about-section { padding-top: 66px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding-bottom: 28px; }
.section-heading h2 { font-size: clamp(26px, 3vw, 32px); margin-top: 9px; }
.section-heading > p { max-width: 39ch; font-size: .9375rem; line-height: 1.7; color: var(--muted); }
.projects-grid { display: grid; gap: 18px; }
.project-card { display: grid; grid-template-columns: 32px minmax(0, 1fr) 218px; grid-template-areas: "number copy meta" ". action meta"; gap: 18px 28px; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.project-card:focus-within { border-color: var(--accent); }
.project-number { grid-area: number; font-family: var(--font-mono); font-size: .8125rem; color: var(--muted); padding-top: 3px; }
.project-copy { grid-area: copy; min-width: 0; }
.project-type { font-size: .8125rem; color: var(--muted); margin-bottom: 8px; }
.project-copy h3 { font-size: 1.6875rem; line-height: 1.25; margin-bottom: 14px; }
.project-copy h3 a:hover { color: var(--accent); text-decoration: underline; }
.project-summary { color: var(--body-ink); line-height: 1.8; max-width: 61ch; }
.project-areas { display: flex; flex-wrap: wrap; padding: 0; list-style: none; gap: 5px 18px; margin-top: 15px; }
.project-areas li { font-size: .8125rem; color: var(--ink); padding-left: 12px; position: relative; }
.project-areas li::before { content: ''; width: 3px; height: 3px; background: var(--muted); position: absolute; top: .73em; left: 0; }
.case-link { grid-area: action; margin-top: 0; justify-self: start; max-width: 100%; min-height: 44px; border: 1px solid var(--control-border); border-radius: var(--radius); padding: 9px 14px; background: var(--surface); font-size: .875rem; }
.case-link:hover { background: var(--accent-soft); border-color: var(--accent); }
.project-meta { grid-area: meta; padding-left: 25px; border-left: 1px solid var(--line); align-self: start; margin-top: 3px; }
.project-meta .eyebrow { font-size: .75rem; }
.project-role { font-size: .9375rem; margin: 5px 0 22px; }
.project-meta .tags { margin-top: 8px; }
.project-meta .tags li { background: transparent; border: 0; padding: 0; border-radius: 0; line-height: 1.8; }
.project-meta .tags li:not(:last-child)::after { content: ' /'; margin-left: 6px; color: var(--muted); }
.archive-section { margin-top: 34px; }
.archive-heading { display: flex; align-items: baseline; gap: 24px; margin-bottom: 14px; }
.archive-heading h3 { font-size: 1.0625rem; font-weight: 550; }
.archive-heading p { font-size: .8125rem; color: var(--muted); }
.archive-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 190px 90px 44px; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); padding-block: 15px; }
.archive-index { color: var(--muted); font-size: .75rem; font-family: var(--font-mono); }
.archive-name h3 { font-size: 1rem; font-weight: 600; }
.archive-name a { display: inline-block; min-height: 26px; }
.archive-name a:hover { color: var(--accent); text-decoration: underline; }
.archive-name p { color: var(--muted); font-size: .8125rem; margin-top: 4px; }
.archive-tech .tags li { font-size: .75rem; }
.archive-badge { color: var(--muted); font-size: .75rem; border: 1px solid var(--line); border-radius: 3px; padding: 2px 7px; width: max-content; }
.confidentiality-note { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: .8125rem; margin-top: 21px; line-height: 1.7; }
.confidentiality-note .icon { width: 15px; height: 15px; margin-top: 3px; }
.confidentiality-note.container { margin-bottom: 38px; }
.career-list { display: grid; gap: 12px; }
.career-item { border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.career-item > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 24px; padding: 22px 24px; align-items: start; border-radius: 6px; }
.career-item > summary:hover { background: var(--surface); }
.career-item > summary:focus-visible { outline-offset: 3px; }
.career-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; min-width: 0; }
.career-company { font-weight: 650; font-size: 1.0625rem; }
.career-role { color: var(--body-ink); font-size: .9375rem; padding-left: 16px; border-left: 1px solid var(--line); }
.career-description { grid-column: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 18px; color: var(--muted); font-size: .875rem; }
.career-dates { white-space: nowrap; }
.career-toggle { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 12px; color: var(--accent); border: 1px solid var(--control-border); border-radius: var(--radius); }
.career-toggle .icon { flex-shrink: 0; width: 18px; height: 18px; }
.career-hint { font-size: .8125rem; font-weight: 500; line-height: 1.5; }
.details-hide { display: none; }
.career-item[data-expanded="true"] .details-show { display: none; }
.career-item[data-expanded="true"] .details-hide { display: inline; }
.no-js .career-item[open] .details-show { display: none; }
.no-js .career-item[open] .details-hide { display: inline; }
.career-details { margin: 0 24px; padding: 20px 0 24px; border-top: 1px solid var(--line); font-size: var(--text-body); line-height: 1.8; color: var(--body-ink); }
.career-details ul { max-width: 85ch; padding-left: 20px; margin: 0; }
.career-details li { padding-left: 3px; }
.career-details li::marker { color: var(--accent); }
.career-details li + li { margin-top: 10px; }
.implementation-stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px 24px; padding: 18px 20px; margin: 20px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.implementation-stack.has-deployment { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 620px) { .implementation-stack.has-deployment { grid-template-columns: 1fr; } }
.implementation-stack dt { font-size: .8125rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.implementation-stack dd { margin: 0; font-size: .9375rem; color: var(--ink); line-height: 1.8; }
.implementation-note { color: var(--body-ink); max-width: 72ch; margin: 0 0 24px; font-size: var(--text-body); line-height: 1.8; }
.case-supporting-tech { font-size: .8125rem; color: var(--muted); margin-top: 12px; }
.case-supporting-tech span { font-weight: 600; margin-right: 8px; }
.system-scope-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.about-section { display: grid; grid-template-columns: minmax(0,1fr) 315px; gap: 95px; padding-bottom: 74px; }
.about-copy h2 { font-size: 32px; margin: 9px 0 22px; }
.about-copy p { font-size: var(--text-body); color: var(--body-ink); line-height: 1.85; max-width: 62ch; }
.about-copy p + p { margin-top: 17px; }
.about-copy .education-line { margin-top: 28px; padding-top: 19px; border-top: 1px solid var(--line); font-size: .8125rem; }
.about-aside { padding-top: 8px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 8px 17px; margin: 14px 0 15px; padding: 0; list-style: none; font-size: .9375rem; }
.more-skills summary { display: flex; align-items: center; justify-content: space-between; padding-block: 10px; font-size: .8125rem; color: var(--accent); min-height: 44px; }
.more-skills p { font-size: .875rem; color: var(--muted); line-height: 1.8; padding-bottom: 14px; }
.spoken-languages { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.spoken-languages p { font-size: .8125rem; color: var(--muted); margin-top: 8px; }
.contact-section { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact-inner { display: grid; grid-template-columns: 285px minmax(0,1fr); column-gap: 70px; padding-block: 50px; }
.contact-heading h2 { font-size: 32px; margin: 9px 0 16px; }
.contact-location { display: flex; align-items: flex-start; gap: 9px; font-size: .8125rem; color: var(--muted); }
.contact-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 38px; }
.contact-option { display: flex; flex-direction: column; align-items: flex-start; }
.contact-option h3 { font-size: 1rem; margin-bottom: 12px; }
.contact-option p { color: var(--body-ink); line-height: 1.8; font-size: var(--text-body); }
.contact-option a { margin-top: auto; padding-top: 16px; font-size: .875rem; }
.contact-address { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding-top: 23px; margin-top: 25px; border-top: 1px solid var(--line); }
.contact-address > a:first-child { font-size: clamp(16px, 2vw, 21px); font-weight: 500; letter-spacing: -.015em; overflow-wrap: anywhere; }
.contact-address > a:hover { text-decoration: underline; }
.contact-address .linkedin-link { font-size: .875rem; color: var(--accent); margin-left: auto; min-height: 44px; display: inline-flex; gap: 9px; align-items: center; }
.site-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 36px; padding-block: 25px; color: var(--muted); font-size: .75rem; }
.site-footer > p { margin-right: auto; }
.footer-profiles { display: flex; align-items: center; gap: 25px; }
.footer-profiles a, .back-top { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; }
.site-footer a:hover { text-decoration: underline; color: var(--accent); }
.site-footer .icon { width: 14px; height: 14px; }
.back-top .icon { transform: rotate(180deg); }

.case-page { padding-top: 26px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: .8125rem; color: var(--muted); margin-bottom: 38px; }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 36px; color: var(--accent); }
.back-arrow .icon { transform: rotate(180deg); width: 16px; margin-right: 8px; }
.breadcrumbs a:hover { text-decoration: underline; }
.case-header { max-width: 820px; }
.case-header > .eyebrow { margin-bottom: 14px; }
.case-header .archive-badge { display: inline-block; margin-left: 8px; }
.case-title { font-size: clamp(32px, 4vw, 48px); margin-bottom: 22px; font-weight: 650; letter-spacing: -.04em; }
.overview-copy { max-width: 68ch; }
.case-overview { font-size: var(--text-lead); line-height: 1.85; color: var(--body-ink); }
.case-overview + .case-overview { margin-top: 14px; }
.case-header > .tags { margin-top: 24px; }
.ownership-panel { padding-block: 19px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 27px; }
.ownership-panel dl { display: flex; flex-wrap: wrap; gap: 15px 45px; }
.ownership-panel dt { color: var(--muted); font-size: .6875rem; font-weight: 550; letter-spacing: .055em; margin-bottom: 5px; }
.ownership-panel dd { font-size: .875rem; }
.private-note { color: var(--muted); font-size: .8125rem; margin-top: 16px; line-height: 1.7; }
.project-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 14px; }
.project-links a { font-size: .875rem; }
.case-details { display: grid; grid-template-columns: minmax(0,1fr) 188px; gap: 52px; margin-top: 42px; }
.case-sidebar, .case-prose { min-width: 0; }
.case-sidebar { grid-column: 2; grid-row: 1; }
.case-prose { grid-column: 1; grid-row: 1; }
.case-prose:only-child { grid-column: 1 / -1; max-width: 820px; }
.case-sidebar-content { position: sticky; top: var(--header-offset, 100px); }
.case-contents > summary { display: none; }
.case-section-links { display: flex; flex-direction: column; }
.case-section-links > span { margin-bottom: 13px; }
.case-section-links > a { padding: 11px 13px; margin-left: 0; font-size: .875rem; border-left: 2px solid var(--line); color: var(--muted); }
.case-section-links > a { border-radius: 0 4px 4px 0; }
.case-section-links > a:hover, .case-section-links > a[aria-current] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.case-prose > section { scroll-margin-top: 20px; margin-bottom: 44px; padding-top: 30px; border-top: 1px solid var(--line); }
.case-prose > section:first-child { border-top: 0; padding-top: 0; }
.case-prose h2, .modal-case .case-prose h3 { font-size: 1.4375rem; margin-bottom: 22px; }
.contribution-list { padding: 0; list-style: none; display: grid; gap: 15px; }
.contribution-list > li { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 13px; }
.contribution-list li > span { color: var(--muted); font-family: var(--font-mono); font-size: .6875rem; padding-top: 6px; }
.contribution-list p { color: var(--body-ink); line-height: 1.85; max-width: 67ch; }
.collaboration { margin-top: 22px; border-left: 2px solid var(--accent); padding-left: 17px; color: var(--muted); line-height: 1.8; font-size: .9375rem; }
.delivery-block { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.delivery-block > h3, .delivery-block > h4 { font-size: 1rem; line-height: 1.5; margin: 0 0 16px; }
.delivery-process { padding: 0; margin: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 18px 24px; }
.delivery-process li { min-width: 0; padding-left: 12px; border-left: 2px solid var(--line); }
.delivery-process li > span { display: block; font-family: var(--font-mono); margin-bottom: 5px; color: var(--accent); font-size: .75rem; }
.delivery-process strong { display: block; font-size: .9375rem; font-weight: 500; color: var(--body-ink); line-height: 1.65; overflow-wrap: anywhere; }
.project-infrastructure { margin-top: 10px; font-size: .8125rem; color: var(--muted); line-height: 1.7; }
.development-tools { margin-top: 24px; }
@media (max-width: 820px) { .project-infrastructure { flex-basis: 100%; margin-top: 0; } }
.system-scope-grid, .architecture-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 28px 32px; }
.scope-module, .architecture-grid > div { min-width: 0; padding-left: 17px; border-left: 2px solid var(--line); }
.scope-module h3, .scope-module h4, .architecture-grid h3, .architecture-grid h4, .modal-case .scope-module h4 { font-size: 1rem; margin-bottom: 8px; font-weight: 600; }
.scope-module p, .architecture-grid p { color: var(--body-ink); line-height: 1.85; }
.workflow-section { margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line); }
.workflow-section > .eyebrow { margin-bottom: 8px; }
.workflow-section h3, .modal-case .workflow-section h4 { font-size: 1.125rem; margin-bottom: 12px; }
.workflow-intro, .workflow-join, .section-note { color: var(--body-ink); line-height: 1.8; }
.route-switch { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 20px 0 0; gap: 8px; }
.route-switch button { color: var(--muted); font-size: .875rem; font-weight: 500; padding: 12px 13px; border-bottom: 2px solid transparent; }
.route-switch button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); }
.route-panel { padding-block: 18px; }
.route-panel p { font-size: .875rem; color: var(--muted); margin-top: 14px; }
.entry-route { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; padding: 0; }
.entry-route li { font-size: .875rem; }
.entry-route li:not(:last-child)::after { content: '→'; color: var(--accent); margin-left: 12px; }
.workflow-join { font-size: .875rem; }
.workflow { list-style: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: var(--line); margin: 16px 0; padding: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.workflow li { min-width: 0; display: flex; gap: 10px; align-items: baseline; padding: 13px; background: var(--surface); }
.workflow li > span { font-family: var(--font-mono); color: var(--muted); font-size: .6875rem; }
.workflow strong { font-size: .8125rem; font-weight: 500; overflow-wrap: anywhere; }
.section-note { font-size: .875rem; }
.case-visual { margin-top: 30px; }
.case-visual > .eyebrow { font-size: .75rem; margin-bottom: 14px; }
.project-visual { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.project-visual figcaption { padding: 10px 16px; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--line); }
.scope-art { background: var(--surface); padding: 25px; }
.diagram { max-width: 650px; margin-inline: auto; font-size: .875rem; }
.diagram-topline { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .6875rem; letter-spacing: .06em; padding-bottom: 18px; }
.diagram-topline .icon { width: 15px; }
.diagram-cross, .node-mark { display: none; }
.clinic-source { text-align: center; }
.connector.vertical { height: 18px; width: 1px; background: var(--line); margin-inline: auto; }
.diagram-node { padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; }
.node-main { text-align: center; }
.node-main strong { display: block; font-size: .9375rem; font-weight: 550; }
.node-stack { font-size: .6875rem; color: var(--muted); display: block; margin-top: 4px; }
.connector.branch { height: 17px; border-bottom: 1px solid var(--line); width: 70%; margin: 0 auto 14px; }
.clinic-domains { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.node-small { padding: 10px; }
.node-number { font-family: var(--font-mono); color: var(--muted); font-size: .75rem; display: block; margin-bottom: 5px; }
.node-small strong { font-size: .75rem; font-weight: 500; }
.scout-mini-flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.mini-join { text-align: center; color: var(--muted); padding-block: 7px; }
.mini-application { text-align: center; border: 1px solid var(--line); background: var(--paper); padding: 12px; }
.recruitment-flow { padding: 18px 0; text-align: center; color: var(--muted); }
.recruitment-flow strong { display: block; color: var(--ink); margin-top: 7px; font-weight: 550; }
.diagram-bottomline { color: var(--muted); font-size: .6875rem; border-top: 1px solid var(--line); padding-top: 10px; }
.commerce-pair { display: grid; grid-template-columns: minmax(0,1fr) 25px minmax(0,1fr); gap: 10px; align-items: center; }
.commerce-pair strong { display: block; font-size: .875rem; font-weight: 550; }
.two-way { text-align: center; color: var(--muted); }
.commerce-bridge { padding-block: 15px; text-align: center; color: var(--muted); font-size: .75rem; }
.commerce-market { border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 16px; }
.commerce-market strong { font-weight: 500; }
.commerce-market > span { color: var(--muted); }
.case-notes { margin-top: 11px; color: var(--muted); font-size: .8125rem; line-height: 1.7; }
.approved-preview img { width: 100%; }
.case-contact { padding-block: 33px; border-top: 1px solid var(--line); margin-top: 25px; }
.case-contact h2 { font-size: 1.75rem; margin-block: 9px 13px; }
.case-contact p { max-width: 65ch; color: var(--body-ink); line-height: 1.8; margin-bottom: 19px; }
.case-contact .text-link { margin-left: 22px; }
.related-projects { border-top: 1px solid var(--line); padding-block: 28px; }
.related-projects > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 35px; margin-top: 12px; }
.related-projects a { display: flex; justify-content: space-between; align-items: center; min-height: 55px; gap: 14px; }
.related-projects a:hover { color: var(--accent); }
.related-projects small { display: block; color: var(--muted); font-size: .8125rem; margin-top: 4px; }
.compact-case .case-details { margin-top: 0; }
.missing-page { padding-block: 100px; min-height: 65vh; }
.missing-page h1 { font-size: clamp(32px,4vw,48px); margin: 16px 0; }
.missing-page p { margin-bottom: 24px; color: var(--muted); }
html[lang="ja"] .hero h1 { letter-spacing: -.04em; }
html[lang="ja"] .hero-intro,
html[lang="ja"] .case-overview,
html[lang="ja"] .case-prose p,
html[lang="ja"] .project-summary { line-height: 1.95; word-break: normal; overflow-wrap: anywhere; }
html[lang="ja"] .hero-role { flex-direction: column; align-items: flex-start; gap: 7px; }
html[lang="ja"] .hero-role > span { border-left: 0; padding-left: 0; }
html[lang="ja"] .eyebrow { letter-spacing: .035em; }

@media (max-width: 1100px) {
  .case-details { display: block; margin-top: 30px; }
  .case-sidebar { margin-bottom: 32px; }
  .case-sidebar-content { position: static; }
  .case-contents { border: 1px solid var(--control-border); border-radius: var(--radius); background: var(--surface); }
  .case-contents > summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 16px; font-size: .9375rem; min-height: 48px; }
  .case-contents .case-section-links { padding: 0 16px 13px; }
  .case-section-links > span { display: none; }
  .case-section-links > a { margin: 0; }
  .contact-inner { grid-template-columns: 1fr; row-gap: 26px; }

  .header-inner { gap: 20px; }
  .desktop-nav { gap: 4px; }
  .header-actions { gap: 5px; }
  .hero-layout { gap: 50px; grid-template-columns: minmax(0,1fr) 175px; }
  .project-card { grid-template-columns: 30px minmax(0,1fr) 190px; gap: 24px; }
  .archive-row { grid-template-columns: 30px minmax(0,1fr) 160px 75px 36px; gap: 24px; }
  .contact-inner { gap: 30px; }
  .contact-options { gap: 26px; }
  .about-section { gap: 55px; grid-template-columns: minmax(0,1fr) 275px; }
}

@media (max-width: 960px) {
  .desktop-nav, .header-actions > .nav-resume { display: none; }
  .menu-button { display: inline-flex; }
  .header-inner { min-height: 68px; gap: 16px; flex-wrap: wrap; }
  .header-actions > .header-preferences { display: none; }
  .mobile-nav { position: absolute; top: 100%; left: 0; right: 0; display: flex; flex-direction: column; width: 100%; max-width: none; max-height: calc(100dvh - var(--header-offset, 88px)); margin: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px var(--gutter) calc(14px + env(safe-area-inset-bottom)); border-bottom: 1px solid var(--line); background: var(--panel); box-shadow: 0 12px 24px rgb(0 0 0 / .12); }
  .mobile-section-links { display: grid; gap: 2px; }
  .mobile-section-links a { display: flex; align-items: center; min-height: 52px; padding: 11px 12px; border-radius: var(--radius); font-size: 1.0625rem; font-weight: 450; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
  .mobile-section-links a:hover:not([aria-current]) { background: var(--surface); }
  .mobile-section-links [aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .mobile-cv { margin-top: 10px; }
  .mobile-cv .nav-resume { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 9px 12px; font-size: .9375rem; font-weight: 600; border: 1px solid var(--control-border); border-radius: var(--radius); color: var(--accent); }
  .mobile-cv .nav-resume:hover { background: var(--accent-soft); border-color: var(--accent); }
  .mobile-preferences { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
  .mobile-preferences:empty { display: none; }
  .mobile-preferences .header-preferences { width: 100%; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
  .mobile-preferences .language-switch { flex-shrink: 0; gap: 2px; padding: 0; border: 0; }
  .mobile-preferences .language-switch a { min-width: 40px; min-height: 44px; font-size: .8125rem; border-radius: 4px; }
  .mobile-preferences .language-switch a:hover { background: var(--surface); }
  .mobile-preferences .theme-button { width: auto; height: auto; min-height: 44px; gap: 8px; padding: 7px 10px; border: 1px solid var(--control-border); font-size: .8125rem; color: var(--body-ink); }
  .mobile-preferences .theme-label { display: inline; }
  .no-js .header-actions > .header-preferences { display: flex; }
  .header-actions .menu-button { min-height: 44px; min-width: 84px; padding-inline: 12px; font-size: .875rem; gap: 8px; }
  .hero { padding-top: 46px; }
  .hero-layout { grid-template-columns: 1fr; gap: 30px; }
  .hero h1 { font-size: clamp(38px,7vw,55px); }
  .hero-aside { padding: 18px 20px; margin-top: 0; }
  .profile-facts { grid-template-columns: 1fr 1.5fr 1fr; gap: 20px; }
  .profile-facts dd { font-size: .875rem; }
  .profile-facts > div:first-child dd { font-size: 1rem; }
  .hero-bottom { margin-top: 12px; padding-block: 12px 24px; }
  .highlight-card { padding-inline: 18px; }
  .highlights-heading .text-link { font-size: .75rem; }
  .highlights-grid { grid-template-columns: 1fr; gap: 19px; }
  .highlight-card, .highlight-card:first-child { padding: 0 27px 19px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .highlight-card:last-child { border-bottom: 0; padding-bottom: 0; }
  .highlights-grid { padding: 19px; }
  .highlight-card .highlight-arrow { right: 0; }
  .highlight-card h3 { font-size: 1.0625rem; margin: 6px 0; }
  .highlight-card > p { max-width: 65ch; }
  .highlight-card .highlight-detail { margin-top: 5px; }
  .work-section, .experience-section, .about-section { padding-top: 57px; }
  .section-heading { gap: 18px; padding-bottom: 23px; align-items: flex-start; flex-direction: column; }
  .section-heading > p { max-width: 60ch; }
  .project-card { grid-template-columns: 28px minmax(0,1fr); grid-template-areas: "number copy" ". meta" ". action"; gap: 16px 20px; padding-block: 29px; }
  .project-meta { padding: 13px 0 0; border-left: 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 0; }
  .project-meta .eyebrow { display: none; }
  .project-role { margin: 0; font-size: .875rem; }
  .project-meta .tags { margin: 0; }
  .project-meta .tags li { font-size: .75rem; }
  .project-copy h3 { font-size: 1.5rem; }
  .archive-row { grid-template-columns: minmax(0,1fr) auto 40px; gap: 14px; }
  .archive-index, .archive-tech { display: none; }

  .about-section { grid-template-columns: 1fr; gap: 32px; padding-bottom: 52px; }
  .about-aside { padding-top: 24px; border-top: 1px solid var(--line); }
  .about-copy p { max-width: 72ch; }
  .contact-inner { grid-template-columns: 1fr; row-gap: 26px; padding-block: 38px; }
  .contact-address { margin-top: 2px; }
  .case-prose > section { margin-bottom: 34px; }
}

@media (max-width: 640px) {
  .header-inner { min-height: 64px; gap: 8px; }
  .header-actions { gap: 2px; }
  .wordmark { font-size: 21px; }
  .language-switch { padding-right: 4px; }
  .language-switch a { min-width: 30px; min-height: 40px; font-size: .6875rem; }
  .header-actions .icon-button { width: 36px; height: 44px; }
  .header-actions .menu-button { width: auto; min-width: 84px; padding-inline: 12px; font-size: .875rem; gap: 8px; }
  .hero { padding-top: 36px; }
  .hero-eyebrow { margin-bottom: 15px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.7rem); line-height: 1.12; max-width: 100%; text-wrap: balance; }
  .hero-role { flex-direction: column; align-items: flex-start; gap: 5px; margin: 18px 0; }
  .hero-role strong { font-size: 1.375rem; }
  .hero-role > span { border-left: 0; padding-left: 0; font-size: .9375rem; }
  .hero-intro { line-height: 1.8; }
  .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
  .hero-actions .button, .hero-actions > .text-link { width: 100%; min-width: 0; padding: 10px; gap: 8px; font-size: .875rem; justify-content: center; }
  .hero-actions .text-link { gap: 8px; font-size: .875rem; }
  .hero-aside { display: none; }
  .hero-bottom { margin-top: 24px; align-items: flex-start; gap: 15px; }
  .hero-bottom .text-link { font-size: .75rem; min-height: 28px; flex-shrink: 0; gap: 5px; }
  .availability { font-size: .75rem; max-width: 32ch; }
  .engineering-highlights { padding-top: 22px; padding-bottom: 25px; }
  .highlights-heading { align-items: flex-start; margin-bottom: 17px; }
  .highlights-heading .text-link { max-width: 17ch; line-height: 1.5; min-height: 30px; align-items: flex-start; text-align: right; gap: 7px; }
  .highlights-heading .text-link .icon { width: 15px; height: 15px; margin-top: 3px; }
  .section-heading h2, .about-copy h2, .contact-heading h2 { font-size: 27px; }
  .section-heading > p { font-size: .875rem; }
  .project-card { padding: 22px 20px; grid-template-columns: minmax(0,1fr); grid-template-areas: "copy" "meta" "action"; gap: 16px; }
  .project-number { display: none; }
  .project-copy h3 { font-size: 1.4375rem; }
  .project-type { font-size: .75rem; }
  .project-areas { gap: 6px 16px; }
  .project-areas li { font-size: .75rem; }
  .project-meta { gap: 10px; flex-direction: column; align-items: flex-start; }
  .archive-heading { display: block; }
  .archive-heading p { margin-top: 7px; }
  .archive-badge { font-size: .75rem; }
  .archive-open { width: 34px; height: 40px; }
  .archive-name p { font-size: .75rem; }
  .career-item > summary { gap: 12px; padding: 20px; }
  .career-heading { flex-direction: column; gap: 4px; }
  .career-role { padding-left: 0; border-left: 0; }
  .career-description { grid-column: 1 / -1; flex-direction: column; gap: 6px; }
  .career-toggle { grid-column: 2; grid-row: 1; min-height: 44px; max-width: 135px; }
  .career-details { margin-inline: 20px; padding: 18px 0 20px; }
  .career-details ul { padding-left: 18px; }
  .contact-options { grid-template-columns: 1fr; gap: 23px; }
  .contact-option + .contact-option { padding-top: 24px; border-top: 1px solid var(--line); }
  .contact-option p { font-size: var(--text-body); }
  .contact-option a { margin-top: 0; }
  .contact-address .linkedin-link { margin-left: 0; width: 100%; }
  .site-footer { gap: 7px 20px; padding-block: 19px; }
  .site-footer > p { flex-basis: 100%; }
  .back-top { margin-left: auto; }
  .footer-profiles { gap: 20px; }
  .case-page { padding-top: 17px; }
  .breadcrumbs { gap: 8px; margin-bottom: 23px; }
  .case-title { font-size: 32px; margin-bottom: 19px; }
  .case-header > .eyebrow { font-size: .6875rem; }
  .case-header .archive-badge { margin-left: 0; }
  .case-overview { font-size: var(--text-body); }
  .ownership-panel dl { gap: 16px 24px; }
  .ownership-panel dd { font-size: .8125rem; }
  .system-scope-grid, .architecture-grid { grid-template-columns: 1fr; gap: 25px; }
  .case-prose h2, .modal-case .case-prose h3 { font-size: 1.3125rem; }
  .contribution-list li { grid-template-columns: 20px minmax(0,1fr); gap: 11px; }
  .scope-art { padding: 18px 14px; }
  .clinic-domains { grid-template-columns: 1fr; }
  .node-small { display: flex; align-items: baseline; gap: 10px; }
  .node-number { margin: 0; }
  .commerce-pair { grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr); gap: 6px; }
  .commerce-pair .diagram-node { padding: 10px; }
  .commerce-pair strong { font-size: .75rem; }
  .commerce-pair .node-number { margin-bottom: 6px; }
  .workflow { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workflow li { padding: 12px 10px; }
  .route-switch button { font-size: .8125rem; padding: 12px 9px; }
  .case-contact .text-link { margin-left: 0; display: flex; width: fit-content; max-width: 100%; margin-top: 12px; }
  .related-projects > div { grid-template-columns: 1fr; gap: 15px; }
  .related-projects a { font-size: .9375rem; }
}


@media (max-width: 380px) {
  .hero-actions { grid-template-columns: 1fr; }
  .archive-row { grid-template-columns: minmax(0,1fr) 36px; gap: 9px 12px; }
  .archive-name { grid-column: 1; }
  .archive-row > .archive-badge { grid-column: 1; }
  .archive-open { grid-column: 2; grid-row: 1 / span 2; }
  .hero-bottom { flex-wrap: wrap; }
  .highlights-heading { flex-wrap: wrap; }
  .highlights-heading .text-link { text-align: left; max-width: none; }
}

@media print {
  :root, html[data-theme="dark"] { --paper: #fff; --ink: #000; --muted: #444; --line: #ccc; --surface: #fff; --body-ink: #222; --panel: #fff; --accent: #222; --accent-soft: #eee; --button-bg: #000; --button-ink: #fff; --button-hover-bg: #000; }
  .site-header, .hero-actions, .hero-bottom, .case-sidebar, .project-modal-library, .contact-section, .site-footer, .back-top { display: none !important; }
  body { font-size: 11pt; }
  .container { width: 100%; }
  .hero { padding-top: 0; }
  .hero-layout { display: block; }
  .hero-aside { display: none; }
  .work-section, .experience-section, .about-section { padding-top: 24px; }
  .case-details { display: block; }
  .case-prose > section { break-inside: avoid; }
  .project-card { break-inside: avoid; }
  .case-link, .archive-open { display: none; }
}

.button, .icon-button, .text-link, .nav-resume, .desktop-nav a, .project-copy h3 a, .career-toggle .icon, .more-skills summary .icon {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 180ms ease;
}
.career-item[data-expanded="true"] .career-toggle .icon,
.no-js .career-item[open] .career-toggle .icon { transform: rotate(180deg); }
.more-skills[data-expanded="true"] summary .icon { transform: rotate(45deg); }
.text-link:hover > .icon { transform: translateX(2px); }
.text-link > .icon { transition: transform 160ms ease; }
.reveal-pending { opacity: 1; transform: none; }
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 30; transform: scaleX(0); transform-origin: left center; pointer-events: none; }
#toast, .dialog-feedback { position: fixed; bottom: 24px; left: 50%; z-index: 80; transform: translateX(-50%); max-width: calc(100vw - 38px); background: var(--ink); color: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 12px 18px; font-size: .875rem; line-height: 1.6; box-shadow: 0 8px 24px #0002; }
.dialog-feedback:empty { display: none; }
.dialog-open { overflow: hidden; }
.project-dialog { position: fixed; inset: 0; margin: 0; padding: 0; max-width: none; max-height: none; width: 100%; height: 100%; border: 0; background: transparent; color: var(--ink); overflow: hidden; }
.project-dialog:not([open]) { display: none; }
.project-dialog[open] { display: flex; align-items: center; justify-content: center; }
.project-dialog::backdrop { background: transparent; }
.dialog-backdrop { position: absolute; inset: 0; background: var(--dialog-backdrop); }
.dialog-panel { position: relative; width: min(940px, calc(100% - 56px)); height: min(90dvh, 960px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.dialog-chrome { background: var(--surface); position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; padding: 12px 20px 12px 30px; border-bottom: 1px solid var(--line); }
.dialog-caption { flex: 1 1 80px; min-width: 0; font-size: .8125rem; color: var(--muted); }
.dialog-current-name { overflow-wrap: anywhere; }
.dialog-tools { display: flex; align-items: center; gap: 15px; }
.fullpage-short { display: none; }
.dialog-copy, .dialog-fullpage { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 4px 6px; color: var(--muted); font-size: .75rem; }
.dialog-copy .icon, .dialog-fullpage .icon { width: 16px; height: 16px; }
.dialog-copy:hover, .dialog-fullpage:hover { color: var(--accent); text-decoration: underline; }
.dialog-close { background: var(--panel); border: 1px solid var(--control-border); width: 44px; height: 44px; color: var(--ink); }
.dialog-progress { position: absolute; height: 2px; bottom: -1px; left: 0; right: 0; background: var(--accent); transform: scaleX(0); transform-origin: left center; }
.dialog-section-nav { background: var(--surface); display: flex; flex-shrink: 0; padding-inline: 30px; gap: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.dialog-section-nav button { padding: 13px 1px; font-size: .8125rem; color: var(--muted); border-bottom: 2px solid transparent; flex-shrink: 0; }
.dialog-section-nav button[aria-current] { border-color: var(--accent); color: var(--accent); }
.dialog-mobile-sections { display: none; }
.dialog-scroll { overflow: auto; overscroll-behavior: contain; min-height: 0; flex: 1 1 auto; scrollbar-gutter: stable; scrollbar-color: var(--scroll-thumb) var(--panel); }
.dialog-content { padding: 35px 40px 0; }
.modal-case .case-title { font-size: 36px; }
.modal-case .case-overview { font-size: var(--text-body); }
.modal-case .case-details { display: block; margin-top: 32px; }
.modal-case .case-prose > section { margin-bottom: 30px; }
.modal-case .case-prose > section:last-child { margin-bottom: 30px; }
.dialog-bottom { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 25px; padding: 24px 32px 28px; border-top: 1px solid var(--line); margin: 8px 0 0; background: var(--surface); }
.dialog-bottom button { display: flex; align-items: center; gap: 14px; text-align: left; min-width: 0; }
.dialog-bottom button > span:not(.dialog-prev-arrow) { min-width: 0; }
.dialog-bottom button:last-child { text-align: right; justify-content: flex-end; }
.dialog-bottom small { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 5px; }
.dialog-bottom strong { display: block; font-size: .875rem; font-weight: 550; overflow-wrap: anywhere; }
.dialog-bottom button:hover strong { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.dialog-prev-arrow .icon { transform: rotate(180deg); }
.dialog-share { flex-basis: 100%; padding-top: 10px; }
.dialog-share label { font-size: .8125rem; color: var(--muted); display: block; margin-bottom: 5px; }
.dialog-share input { display: block; width: 100%; min-width: 0; background: var(--paper); color: var(--ink); border: 1px solid var(--control-border); padding: 9px 12px; border-radius: 4px; font-size: 1rem; }
.dialog-share p { color: var(--muted); font-size: .75rem; margin-top: 5px; }
.dialog-feedback { position: absolute; }
.no-js .theme-button, .no-js .menu-button, .no-js .copy-button { display: none; }
.no-js .mobile-nav[hidden] { display: flex !important; position: static; box-shadow: none; }
@media (min-width: 961px) {
  .no-js .mobile-nav[hidden] { display: none !important; }
}
.no-js .route-switch { display: none; }
.no-js .route-panel { display: block !important; }
.no-js .case-contents { display: block; }

@media (max-width: 960px) {
  .dialog-content { padding: 29px 32px 0; }
  .dialog-tools { gap: 8px; }
  .dialog-copy span, .dialog-fullpage .fullpage-long { display: none; }
  .dialog-fullpage .fullpage-short { display: inline; }
  .dialog-copy { width: 40px; min-height: 44px; }
  .dialog-fullpage { width: auto; min-height: 44px; font-size: .75rem; }
}

@media (max-width: 760px) {
  .dialog-panel { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; padding-top: env(safe-area-inset-top); }
  .dialog-chrome { padding: 8px 14px 8px 22px; gap: 7px; }
  .dialog-caption { font-size: .75rem; }
  .dialog-close { width: 44px; height: 44px; }
  .dialog-tools { gap: 3px; }
  .dialog-section-nav { background: var(--surface); display: none; }
  .dialog-mobile-sections { background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 9px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
  .dialog-mobile-sections label { font-size: .75rem; color: var(--muted); }
  .dialog-mobile-sections select { min-width: 0; width: auto; max-width: 70%; font-size: 1rem; color: var(--ink); border: 1px solid var(--control-border); border-radius: 4px; min-height: 44px; padding: 6px 9px; background: var(--panel); }
  .dialog-content { padding: 26px 24px 0; }
  .modal-case .case-title { font-size: clamp(1.75rem, 6vw, 2.125rem); }
  .modal-case .case-header > .eyebrow { font-size: .6875rem; }
  .modal-case .case-overview { line-height: 1.8; }
  .modal-case .case-details { margin-top: 28px; }
  .modal-case .case-prose h3 { font-size: 1.25rem; }
  .dialog-bottom { padding: 22px 24px calc(24px + env(safe-area-inset-bottom)); gap: 23px; }
  .dialog-bottom button { gap: 9px; align-items: flex-start; }
  .dialog-bottom strong { font-size: .875rem; }
  .dialog-bottom .icon { width: 16px; height: 16px; }
  .dialog-bottom .dialog-prev-arrow, .dialog-bottom button > .icon { margin-top: 3px; }
  .dialog-feedback { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (max-height: 540px) and (max-width: 1000px) {
  .dialog-panel { height: 100dvh; max-height: 100dvh; width: 100%; border: 0; border-radius: 0; }
  .dialog-chrome { padding-block: 4px; }
  .dialog-mobile-sections { padding-block: 5px; }
  .dialog-section-nav button { padding-block: 9px; }
  .dialog-content { padding-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html, .dialog-scroll { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-pending { opacity: 1 !important; transform: none !important; }
}
@media print {
  .reading-progress, #toast { display: none; }
  .reveal-pending { opacity: 1; transform: none; }
}
