@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/ibm-plex-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-semibold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f9fb;
  --sidebar: #eaf2f5;
  --blue: #315ef5;
  --teal: #0d6075;
  --ink: #0b1220;
  --text: #475467;
  --muted: #657586;
  font-family: "IBM Plex Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: #e1e8ed;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blue);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
  border-radius: 2px;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

.print-only {
  display: none;
}

.analytics-footer {
  display: grid;
  place-items: center;
  min-height: 44px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 24px;
  color: var(--muted);
  font-size: 11px;
  line-height: 20px;
}

.analytics-footer > p {
  font-size: 14px;
  margin-bottom: 8px;
}

.analytics-footer > div {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.analytics-footer button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.analytics-consent {
  position: fixed;
  z-index: 20;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  margin: 0;
  padding: 20px max(24px, calc((100vw - 1120px) / 2));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid #ccdce3;
  border-radius: 0;
  background: var(--paper);
  box-shadow: 0 -8px 30px rgb(11 18 32 / 10%);
  font-size: 14px;
  line-height: 1.55;
}

.analytics-kicker {
  margin-bottom: 4px;
  color: var(--teal);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .05em;
}

.analytics-copy h2 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.analytics-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.analytics-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

.analytics-actions button {
  min-height: 42px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 500;
  cursor: pointer;
}

.analytics-decline {
  background: transparent;
  color: var(--teal);
}

.analytics-allow {
  background: var(--teal);
  color: white;
}

.analytics-actions button:hover {
  box-shadow: 0 0 0 2px rgb(13 96 117 / 15%);
}

@media screen and (max-width: 800px) {
  .analytics-consent {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

@media screen and (max-width: 480px) {
  .analytics-actions button {
    flex: 1;
    padding-inline: 10px;
  }
}

@media print {
  .analytics-footer,
  .analytics-consent {
    display: none !important;
  }
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  transform: translateY(-160%);
  background: white;
  color: var(--ink);
  border-radius: 6px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-toolbar,
.portfolio-toolbar {
  --toolbar-font-size: 16px;
  --toolbar-gap: 24px;
  --toolbar-height: 36px;
  --toolbar-link-color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--toolbar-gap);
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 32px;
  font-size: var(--toolbar-font-size);
  font-weight: 500;
  line-height: 20px;
}

.site-toolbar nav,
.portfolio-toolbar nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--toolbar-gap);
  font: inherit;
}

.site-toolbar > a,
.site-toolbar nav > a,
.site-toolbar .pdf-action,
.portfolio-toolbar > a,
.portfolio-toolbar nav > a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: var(--toolbar-height);
  font: inherit;
  white-space: nowrap;
  text-decoration: none;
  color: var(--toolbar-link-color);
}

:is(.site-toolbar, .portfolio-toolbar) > a:is(:hover, :focus-visible),
:is(.site-toolbar, .portfolio-toolbar) nav > a:is(:hover, :focus-visible) {
  color: var(--blue);
}

.site-toolbar a:focus-visible,
.portfolio-toolbar a:focus-visible {
  outline-offset: 3px;
}

.site-toolbar > .site-brand {
  flex-shrink: 0;
  font-weight: 700;
}

.site-toolbar nav {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  width: 100%;
}

.site-toolbar .pdf-action {
  color: white;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--toolbar-height);
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
}

.site-toolbar .pdf-action:hover,
.site-toolbar .pdf-action:focus-visible {
  border-color: var(--blue);
  background: #182234;
  color: white;
}

.cv {
  display: grid;
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
}

.cv-page {
  position: relative;
  min-width: 0;
  background: var(--paper);
  box-shadow: 0 12px 48px rgb(11 18 32 / 6%);
}

.page-one {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  column-gap: 44px;
  padding-right: 48px;
}

.identity {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin-top: 44px;
  margin-bottom: 34px;
  padding-right: 124px;
}

.identity-copy {
  display: contents;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--teal);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.identity h1 {
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.headline {
  margin-top: 10px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
}

.summary {
  margin-top: 15px;
  font-size: 14px;
  line-height: 1.55;
}

.portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 9;
  margin: 0 0 26px;
  border-radius: 9px;
  background: var(--sidebar);
  overflow: hidden;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Figma-based crop, tightened slightly to keep the shirt lettering out. */
  transform: scale(1.1);
  transform-origin: 50% 25%;
}

