:root {
  color-scheme: dark;
  --background: #101923;
  --panel: #162331;
  --panel-strong: #1a293a;
  --ink: #edf3f9;
  --muted: #bac9d9;
  --accent: #b5d4fc;
  --rule: #354c63;
  font-family: Inter, "Segoe UI", sans-serif;
  scroll-padding-top: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse 65rem 40rem at 50% 7rem, #182535, transparent 80%), var(--background); }
a { color: var(--accent); text-underline-offset: .25em; }
a:hover { color: white; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, h4, p { margin: 0; }
p, li { line-height: 1.65; }
.shell { width: min(1220px, calc(100% - 72px)); margin-inline: auto; }
.skip { position: fixed; z-index: 5; top: 10px; left: 10px; padding: 10px 16px; background: var(--panel); transform: translateY(-170%); }
.skip:focus { transform: none; }

.site-header { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; min-height: 78px; border-bottom: 1px solid var(--rule); }
.identity { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #57738e; border-radius: 6px; font-size: .88rem; font-weight: 700; letter-spacing: .04em; text-decoration: none; }
.site-header nav { display: flex; justify-content: center; gap: clamp(14px, 3vw, 38px); }
.site-header nav a, .contact-link { color: var(--muted); font-size: .91rem; text-decoration: none; }
.site-header nav a:hover, .contact-link:hover { color: white; }
.contact-link { justify-self: end; }

.network { --rail-inset: 14px; --content-inset: 66px; position: relative; isolation: isolate; padding-inline: var(--content-inset); }
#profile-grid { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.network > section { position: relative; }
.track { fill: none; stroke: #547da6; stroke-width: 1.8; opacity: .7; }
.circuit { fill: none; stroke: #a7d3ff; stroke-width: 2.6; opacity: 0; transition: opacity 240ms ease; filter: drop-shadow(0 0 6px #79b8fbd0); }
.circuit.is-active { opacity: .78; }
.terminal { fill: #152233; stroke: #789abe; stroke-width: 1.5; }
.terminal.profile-terminal { fill: #b7d9ff; stroke: #d4ebff; stroke-width: 2.2; filter: drop-shadow(0 0 7px #80c8ff); }
.pulse { fill: none; stroke-linecap: round; }
.pulse-core { stroke: #d9efff; stroke-width: 2.8; }
.pulse-halo { stroke: #70b8ff; stroke-width: 8; filter: drop-shadow(0 0 5px #70b8ff); }

.profile { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); align-items: end; gap: clamp(20px, 4.4vw, 70px); padding-block: clamp(60px, 8vw, 109px) clamp(48px, 6vw, 84px); }
.eyebrow, .meta { color: var(--accent); font: .79rem/1.5 "IBM Plex Mono", Consolas, monospace; }
.eyebrow { letter-spacing: .08em; text-transform: uppercase; }
h1 { font-size: clamp(2.7rem, 6.3vw, 6.1rem); font-weight: 670; line-height: .98; letter-spacing: -.065em; }
.profile h1 { margin-block: 17px 14px; }
.profile, .hub { background: radial-gradient(ellipse at 22% 55%, #4c8ccb30, transparent 72%); }
.profile h1, .hub h1 { text-shadow: 0 0 27px #80bcff78; }
.profile-line { color: var(--accent); font-size: clamp(1.19rem, 2.5vw, 2.08rem); line-height: 1.24; letter-spacing: -.025em; }
.profile-summary { padding: 18px 0 6px clamp(14px, 2vw, 26px); border-left: 1px solid var(--rule); }
.profile-summary > p, .project-intro { color: var(--muted); font-size: clamp(1.01rem, 1.55vw, 1.2rem); line-height: 1.6; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 22px; }
.actions a { font-size: .9rem; font-weight: 600; }
.actions .button { display: inline-flex; align-items: center; gap: 16px; padding: 11px 14px; min-height: 44px; border-radius: 5px; color: #101923; background: var(--accent); text-decoration: none; }
.actions .button:hover { background: #d4e6ff; }
.motion-control { min-height: 40px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: .82rem; text-decoration: underline; text-underline-offset: .25em; cursor: pointer; }
.motion-control:hover { color: white; }

.chapter { padding-block: clamp(36px, 5vw, 66px); border-top: 1px solid var(--rule); }
.chapter::before { position: absolute; inset: 0 -12px; z-index: -1; pointer-events: none; content: ''; background: linear-gradient(155deg, #5b9ee236, transparent 80%); opacity: 0; transition: opacity 240ms ease; }
.chapter { transition: filter 240ms ease; }
.chapter:not(.is-active):not(:focus-within) { filter: brightness(.78); }
.chapter.is-active::before { opacity: 1; }
.chapter.is-active h2 { color: #eef8ff; text-shadow: 0 0 23px #83baf7a0; }
.section-top { margin-top: 19px; text-align: right; font-size: .84rem; }
@media (prefers-reduced-motion: reduce) { .circuit, .chapter, .chapter::before { transition: none; } }
.section-heading { position: relative; margin-bottom: 26px; }
.profile-heading { margin: 0; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3.4rem); line-height: 1.08; letter-spacing: -.044em; font-weight: 635; }
h3 { font-size: 1.21rem; letter-spacing: -.014em; }
h4 { font-size: 1.04rem; line-height: 1.3; }
.skill-grid, .highlight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.skill-grid article, .highlight-grid article { background: var(--panel); border: 1px solid var(--rule); padding: clamp(14px, 1.6vw, 22px); border-radius: 6px; }
.skill-grid article p, .highlight-grid article p:last-child { color: var(--muted); margin-top: 8px; font-size: .94rem; }
.highlight-grid article:first-child { background: var(--panel-strong); border-color: #587493; }
.highlight-grid h3 { margin-top: 7px; }

.employer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: clamp(24px, 5vw, 76px); padding-block: 24px; border-top: 1px solid var(--rule); }
.role li { color: var(--muted); font-size: .95rem; }
.role + .role { margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--rule); }
.role h4 { margin-top: 4px; }
.role ul { margin-block: 8px 0; padding-inline-start: 1.2em; }
.role li + li { margin-top: .28em; }

.qualifications, .publications { list-style: none; padding: 0; margin: 0; }
.qualifications li { display: grid; grid-template-columns: 1.3fr 1fr auto; align-items: baseline; gap: 16px; border-top: 1px solid var(--rule); padding-block: 14px; }
.qualifications h3 { font-size: 1rem; }
.qualifications p { font-size: .94rem; color: var(--muted); }
.qualifications .meta { white-space: nowrap; }

.recognition { margin-top: 12px; color: var(--muted); font-size: .92rem; }
.publication-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; }
.publication-heading > a { font-size: .86rem; }
.publications { margin-top: 14px; }
.publications li { padding-block: 10px; border-top: 1px solid var(--rule); }
.publications li:last-child { padding-bottom: 0; }
.publications a { display: inline-block; margin-top: 3px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0 32px; border-top: 1px solid var(--rule); font-size: .84rem; color: var(--muted); }
.project-page { max-width: 940px; padding-block: 48px 28px; }
.project-page .back-link { display: inline-block; margin-bottom: 36px; }
.project-page h1 { margin-block: 14px 18px; }
.project-page .project-intro { max-width: 64ch; }
.project-page .project-intro + .project-intro { margin-top: 12px; }
.project-duration { margin-top: 9px; color: var(--muted); }
.project-hero { padding-bottom: 42px; }

@media (max-width: 980px) {
  .network { --content-inset: 49px; --rail-inset: 10px; }
}

@media (max-width: 720px) {
  .shell { width: calc(100% - 32px); }
  .network { width: calc(100% - 12px); --content-inset: 27px; --rail-inset: 5px; }
  .profile { grid-template-columns: 1fr; gap: 20px; padding-block: 51px 42px; }
  .profile-summary { padding: 0; border: 0; max-width: 50ch; }
  .profile-line { margin-bottom: 0; }
  .employer, .highlight-grid, .skill-grid { grid-template-columns: 1fr; gap: 12px; }
  .qualifications li { grid-template-columns: 1fr; gap: 3px; }
  .qualifications .meta { white-space: normal; }
}

@media (max-width: 460px) {
  .site-header { grid-template-columns: 1fr 1fr; min-height: auto; gap: 11px; padding-block: 12px; }
  .site-header nav { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; gap: 7px 14px; }
  .site-header nav a, .contact-link { font-size: .82rem; }
}
