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

html {
  background: #0b0b0c;
  color: #f4f4f2;
  font-family: "Inter Tight", sans-serif;
}

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

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

.top {
  display: flex;
  justify-content: space-between;
  padding: 18px 20px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.top span {
  opacity: 0.55;
}

.home {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  height: calc(100svh - 58px);
  padding: 0 20px 20px;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #1a1a1c;
  transition: scale 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card:hover {
  scale: 1.012;
}

.card:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.card span {
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.hero {
  position: relative;
  height: calc(100svh - 78px);
  margin: 0 20px;
  overflow: hidden;
  border-radius: 16px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 50% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.42));
}

.hero h1 {
  position: absolute;
  z-index: 1;
  left: 22px;
  bottom: 6px;
  padding-bottom: 0.1em;
  font-size: clamp(72px, 16vw, 300px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.04em;
  view-transition-name: title;
}

.back {
  position: absolute;
  z-index: 1;
  top: 18px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px);
  font-size: 21px;
}

.about {
  max-width: 22em;
  padding: 110px 42px 140px;
  font-size: clamp(28px, 4vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

@view-transition {
  navigation: auto;
}

.card,
.hero {
  view-transition-class: film;
}

::view-transition-group(.film) {
  animation-duration: 0.9s;
  animation-timing-function: cubic-bezier(0.7, 0, 0.2, 1);
  overflow: hidden;
  border-radius: 16px;
}

::view-transition-old(.film),
::view-transition-new(.film) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

::view-transition-new(.film) {
  animation: none;
}

::view-transition-old(.film) {
  animation: fade-out 0.1s linear 0.35s both;
}

::view-transition-old(.film):only-child {
  animation: fade-out 0.25s ease both;
}

::view-transition-new(.film):only-child {
  animation: fade-in 0.3s ease 0.6s both;
}

:root:has(.home)::view-transition-old(.film) {
  z-index: 1;
  animation: fade-out 0.2s ease 0.7s both;
}

::view-transition-group(title) {
  overflow: clip;
}

::view-transition-new(title) {
  animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.45s both;
}

@keyframes fade-out {
  to { opacity: 0; }
}

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

@keyframes rise {
  from { transform: translateY(105%); }
}

@media (max-width: 700px) {
  .home {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }

  .card,
  .card:first-child {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 16 / 10;
  }

  .hero {
    height: 72svh;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
