:root {
  --bg: #ffffff;
  --text-dark: #404040;
  --text-light: #8c8c8c;
  --gap: 16px;
  --header-height: 56px;
  --header-bg: #ffffff;
  --tile-overlay: rgba(64, 64, 64, 0.06);
  --logo-bg: #f6f6f6;
  --logo-filter: invert(1);
}

[data-theme="dark"] {
  --bg: #0e0f11;
  --text-dark: #f3f3f3;
  --text-light: #9aa0a6;
  --header-bg: #0e0f11;
  --tile-overlay: rgba(243, 243, 243, 0.08);
  --logo-bg: #151515;
  --logo-filter: none;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text-dark);
  font-family: "Relative", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  scroll-behavior: smooth;
  transition: background 200ms ease, color 200ms ease;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--header-height) var(--gap) var(--gap);
  min-height: 100vh;
}

header {
  align-items: center;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  letter-spacing: 0.72px;
  line-height: 24px;
  font-size: 24px;
  position: fixed;
  top: 0;
  background: var(--header-bg);
  z-index: 10;
  width: 100%;
  left: 0;
  right: 0;
  height: var(--header-height);
  padding: var(--gap);
}

.header-left {
  display: flex;
  align-items: center;
}

.site-title {
  font-size: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

.nav {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.header-right {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nav a {
  color: var(--text-dark);
  text-decoration: none;
  transition: color 160ms ease;
  font-size: inherit;
  line-height: inherit;
}

.nav a.light {
  color: var(--text-light);
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--text-dark);
}

.theme-toggle {
  border: 0;
  background: transparent;
  color: var(--text-dark);
  font: inherit;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 160ms ease;
}

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

.theme-toggle__dot {
  width: 80%;
  height: 80%;
  border-radius: 999px;
  background: var(--text-dark);
  transition: transform 200ms ease, background 200ms ease;
}

[data-theme="dark"] .theme-toggle__dot {
  background: var(--text-light);
  transform: scale(1);
}

.grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
}

.about {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.about__spacer {
  min-height: 1px;
}

.about__image {
  position: relative;
  width: 100%;
  min-height: 320px;
  background: #000;
  overflow: hidden;
}

.about__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.48px;
}

.about__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about__item-title {
  margin-bottom: 4px;
}

.about__contacts {
  color: var(--text-light);
}

.footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: 0.72px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--text-light);
}

.footer-right {
  display: flex;
  justify-content: flex-start;
}

.footer-link {
  color: var(--text-light);
  text-decoration: none;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--text-dark);
}

.tile {
  position: relative;
  width: 100%;
  aspect-ratio: 656 / 440;
  overflow: hidden;
  background: #000;
  transform: translateY(8px);
  opacity: 0;
  animation: tileReveal 520ms ease forwards;
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 320ms ease;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 220ms ease;
}

.tile:hover::after,
.tile:focus-within::after {
  background: var(--tile-overlay);
}

.tile:hover img,
.tile:focus-within img {
  transform: scale(1.015);
}

.tile--logo {
  background: var(--logo-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile--logo img {
  width: 70%;
  height: auto;
  position: static;
  inset: auto;
  object-fit: contain;
  filter: var(--logo-filter);
}

.tile:nth-child(1) { animation-delay: 40ms; }
.tile:nth-child(2) { animation-delay: 80ms; }
.tile:nth-child(3) { animation-delay: 120ms; }
.tile:nth-child(4) { animation-delay: 160ms; }
.tile:nth-child(5) { animation-delay: 200ms; }
.tile:nth-child(6) { animation-delay: 240ms; }
.tile:nth-child(7) { animation-delay: 280ms; }
.tile:nth-child(8) { animation-delay: 320ms; }

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

@media (max-width: 800px) {
  header {
    font-size: 20px;
    padding: 12px;
  }

  .page {
    padding: var(--header-height) 12px 12px;
  }

  .header-right {
    width: 100%;
    gap: 8px;
    justify-content: flex-end;
  }

  .nav {
    gap: 8px;
  }

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

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

  .footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
}
