@font-face {
  font-family: Inter;
  src: url("./fonts/Inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("./fonts/JetBrainsMono.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #101010;
  --text: #f5f5f5;
  --muted: #b6b6bd;
  --accent: #91bbf1;
  --line: #313136;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  font: 400 1rem/1.6 var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
}

h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.12; }
strong { color: var(--text); font-weight: 700; }

a {
  color: var(--accent);
  text-underline-offset: .24em;
  text-decoration-thickness: 1px;
  transition: color .15s ease;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.shell { width: min(900px, calc(100% - 64px)); margin-inline: auto; }

.skip-link {
  position: absolute;
  z-index: 1;
  padding: 8px 16px;
  background: var(--background);
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.site-header a { color: var(--text); text-decoration: none; }
.site-header a:hover { color: var(--accent); }
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.wordmark-portrait {
  --avatar-size: 48px;
  flex: 0 0 var(--avatar-size);
  width: var(--avatar-size);
  height: var(--avatar-size);
  overflow: hidden;
  border-radius: 50%;
}

.wordmark-portrait img {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(1.35);
  transform-origin: 60% 18%;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: .875rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
  gap: 48px;
  padding-block: 48px 56px;
  align-items: center;
}

.hero-copy { padding-bottom: 32px; }

.hero-name {
  --portrait-size: 112px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.hero-name h1 { min-width: 0; }

.profile-portrait {
  display: block;
  flex: 0 0 var(--portrait-size);
  width: var(--portrait-size);
  height: auto;
  border-radius: 8px;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.045em;
}

.role {
  max-width: 32ch;
  margin-top: 16px;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  line-height: 1.3;
  letter-spacing: -.025em;
}

.summary {
  max-width: 62ch;
  margin-top: 24px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  font-size: .875rem;
}

.profile-link { font-weight: 600; }

button { font: inherit; }

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease;
}

.action-button:is(:hover, :focus-visible) {
  color: #141414;
  border-color: transparent;
  background: linear-gradient(110deg, #90d9ff, #c3adff, #ffbad8, #ffe099, #9defd6) 0% 50% / 300% 100%;
  animation: button-gradient 2.8s ease-in-out infinite alternate;
}

@keyframes button-gradient {
  to { background-position: 100% 50%; }
}

.reel { scroll-margin-block-start: 16px; }

.reel-frame {
  display: grid;
  align-items: center;
  aspect-ratio: 1;
}

.reel video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  /* Blend slight compression shifts at the video edges into the page color. */
  mask-image:
    linear-gradient(to right, transparent, #000 3%, #000 97%, transparent),
    linear-gradient(to bottom, transparent, #000 3%, #000 97%, transparent);
  mask-composite: intersect;
  pointer-events: none;
}

.reel-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  padding-top: 16px;
  font-size: .875rem;
}

.reel-caption .action-button {
  width: 8.5rem;
  max-width: 100%;
  font-weight: 500;
}

.reel-caption .action-button:last-child:not(:hover, :focus-visible) {
  color: var(--accent);
  border-color: #607997;
}

.resume-section, .site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.25fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-block: 40px;
  scroll-margin-block-start: 16px;
}

h2 {
  font-size: clamp(1.25rem, 2.1vw, 1.625rem);
  font-weight: 500;
  letter-spacing: -.035em;
}

h3 { font-weight: 700; font-size: 1.125rem; letter-spacing: -.025em; }

.experience-summary p, .job-notes, dd { max-width: 70ch; color: var(--muted); }
.experience-summary p + p { margin-top: 12px; }
.experience-list { margin-top: 32px; }

.experience-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
}

.experience-item:last-child { padding-bottom: 0; }
.company-logo { display: block; width: 100%; height: auto; border-radius: 8px; }
.job-role { margin-top: 4px; font-weight: 500; }
.job-meta { margin-top: 4px; color: var(--muted); font: 500 .8125rem/1.55 var(--mono); }
.job-notes { margin: 8px 0 0; }
ul.job-notes { padding-inline-start: 20px; }
.job-notes li + li { margin-top: 4px; }

.resume-details { display: grid; gap: 24px; }
.resume-details div { display: grid; gap: 4px; }
dt { font-weight: 600; font-size: .9375rem; }
.site-footer { margin-bottom: 16px; align-items: baseline; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-links li { min-width: 0; max-width: 100%; }

.contact-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.contact-icon {
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
}

.contact-icon svg { width: 20px; height: 20px; }
.telegram-icon { background: #168fc4; }
.gmail-icon { background: #fff; }
.linkedin-icon { background: #0a66c2; }

@media screen {
  .role::after {
    content: "";
    display: block;
    width: 72px;
    height: 3px;
    margin-top: 20px;
    background: var(--accent);
  }
}

@media screen and (min-width: 960px) {
  .shell {
    --hero-width: min(1328px, calc(50% + 50vw - 32px));
    --hero-copy-width: 400px;
    --hero-gap: 32px;
    --reel-edge-inset: .12;
    --hero-rule-width: calc(var(--hero-width) - (var(--hero-width) - var(--hero-copy-width) - var(--hero-gap)) * var(--reel-edge-inset));
  }

  .site-header {
    /* Align the navigation with the cards inside the wider video frame. */
    width: var(--hero-rule-width);
  }

  .hero {
    width: var(--hero-width);
    grid-template-columns: var(--hero-copy-width) minmax(0, 1fr);
    gap: var(--hero-gap);
  }

  .reel-frame { aspect-ratio: 16 / 9; }

  .resume-section, .site-footer {
    position: relative;
    border-top-color: transparent;
  }

  .resume-section::before, .site-footer::before {
    content: "";
    position: absolute;
    top: -1px;
    inset-inline-start: 0;
    width: var(--hero-rule-width);
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 959px) {
  .hero-name { --portrait-size: 88px; gap: 16px; }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 48px); }
  .hero { gap: 24px; }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }

  .site-header {
    align-items: baseline;
    flex-direction: column;
    gap: 8px;
    padding-block: 16px;
  }

  .site-header nav { gap: 8px 16px; }
  .wordmark-portrait { --avatar-size: 40px; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-block: 32px 40px;
  }

  .hero-copy { padding-bottom: 0; }
  .hero-name { --portrait-size: 80px; }
  h1 { font-size: clamp(2rem, 9.5vw, 3rem); }

  .resume-section, .site-footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-block: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .action-button:is(:hover, :focus-visible) { animation: none; }
}

@page {
  size: A4;
  margin: 12mm 15mm;
}

@media print {
  :root {
    color-scheme: light;
    --background: #fff;
    --text: #1a1a1a;
    --muted: #3e3e45;
    --accent: #1e40af;
    --line: #d3d5da;
    font: 400 10.5pt/1.42 var(--sans);
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .site-header, .skip-link, .reel, .hero-actions, .contact-icon { display: none !important; }
  .shell { width: 100%; }
  .hero { display: block; padding-block: 0 16px; }
  .hero-copy {
    position: relative;
    min-height: 24mm;
    padding: 0 32mm 0 0;
  }

  .hero-name { display: block; }

  .profile-portrait {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    width: 24mm;
    margin: 0;
  }

  h1 { font-size: 30pt; letter-spacing: -.05em; }
  .role { max-width: none; margin-top: 4px; font-size: 14pt; }
  .summary { max-width: 75ch; margin-top: 8px; }

  .resume-section, .site-footer {
    display: block;
    padding-block: 12px;
  }

  h2 {
    margin-bottom: 8px;
    font-size: 13pt;
    letter-spacing: -.03em;
    break-after: avoid;
  }

  h3 { font-size: 10.5pt; break-after: avoid; }
  .experience-list, .resume-details { display: block; }
  .experience-summary p + p { margin-top: 4px; }
  .experience-summary p, .job-notes, dd { max-width: none; }
  .experience-list { margin-top: 12px; }
  .experience-item, .resume-details div, .site-footer { break-inside: avoid; }
  .experience-item { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding-block: 6px; }
  .company-logo { border-radius: 4px; }
  .job-role, .job-meta { margin-top: 0; }
  .job-meta { font: 400 9pt/1.35 var(--sans); }
  .job-notes { margin-top: 3px; }
  .job-notes li + li { margin-top: 0; }
  .resume-details div + div { margin-top: 8px; }
  .contact-links a { min-height: 0; font-size: 9pt; }

  .resume-details div {
    display: grid;
    grid-template-columns: 41mm minmax(0, 1fr);
    gap: 8px;
  }

  dt { font-size: 10pt; }
  p, dd { orphans: 2; widows: 2; }
}
