/* Midnight research: local fonts, CSS illustration, no visual dependencies. */
:root {
  color-scheme: dark;
  --bg: #080d17;
  --surface: #0e1624;
  --surface-raised: #131e2e;
  --ink: #e9f0fa;
  --muted: #a3b1c7;
  --accent: #6be7e8;
  --accent-ink: #071b22;
  --violet: #b7a5ff;
  --rule: #263449;
  --soft: #132b35;
  --header: rgba(8, 13, 23, .9);
  --grid: rgba(113, 160, 200, .065);
  --glow: rgba(49, 141, 183, .12);
  --violet-glow: rgba(122, 92, 201, .11);
  --mono: Consolas, "SFMono-Regular", "Liberation Mono", monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fc;
  --surface: #ffffff;
  --surface-raised: #eaf0f9;
  --ink: #15273c;
  --muted: #4d6078;
  --accent: #086578;
  --accent-ink: #ffffff;
  --violet: #6545a9;
  --rule: #ced9e8;
  --soft: #e0f1f3;
  --header: rgba(243, 246, 252, .93);
  --grid: rgba(35, 84, 120, .055);
  --glow: rgba(81, 162, 210, .1);
  --violet-glow: rgba(139, 116, 221, .1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif; font-size: 16px; line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(ellipse at 85% 8%, var(--glow), transparent 30%), radial-gradient(ellipse at 4% 45%, var(--violet-glow), transparent 35%);
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: linear-gradient(#000, transparent 85%);
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); text-underline-offset: 5px; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 3px; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; }
.site-header, main, footer { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: -100px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); z-index: 100; }
.skip-link:focus { top: 12px; }
/* Reading progress: Pac-Man rail with pellets, section power pellets and chasing ghosts. */
.reading-progress {
  --pacman: #ffd34e; --pellet: #c9d8ee; --ghost-a: #ff5d5d; --ghost-b: #ffa8dd; --ghost-c: #63dcff; --scared: #4a63ff; --scared-ink: #dbe4ff;
  display: none; position: fixed; inset: 0 0 auto; z-index: 30; height: 24px; background: var(--bg); pointer-events: none;
}
.reading-progress.is-ready { display: block; }
.reading-progress:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
[data-theme="light"] .reading-progress { --pacman: #e0a200; --pellet: #6c7f96; --ghost-a: #dc4747; --ghost-b: #e072b8; --ghost-c: #1fa2d8; --scared: #2f49cf; --scared-ink: #eaefff; }
.has-reading-progress .site-header { top: 24px; }
.progress-track { position: absolute; inset: 0; overflow: hidden; border-bottom: 1px solid var(--rule); }
.progress-seek { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0 2px; border: 0; opacity: 0; appearance: none; background: transparent; cursor: pointer; pointer-events: auto; }
.progress-seek::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border: 0; }
.progress-seek::-moz-range-thumb { width: 18px; height: 18px; border: 0; }
.progress-dots { position: absolute; inset: 0 10px; background: radial-gradient(circle at center, var(--pellet) 0 1.6px, transparent 2.3px) 0 50% / 18px 100% repeat-x; opacity: .8; clip-path: inset(0 0 0 var(--progress-x, 0px)); }
.progress-marks { position: absolute; inset: 0; }
.progress-eaten { position: absolute; left: 0; top: 0; bottom: 0; width: var(--progress-percent, 0%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 13%, transparent)); }
.progress-eaten::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent) 45%, var(--pacman)); }
.progress-mark { position: absolute; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg), 0 0 8px color-mix(in srgb, var(--accent) 65%, transparent); transition: opacity .18s ease, transform .18s ease; }
.reading-progress.is-moving .progress-mark { animation: pellet-pulse .55s ease-in-out infinite alternate; }
.progress-mark.is-eaten { opacity: 0; transform: scale(.3); }
.progress-pacman { position: absolute; left: 0; top: 50%; width: 16px; height: 16px; margin-top: -8px; transform: translateX(var(--progress-x, 2px)) scaleX(var(--facing, 1)); }
.progress-pacman::before, .progress-pacman::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--pacman); animation: pacman-top .24s ease-in-out infinite alternate paused; }
.progress-pacman::before { clip-path: inset(0 0 50% 0); transform: rotate(-32deg); }
.progress-pacman::after { clip-path: inset(50% 0 0 0); transform: rotate(32deg); animation-name: pacman-bottom; }
.progress-eye { position: absolute; left: 7px; top: 3px; z-index: 1; width: 2px; height: 2px; border-radius: 50%; background: #10192b; }
.progress-ghost {
  position: absolute; left: 0; top: 50%; width: 14px; height: 14px; margin-top: -7px; background: var(--ghost);
  transform: translateX(calc(var(--progress-x, 2px) - var(--facing, 1) * var(--gap)));
  clip-path: polygon(0 100%, 0 45%, 7% 22%, 22% 7%, 45% 0, 55% 0, 78% 7%, 93% 22%, 100% 45%, 100% 100%, 83% 86%, 66% 100%, 50% 86%, 34% 100%, 17% 86%);
}
.reading-progress.is-moving .progress-ghost { animation: ghost-feet .42s steps(1, end) infinite; }
.progress-ghost::before, .progress-ghost::after { content: ""; position: absolute; top: 3px; width: 4px; height: 5px; border-radius: 50%; background-color: #fdfefe; background-image: radial-gradient(circle 1.3px at calc(50% + var(--facing, 1) * 1px) 60%, #172440 0 100%); }
.progress-ghost::before { left: 2px; }
.progress-ghost::after { left: 8px; }
.reading-progress.is-cleared .progress-ghost { background: var(--scared); }
.reading-progress.is-cleared .progress-ghost::before, .reading-progress.is-cleared .progress-ghost::after { background-color: var(--scared-ink); background-image: none; width: 3px; height: 3px; top: 4px; }
.progress-label { position: absolute; top: calc(100% + 6px); left: 0; z-index: 1; padding: 4px 9px; border: 1px solid var(--rule); border-radius: 5px; background: var(--surface-raised); color: var(--ink); font: 11px/1.4 var(--mono); white-space: nowrap; transform: translateX(-50%); pointer-events: none; }
@keyframes pacman-top { from { transform: rotate(-32deg); } to { transform: rotate(0); } }
@keyframes pacman-bottom { from { transform: rotate(32deg); } to { transform: rotate(0); } }
@keyframes pellet-pulse { from { transform: scale(.75); } to { transform: scale(1.15); } }
@keyframes ghost-feet {
  50% { clip-path: polygon(0 100%, 0 45%, 7% 22%, 22% 7%, 45% 0, 55% 0, 78% 7%, 93% 22%, 100% 45%, 100% 86%, 83% 100%, 66% 86%, 50% 100%, 34% 86%, 17% 100%); }
}
.reading-progress.is-moving .progress-pacman::before, .reading-progress.is-moving .progress-pacman::after { animation-play-state: running; }
[data-motion="paused"] .reading-progress.is-ready .progress-pacman::before, [data-motion="paused"] .reading-progress.is-ready .progress-pacman::after, [data-motion="paused"] .reading-progress.is-ready .progress-ghost, [data-motion="paused"] .reading-progress.is-ready .progress-mark { animation: none; }
@media (prefers-reduced-motion: reduce) { .reading-progress.is-ready .progress-pacman::before, .reading-progress.is-ready .progress-pacman::after, .reading-progress.is-ready .progress-ghost, .reading-progress.is-ready .progress-mark { animation: none; } }
.site-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px;
  min-height: 88px; border-bottom: 1px solid var(--rule); background: var(--header); backdrop-filter: blur(18px);
}
.wordmark { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; white-space: nowrap; font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.small-monogram { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--accent); border-radius: 10px 3px 10px 3px; color: var(--accent); font-size: 17px; letter-spacing: -1px; }
nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px 20px; margin-left: auto; font-size: 13px; }
nav a { color: var(--muted); text-decoration: none; position: relative; padding: 8px 0; }
nav a:hover, nav a[aria-current="location"] { color: var(--accent); text-decoration: none; }
nav a[aria-current="location"]::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--accent); }
nav .nav-cv { border: 1px solid var(--rule); padding: 7px 13px; border-radius: 6px; color: var(--ink); }
html[data-i18n-pending] body { visibility: hidden; }
.lang-switch { position: relative; display: inline-flex; align-items: center; gap: 6px; padding-left: 9px; border: 1px solid var(--rule); border-radius: 6px; color: var(--muted); }
.lang-switch:hover { color: var(--accent); }
.lang-switch:focus-within { border-color: var(--accent); }
.lang-switch::after { content: ""; position: absolute; right: 9px; top: 50%; width: 5px; height: 5px; margin-top: -4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); pointer-events: none; }
.globe-icon { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.lang-select { appearance: none; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; line-height: 1; padding: 8px 22px 8px 2px; cursor: pointer; }
.lang-select:focus { outline: none; }
.lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-select option { background: var(--surface); color: var(--ink); }
.display-controls { display: flex; align-items: center; gap: 5px; }
.icon-button { display: grid; place-items: center; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--muted); width: 36px; height: 36px; padding: 8px; }
.icon-button:hover { border-color: var(--rule); color: var(--accent); background: var(--surface); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.moon-icon, .play-icon { display: none; }
[data-theme="light"] .sun-icon, [data-motion="paused"] .pause-icon { display: none; }
[data-theme="light"] .moon-icon, [data-motion="paused"] .play-icon { display: block; }
.hero { display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 35px; padding: 86px 0 74px; min-height: 680px; }
.hero-copy { position: relative; z-index: 2; }
.eyebrow { color: var(--accent); font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 1.5px; text-transform: uppercase; margin: 0 0 25px; }
.signal-dot { display: inline-block; width: 6px; height: 6px; vertical-align: 1px; margin-right: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
h1 { font-size: clamp(64px, 7.3vw, 102px); line-height: 1.04; font-weight: 650; letter-spacing: -6px; margin-bottom: 29px; }
.surname { color: var(--ink); }
.name-period { color: var(--accent); }
.name-note { display: block; color: var(--muted); font-family: var(--mono); font-size: 13px; font-weight: 400; line-height: 1.7; letter-spacing: 1px; margin-top: 20px; }
.name-note span { color: var(--accent); margin-inline: 8px; }
.affiliation { font-size: 15px; line-height: 1.85; margin-bottom: 22px; }
.affiliation span { color: var(--muted); font-size: 13px; }
.intro { color: var(--muted); max-width: 585px; font-size: 16px; line-height: 1.85; }
.hero-links { display: flex; align-items: center; gap: 27px; margin-top: 32px; }
.button { display: inline-flex; align-items: center; gap: 25px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 6px; padding: 11px 20px; font-size: 13px; font-weight: 600; text-decoration: none; transition: box-shadow .2s, transform .2s; }
.button:hover { text-decoration: none; box-shadow: 0 0 28px var(--glow); transform: translateY(-2px); }
.text-link { font-size: 13px; }
.research-visual { aspect-ratio: 1; position: relative; isolation: isolate; --pointer-x: 50%; --pointer-y: 50%; }
.research-visual::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at var(--pointer-x) var(--pointer-y), var(--glow), transparent 65%); border-radius: 50%; z-index: -1; }
.visual-heading, .visual-footer { position: absolute; left: 35px; right: 35px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px; }
.visual-heading { top: 8px; }.visual-footer { bottom: 0; font-size: 8px; }.visual-cross { color: var(--accent); font-size: 22px; }
.network-graphic { display: block; width: 100%; height: 100%; }
.diagram-grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 5; }
.visual-brackets { stroke: var(--accent); stroke-opacity: .4; }
.network-links { stroke: var(--accent); stroke-width: 1; stroke-opacity: .27; }.network-links circle { fill: var(--accent); stroke-opacity: .5; }
.orbit { transform-origin: 240px 240px; animation: orbit-turn 60s linear infinite; }.orbit-inner { animation-duration: 85s; animation-direction: reverse; }
@keyframes orbit-turn { to { transform: rotate(360deg); } }
.core-monogram { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; width: 124px; height: 124px; border: 1px solid var(--rule); border-radius: 24px 8px 24px 8px; background: var(--surface); box-shadow: 0 0 50px var(--glow), inset 0 0 25px var(--glow); }
.core-monogram>span { font-size: 54px; font-weight: 300; line-height: 1.2; letter-spacing: -5px; padding-right: 5px; color: var(--accent); }.core-monogram small { font-family: var(--mono); font-size: 7px; letter-spacing: 1px; color: var(--muted); margin-top: 8px; }
.orbit-label { position: absolute; border: 1px solid var(--rule); border-radius: 4px; padding: 5px 9px; background: var(--surface); color: var(--muted); font: 8px/1.5 var(--mono); letter-spacing: .8px; }
.label-memory { left: 1%; top: 29%; }.label-modal { right: 0; top: 20%; color: var(--violet); }.label-wireless { right: 1%; bottom: 21%; color: var(--accent); }
.news-section { padding: 42px 0 48px; border-top: 1px solid var(--rule); }
.news-section h2 { font-size: 29px; font-weight: 500; letter-spacing: -.8px; margin-bottom: 28px; }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 25px; align-items: baseline; }
.news-list li+li { margin-top: 24px; }
.news-date { color: var(--muted); font: 12px/1.8 var(--mono); }
.news-list p { margin: 0; font-size: 16px; line-height: 1.85; }
.interests { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 25px; padding: 23px 0; border-block: 1px solid var(--rule); }
.interests h2 { font-family: var(--mono); font-size: 11px; line-height: 1.7; text-transform: uppercase; letter-spacing: 1.3px; font-weight: 400; margin: 0; color: var(--muted); }
.interest-tags { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 9px; }
.interest-tags li { padding: 5px 11px; background: var(--surface); border: 1px solid var(--rule); border-radius: 5px; font-size: 11px; color: var(--muted); }
.content-section { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 55px; padding: 65px 0; border-bottom: 1px solid var(--rule); }
.section-heading { align-self: start; position: sticky; top: 120px; }
.section-number { display: flex; align-items: center; gap: 13px; font: 11px var(--mono); color: var(--accent); margin-bottom: 15px; }
.section-number::after { content: ""; width: 35px; height: 1px; background: var(--rule); }
.section-heading h2 { font-size: 29px; font-weight: 500; letter-spacing: -.8px; max-width: 220px; }
h3 { font-size: 19px; font-weight: 550; letter-spacing: -.35px; margin-bottom: 12px; }
.entry { position: relative; }.entry+.entry { border-top: 1px solid var(--rule); padding-top: 28px; margin-top: 28px; }
.entry-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 25px; }
.date { font: 11px/1.8 var(--mono); color: var(--muted); white-space: nowrap; }
.entry-meta { font-size: 12px; color: var(--muted); margin-bottom: 19px; }
.entry p { margin-bottom: 13px; }.entry p:last-child { margin-bottom: 0; }.entry p:not(.entry-meta):not(.keywords) { font-size: 14px; line-height: 1.9; color: var(--muted); }
#research .entry { padding: 28px 30px; margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; transition: border-color .25s, transform .25s; }
#research .entry::before { content: ""; position: absolute; top: 0; left: 30px; width: 50px; height: 2px; background: var(--accent); }
#research .entry:nth-child(2)::before { background: var(--violet); }
#research .entry+.entry { margin-top: 20px; }
#research .entry:hover { border-color: var(--accent); transform: translateY(-3px); }
#research .entry-heading { display: block; }.entry-heading .date { display: block; margin: 0 0 12px; }
.keywords { font: 10px/1.9 var(--mono); color: var(--accent); margin-top: 23px; }
#research .entry:nth-child(2) .keywords { color: var(--violet); }
.manuscript { border-left: 2px solid var(--violet); padding: 6px 0 6px 26px; }
.status { display: inline-block; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); color: var(--violet); padding: 4px 9px; font: 10px/1.5 var(--mono); margin-bottom: 18px; }
#education .section-body { border-left: 1px solid var(--rule); padding-left: 27px; }
#education .entry::before { content: ""; position: absolute; width: 7px; height: 7px; border: 1px solid var(--accent); background: var(--bg); border-radius: 50%; top: 8px; left: -32px; }
#education .entry+.entry::before { top: 36px; }
.compact-list article+article { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--rule); }.compact-list h3 { font-size: 16px; }.compact-list p { font-size: 14px; margin-bottom: 0; color: var(--muted); }
.honors-list { list-style: none; padding: 0; margin: 0; }.honors-list li { display: grid; grid-template-columns: 85px 1fr; gap: 24px; font-size: 14px; }.honors-list li+li { margin-top: 25px; }.honors-list time { font: 11px/2.1 var(--mono); color: var(--accent); }.honors-list small { color: var(--muted); font-size: 12px; }
.skills-list { margin: 0; }.skills-list>div { display: grid; grid-template-columns: 155px 1fr; gap: 20px; }.skills-list>div+div { margin-top: 22px; }dt { font: 11px/2 var(--mono); color: var(--accent); }dd { margin: 0; font-size: 14px; color: var(--muted); }
.contact-section { position: relative; padding: 65px 0; }.contact-section .eyebrow { margin-bottom: 17px; }.contact-section h2 { font-size: clamp(28px, 3.2vw, 43px); font-weight: 450; letter-spacing: -1.2px; margin-bottom: 19px; }.contact-section>p:not(.eyebrow) { color: var(--muted); font-size: 14px; }.contact-links { display: flex; gap: 35px; flex-wrap: wrap; font-size: 15px; }
.visitor-section { border-top: 1px solid var(--rule); text-align: center; padding: 50px 0; }.visitor-section .eyebrow { margin-bottom: 12px; }.visitor-section h2 { font-size: 32px; font-weight: 450; letter-spacing: -1px; margin-bottom: 30px; }.visitor-map { width: 100%; max-width: 780px; min-height: 165px; margin: 0 auto; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }.visitor-map #mapmyvisitors-widget, .visitor-map .mapmyvisitors-map { max-width: 100%; }.visitor-caption { font-size: 12px; color: var(--muted); margin: 20px 0 7px; }.visitor-privacy { font-size: 11px; color: var(--muted); margin: 0; }
.visitor-map-content { width: 100%; }
.visitor-map .mapmyvisitors-map { width: 100% !important; height: auto !important; aspect-ratio: 2.04; background-size: 100% 100%; }
.visitor-map-status { padding: 17px 20px; margin: 0; color: var(--muted); font-size: 13px; }
.visitor-fallback { display: block; }
.visitor-fallback img { display: block; width: 100%; height: auto; }
.visitor-map[data-state="unavailable"] { min-height: 0; }
footer { border-top: 1px solid var(--rule); padding: 25px 0 35px; display: flex; gap: 25px; font: 10px/1.8 var(--mono); color: var(--muted); }footer a { margin-left: auto; }
[data-motion="paused"] *, [data-motion="paused"] *::before, [data-motion="paused"] *::after { animation-play-state: paused !important; transition: none !important; }
[data-motion="paused"] { scroll-behavior: auto; }
@media (max-width: 1050px) {
  .site-header, main, footer { width: calc(100% - 64px); }
  .site-header { gap: 16px; } nav { gap: 19px; }.wordmark>span:last-child { display: none; }
  .hero { gap: 18px; min-height: 630px; padding-block: 65px; }h1 { font-size: 78px; letter-spacing: -5px; }
  .hero .eyebrow { max-width: 350px; font-size: 9px; line-height: 2; }
  .content-section { grid-template-columns: 180px minmax(0, 1fr); gap: 32px; }.section-heading h2 { font-size: 26px; }
  .core-monogram { width: 98px; height: 98px; }.core-monogram>span { font-size: 43px; }.core-monogram small { font-size: 6px; }.orbit-label { font-size: 7px; padding: 4px 6px; }
  .visual-heading { font-size: 7px; }.visual-footer { font-size: 6px; }
  .interests { grid-template-columns: 150px 1fr; }.entry-heading { display: block; }
}
@media (max-width: 760px) {
  .news-section { padding: 30px 0; }
  .news-section h2 { font-size: 25px; margin-bottom: 22px; }
  .news-list li { grid-template-columns: 1fr; gap: 7px; }
  .news-list p { font-size: 14px; }
  .site-header, main, footer { width: calc(100% - 40px); }
  .site-header { min-height: 108px; flex-wrap: wrap; justify-content: space-between; align-content: center; gap: 8px; padding-block: 11px; }
  .wordmark>span:last-child { display: inline; }.small-monogram { width: 30px; height: 30px; font-size: 14px; border-radius: 8px 2px 8px 2px; }
  .display-controls { order: 1; }.lang-select { font-size: 11px; padding: 7px 20px 7px 2px; }.lang-switch { padding-left: 7px; }nav { order: 2; width: 100%; margin: 0; justify-content: space-between; gap: 8px; font-size: 11px; }nav .nav-cv { padding: 3px 10px; }
  .hero { grid-template-columns: 1fr; gap: 24px; min-height: 0; padding: 50px 0 40px; }
  .hero .eyebrow { max-width: none; font-size: 9px; letter-spacing: 1.1px; margin-bottom: 22px; }
  h1 { font-size: clamp(62px, 12vw, 84px); letter-spacing: -4px; margin-bottom: 24px; }.name-note { font-size: 12px; }
  .intro { font-size: 15px; }.affiliation { font-size: 14px; }.affiliation span { font-size: 12px; }
  .research-visual { width: min(100%, 390px); margin: 0 auto; }.visual-heading { font-size: 8px; }.visual-footer { font-size: 7px; }.orbit-label { font-size: 7px; }
  .hero-links { gap: 23px; margin-top: 26px; }.button { padding: 10px 16px; gap: 19px; font-size: 12px; }.text-link { font-size: 12px; }
  .interests { grid-template-columns: 1fr; gap: 15px; padding: 24px 0; }.interest-tags { gap: 7px; }.interest-tags li { font-size: 10px; padding: 5px 9px; }
  .content-section { grid-template-columns: 1fr; gap: 23px; padding: 36px 0; }
  .section-heading { position: static; display: flex; align-items: baseline; gap: 15px; }.section-number { margin: 0; }.section-number::after { display: none; }.section-heading h2 { max-width: none; margin: 0; font-size: 25px; }
  #research .entry { padding: 24px 22px; }h3 { font-size: 18px; }.entry p:not(.entry-meta):not(.keywords) { font-size: 13px; }
  .manuscript { padding-left: 20px; }.honors-list li { grid-template-columns: 72px 1fr; gap: 17px; font-size: 13px; }
  .skills-list>div { grid-template-columns: 1fr; gap: 4px; }.skills-list>div+div { margin-top: 19px; }
  .contact-section { padding: 40px 0; }.contact-links { flex-direction: column; gap: 13px; font-size: 14px; }.contact-section h2 { letter-spacing: -.6px; }
  .visitor-section { padding: 35px 0; }.visitor-section h2 { font-size: 27px; }.visitor-caption { font-size: 11px; }.visitor-privacy { font-size: 10px; }
  footer { flex-wrap: wrap; gap: 9px 20px; font-size: 9px; }footer span:nth-child(2) { margin-left: auto; }footer a { margin-left: 0; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Creative portfolio: shared theme, quiet framing, original photo proportions. */
nav a[aria-current="page"] { color: var(--accent); border-bottom: 2px solid var(--accent); }
.legacy-anchor { scroll-margin-top: 140px; }
.creative-section { padding: 64px 0; border-bottom: 1px solid var(--rule); }
.creative-section h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 450; letter-spacing: -1px; }
.creative-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.creative-card { display: block; padding: 30px; border: 1px solid var(--rule); border-radius: 10px; background: linear-gradient(135deg, var(--surface), var(--soft)); color: var(--ink); text-decoration: none; }
.creative-card:hover { border-color: var(--accent); text-decoration: none; }
.creative-card .eyebrow { display: block; margin-bottom: 35px; }
.creative-card h3 { display: flex; justify-content: space-between; font-size: 27px; }
.creative-card p { color: var(--muted); font-size: 14px; margin: 0; }
.portfolio-page { min-height: calc(100vh - 180px); padding-bottom: 70px; }
.portfolio-intro { padding: 80px 0 45px; border-bottom: 1px solid var(--rule); }
.portfolio-intro h1 { font-size: clamp(43px, 7vw, 88px); letter-spacing: -.045em; overflow-wrap: anywhere; }
.portfolio-subtitle { color: var(--muted); font-size: 19px; }
.portfolio-empty { display: grid; grid-template-columns: 1fr 1fr; gap: 55px; align-items: center; padding: 65px 0; }
.portfolio-empty h2 { font-size: 29px; font-weight: 450; }
.portfolio-empty p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.empty-viewfinder { aspect-ratio: 3/2; border: 1px solid var(--rule); background: radial-gradient(ellipse at center, var(--glow), transparent 65%), var(--surface); display: grid; place-items: center; position: relative; }
.empty-viewfinder::before { content: ''; position: absolute; inset: 22px; border: 1px solid var(--accent); opacity: .4; clip-path: polygon(0 0, 18% 0, 18% 1%, 1% 1%, 1% 18%, 0 18%, 0 0, 100% 0, 100% 18%, 99% 18%, 99% 1%, 82% 1%, 82% 0, 100% 0, 100% 100%, 82% 100%, 82% 99%, 99% 99%, 99% 82%, 100% 82%, 100% 100%, 0 100%, 0 82%, 1% 82%, 1% 99%, 18% 99%, 18% 100%, 0 100%); }
.empty-viewfinder span { color: var(--muted); font: 11px var(--mono); letter-spacing: 3px; }
.portfolio-filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 30px 0 0; }
.filter-button, .photo-viewer button { padding: 8px 15px; border: 1px solid var(--rule); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 13px; }
.filter-button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.photo-grid { columns: 3; column-gap: 24px; margin-top: 35px; }
.photo-card { break-inside: avoid; margin: 0 0 28px; }
.photo-open { display: block; }.photo-open img { display: block; width: 100%; height: auto; border-radius: 5px; }
.photo-card figcaption { padding-top: 9px; color: var(--muted); font-size: 12px; }
.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 35px; }
.social-card { color: var(--ink); text-decoration: none; border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; background: var(--surface); }
.social-card:hover { border-color: var(--accent); text-decoration: none; }
.social-card { display: flex; align-items: flex-start; gap: 20px; padding: 28px; }
.social-avatar { flex: 0 0 64px; height: 64px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 16px; color: var(--accent); background: var(--soft); font: 24px var(--mono); overflow: hidden; }
.social-avatar img { width: 100%; height: 100%; object-fit: cover; }
.social-info { min-width: 0; overflow-wrap: anywhere; }.social-info .eyebrow { margin-bottom: 12px; }.social-info h2 { font-size: 23px; }.social-info>p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.photo-viewer { width: min(1100px, 96vw); max-height: 94dvh; padding: 18px; background: var(--bg); color: var(--ink); border: 1px solid var(--rule); border-radius: 9px; }
.photo-viewer::backdrop { background: rgba(0, 0, 0, .88); }
.viewer-toolbar, .viewer-navigation { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
#viewer-image { display: block; width: 100%; height: 62dvh; object-fit: contain; margin: 15px 0; }
#viewer-caption { font-size: 14px; color: var(--muted); }#viewer-position { font: 12px var(--mono); }
.viewer-open { overflow: hidden; }
@media (max-width: 900px) { nav { gap: 12px; }.photo-grid { columns: 2; } }
@media (max-width: 760px) {
  nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; align-items: center; }
  nav a { justify-self: start; }
  .site-header { min-height: 108px; } html { scroll-padding-top: 200px; }
  .creative-links, .portfolio-empty, .social-grid { grid-template-columns: 1fr; }
  .creative-section { padding: 38px 0; }.creative-card { padding: 24px; }
  .portfolio-intro { padding: 48px 0 30px; }.portfolio-subtitle { font-size: 16px; }
  .portfolio-empty { gap: 30px; padding: 35px 0; }.portfolio-empty h2 { font-size: 25px; }
}
@media (max-width: 440px) { .photo-grid { columns: 1; } }
.reading-intro { color: var(--muted); font-size: 14px; }
/* Reading Notes lives at reading.html as a self-contained page with its own styles. */
.project-topic { padding: 45px 0; }
.topic-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 25px; border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
.topic-heading h2 { font-size: 34px; font-weight: 500; }.topic-heading .eyebrow { margin-bottom: 12px; }.topic-heading>p { color: var(--muted); font: 11px/1.8 var(--mono); }
.topic-intro { color: var(--muted); max-width: 780px; margin-bottom: 35px; }
.projects-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 42px 30px; }
.project-card { min-width: 0; border: 1px solid var(--rule); background: var(--surface); border-radius: 9px; overflow: hidden; }
.project-cover { display: grid; place-items: center; aspect-ratio: 16/9; max-height: 300px; overflow: hidden; background: #0e1624; }
.project-cover img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.project-card-body { padding: 25px; }.project-card-body .eyebrow { margin-bottom: 14px; }.project-card h3 { font-size: 25px; }.project-card h3 a { color: var(--ink); text-decoration: none; }.project-card h3 a:hover { color: var(--accent); }
.project-card-body>p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.project-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; font-size: 13px; }
.project-index-grid .project-card { background: transparent; border: 0; border-radius: 0; }
.project-index-grid .project-card-body { padding: 23px 0 0; }
.project-index-grid .project-cover { border-radius: 6px; }
.practice-section { padding-block: 20px; }
.practice-note { padding: 26px 0; border-bottom: 1px solid var(--rule); }
.practice-note h3 { font-size: 19px; }
.practice-note>p, .practice-caveat { color: var(--muted); font-size: 14px; }
.practice-note .source-files { max-width: 930px; }
.practice-note .source-files>p { overflow-wrap: anywhere; }
.project-detail .portfolio-intro h1 { font-size: clamp(42px,6vw,76px); }
.project-facts { display: flex; gap: 20px 35px; flex-wrap: wrap; padding: 25px 0; border-bottom: 1px solid var(--rule); color: var(--muted); font: 12px/1.8 var(--mono); }
.project-prose { padding-top: 45px; max-width: 930px; }.project-prose h2, .project-gallery h2 { font-size: 29px; font-weight: 500; margin-bottom: 24px; }.project-prose p, .project-prose li { color: var(--muted); font-size: 15px; }.project-prose li { margin-bottom: 18px; }.project-prose strong { color: var(--ink); }.project-prose h2:not(:first-child) { margin-top: 40px; }
.project-gallery { padding-top: 35px; max-width: 930px; }.project-gallery figure { margin: 0 0 30px; }.project-gallery figure>a { display: block; width: fit-content; max-width: 100%; margin-inline: auto; }.project-gallery img { display: block; width: auto; height: auto; max-width: 100%; max-height: 540px; border: 1px solid var(--rule); border-radius: 7px; }.project-gallery figcaption { margin-top: 10px; font-size: 12px; color: var(--muted); }
.source-code { max-width: 100%; overflow-x: auto; border: 1px solid var(--rule); background: var(--surface); padding: 24px; border-radius: 7px; color: var(--accent); font: 12px/1.8 var(--mono); }
.project-prose>p>code { overflow-wrap: anywhere; font-size: 12px; }.source-files { margin-top: 20px; padding: 15px 20px; border: 1px solid var(--rule); border-radius: 6px; }.source-files summary { cursor: pointer; color: var(--accent); font-size: 14px; }.source-files ul { padding-left: 20px; }.source-files li { font-size: 12px; overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; overflow-x: auto; margin: 26px 0 30px; border: 1px solid var(--rule); border-radius: 7px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.data-table thead th { background: var(--surface); color: var(--ink); font-weight: 500; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.data-table td { color: var(--muted); font-family: var(--mono); }
.data-table td:first-child { color: var(--ink); font-family: inherit; }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: 0; }
.project-scope { border-left: 2px solid var(--violet); padding: 10px 0 10px 25px; margin: 45px 0; max-width: 930px; }.project-scope h2 { font-size: 20px; }.project-scope p { font-size: 13px; color: var(--muted); }.project-scope p:last-child { margin: 0; }.project-return { padding-bottom: 35px; }
@media (max-width:760px) { .projects-grid { grid-template-columns: 1fr; gap: 26px; }.topic-heading { display: block; }.project-card-body { padding: 22px; }.project-topic { padding-top: 30px; }.project-prose { padding-top: 30px; }.project-facts { gap: 12px 22px; }.project-prose p, .project-prose li { font-size: 14px; }.project-prose ul { padding-left: 22px; }.project-prose h2, .project-gallery h2 { font-size: 25px; } }
@media print {
  .reading-progress.is-ready { display: none; }
  :root { color-scheme: light; --bg: white; --ink: #15273c; --muted: #394c64; --accent: #086578; --violet: #6545a9; --rule: #ced9e8; --surface: white; }
  body { background: white; font-size: 11pt; } body::before, .site-header, .reading-progress, .research-visual, .hero-links, .skip-link, .visitor-section, footer { display: none; }
  main { width: 100%; }.hero { display: block; min-height: 0; padding: 0 0 20px; }h1 { font-size: 34pt; letter-spacing: -1px; }
  .content-section { padding: 20px 0; grid-template-columns: 150px 1fr; gap: 20px; break-inside: avoid; }.section-heading { position: static; }.section-heading h2 { font-size: 18pt; }
  #research .entry { padding: 15px; }.interests { grid-template-columns: 150px 1fr; }.contact-section { padding: 20px 0; }a { color: inherit; }
}

/* ===================================================================
   Full-screen cover (index only) — Gallery of the Louvre backdrop.
   Scoped to body.has-cover so every other page keeps its sticky header.
   =================================================================== */
body.has-cover .site-header {
  position: fixed; left: 0; right: 0;
  background: transparent; backdrop-filter: none; border-bottom-color: transparent;
  transition: background-color .35s ease, border-color .35s ease, backdrop-filter .35s ease;
}
body.has-cover .site-header nav a, body.has-cover .wordmark, body.has-cover .icon-button, body.has-cover .lang-switch {
  text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
}
body.has-cover.is-past-cover .site-header { border-bottom-color: transparent; }
.header-backdrop {
  display: none; position: fixed; z-index: 19; left: 0; right: 0; top: 0;
  height: var(--header-bottom, 112px); pointer-events: none;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color .35s ease, border-color .35s ease;
}
body.has-cover .header-backdrop { display: block; }
body.has-cover.is-past-cover .header-backdrop { background: var(--bg); border-bottom-color: var(--rule); }
body.has-cover.is-past-cover .site-header nav a, body.has-cover.is-past-cover .wordmark,
body.has-cover.is-past-cover .icon-button, body.has-cover.is-past-cover .lang-switch { text-shadow: none; }

.cover {
  /* ---------- 首屏可調參數：平常只要改這 6 行 ---------- */
  --cover-title: clamp(40px, 5.6vw, 84px);  /* 大標題字級：最小 / 隨螢幕縮放 / 最大 */
  --cover-sub: clamp(16px, 1.7vw, 23px);    /* 打字那行的字級 */
  --cover-width: 880px;                     /* 文字區塊最大寬度，太窄標題就會換行 */
  --cover-shift: min(8%, 90px);             /* 文字離左邊多遠：0 = 貼左，auto = 水平置中 */
  --cover-align: left;                      /* 文字對齊：left / center（設 center 時 shift 要改 auto）*/
  --cover-lift: 0px;                        /* 文字整體上移幾 px，正值往上、負值往下 */
  /* --------------------------------------------------- */
  position: relative; display: grid; align-items: center;
  width: 100%; margin: 0; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  background-color: #060a12; color: #fff;
  border-bottom: 1px solid var(--rule);
}
.cover::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: url("../img/hero-louvre-1920.webp");
  background-repeat: no-repeat; background-size: cover; background-position: 50% 45%;
}
.cover::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(8, 13, 23, .4) 0%, rgba(8, 13, 23, .26) 26%, rgba(8, 13, 23, .1) 46%, rgba(8, 13, 23, 0) 62%),
    linear-gradient(180deg, rgba(8, 13, 23, .42) 0%, rgba(8, 13, 23, 0) 15%, rgba(8, 13, 23, 0) 84%, rgba(8, 13, 23, .42) 100%);
}
.cover-inner {
  position: relative; z-index: 2;
  width: min(1200px, calc(100% - 96px)); margin-inline: auto;
  padding: 130px 0 130px;
}
.cover-copy {
  max-width: var(--cover-width); margin-left: var(--cover-shift); margin-right: var(--cover-shift);
  text-align: var(--cover-align); translate: 0 calc(-1 * var(--cover-lift));
}
.cover-title {
  margin: 0 0 24px; color: #fff;
  font-family: "Segoe UI", Arial, sans-serif; font-weight: 700;
  font-size: var(--cover-title); line-height: 1.07; letter-spacing: -.035em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 2px 14px rgba(0, 0, 0, .85), 0 10px 46px rgba(0, 0, 0, .7);
}
.cover-sub-typed {
  margin: 0; color: #f2f6fd; font-weight: 400;
  font-size: var(--cover-sub); line-height: 1.65;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 2px 10px rgba(0, 0, 0, .9), 0 6px 30px rgba(0, 0, 0, .75);
}
.cover-sub-typed { margin-top: 0; min-height: 1.65em; color: var(--accent); }
.cover-caret {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 4px;
  vertical-align: -.16em; background: var(--accent); box-shadow: 0 0 10px rgba(107, 231, 232, .8);
  animation: cover-blink 1.05s steps(1, end) infinite;
}
@keyframes cover-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.cover-arrow {
  position: absolute; z-index: 3; left: 50%; bottom: 40px; translate: -50% 0;
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid rgba(233, 240, 250, .3); border-radius: 50%;
  background: rgba(8, 13, 23, .3); backdrop-filter: blur(4px);
  color: #e9f0fa; text-decoration: none;
}
.cover-arrow:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.cover-arrow svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  animation: cover-bob 2.1s ease-in-out infinite;
}
@keyframes cover-bob { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }

.cover-credit {
  position: absolute; z-index: 3; right: 26px; bottom: 16px; margin: 0; max-width: min(700px, 76vw);
  font-family: var(--mono); font-size: 10.5px; line-height: 1.6; text-align: right;
  color: rgba(233, 240, 250, .4); text-shadow: 0 1px 6px rgba(0, 0, 0, .85);
  transition: color .25s ease;
}
.cover-credit:hover { color: rgba(233, 240, 250, .92); }

@media (max-width: 1050px) {
  .cover-inner { width: calc(100% - 64px); padding: 120px 0 120px; }
}
@media (max-width: 760px) {
  .cover::before { background-image: url("../img/hero-louvre-1000.webp"); }
  .cover-inner { width: calc(100% - 40px); padding: 130px 0 130px; }
  .cover { --cover-width: none; --cover-shift: 0; }
  .cover-title { letter-spacing: -.028em; }
  .cover-arrow { bottom: 78px; width: 42px; height: 42px; }
  .cover-credit { right: 20px; left: 20px; bottom: 14px; max-width: none; font-size: 9.5px; text-align: center; }
}
/* Portrait phones: keep the figures in the lower half of the painting in frame,
   and darken from the top instead of from the left so the copy stays readable. */
@media (max-width: 760px) and (orientation: portrait) {
  .cover::before { background-position: 50% 56%; }
  .cover::after {
    background:
      linear-gradient(180deg, rgba(8, 13, 23, .6) 0%, rgba(8, 13, 23, .42) 22%, rgba(8, 13, 23, .12) 44%, rgba(8, 13, 23, 0) 62%, rgba(8, 13, 23, .38) 100%);
  }
}
[data-motion="paused"] .cover-caret { display: none; }
@media (prefers-reduced-motion: reduce) { .cover-caret { display: none; } }
