:root {
  color-scheme: light;
  --ink: #363636;
  --muted-ink: rgba(54, 54, 54, 0.58);
  --body-copy: rgba(54, 54, 54, 0.7);
  --project-ink: #212121;
  --line: #e6e6e7;
  --paper: #ffffff;
  --soft: #f2f2f1;
  --surface: #ffffff;
  --surface-hover: #fafafa;
  --media-surface: #f2f1ed;
  --hover-line: #d4d4d4;
  --quiet-ink: rgba(54, 54, 54, 0.52);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --spring: cubic-bezier(0.2, 1.5, 0.4, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Instrument Serif", Georgia, serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
.project-video:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.site-shell {
  width: min(560px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 96px 0 112px;
}

.profile {
  width: 100%;
}

.portrait-wrap {
  width: 126px;
  height: 126px;
  margin-left: -3px;
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 54%, rgba(0, 0, 0, 0.9) 61%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000 54%, rgba(0, 0, 0, 0.9) 61%, transparent 72%);
}

.intro {
  margin-top: 25px;
}

.bio h1,
.bio p,
.project h2,
.empty-state {
  margin: 0;
  font-weight: 400;
}

.bio h1 {
  font-size: 1.125rem;
  line-height: 1.12;
  letter-spacing: 0.02em;
}

.bio p {
  margin-top: 8px;
  color: var(--body-copy);
  font-size: 1.125rem;
  line-height: 1.12;
  letter-spacing: 0.03em;
}

.contact-menu {
  position: relative;
  z-index: 3;
  width: 230px;
  height: 38px;
  margin-top: 24px;
}

.goo-defs {
  position: absolute;
  pointer-events: none;
}

.goo-surface {
  position: absolute;
  inset: 0;
  filter: url("#goo");
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.contact-menu[data-open="true"] .goo-surface {
  opacity: 1;
}

.contact-blob,
.social-blob {
  position: absolute;
  background: var(--soft);
}

.contact-blob {
  top: 4px;
  left: 4px;
  width: 70px;
  height: 30px;
  border-radius: 10px;
}

.social-blob {
  top: 4px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  transform: translate(21px, 0) scale(0.25);
  transition: transform 560ms var(--spring);
}

.contact-menu[data-open="true"] .social-blob--telegram {
  transform: translate(0, 48px) scale(1);
}

.contact-menu[data-open="true"] .social-blob--x {
  transform: translate(48px, 48px) scale(1);
  transition-delay: 35ms;
}

.contact-menu[data-open="true"] .social-blob--linkedin {
  transform: translate(96px, 48px) scale(1);
  transition-delay: 70ms;
}

.contact-trigger {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 2;
  min-width: 78px;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 150ms var(--ease-out), border-color 150ms ease, background 150ms ease;
  appearance: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.contact-trigger:hover {
  border-color: var(--hover-line);
  background: var(--surface-hover);
}

.contact-trigger[aria-expanded="true"] {
  background: var(--surface);
  box-shadow: none;
}

.social-links {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.social-link {
  position: absolute;
  top: 1px;
  left: 1px;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
  color: var(--ink);
  opacity: 0;
  transform: translateX(22px) scale(0.35);
  transition: transform 560ms var(--spring), opacity 160ms ease, border-color 150ms ease, background 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.social-link img {
  display: block;
  width: 16px;
  height: 16px;
}

.contact-menu[data-open="true"] .social-links {
  pointer-events: auto;
}

.contact-menu[data-open="true"] .social-link {
  opacity: 1;
}

.contact-menu[data-open="true"] .social-link--telegram {
  transform: translate(0, 48px) scale(1);
}

.contact-menu[data-open="true"] .social-link--x {
  transform: translate(48px, 48px) scale(1);
  transition-delay: 35ms;
}

.contact-menu[data-open="true"] .social-link--linkedin {
  transform: translate(96px, 48px) scale(1);
  transition-delay: 70ms;
}

.social-link:hover {
  color: var(--ink);
  border-color: var(--hover-line);
  background: var(--surface-hover);
}

.work {
  margin-top: 116px;
}

.tabs {
  display: flex;
  gap: 52px;
  align-items: center;
}

.tab {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-ink);
  font-size: 1.125rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 180ms ease, opacity 180ms ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  color: var(--ink);
}

.tab-panel {
  min-height: 460px;
  margin-top: 36px;
  opacity: 0;
  transform: translateY(7px);
}

.tab-panel.is-visible {
  animation: reveal-panel 420ms var(--ease-out) forwards;
}

.project-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 16px;
  background: var(--media-surface);
}

.project-media--portrait {
  aspect-ratio: 9 / 16;
}

.project-media--mac {
  aspect-ratio: 2036 / 2160;
}

.project-media--outlined::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid oklch(0 0 0 / 0.08);
  border-radius: inherit;
  pointer-events: none;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.project-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project h2 {
  margin-top: 16px;
  color: var(--project-ink);
  font-size: 1rem;
  line-height: 1.3;
}

.project-info {
  margin-top: 16px;
}

.project-title-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.project-title-row h2 {
  margin-top: 0;
}

.project-app-icon {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.download-link {
  display: block;
  width: max-content;
  margin: 0;
  justify-self: end;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 120ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .download-link:hover {
    color: var(--quiet-ink);
  }
}

.download-link:active {
  color: var(--ink);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 72px;
}

.footer-stamp-wrap {
  position: relative;
  width: 112px;
  height: 112px;
}

.footer-stamp-wrap::before,
.footer-stamp-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./assets/footer-stamp.png") center / contain no-repeat;
  opacity: 0;
  pointer-events: none;
  transform-origin: center;
}

.footer-stamp {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateY(-32px) scale(2.6);
  transform-origin: center;
  will-change: transform, opacity;
}

.footer-stamp-wrap.is-stamped .footer-stamp {
  animation: stamp-in 620ms var(--ease-out) both;
}

.footer-stamp-wrap.is-stamped::before {
  animation: stamp-ghost-a 420ms var(--ease-out) both;
}

.footer-stamp-wrap.is-stamped::after {
  animation: stamp-ghost-b 480ms var(--ease-out) both;
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    transform: translateY(-32px) scale(2.6);
  }

  38% {
    opacity: 1;
    transform: translateY(3px) scale(0.88);
  }

  64% {
    opacity: 1;
    transform: translateY(-2px) scale(1.06);
  }

  82% {
    opacity: 1;
    transform: translateY(1px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stamp-ghost-a {
  0% {
    opacity: 0;
    transform: translateY(-42px) scale(3.1);
  }

  18% {
    opacity: 0.16;
  }

  58% {
    opacity: 0;
    transform: translateY(2px) scale(1.12);
  }

  100% {
    opacity: 0;
    transform: translateY(0) scale(1);
  }
}

@keyframes stamp-ghost-b {
  0% {
    opacity: 0;
    transform: translateY(-24px) scale(2.45);
  }

  24% {
    opacity: 0.12;
  }

  66% {
    opacity: 0;
    transform: translateY(1px) scale(1.05);
  }

  100% {
    opacity: 0;
    transform: translateY(0) scale(1);
  }
}

@keyframes stamp-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes reveal-panel {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .site-shell {
    width: min(432px, calc(100vw - 32px));
    padding-top: 48px;
    padding-bottom: 72px;
  }

  .portrait-wrap {
    width: 112px;
    height: 112px;
  }

  .work {
    margin-top: 88px;
  }

  .tab-panel {
    min-height: calc(100vw - 32px);
  }

  .projects-list {
    gap: 40px;
  }

  .site-footer {
    margin-top: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body {
    transition: background-color 160ms ease, color 160ms ease;
  }

  .footer-stamp-wrap::before,
  .footer-stamp-wrap::after {
    display: none;
  }

  .footer-stamp {
    transform: none;
  }

  .footer-stamp-wrap.is-stamped .footer-stamp {
    animation-name: stamp-fade;
    animation-duration: 160ms !important;
    animation-timing-function: ease !important;
  }

}
