:root {
  --bg: #050505;
  --text: #f5f1e8;
  --muted: rgba(245, 241, 232, 0.58);
  --shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

body { overflow: hidden; }
button, video { font: inherit; }

.preloader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #000;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; }
.preloader__logo-image {
  width: min(32vw, 320px);
  max-width: 80vw;
  height: auto;
  opacity: 0.92;
  transform: translateY(10px);
  animation: rise 1.2s ease forwards;
}

.app { position: relative; min-height: 100svh; }

.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 24px;
  padding: 24px 28px;
}

.brand__logo,
.topbar__meta,
.socials { mix-blend-mode: screen; }
.brand__logo { width: 84px; height: auto; display: block; opacity: 0.92; justify-self: start; }
.topbar__meta {
  display: flex;
  justify-self: end;
  gap: 18px;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.socials {
  justify-self: end;
  display: inline-flex;
  gap: 10px;
}

.social {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  backdrop-filter: blur(16px);
}

.social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.18);
}

.tabs--bottom {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 40;
}

.reels__footer {
  bottom: 88px;
}

.tabs,
.tab,
.nav,
.play-button,
.reels__nav,
.reel-card__play { pointer-events: auto; }

.tabs {
  justify-self: center;
  align-self: start;
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(16px);
}
.tab {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.54);
  padding: 10px 18px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.tab.is-active { background: rgba(255,255,255,0.1); color: #fff; }

.view { display: none; }
.view.is-active { display: block; }

.hero {
  position: relative;
  min-height: 100svh;
  width: 100%;
  overflow: hidden;
}
.hero__media-wrap { position: absolute; inset: 0; background: #000; }
.hero__poster,
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__poster {
  filter: saturate(0.92) contrast(1.02) brightness(0.74);
  transform: scale(1.02);
  transition: opacity 0.5s ease, transform 0.8s ease;
}
.hero__video { opacity: 0; pointer-events: none; }
.hero--playing .hero__video { opacity: 1; pointer-events: auto; }
.hero--playing .hero__poster,
.hero--playing .hero__overlay,
.hero--playing .play-button { opacity: 0; pointer-events: none; }
.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.44) 0%, rgba(0,0,0,0.16) 28%, rgba(0,0,0,0.12) 48%, rgba(0,0,0,0.58) 100%),
    radial-gradient(circle at center, rgba(255,255,255,0.04), transparent 42%);
  transition: opacity 0.5s ease;
}
.hero__content {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 28px 28px;
}
.hero__eyebrow,
.hero__meta {
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.hero__eyebrow { color: rgba(255,255,255,0.72); }
.hero__title {
  margin: 0;
  max-width: 9ch;
  font-size: clamp(3.4rem, 9vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
  font-weight: 600;
  text-transform: uppercase;
}
.hero__bottom { display: flex; gap: 16px; align-items: center; }
.hero__meta { margin: 0; color: var(--muted); }

.play-button {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 5;
  width: clamp(82px, 10vw, 132px);
  height: clamp(82px, 10vw, 132px);
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(18px);
  transform: translate(-50%, -50%);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, background 0.3s ease, opacity 0.5s ease;
}
.play-button:hover { transform: translate(-50%, -50%) scale(1.06); background: rgba(255,255,255,0.08); }
.play-button__icon {
  display: inline-block;
  margin-left: 6px;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 22px solid var(--text);
}

.nav {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.82);
  font-size: 3.2rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 0.25s ease, color 0.25s ease;
}
.nav:hover { transform: translateY(-50%) scale(1.08); color: #fff; }
.nav--prev { left: 22px; }
.nav--next { right: 22px; }
.hero.is-transitioning .hero__poster,
.hero.is-transitioning .hero__content { opacity: 0.32; transform: scale(1.01); }

.reels {
  position: relative;
  min-height: 100svh;
  padding: 108px 28px 24px;
}
.reels__viewport {
  min-height: calc(100svh - 156px);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
}
.reels__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}
.reel-card {
  position: relative;
  aspect-ratio: 9 / 16;
  width: min(100%, 340px);
  max-height: calc(100svh - 190px);
  justify-self: center;
  border-radius: 28px;
  overflow: hidden;
  background: #0b0b0b;
  box-shadow: var(--shadow);
}
.reel-card img,
.reel-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.35s ease;
}
.reel-card video { opacity: 0; pointer-events: none; background: #000; }
.reel-card.is-playing video { opacity: 1; pointer-events: auto; }
.reel-card.is-playing img,
.reel-card.is-playing .reel-card__overlay,
.reel-card.is-playing .reel-card__play { opacity: 0; pointer-events: none; }
.reel-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.4) 100%);
  transition: opacity 0.35s ease;
}
.reel-card__play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  padding-left: 5px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: opacity 0.35s ease;
}
.reel-card__play::before {
  content: '';
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid #fff;
}
.reel-card.is-empty { opacity: 0; pointer-events: none; }
.reels__nav {
  width: 72px;
  height: 72px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.78);
  font-size: 2.8rem;
  cursor: pointer;
  z-index: 6;
}
.reels__nav:hover { color: #fff; }

.reels__nav--prev {
  justify-self: start;
}

.reels__nav--next {
  justify-self: end;
}

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

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto 1fr;
    gap: 12px;
  }
  .topbar__meta { display: none; }
  .tabs { justify-self: end; }
  .hero__content { padding: 0 18px 18px; }
  .hero__bottom { flex-direction: column; align-items: flex-start; }
  .nav { width: 68px; height: 68px; font-size: 2.2rem; }
  .nav--prev { left: 6px; }
  .nav--next { right: 6px; }

  .reels {
    position: fixed;
    inset: 0;
    padding: 0;
    min-height: 100svh;
  }
  .reels__viewport {
    grid-template-columns: 1fr;
    min-height: 100svh;
    height: 100svh;
    gap: 0;
  }
  .reels__nav {
    display: grid;
    place-items: center;
    position: absolute;
    top: 50%;
    width: 64px;
    height: 64px;
    transform: translateY(-50%);
    font-size: 2.2rem;
    color: rgba(255,255,255,0.88);
  }
  .reels__nav--prev { left: 8px; }
  .reels__nav--next { right: 8px; }
  .reels__grid {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 100svh;
    height: 100svh;
  }
  .reel-card:nth-child(n+2) { display: none; }
  .reel-card.is-empty { display: none; }
  .reels .reel-card {
    width: 100vw;
    max-width: 100vw;
    min-width: 100vw;
    min-height: 100svh;
    height: 100svh;
    max-height: 100svh;
    margin: 0;
    border-radius: 0 !important;
  }
  .reels .reel-card img,
  .reels .reel-card video,
  .reels .reel-card__overlay {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .topbar {
    z-index: 30;
  }
}
