@font-face {
  font-family: Instrument;
  src: url("assets/instrument.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: Barlow;
  src: url("assets/barlow-semi-condensed.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
:root {
  color-scheme: light dark;
  --paper: light-dark(#fcfcfa, #191d22);
  --ink: light-dark(#171b20, #f3f1e9);
  --body: light-dark(#303841, #e3e4e4);
  --muted: light-dark(#555f68, #adb8c1);
  --blue: light-dark(#1758a1, #9dc9ff);
  --rule: light-dark(#b9bec0, #535b63);
  --soft-rule: light-dark(#dce0df, #394047);
  --gutter: clamp(19px, 5.5vw, 90px);
  --sans: Instrument, Arial, sans-serif;
  --head: Barlow, "Arial Narrow", var(--sans);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
html { scroll-padding-top: 18px; }
body {
  margin: 0;
  font: 400 16px/1.53 var(--sans);
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure, dl, dd, ol { margin: 0; }
h1, h2, h3, dt { color: var(--ink); }
h1, h2 { font-family: var(--head); font-weight: 600; }
h1 { font-size: clamp(52px, 6vw, 86px); line-height: 1; letter-spacing: -.033em; }
.surname { white-space: nowrap; }
h2 { font-size: clamp(28px, 2.45vw, 36px); letter-spacing: -.019em; line-height: 1.12; }
h3 { font-size: 20px; font-weight: 640; line-height: 1.25; letter-spacing: -.026em; }
img { display: block; max-width: 100%; }
a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: .17em;
  text-decoration-color: color-mix(in srgb, var(--blue) 60%, transparent);
}
a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
button, summary { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
::selection { background: #cddff4; color: #11253c; }
.frame { width: min(calc(100% - 2 * var(--gutter)), 1140px); margin-inline: auto; }
.skip-link { position: absolute; z-index: 2; top: 4px; left: var(--gutter); background: var(--paper); padding: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.page-nav, .page-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.page-nav { padding-block: 16px 5px; font-size: 14px; }
.page-nav nav, .settings, .contacts { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; }
.page-nav a, .page-foot a, .theme-control {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  text-decoration: none;
  color: var(--muted);
}
.page-nav a:hover, .page-foot a:hover, .theme-control:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--blue); }
.page-nav .language { color: var(--blue); }
.profile {
  display: grid;
  grid-template-columns: clamp(145px, 14.5vw, 194px) minmax(0, 1fr);
  gap: clamp(25px, 3.7vw, 66px);
  align-items: center;
  padding-block: clamp(18px, 2.8vw, 46px) clamp(30px, 3.4vw, 55px);
}
.portrait { width: 100%; height: auto; aspect-ratio: 1; }
.signal-print, .print-ink { display: block; }
/* The border extends the outermost pixel of the original image into each strand. */
@supports (container-type: inline-size) and (mask-image: linear-gradient(black, transparent)) {
  .signal-print { display: flow-root; container-type: inline-size; }
  .portrait-print {
    --source: url("assets/sasha.webp");
    --strands: url("assets/portrait-edges.svg");
    --north: 6cqw; --east: 6cqw; --south: 6cqw; --west: 20cqw;
  }
  .print-ink {
    position: relative;
    pointer-events: none;
    margin: calc(0px - var(--north)) calc(0px - var(--east)) calc(0px - var(--south)) calc(0px - var(--west));
    padding: var(--north) var(--east) var(--south) var(--west);
    mask: var(--strands) center / 100% 100% no-repeat;
  }
  .print-ink img { pointer-events: auto; }
  .print-ink::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    border-image: var(--source) 1 / calc(var(--north) + 1px) calc(var(--east) + 1px) calc(var(--south) + 1px) calc(var(--west) + 1px) stretch;
  }
}
.introduction > p { margin-top: 14px; font-size: clamp(17px, 1.31vw, 20px); line-height: 1.48; max-width: 63ch; text-wrap: pretty; }
.contacts { margin-top: 15px; gap: 4px 20px; font-size: 15px; font-style: normal; }
.education {
  border-block: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(114px,.46fr) minmax(0,1.05fr) minmax(0,1fr);
  gap: clamp(22px, 3.2vw, 52px);
  padding-block: clamp(25px, 2.5vw, 40px);
}
.school { max-width: 46ch; }
.degree, .position { color: var(--ink); }
.degree { font-size: 16px; margin-top: 4px; }
.when { color: var(--muted); font-size: 13px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.school .when { margin-top: 3px; }
.study-detail { font-size: 15px; margin-top: 12px; line-height: 1.52; }
.body-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr);
  column-gap: clamp(48px, 7.6vw, 124px);
  padding-block: clamp(29px, 2.9vw, 48px) 52px;
}
.jobs { padding: 0; list-style: none; }
.job { margin-top: 25px; }
.job + .job { padding-top: 21px; margin-top: 21px; border-top: 1px solid var(--soft-rule); }
.job-head { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: baseline; gap: 4px 16px; }
.position { margin-top: 3px; font-size: 15px; }
.job-detail { margin-top: 9px; max-width: 74ch; text-wrap: pretty; }
.project-figure { margin-top: 25px; }
.project-figure a:has(img) { display: block; }
.project-figure img { width: 100%; height: auto; }
.project-figure figcaption, .personal-project, .project-list dd { font-size: 15.5px; line-height: 1.53; }
.project-figure figcaption { margin-top: 11px; }
.personal-project { margin-top: 15px; }
.project-group { font-size: 22px; margin-top: 31px; }
.project-list > div { margin-top: 19px; }
.project-list dt { font-weight: 625; margin-bottom: 3px; }
.skills { margin-top: 26px; border-top: 1px solid var(--rule); }
.skills summary { width: fit-content; padding-block: 12px; color: var(--blue); font-size: 15px; }
.skills summary:hover { text-decoration: underline; }
.skills dl { margin-top: 2px; }
.skills dl > div { margin-bottom: 10px; }
.skills dt { font-size: 14px; font-weight: 620; }
.skills dd { font-size: 14px; color: var(--muted); }
.page-foot { border-top: 1px solid var(--rule); padding-block: 12px 24px; font-size: 13px; }
.theme-control { padding: 0; border: 0; background: transparent; }
.theme-control[hidden] { display: none; }
@media (max-width: 880px) {
  .education { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .education > h2 { grid-column: 1 / -1; }
  .body-columns { grid-template-columns: minmax(0,1.4fr) minmax(0,.88fr); column-gap: 34px; }
  .job-head { display: block; }
  .job-head .when { display: block; margin-block: 3px; }
}
@media (max-width: 690px) {
  :root { --gutter: clamp(19px, 5.2vw, 32px); }
  .page-nav { padding-top: 6px; }
  .page-nav a, .page-foot a, .theme-control { min-height: 44px; }
  .page-nav nav { gap: 4px 16px; }
  .profile { padding-block: 18px 28px; grid-template-columns: 80px minmax(0,1fr); gap: 15px 17px; }
  .introduction { display: contents; }
  h1 { font-size: clamp(38px, 8.35vw, 54px); letter-spacing: -.025em; }
  .introduction > p, .contacts { grid-column: 1 / -1; margin: 0; }
  .introduction > p { font-size: 17px; }
  .contacts { gap: 2px 17px; }
  .contacts a { padding-block: 4px; }
  .body-columns { grid-template-columns: 1fr; gap: 30px; padding-bottom: 32px; }
  .job-head { display: grid; }
  .job { margin-top: 19px; }
  .job + .job { margin-top: 17px; padding-top: 17px; }
  .job-detail { margin-top: 7px; }
  .skills { margin-top: 19px; }
  .projects { border-top: 1px solid var(--rule); padding-top: 24px; }
  .project-figure { margin-top: 17px; }
  .project-figure img { max-width: 430px; }
  .projects { max-width: 60ch; }
}
@media (max-width: 520px) {
  .education { grid-template-columns: 1fr; padding-block: 22px; gap: 21px; }
  .school .study-detail { margin-top: 7px; }
  .job-head { display: block; }
  .job-head .when { margin-block: 4px 2px; }
  .page-foot { align-items: start; }
  .settings { gap: 0 11px; justify-content: end; }
}
@media (max-width: 365px) {
  .page-nav { font-size: 13px; }
  .page-nav nav { column-gap: 11px; }
  .profile { grid-template-columns: 66px minmax(0,1fr); column-gap: 11px; }
  h1 { font-size: 35px; }
  .contacts { font-size: 14px; gap: 2px 12px; }
  .page-foot { flex-wrap: wrap; gap: 0 14px; }
}
@media print {
  :root { color-scheme: light; --gutter: 0px; }
  .page-nav, .page-foot, .skip-link { display: none; }
  .frame { width: 100%; }
  .body-columns { display: block; }
  .profile { grid-template-columns: 100px 1fr; padding-top: 0; }
  .introduction { display: block; }
  .job, .school, .project-figure { break-inside: avoid; }
  .project-figure { max-width: 55ch; }
  .project-figure img { max-width: 200px; }
}
@media print, (forced-colors: active) {
  .print-ink { margin: 0; padding: 0; mask: none; }
  .print-ink::before { content: none; }
}

/* Both plots live in the background stacking context, outside the document flow. */
body { position: relative; isolation: isolate; }
.signal-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.signal-field canvas { display: block; position: absolute; }
.phase-plot {
  width: clamp(390px, 35vw, 690px);
  aspect-ratio: .88;
  right: -2.8vw;
  top: clamp(-150px, -6.8vw, -72px);
  color: light-dark(#175b9e, #80c9fa);
}
.wave-bank {
  width: clamp(310px, 31vw, 550px);
  aspect-ratio: 1.22;
  left: -6.5vw;
  bottom: -1.5vh;
  color: light-dark(#245f83, #80b6c9);
}
.page-foot { position: relative; }
.motion-control {
  position: absolute;
  left: 100px;
  top: 12px;
  min-height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--muted);
}
.motion-control:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 690px) {
  .phase-plot { width: clamp(235px, 62vw, 330px); right: -62px; top: clamp(-36px, -6.5vw, -20px); }
  .signal-field .wave-bank { display: none; }
  .motion-control { top: auto; left: 0; bottom: 0; min-height: 24px; }
}
@media print, (forced-colors: active) {
  .signal-field, .motion-control { display: none; }
}
