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

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

@font-face {
  font-family: "Onest";
  src: url("assets/images/onest-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #ffffff;
  --text: #000000;
  --muted: #8794aa;
  --surface: #f4f4f4;
  --border: #d9dee4;
  --shadow: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #ffffff;
}

html[data-theme="dark"] {
  background: #151719;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

html.is-restoring-home-scroll body {
  opacity: 0;
  visibility: hidden;
  transition: none;
}

html.is-restoring-home-scroll .page {
  animation: none;
}

body.page-leaving {
  opacity: 0;
  pointer-events: none;
}

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

button {
  border: 0;
}

a {
  text-underline-position: from-font;
}

p,
h2,
h3,
ul {
  margin: 0;
}

.page {
  --page-padding: clamp(20px, calc((100vw - 992px) / 2), 60px);
  width: 100%;
  min-height: 100vh;
  padding: 60px var(--page-padding);
  position: relative;
  animation: page-enter 240ms ease both;
}

.content {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.header,
.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 600px minmax(0, 1fr);
}

.header {
  height: 236px;
  align-items: start;
}

.portrait-row {
  align-self: stretch;
  display: flex;
  align-items: center;
}

.portrait-switcher {
  display: block;
  width: 137px;
  height: 236px;
  flex: 0 0 137px;
  padding: 0;
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  transition: transform 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

.portrait-switcher:active {
  transform: scale(0.94);
}

.portrait-switcher:focus-visible {
  outline: 2px solid #5d8ef7;
  outline-offset: 2px;
}

.portrait {
  display: block;
  width: 137px;
  height: 236px;
  border-radius: 20px;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.about {
  width: 600px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.5px;
  word-break: break-word;
}

.muted,
.section-title {
  color: var(--muted);
}

.links {
  display: flex;
  gap: 20px;
  white-space: nowrap;
}

.desktop-options {
  position: absolute;
  top: 60px;
  right: var(--page-padding);
  width: 100px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 20px;
}

.mobile-options {
  display: none;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 120ms ease, background-color 180ms ease;
}

.icon-button:active,
.case-link:active {
  transform: scale(0.94);
}

.icon-button:focus-visible,
.case-link:focus-visible,
.segment:focus-visible,
a:focus-visible {
  outline: 2px solid #5d8ef7;
  outline-offset: 2px;
}

.icon-button img {
  width: 24px;
  height: 24px;
  display: block;
}

.theme-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
}

.theme-icon__glyph {
  position: absolute;
  inset: 0;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: center;
}

.theme-icon__moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-icon__sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.55);
}

.lang-toggle {
  font-size: 14px;
  line-height: 16px;
  letter-spacing: 0.1px;
}

.section-title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.cases-title {
  padding-top: 84px;
}

@media (min-width: 1032px) {
  .header + .cases-section {
    margin-top: -60px;
  }
}

.cases-column {
  width: 600px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.tab-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel.is-active {
  animation: tab-panel-enter 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes tab-panel-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.segmented {
  position: relative;
  width: 100%;
  height: 52px;
  padding: 4px;
  border-radius: 16px;
  background: var(--surface);
  display: flex;
}

.segmented::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: var(--segment-left, 4px);
  width: var(--segment-width, calc(50% - 6px));
  border-radius: 12px;
  background: var(--background);
  box-shadow: 0 6px 12px var(--shadow);
  pointer-events: none;
  transition: left 280ms cubic-bezier(0.22, 1, 0.36, 1), width 280ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms ease, box-shadow 180ms ease;
}

.segment {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 44px;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 16px;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.segment.active {
  background: transparent;
  box-shadow: none;
}

.segment:disabled {
  color: var(--muted);
  cursor: default;
}

.case-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.case-card--short,
.case-card--short-mobile-tall {
  height: 544px;
}

.case-card--tall {
  height: 568px;
}

.personal-card {
  height: auto;
}

.personal-card strong {
  font-weight: 500;
}

.personal-placeholder {
  background: #dedede;
}

body.dark .personal-placeholder {
  background: #303235;
}

.personal-image {
  display: block;
  object-fit: cover;
}

.case-heading {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.case-heading h3 {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.5px;
  font-weight: 400;
  word-break: break-word;
}

.case-link {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 120ms ease, background-color 180ms ease;
}

.case-link img {
  width: 24px;
  height: 24px;
  display: block;
}

.case-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  flex: 0 0 auto;
  border-radius: 20px;
  background: var(--surface);
  transition: background-color 180ms ease;
}

.case-preview--video-shell {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  clip-path: inset(0 round 20px);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.case-preview--round.case-preview--video-shell {
  clip-path: inset(0 round 20px);
}

.case-video {
  position: absolute;
  inset: -1px;
  display: block;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  border: 0;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}

.case-preview--round {
  border-radius: 20px;
}

.pet-section {
  height: 72px;
}

.pet-section[hidden],
.career-section[hidden] {
  display: none;
}

.project-card {
  width: 600px;
  height: 72px;
  display: flex;
  gap: 8px;
  text-decoration: none;
}

.project-icon,
.company-icon {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

.project-icon {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  overflow: hidden;
}

.project-icon img {
  width: 48px;
  height: 48px;
  display: block;
}

.project-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.5px;
}

.project-title {
  height: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  height: 20px;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--surface);
  font-family: "Onest", sans-serif;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.2px;
}

.career-section {
  height: auto;
}

.career-list {
  width: 600px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.job {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.job-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.job-heading {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.5px;
}

.job-title {
  height: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.job-title i {
  display: block;
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  border-radius: 50%;
  background: var(--text);
}

.job-block {
  width: 100%;
  padding-left: 56px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.5px;
  word-break: break-word;
}

.job-block h3 {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  font-weight: 500;
}

.job-points {
  width: 100%;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.job-points li {
  position: relative;
  padding-left: 12px;
}

.job-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text);
}

.contacts {
  width: 600px;
  height: 48px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -1px;
}

body.dark,
html[data-theme="dark"] body {
  color-scheme: dark;
  --background: #151719;
  --text: #f4f5f6;
  --muted: #929fb2;
  --surface: #25282b;
  --border: #3a3f45;
  --shadow: rgba(0, 0, 0, 0.3);
}

body.dark .theme-toggle img,
body.dark .case-link img,
html[data-theme="dark"] .theme-toggle img,
html[data-theme="dark"] .case-link img {
  filter: invert(1);
}

body.dark .theme-icon__moon,
html[data-theme="dark"] .theme-icon__moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.55);
}

body.dark .theme-icon__sun,
html[data-theme="dark"] .theme-icon__sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

body.dark .project-icon,
html[data-theme="dark"] .project-icon {
  background: #ffffff;
  border-color: #d9dee4;
}

@media (max-width: 1031px) {
  .page {
    --page-padding: 20px;
    min-width: 320px;
    padding: 20px;
    display: block;
  }

  .content {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    gap: 60px;
  }

  .desktop-options {
    display: none;
  }

  .header,
  .section {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .header {
    height: auto;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
  }

  .portrait-row {
    width: 100%;
    height: 236px;
    align-items: flex-start;
    gap: 10px;
  }

  .portrait-switcher {
    flex: 0 0 137px;
  }

  .mobile-options {
    flex: 1;
    min-width: 0;
    height: 40px;
    display: flex;
    justify-content: flex-end;
    gap: 20px;
  }

  .about {
    width: 100%;
    height: auto;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.5px;
  }

  .section-title {
    font-size: 14px;
    line-height: 20px;
  }

  .cases-section {
    height: auto;
  }

  .cases-title {
    display: none;
  }

  .cases-column {
    width: 100%;
  }

  .segment {
    line-height: 20px;
  }

  .case-card--short {
    height: auto;
  }

  .case-card--tall,
  .case-card--short-mobile-tall {
    height: auto;
  }

  .case-heading {
    gap: 12px;
  }

  .case-heading h3 {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.5px;
  }

  .case-link {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    padding: 8px;
  }

  .case-preview--round {
    border-radius: 20px;
  }

  .case-preview--round.case-preview--video-shell {
    clip-path: inset(0 round 20px);
  }

  .pet-section {
    height: auto;
    gap: 20px;
  }

  .project-card {
    width: 100%;
    height: auto;
  }

  .project-copy {
    font-size: 14px;
    line-height: 20px;
  }

  .project-title {
    height: 20px;
  }

  .career-section {
    height: auto;
    gap: 20px;
  }

  .career-list {
    width: 100%;
    height: auto;
    gap: 20px;
  }

  .job {
    gap: 16px;
  }

  .job--genotek {
    height: auto;
  }

  .job--yourgoods {
    height: auto;
  }

  .job-heading {
    font-size: 14px;
    line-height: 20px;
  }

  .job-title {
    height: 20px;
  }

  .job-block {
    padding-left: 56px;
    font-size: 14px;
    line-height: 20px;
  }

  .job-points li::before {
    top: 8px;
  }

  .contacts {
    height: 48px;
    width: 100%;
    margin: 0;
    padding-left: 0;
    font-size: 16px;
    line-height: 24px;
  }
}

@media (min-width: 1441px) {
  .page {
    max-width: 1440px;
    margin: 0 auto;
  }
}

@keyframes page-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  .page {
    animation: none;
  }

  .tab-panel.is-active {
    animation: none;
  }

  .segmented::after {
    transition: none;
  }
}
