:root {
  --bg: #09090b;
  --bg-2: #101014;
  --surface: #141418;
  --surface-2: #1b1b21;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #e8b86d;
  --accent-2: #f5d7a1;
  --vk: #0077ff;
  --radius: 18px;
  --nav-h: 56px;
  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 1120px;
  --font: "Manrope", "Onest", system-ui, sans-serif;
  --display: "Onest", "Manrope", system-ui, sans-serif;
}

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

html {
  scroll-behavior: auto;
  scroll-padding-top: var(--nav-h);
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
}

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

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

button,
textarea {
  font: inherit;
  color: inherit;
}

code {
  font-size: 0.86em;
  color: var(--accent-2);
}

.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 80;
  background: transparent;
}

.progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 70;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 600;
}

.nav__mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.nav__name {
  font-size: 0.92rem;
}

.nav__links {
  display: none;
  gap: 1.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.nav__links a:hover,
.nav-drawer a:hover {
  color: var(--text);
}

.nav__burger {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  display: grid;
  gap: 6px;
  align-content: center;
  justify-items: center;
  cursor: pointer;
}

.nav__burger span {
  width: 18px;
  height: 1.5px;
  background: var(--text);
}

.nav-drawer {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 69;
  display: none;
  padding: 0.35rem 1rem 0.55rem;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-drawer:not([hidden]) {
  display: grid;
}

.nav-drawer[hidden] {
  display: none !important;
}

.nav-drawer a {
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero,
.section,
.footer {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.hero,
.section {
  scroll-margin-top: var(--nav-h);
}

.hero {
  width: min(1180px, calc(100% - 2rem));
  min-height: 0;
  display: grid;
  gap: 1.5rem;
  padding: clamp(2rem, 6vh, 4.5rem) 0 clamp(3rem, 8vh, 5.5rem);
  align-items: center;
}

.hero__copy {
  max-width: 38rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0;
}

h1 {
  font-size: clamp(1.85rem, 4.4vw, 3.15rem);
  line-height: 1.22;
  text-wrap: pretty;
  max-width: 18ch;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.lead,
.section__lead {
  color: var(--muted);
  max-width: 36rem;
}

.hero .lead {
  margin-top: 1rem;
  line-height: 1.5;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.1rem 0 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.94rem;
}

.btn--solid {
  background: var(--text);
  color: #111;
}

.btn--ghost {
  border-color: var(--line-strong);
  background: transparent;
}

.btn--vk {
  background: var(--vk);
  color: #fff;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.hero__stats dt {
  font-size: 1.4rem;
  font-weight: 700;
}

.hero__stats dd {
  margin: 0.15rem 0 0;
  color: var(--faint);
  font-size: 0.82rem;
}

.hero__photo {
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
  max-height: 78vh;
  width: 100%;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
}

.section {
  padding: clamp(3.25rem, 8vh, 5.5rem) 0;
}

.section--last {
  padding-bottom: clamp(3rem, 7vh, 5rem);
}

.section__head {
  margin-bottom: 1rem;
}

.section__lead {
  margin: 0.8rem 0 0;
}

.journal {
  display: grid;
  gap: 0.7rem;
  min-height: 0;
}

.year-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  min-height: 32px;
  padding: 0 0.8rem;
  cursor: pointer;
  font-size: 0.88rem;
}

.chip.is-on {
  background: var(--text);
  color: #111;
  border-color: var(--text);
}

.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.kpis article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.7rem 0.95rem;
}

.kpis strong {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.04em;
  line-height: 1;
}

.kpis span {
  color: var(--faint);
  font-size: 0.84rem;
}

.kpis em {
  font-style: normal;
  color: var(--accent);
}

.year-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.year-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.65rem 0.75rem 0.7rem;
  cursor: pointer;
  color: inherit;
}

.year-card.is-on {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--surface-2);
}

.year-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}

.year-card header span {
  color: var(--faint);
  font-size: 0.82rem;
}

.year-card__bar {
  height: 3px;
  background: #27272a;
  border-radius: 99px;
  margin: 0.45rem 0 0.5rem;
}