.portrait .portrait-print {
  display: none;
}

.portrait-mobile {
  display: none;
}

.profile-details {
  margin-top: 29px;
}

.profile-toggle {
  display: none;
}

.sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
  min-width: 0;
  padding: 46px 24px 40px;
  background: var(--sidebar);
  font-size: 13px;
  line-height: 1.6;
}

.sidebar-section + .sidebar-section {
  margin-top: 29px;
}

.sidebar-section h2 {
  margin-bottom: 11px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.035em;
}

.sidebar-section p + p {
  margin-top: 7px;
}

.sidebar ul {
  display: grid;
  gap: 7px;
  padding: 0;
  list-style: none;
}

.contact-list {
  display: grid;
  gap: 7px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.contact-context,
.contact-links {
  display: contents;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.contact-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.language-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 10px;
}

.language-list dd {
  color: var(--teal);
  text-align: right;
}

.language-list > div {
  display: contents;
}

.experience {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.section-label {
  margin-bottom: 23px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.job + .job {
  margin-top: 29px;
}

.job-header {
  margin-bottom: 10px;
}

.job-title-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(42%);
  align-items: baseline;
  column-gap: 12px;
}

.job-heading {
  min-width: 0;
}

.company a {
  color: inherit;
  text-decoration: none;
}

.company a:hover {
  color: var(--teal);
}

.company-name-short {
  display: none;
}

.company,
.project h3,
.project-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.domain {
  color: var(--teal);
  font-size: 11px;
  line-height: 1.4;
}

.job-role {
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.job-meta,
.project-meta {
  margin-top: 4px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.55;
}

.job-domain {
  min-width: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.55;
  text-align: right;
  overflow-wrap: anywhere;
}

.achievements {
  padding-left: 1.15em;
}

.achievements li {
  padding-left: 0.15em;
}

.achievements li + li {
  margin-top: 6px;
}

.achievements li::marker {
  color: var(--teal);
  font-size: 0.75em;
}

.page-number {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  text-align: right;
  line-height: 1;
}

.page-one > .page-number {
  grid-column: 2;
  grid-row: 3;
  margin: 34px 0 24px;
}

.page-two {
  padding: 44px 48px 24px;
}

.page-intro {
  position: relative;
  margin-bottom: 29px;
  padding-right: 180px;
}

.research-motif {
  position: absolute;
  top: 0;
  right: 0;
  width: 156px;
  height: 52px;
  pointer-events: none;
}

.page-intro h2 {
  font-size: 27px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.page-intro p {
  margin-top: 7px;
  color: var(--teal);
  font-size: 13px;
}

.technologies .section-label {
  margin-bottom: 17px;
}

.tech-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tech-column {
  min-width: 0;
  padding: 18px;
  border-radius: 8px;
  background: var(--sidebar);
}

.tech-group + .tech-group {
  margin-top: 20px;
}

.tech-group h3 {
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.tech-list {
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.65;
}

.projects {
  margin-top: 35px;
}

.project + .project {
  margin-top: 28px;
}

.project header {
  margin-bottom: 12px;
}

.projects-featured {
  margin: 0 0 35px;
}

.project-agent {
  padding: 24px;
  border: 1px solid #b8e3e8;
  border-radius: 10px;
  background: #f0fafb;
}

.project-agent .project-title {
  color: var(--teal);
}

.project-summary {
  margin-bottom: 12px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-top: 16px;
  font-size: 12px;
}

.project-links-label {
  color: var(--muted);
  font-weight: 500;
}

.project-links a {
  white-space: nowrap;
}

.page-two > .page-number {
  margin-top: 34px;
}

@media screen {
  .company a {
    text-decoration: underline dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
  }

  .company a:hover {
    text-decoration-style: solid;
  }

  .site-toolbar > .site-brand,
  .site-toolbar nav a:not(.pdf-action) {
    transform: none;
  }

  .cv {
    /* Grow the outer gutters smoothly instead of taking space away at 641px. */
    width: min(1120px, calc(100% - clamp(0px, 12.5vw - 80px, 48px)));
  }

  .identity {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px 24px;
    margin-block: 32px 20px;
    padding: 0 0 14px;
    border-bottom: 1px solid #d8e0e8;
  }

  .identity-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    grid-column: 1;
    grid-row: 1;
    gap: 8px;
    min-width: 0;
    align-self: center;
  }

  .identity .eyebrow,
  .identity .headline {
    margin: 0;
  }

  .identity .eyebrow {
    color: var(--blue);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.06em;
  }

  .identity h1 {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -0.025em;
    text-transform: uppercase;
  }

  .identity .headline {
    color: var(--muted);
    font-size: 15px;
    font-weight: 400;
    line-height: 22px;
  }

  .identity .summary {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
  }

  /* A readable middle ground between spacious screen cards and dense print. */
  .experience > .section-label {
    margin-bottom: 16px;
    font-size: 11.5px;
    line-height: 16px;
  }

  .experience .job + .job {
    margin-top: 26px;
  }

  .experience .job-header {
    margin-bottom: 8px;
  }

  .experience .company {
    font-size: 18px;
    line-height: 24px;
  }

  .experience .job-role {
    margin-top: 3px;
    line-height: 20px;
  }

  .experience .job-meta {
    margin-top: 4px;
    font-size: 11px;
    line-height: 16px;
  }

  .experience .achievements li + li {
    margin-top: 5px;
  }

  .page-intro {
    margin-bottom: 28px;
  }

  .projects-featured {
    margin-bottom: 32px;
  }

  .projects-secondary {
    margin-top: 32px;
  }

  .technologies .section-label {
    margin-bottom: 16px;
  }

  .portrait {
    width: var(--portrait-width);
    border-radius: 4px;
  }

  .sidebar {
    --portrait-width: 172px;
    position: relative;
    align-self: stretch;
    padding-top: 32px;
    border-radius: 0;
  }

  .contact-list {
    row-gap: 6px;
  }

  .tech-columns {
    /* Size cards by their container, with at most three columns. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, max(15.5rem, (100% - 28px) / 3)), 1fr));
    gap: 14px;
  }

  .tech-group {
    grid-column: auto;
  }

  .tech-column {
    display: contents;
  }

  .tech-group,
  .tech-group + .tech-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    margin: 0;
    padding: 20px 16px;
    border: 1px solid #dfe8ec;
    border-radius: 10px;
    background: #eff5f7;
  }

  .tech-group h3 {
    margin: 0;
    color: var(--teal);
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    text-wrap: balance;
  }

  .tech-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: start;
    gap: 6px;
  }

  .tech-list li {
    max-width: 100%;
    padding: 4px 8px;
    border: 1px solid #e1e8ed;
    border-radius: 5px;
    background: #fff;
    color: #344555;
    font-size: 12.5px;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: break-word;
  }

  [data-category="programming"] { order: 1; }
  [data-category="cloud"] { order: 2; }
  [data-category="security"] { order: 3; }
  [data-category="platform"] { order: 4; }
  [data-category="data"] { order: 5; }
  [data-category="agents"] { order: 6; }
}

@media screen and (min-width: 981px) {
  .identity .eyebrow {
    /* Optically match section spacing: the larger name has more space above its glyphs. */
    margin-bottom: 4px;
  }
}

@media screen and (max-width: 1180px) {
  .sidebar {
    --portrait-width: 152px;
  }

  .page-one {
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: 32px;
    padding-right: 32px;
  }

  .page-two {
    padding-inline: clamp(20px, 3.75vw - 4px, 32px);
  }
}

@media screen and (max-width: 980px) {
  .page-one {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    gap: 0;
    padding: 0 clamp(20px, 3.75vw - 4px, 32px);
  }

  .identity {
    grid-column: 1;
    grid-row: 1;
    margin: 28px 0 22px;
  }

  .sidebar {
    --portrait-width: 160px;
    position: static;
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: var(--portrait-width) minmax(0, 1fr);
    gap: 22px 24px;
    padding: 22px clamp(20px, 1.25vw + 12px, 24px);
    border-radius: 10px;
  }

  .portrait {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin: 0;
  }

  .profile-contact {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .contact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 24px;
  }

  .contact-context > span {
    grid-column: 1 / -1;
  }

  .profile-languages {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
  }

  .language-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .language-list > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .language-list dd {
    text-align: left;
  }

  .sidebar-section + .sidebar-section {
    margin-top: 0;
  }

  .profile-details {
    grid-column: 1 / -1;
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid #d4e2e7;
  }

  .profile-toggle {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--teal);
    text-align: left;
    font-weight: 500;
    cursor: pointer;
  }

  .profile-toggle::after {
    content: "+";
    font-size: 20px;
    line-height: 1;
  }

  .profile-toggle[aria-expanded="true"]::after {
    content: "−";
  }

  .profile-toggle:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
    border-radius: 3px;
  }

  .profile-extra {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    gap: 20px;
    padding-top: 18px;
  }

  .profile-extra > .sidebar-section {
    min-width: 0;
  }

  /* Collapse only on screen so printing never depends on browser print events. */
  .profile-details[data-collapsed="true"] .profile-extra {
    display: none;
  }

  .experience {
    grid-column: 1;
    grid-row: 3;
    padding-top: 28px;
  }

  .page-one > .page-number {
    grid-column: 1;
    grid-row: 4;
  }
}

@media screen and (max-width: 850px) {
  .page-intro {
    padding-right: 0;
  }

  .research-motif {
    display: none;
  }
}

@media screen and (max-width: 700px) {
  .site-toolbar,
  .portfolio-toolbar {
    padding: 20px;
  }
}

@media screen and (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .site-brand {
    flex-basis: auto;
  }

  .site-toolbar > .site-brand,
  .site-toolbar nav a:not(.pdf-action) {
    transform: none;
  }

  .site-toolbar,
  .portfolio-toolbar {
    --toolbar-font-size: 13px;
    --toolbar-gap: 12px;
  }

  .site-toolbar .pdf-action {
    padding-inline: 8px;
  }

  .cv {
    width: 100%;
    margin: 0;
    gap: 16px;
  }

  .cv-page {
    box-shadow: none;
  }

  .page-one {
    padding-inline: 20px;
  }

  .identity {
    margin-top: 24px;
    margin-bottom: 20px;
    padding-bottom: 0;
    row-gap: 16px;
    border-bottom: 0;
  }

  .identity-copy {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: start;
    gap: 6px;
    text-align: left;
  }

  .identity .portrait-mobile {
    display: block;
    grid-column: 1;
    grid-row: 2;
    /* The name sets this track's width, not the image's intrinsic size. */
    contain: inline-size;
    width: calc(100% - 2px);
    margin: 10px 0;
  }

  .identity h1 {
    grid-column: 1;
    grid-row: 3;
    font-size: 30px;
    margin-top: 4px;
  }

  .identity .eyebrow,
  .identity .headline {
    grid-column: 1 / -1;
  }

  .identity .eyebrow {
    grid-row: 1;
    margin-bottom: 4px;
    font-size: 10px;
    line-height: 15px;
  }

  .identity .headline {
    grid-row: 4;
    /* Tighten only the name-to-experience gap; preserve photo spacing. */
    margin-top: -4px;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 20px;
  }

  .project-agent {
    padding: 18px;
  }

  .sidebar {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
    gap: 20px;
    font-size: 12.5px;
  }

  .sidebar > .portrait {
    display: none;
  }

  .profile-contact {
    grid-column: 1;
    grid-row: 1;
  }

  .sidebar-section h2 {
    margin-bottom: 8px;
  }

  .section-label {
    margin-bottom: 19px;
  }

  .company,
  .project h3,
  .project-title {
    font-size: 18px;
  }

  .job + .job {
    margin-top: 28px;
  }

  .job-title-line {
    gap: 4px 10px;
  }

  .company-name-full {
    display: none;
  }

  .company-name-short {
    display: inline;
    white-space: nowrap;
  }

  .job-title-line:has(.company-name-short) {
    grid-template-columns: max-content minmax(0, 1fr);
  }

  .page-two {
    padding: 28px 20px 22px;
  }

  .page-intro h2 {
    font-size: 25px;
  }
}

@media screen and (max-width: 640px) {
  .profile-extra {
    text-align: center;
  }

  .contact-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .contact-context {
    display: grid;
    gap: 4px;
  }

  .contact-links {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 8px 12px;
  }

  .sidebar .profile-languages {
    grid-row: 2;
    margin-top: 0;
  }

  .profile-details {
    grid-row: 3;
  }

  .profile-toggle {
    position: relative;
    justify-content: center;
    padding-inline: 26px;
    text-align: center;
  }

  .profile-toggle::after {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }

  .profile-languages h2 {
    margin-bottom: 12px;
  }

  .language-list > div {
    gap: 4px;
  }

  .language-list dt {
    font-size: 11.5px;
  }

}

@media screen and (max-width: 580px) {
  .tech-group,
  .tech-group + .tech-group {
    padding: 18px 14px;
    gap: 12px;
  }

  .tech-list li {
    font-size: 13px;
  }
}

@media screen and (min-width: 641px) and (max-width: 980px) {
  .portrait {
    align-self: start;
  }

  .profile-contact {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    padding-block: 4px;
  }

  .profile-contact > h2 {
    margin-bottom: 12px;
  }

  .contact-list {
    flex: 1;
    grid-template-columns: minmax(0, 1fr);
    align-content: space-between;
    row-gap: 12px;
  }

  .contact-context {
    display: grid;
    grid-column: 1 / -1;
    align-content: start;
    gap: 4px;
  }

  .contact-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 6px 24px;
  }
}

@media screen and (min-width: 361px) and (max-width: 374px) {
  .site-toolbar,
  .portfolio-toolbar {
    --toolbar-gap: 10px;
  }
}

@media screen and (max-width: 360px) {
  .site-toolbar,
  .portfolio-toolbar {
    --toolbar-font-size: 12px;
    --toolbar-gap: 8px;
    padding-inline: 12px;
  }

  .site-toolbar .pdf-action {
    padding-inline: 6px;
  }

  .identity h1 {
    font-size: 27px;
  }

  .sidebar {
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Follow the device live, without scripts or stored preferences. Screen-only
   colors keep native printing and the downloadable CV on the light palette. */
@media screen and (prefers-color-scheme: dark) {
  .site-toolbar,
  .portfolio-toolbar {
    --toolbar-link-color: #f0f5fa;
  }

  :root {
    color-scheme: dark;
    --paper: #131c27;
    --sidebar: #192635;
    --blue: #93adff;
    --teal: #77cedd;
    --ink: #f0f5fa;
    --text: #ced8e3;
    --muted: #9fb0c3;
  }

  body {
    background: #0b1118;
  }

  .cv-page {
    box-shadow: 0 12px 48px rgb(0 0 0 / 18%);
  }

  .identity,
  .profile-details {
    border-color: #33465b;
  }

  .project-agent {
    background: #152d35;
    border-color: #2d5c65;
  }

  .tech-group,
  .tech-group + .tech-group {
    background: #1a2938;
    border-color: #33465b;
  }

  .tech-list li {
    background: #243448;
    border-color: #3c5268;
    color: var(--text);
  }

  .skip-link {
    background: var(--sidebar);
  }

  /* Keep the PDF action black even though the heading ink is now light. */
  .site-toolbar .pdf-action {
    background: #0b1220;
    border-color: #657586;
  }

  .site-toolbar .pdf-action:hover,
  .site-toolbar .pdf-action:focus-visible {
    background: #182234;
    border-color: var(--blue);
    color: white;
  }

  .analytics-consent {
    border-color: #33465b;
    box-shadow: 0 -8px 30px rgb(0 0 0 / 28%);
  }

  .analytics-allow {
    color: var(--paper);
  }

  .analytics-actions button:hover {
    box-shadow: 0 0 0 2px rgb(119 206 221 / 25%);
  }
}

@page {
  size: A4 portrait;
  margin: 0;
}

.site-toolbar .toolbar-actions { display: flex; align-items: center; flex: 0 0 auto; gap: var(--toolbar-gap); margin-left: auto; }
.site-toolbar .pdf-action { margin-left: 0; }
.language-menu { display: block; position: relative; flex: 0 0 auto; }
.language-menu summary { display: flex; align-items: center; justify-content: center; gap: 4px; width: 42px; height: var(--toolbar-height); padding: 0 4px; color: var(--toolbar-link-color); cursor: pointer; list-style: none; border-radius: 5px; }
.language-menu summary:is(:hover, :focus-visible) { color: var(--blue); background: var(--sidebar); }
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.current-language-flag { font-size: 20px; line-height: 1; }
.language-caret { font-size: 12px; line-height: 1; }
.language-options { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 150px; padding: 5px; border: 1px solid var(--muted); border-radius: 8px; background: var(--paper); box-shadow: 0 8px 24px rgb(0 0 0 / 16%); }
.site-toolbar .language-options a, .portfolio-toolbar .language-options a { display: flex; justify-content: flex-start; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; color: var(--ink); font-size: 14px; text-decoration: none; border-radius: 4px; }
.language-options [aria-current="page"], .language-options a:hover { background: var(--sidebar); }
.site-toolbar .language-options a:is(:hover, :focus-visible), .portfolio-toolbar .language-options a:is(:hover, :focus-visible) { color: var(--blue); background: var(--sidebar); }
@media screen and (max-width: 640px) {
  .site-toolbar > .site-brand { display: none; }
}

@media print {
  html {
    scroll-behavior: auto;
  }

  /* Cyrillic prose uses a slightly wider text column; type sizes stay unchanged. */
  html[lang="ru"] body { line-height: 15px; }
  html[lang="ru"] .page-one {
    grid-template-columns: 162px minmax(0, 1fr);
    column-gap: 28px;
    padding-right: 28px;
  }
  html[lang="ru"] .sidebar { padding-left: 14px; padding-right: 14px; }
  html[lang="ru"] .job-domain { max-width: 112px; }
  html[lang="ru"] .job-title-line { column-gap: 8px; }
  html[lang="ru"] .job-role { text-transform: none; }
  html[lang="ru"] .page-two { padding-left: 32px; padding-right: 32px; }
  html[lang="ru"] .page-intro { padding-right: 130px; }
  html[lang="ru"] .tech-columns { min-height: 0; }
  html[lang="ru"] .tech-column { padding: 8px; }
  html[lang="ru"] .tech-list { line-height: 15px; }
  html[lang="ru"] .tech-group + .tech-group { margin-top: 10px; }
  html[lang="ru"] .project-agent .achievements li + li { margin-top: 1px; }
  html[lang="ru"] .projects-secondary .achievements li + li { margin-top: 2px; }

  body {
    background: white;
    font-size: 11px;
    line-height: 16px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .site-toolbar,
  .skip-link,
  .profile-toggle,
  .portrait-mobile,
  .name-alias {
    display: none !important;
  }

  .print-only {
    display: inline;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  /* Figma's 794 × 1123 canvas is translated to physical A4, not rasterized. */
  .cv {
    display: block;
    width: 210mm;
    max-width: none;
    margin: 0;
  }

  .cv-page {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none;
    break-after: page;
    break-inside: avoid;
  }

  .cv-page:last-child {
    break-after: auto;
  }

  .page-one {
    display: grid;
    grid-template-columns: 174px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 36px;
    padding: 0 36px 34px 0;
  }

  .identity {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 90px auto;
    gap: 8px 24px;
    margin: 30px 0 6px;
    padding: 0 0 8px;
    border-bottom: 1px solid #d8e0e8;
  }

  .identity-copy {
    display: flex;
    flex-direction: column;
    align-self: center;
    gap: 8px;
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
  }

  .identity .eyebrow {
    margin: 0;
    color: var(--blue);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.7px;
  }

  .identity h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 38px;
    letter-spacing: -0.8px;
    text-transform: uppercase;
  }

  .identity .headline {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
  }

  .identity .summary {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    padding-top: 2px;
    font-size: 12.5px;
    line-height: 18px;
    letter-spacing: 0.1px;
  }

  .portrait {
    width: 134px;
    aspect-ratio: 581 / 656;
    margin: 0 0 24px;
    border-radius: 3.154px;
  }

  .portrait .portrait-screen {
    display: none;
  }

  .portrait .portrait-print {
    display: block;
  }

  .portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1.4565px solid #c9dde2;
    border-radius: inherit;
    pointer-events: none;
  }

  .sidebar {
    display: block;
    position: absolute;
    inset: 0 auto 0 0;
    grid-column: auto;
    grid-row: auto;
    width: 174px;
    padding: 36px 20px;
    color: #263746;
    font-size: 9.2px;
    line-height: 14px;
  }

  .sidebar-section + .sidebar-section,
  .profile-details {
    margin-top: 22px;
  }

  .profile-extra {
    display: block;
  }

  .sidebar-section h2 {
    margin-bottom: 8px;
    color: var(--teal);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 14px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
  }

  .sidebar ul,
  .contact-list,
  .language-list {
    gap: 0;
  }

  .sidebar ul,
  .contact-list {
    row-gap: 2px;
  }

  .contact-list a {
    gap: 5px;
  }

  .contact-icon {
    width: 10px;
    height: 10px;
    flex-basis: 10px;
  }

  .language-list {
    display: block;
  }

  .language-list > div {
    display: flex;
    gap: 3px;
  }

  .language-list > div + div {
    margin-top: 2px;
  }

  .language-list dt::after {
    content: ":";
  }

  .language-list dd {
    color: inherit;
    text-align: left;
  }

  .experience {
    grid-column: 2;
    grid-row: 2;
    padding: 0;
  }

  .section-label,
  .page-intro h2,
  .project h3,
  .project-title {
    color: var(--blue);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 14px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
  }

  .experience > .section-label {
    margin-bottom: 4px;
  }

  .job,
  .project,
  .tech-group,
  .sidebar-section {
    break-inside: avoid;
  }

  .job + .job {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #d8e0e8;
  }

  .job-header {
    display: grid;
    row-gap: 3px;
    margin-bottom: 4px;
  }

  .job-title-line {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
  }

  .job-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 4px;
  }

  .company,
.job-role {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 18px;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .job-role::before {
    content: "— ";
  }

  .job-domain {
    font-size: 8.2px;
    font-weight: 500;
    line-height: 11px;
    letter-spacing: 0;
  }

  .job-meta,
  .project-meta,
  .project-links {
    margin: 0;
    color: var(--blue);
    font-family: "IBM Plex Mono", monospace;
    font-size: 8.8px;
    font-weight: 500;
    line-height: 13px;
    letter-spacing: 0.1px;
  }

  /* Source bullets wrap flush with the column rather than a hanging indent. */
  .achievements {
    padding: 0;
    list-style: none;
  }

  .achievements li {
    padding: 0;
  }

  .achievements li::before {
    content: "• ";
  }

  .job .achievements li + li {
    margin-top: 1.5px;
  }

  .page-one > .page-number,
  .page-two > .page-number {
    position: absolute;
    right: 44px;
    bottom: 14px;
    margin: 0;
    color: var(--blue);
    font-size: 9.5px;
    font-weight: 600;
    line-height: 14px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
  }

  .page-two {
    display: block;
    padding: 36px 40px 34px 42px;
  }

  .page-intro {
    margin-bottom: 10px;
    padding-right: 156px;
    overflow: hidden;
  }

  .page-intro p {
    margin-top: 8px;
    color: var(--text);
    font-size: 10.2px;
    line-height: 16px;
  }

  .portfolio-overview-link {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .research-motif {
    top: -4px;
  }

  .projects-featured {
    margin: 0 0 10px;
  }

  .project,
  .technologies {
    position: relative;
    padding: 6px 13px;
    border: 1px solid #d8e0e8;
    border-radius: 6px;
    background: white;
  }

  .project-agent {
    border-color: #b8e3e8;
    background: #f0fafb;
  }

  .project-agent .project-title {
    color: var(--blue);
  }

  .project header {
    margin-bottom: 4px;
  }

  .project-meta {
    margin-top: 4px;
  }

  .project-summary {
    margin-bottom: 2px;
  }

  .project-agent .achievements li + li {
    margin-top: 2px;
  }

  .project-links {
    gap: 2px 12px;
    margin-top: 6px;
  }

  .technologies .section-label {
    margin-bottom: 6px;
  }

  .tech-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    min-height: 228px;
  }

  .tech-column {
    padding: 10px;
    border-radius: 4px;
    background: rgb(240 250 251 / 42%);
  }

  .tech-group + .tech-group {
    margin-top: 16px;
  }

  .tech-group h3 {
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
  }

  .tech-list {
    font-size: 11px;
    line-height: 16px;
  }

  .tech-list li {
    display: inline;
  }

  .tech-list [data-print-prefix]::before {
    content: attr(data-print-prefix);
  }

  .tech-list li:not(.line-end)::after {
    content: " · ";
  }

  .tech-list li.line-end::after {
    content: "\A";
    white-space: pre;
  }

  .projects-secondary {
    margin-top: 10px;
  }

  .project + .project {
    margin-top: 10px;
  }

  .projects-secondary .achievements li + li {
    margin-top: 3px;
  }

}
