@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./assets/fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light dark;
  --canvas: light-dark(#e8ebea, #181d20);
  --paper: light-dark(#f3f4f1, #22292c);
  --ink: light-dark(#253033, #edf0ef);
  --muted: light-dark(#505c5f, #b2bdbc);
  --rule: light-dark(#bcc7c4, #465254);
  --link: light-dark(#284863, #b1cde0);
  --link-hover: light-dark(#20405a, #d2e4ec);
  --interaction: light-dark(#dce6e9, #33444b);
  --award-paper: light-dark(#eee2cd, #3c3226);
  --award-ink: light-dark(#533619, #f2d6a6);
  --ball-leather: light-dark(#be6947, #e4a981);
  --ball-seam: #552f23;
  --rim: light-dark(#934f37, #e7a47c);
  --target: 2.75rem;
  --gutter: clamp(1rem, 5vw, 3.5rem);

  color: var(--ink);
  background: var(--canvas);
  font: 400 100%/1.58 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-padding-block-start: 4rem;
}

:root[data-theme="light"] { color-scheme: only light; }
:root[data-theme="dark"] { color-scheme: only dark; }

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, figure { margin: 0; }

::selection {
  color: var(--paper);
  background: var(--link);
}

a {
  color: var(--link);
  text-underline-offset: .24em;
}

:is(a, button):focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.page {
  width: min(calc(100% - 2 * var(--gutter)), 64rem);
  margin-inline: auto;
  padding-block: clamp(1.6rem, 5.5vw, 4.5rem) clamp(3rem, 8vw, 6rem);
}

.page > header {
  padding-block: .25rem 1rem;
}

.profile-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem 1.25rem;
}

.profile-heading > div { min-width: 0; }

.identity {
  display: flex;
  align-items: center;
  gap: .25rem;
}

h1 {
  font-size: clamp(2rem, 4.25vw, 3.65rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.timezone {
  margin-block-start: .65rem;
  color: var(--muted);
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
}

.theme-toggle {
  min-height: var(--target);
  padding: .25rem .375rem;
  border: 0;
  border-radius: .25rem;
  background: transparent;
  color: var(--muted);
  font: 550 .875rem/1.2 Inter, sans-serif;
  cursor: pointer;
}

.theme-toggle:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

.theme-toggle:is(:hover, :focus-visible) { color: var(--link-hover); }

.switch-track {
  display: inline-flex;
  flex: none;
  align-items: center;
  width: 2.25rem;
  height: 1.375rem;
  padding: .125rem;
  border: 1px solid currentColor;
  border-radius: 1rem;
}

.switch-track::after {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.theme-toggle[aria-checked="true"] .switch-track {
  justify-content: flex-end;
  color: var(--link);
}

.contacts, .contents {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .125rem clamp(.9rem, 2.6vw, 1.8rem);
}

.contacts { margin-block-start: .65rem; }

.contacts a, .contents a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  min-width: var(--target);
  font-size: .9375rem;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.contacts a { text-decoration-color: var(--rule); }

.contacts a:is(:hover, :focus-visible) {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

.contents {
  position: sticky;
  z-index: 2;
  inset-block-start: 0;
  min-height: 3.25rem;
  border-block: 1px solid var(--rule);
  background: var(--canvas);
}

.contents a { color: var(--ink); }

.contents a:not(:is(:hover, :focus-visible)) { text-decoration: none; }

.page:has(#experience:target) .contents a[href="#experience"],
.page:has(#hackathons:target) .contents a[href="#hackathons"] {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

#diplomas, #internship, section { scroll-margin-block-start: .75rem; }

section {
  margin-block-start: clamp(1.75rem, 4.5vw, 3.5rem);
}

h2 {
  margin-block-end: 1.2rem;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -.026em;
}

h3 {
  max-width: 40ch;
  font-size: clamp(1.15rem, 1.65vw, 1.55rem);
  line-height: 1.22;
  letter-spacing: -.028em;
  text-wrap: balance;
}

.meta {
  margin-block: .45rem .75rem;
  color: var(--muted);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}

.entry p:not(.meta) {
  max-width: 66ch;
  text-wrap: pretty;
}

.featured {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  align-items: start;
  gap: clamp(1rem, 3vw, 2.25rem);
  padding: clamp(1rem, 2.8vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: .85rem;
  background: var(--paper);
}

.featured h3 { max-width: 23ch; }

.award {
  display: inline-flex;
  align-items: center;
  min-height: 3.25rem;
  gap: .7rem;
  margin-block-start: 1.35rem;
  padding: 0 1.05rem 0 .55rem;
  border-radius: .45rem;
  color: var(--award-ink);
  background: var(--award-paper);
  font-size: 1.0625rem;
  letter-spacing: -.014em;
}

.award img {
  display: block;
  flex: none;
  width: 3.75rem;
  height: auto;
  margin-block: -.3rem;
  transform: rotate(-8deg);
}

.documents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(.65rem, 2vw, 1.2rem);
}

figure { min-width: 0; }

figure > a {
  display: block;
  width: fit-content;
  max-width: 100%;
  min-height: var(--target);
  cursor: zoom-in;
  border-radius: .2rem;
}

figure:has(> figcaption) {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: inherit;
}

figure:has(a:is(:hover, :focus-visible)) img { border-color: var(--link); }

figcaption a::after {
  position: absolute;
  inset: 0;
  content: "";
  cursor: zoom-in;
}

figcaption {
  margin-block-start: .4rem;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.4;
}

.event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--document-width, 11.5rem);
  align-items: start;
  gap: clamp(1rem, 3vw, 2rem);
  padding-block: 1.35rem;
  border-block-start: 1px solid var(--rule);
}

.featured + .event {
  margin-block-start: 1.3rem;
  border-block-start: 0;
}

.event img { max-height: 11rem; }

#internship { --document-width: 12.5rem; }
#internship figure { max-width: var(--document-width); }
#internship img { max-height: none; }

#internship figure span {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  font-size: .875rem;
  text-decoration: underline;
}

.shot {
  appearance: none;
  position: relative;
  flex: 0 0 var(--target);
  width: var(--target);
  height: var(--target);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.shot:is(:hover, :focus-visible) { background: var(--interaction); }

.ball {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 18px;
  height: 18px;
  overflow: hidden;
  border: 1px solid var(--ball-seam);
  border-radius: 50%;
  background: var(--ball-leather);
  transform: rotate(-25deg);
}

.ball::before, .ball::after {
  position: absolute;
  content: "";
}

.ball::before {
  inset: -15% 19%;
  border-inline: 1px solid var(--ball-seam);
  border-radius: 50%;
}

.ball::after {
  inset: 46% -8% auto;
  border-top: 1px solid var(--ball-seam);
}

.basket {
  position: absolute;
  left: -40px;
  top: calc(17.5px - var(--rise, 55px));
  width: 21px;
  height: 5px;
  border: 1.5px solid var(--rim);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.basket::after {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 11px;
  height: 8px;
  border: 1px solid var(--muted);
  border-top: 0;
  border-radius: 0 0 45% 45%;
  content: "";
}

.shot[data-playing] .basket { opacity: 1; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 53rem) {
  .featured { grid-template-columns: minmax(0, 1fr); }
  .featured h3 { max-width: 31ch; }
  .documents { max-width: 38rem; }
}

@media (max-width: 36rem) {
  .event { grid-template-columns: minmax(0, 1fr); }
  .event figure img { max-height: 12rem; }
}

@media (max-width: 23rem) {
  .contents { position: static; }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .award img, .documents img { transition: transform 220ms cubic-bezier(.2, .75, .3, 1); }
  .award:hover img { transform: translateY(-.2rem) rotate(0); }
  .documents figure:has(a:hover) img { transform: translateY(-2px); }
}