.year-card__bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.year-card__icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.year-card__icons img {
  width: 28px;
  height: 38px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
}

.games {
  display: grid;
  gap: 1rem;
  align-items: start;
  min-height: 0;
}

.games__canvas-wrap {
  position: relative;
  width: min(240px, 100%);
  margin: 0 auto;
  aspect-ratio: 1;
}

.games__canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.games__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.games__center strong {
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.games__center span {
  color: var(--faint);
  font-size: 0.8rem;
}

.games__legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.games__item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.55rem 0.7rem 0.55rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  height: auto;
}

.games__item.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--surface-2);
}

.games__item img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 9px;
}

.games__item h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.games__item p {
  margin: 0.15rem 0 0;
  color: var(--faint);
  font-size: 0.78rem;
}

.games__item > b {
  font-size: 1.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
  align-self: center;
}

.games__item-body {
  min-width: 0;
}

.games__system {
  margin: 0.12rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.games__excerpt {
  margin: 0 0 0.35rem;
  color: var(--faint);
  font-size: 0.75rem;
  line-height: 1.35;
}

.games__years {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.1rem;
}

.games__years li {
  color: var(--faint);
  font-size: 0.75rem;
}

.games__legend.is-detail {
  grid-template-columns: 1fr;
  overflow: auto;
}

.game-detail {
  list-style: none;
}

.game-detail__back {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 0 0.65rem;
  cursor: pointer;
  font-size: 0.86rem;
}

.game-detail__back:hover {
  color: var(--text);
}

.game-detail__card {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.game-detail__card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
}

.game-detail__body h3 {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
}

.game-detail__note {
  margin: 0 0 0.7rem;
  color: var(--muted);
}

.games__years--lg li {
  font-size: 0.88rem;
  color: var(--muted);
}

.game-detail__total {
  margin: 0.8rem 0 0;
  color: var(--faint);
}

.game-detail__total b {
  font-size: 1.5rem;
  margin-right: 0.3rem;
  color: var(--text);
}

.games__bar {
  display: none;
}

.games__note {
  margin-top: 0.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.games__note img {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.games__note p {
  margin: 0.25rem 0 0;
}

.games__note[hidden] {
  display: none;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.gallery a {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  aspect-ratio: 1;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery a:hover img {
  transform: scale(1.04);
}

.gallery__tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
}

.projects {
  display: grid;
  gap: 1.1rem;
}

.project {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.project:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.project__shots {
  display: flex;
  flex: 0 0 auto;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.project__shots::-webkit-scrollbar {
  display: none;
}

.project__shots img {
  min-width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  scroll-snap-align: start;
}

.project__body {
  flex: 0 0 auto;
  overflow: visible;
  padding: 0.75rem 0.95rem 0.9rem;
}

.project__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.project__tags span {
  font-size: 0.72rem;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.project h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.project p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.project__dots {
  display: flex;
  gap: 0.35rem;
  margin: 0.6rem 0 0;
}

.project__dots button {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  border: 0;
  background: #3f3f46;
  padding: 0;
}

.project__dots button.is-on {
  background: var(--accent);
  width: 16px;
}

.review-box {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.2rem;
  background: var(--surface);
  margin-bottom: 1.4rem;
}

.review-box__auth p,
.hint,
.contacts__note {
  color: var(--muted);
}

.review-form__user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.review-form__user img,
.review-card img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field span {
  font-size: 0.82rem;
  color: var(--faint);
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0.8rem;
}

.review-form__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
}

.reviews {
  display: grid;
  gap: 0.8rem;
}

.review-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  background: var(--bg-2);
}

.review-card header {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

.review-card a {
  font-weight: 600;
}

.review-card time {
  display: block;
  color: var(--faint);
  font-size: 0.75rem;
}

.review-card p {
  margin: 0;
  color: #d4d4d8;
}

.contacts {
  display: grid;
  gap: 0.7rem;
  align-content: start;
  align-items: start;
}

.contact {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  height: auto;
  align-self: start;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
}

.contact span {
  color: var(--faint);
  font-size: 0.82rem;
}

.contact--btn {
  width: 100%;
  cursor: pointer;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  justify-content: space-between;
  padding: 2rem 0 3rem;
  color: var(--faint);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 800px) {
  .nav__links {
    display: flex;
  }

  .nav__burger,
  .nav-drawer,
  .nav-drawer:not([hidden]) {
    display: none !important;
  }

  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 320px);
    gap: 2.5rem;
    padding: 2rem 0 3rem;
    align-items: center;
  }

  .hero__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.5rem 0;
  }

  .kpis {
    grid-template-columns: 1fr 1fr;
  }

  .year-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .games {
    grid-template-columns: minmax(180px, 240px) 1fr;
    align-items: start;
  }

  .games__legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .projects {
    grid-template-columns: 1fr 1fr;
  }

  .contacts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 800px) and (orientation: portrait) {
  .hero,
  .section,
  #games,
  #props,
  #projects,
  #contacts {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    scroll-snap-align: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
    gap: 1.75rem;
    padding: 2rem 0 2.75rem;
    align-items: start;
  }

  .hero__photo {
    max-height: 38vh;
    width: 100%;
    aspect-ratio: 3 / 4;
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .section {
    padding: 3rem 0;
  }

  .gallery,
  .projects,
  .journal,
  .contacts {
    flex: none;
  }
}

@media (min-width: 1100px) and (orientation: landscape) {
  html {
    scroll-snap-type: y proximity;
  }

  .hero,
  .section {
    box-sizing: border-box;
    width: min(var(--max), calc(100% - 2rem));
    height: calc(100svh - var(--nav-h));
    max-height: calc(100svh - var(--nav-h));
    min-height: calc(100svh - var(--nav-h));
    padding: 1.15rem 0 1.35rem;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    display: flex;
    flex-direction: column;
  }

  .hero {
    width: min(1180px, calc(100% - 2rem));
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 340px);
    align-items: center;
    gap: 3.5rem;
  }

  .hero__photo {
    aspect-ratio: 3 / 4;
    width: 100%;
    height: auto;
    max-height: min(68vh, 540px);
    justify-self: end;
    align-self: center;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 3.4vw, 2.85rem);
    line-height: 1.22;
    max-width: 18ch;
    text-wrap: pretty;
  }

  h2 {
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  }

  .section__lead {
    display: none;
  }

  .section__head {
    flex: 0 0 auto;
    margin-bottom: 0.85rem;
  }

  .journal,
  .gallery,
  .projects,
  .contacts {
    flex: 1;
    min-height: 0;
  }

  .journal {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 0.65rem;
  }

  .games {
    min-height: 0;
    height: 100%;
    align-items: stretch;
  }

  .games__legend {
    max-height: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    overflow: auto;
  }

  .games__note {
    display: none;
  }

  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    align-content: stretch;
    overflow: hidden;
  }

  .gallery a {
    aspect-ratio: auto;
    height: 100%;
    min-height: 0;
  }

  .projects {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(0, 1fr);
    align-content: stretch;
    overflow: hidden;
    gap: 0.85rem;
  }

  .project {
    height: 100%;
    min-height: 0;
  }

  .project__shots {
    flex: 1 1 auto;
    min-height: 0;
  }

  .project__shots img {
    aspect-ratio: auto;
    height: 100%;
    max-height: none;
    object-fit: cover;
  }

  .project__body {
    flex: 0 0 auto;
  }

  .project p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #contacts {
    justify-content: center;
    height: calc(100svh - var(--nav-h) - 3.25rem);
    max-height: calc(100svh - var(--nav-h) - 3.25rem);
    min-height: calc(100svh - var(--nav-h) - 3.25rem);
  }

  .contacts {
    flex: 0 0 auto;
    align-content: start;
    align-items: start;
  }

  .contact {
    height: auto;
    min-height: 0;
  }

  .contacts__note {
    margin-top: 1rem;
  }

  .footer {
    display: flex;
    scroll-snap-align: none;
    padding: 0.9rem 0 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
