/* ==========================================================================
   PLAY NEW - Homepage Styles
   ========================================================================== */

/* -------------------------------------------------------------------------
   Fullpage Home Layout - 12 column grid, 24px margin/gutter
   ------------------------------------------------------------------------- */

.home-fullpage {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* dynamic viewport height - accounts for mobile browser UI */
  padding: 24px;
  overflow: hidden;
}

/* -------------------------------------------------------------------------
   Text Entrance Animations (keyframes in base.css)
   ------------------------------------------------------------------------- */

/* Page exit animation - nav stays, content exits */
.home-fullpage.page-exit .home-col-tagline,
.home-fullpage.page-exit .home-bottom {
  animation: fade-down-out 0.3s ease-in forwards;
}

/* Legal fades out in place (no transform to avoid position jump) */
.home-fullpage.page-exit .home-legal {
  animation: fade-out 0.3s ease-in forwards;
}

/* Hide elements initially to prevent flash */
.home-tagline-text,
.home-logo-text,
.home-legal {
  opacity: 0;
}

/* JS adds this class when scramble is ready */
.home-logo-text.scramble-ready {
  opacity: 1;
}

/* Nav columns hidden initially, animation brings them in */
.home-col-nav {
  opacity: 0;
}

/* First visit - animate everything */
.home-tagline-text {
  animation: fade-up 0.8s ease-out both;
}

.home-col-nav:nth-child(2) { animation: fade-up 0.8s ease-out 0.1s both; }
.home-col-nav:nth-child(3) { animation: fade-up 0.8s ease-out 0.2s both; }
.home-col-nav:nth-child(4) { animation: fade-up 0.8s ease-out 0.3s both; }
.home-col-nav:nth-child(5) { animation: fade-up 0.8s ease-out 0.4s both; }

.home-logo-text .char {
  display: inline-block;
}

.home-legal {
  animation: fade-up 0.8s ease-out 0.6s both;
}

/* Return visit - only animate tagline and logo */
.home-fullpage.revisit .home-col-nav,
.home-fullpage.revisit .home-legal {
  animation: none;
  opacity: 1;
}

.home-fullpage.revisit .home-tagline-text {
  animation: fade-up 0.8s ease-out both;
}

/* Header - 12 column grid */
.home-header {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: start;
}

/* Column base */
.home-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Tagline spans 3 columns */
.home-col-tagline {
  grid-column: 1 / span 3;
}

.home-tagline-text {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.5);
  margin: 0;
}

/* Nav columns - each spans 2 columns, starting from column 5 */
.home-col-nav:nth-child(2) { grid-column: 5 / span 2; }
.home-col-nav:nth-child(3) { grid-column: 7 / span 2; }
.home-col-nav:nth-child(4) { grid-column: 9 / span 2; }
.home-col-nav:nth-child(5) { grid-column: 11 / span 2; }

.home-nav-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: var(--weight-medium);
  color: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.5;
  margin-top: 0.15rem;
  margin-bottom: 0.5rem;
}

.home-nav-link {
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  text-decoration: none;
}

.home-nav-link:hover {
  text-decoration: underline;
}

/* Bottom section - Logo */
.home-bottom {
  flex: 1;
  display: flex;
  align-items: flex-end;
  min-height: 0;
}

.home-logo-text {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.07em;
  margin: 0;
  margin-left: -0.08em;
  margin-bottom: -0.02em;
  font-size: min(calc((100vh - 48px - 180px) / 2), 28vw);
  animation: color-shift 45s ease-in-out infinite;
}

.home-logo-line {
  display: block;
}

/* Legal info - bottom right */
.home-legal {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.5;
}

.home-legal a {
  color: var(--color-text);
  text-decoration: none;
}

.home-legal a:hover {
  text-decoration: underline;
}

.home-legal-links {
  display: flex;
  gap: 0.5rem;
}

/* -------------------------------------------------------------------------
   Mobile Menu
   ------------------------------------------------------------------------- */

.home-menu-btn {
  display: none;
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.home-menu-icon {
  display: block;
  position: relative;
  width: 28px;
  height: 2px;
  background-color: var(--color-text);
  transition: background-color 0.2s;
}

.home-menu-icon::before,
.home-menu-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 28px;
  height: 2px;
  background-color: var(--color-text);
  transition: transform 0.2s, top 0.2s;
}

.home-menu-icon::before {
  top: -8px;
}

.home-menu-icon::after {
  top: 8px;
}

/* Menu open state */
.menu-open .home-menu-icon {
  background-color: transparent;
}

.menu-open .home-menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-open .home-menu-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Mobile Menu Overlay */
.home-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg);
  z-index: 1000;
  padding: 80px 24px 24px;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-open .home-menu-overlay {
  opacity: 1;
  visibility: visible;
}

/* Menu items animation */
.home-menu-col {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu-open .home-menu-col:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.1s; }
.menu-open .home-menu-col:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
.menu-open .home-menu-col:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
.menu-open .home-menu-col:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.25s; }

.home-menu-legal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu-open .home-menu-legal {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.home-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.home-menu-col {
  display: flex;
  flex-direction: column;
}

.home-menu-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: var(--weight-medium);
  color: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.home-menu-link {
  font-family: var(--font-mono);
  font-size: 2rem;
  line-height: 1.3;
  color: var(--color-text);
  text-decoration: none;
}

.home-menu-link:hover {
  text-decoration: underline;
}

.home-menu-legal {
  display: flex;
  flex-direction: column;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.5;
  margin-top: auto;
  padding-top: 3rem;
}

.home-menu-legal-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.75rem;
}

.home-menu-legal-links a {
  color: var(--color-text);
  text-decoration: none;
  padding: 0.25rem 0;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 1023px) {
  .home-fullpage {
    padding: 24px;
    padding-top: 32px;
  }

  .home-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    top: 24px;
    right: 20px;
  }

  .home-col-nav {
    display: none;
  }

  .home-header {
    display: block;
  }

  .home-col-tagline {
    max-width: 50%;
    padding-right: 60px;
  }

  .home-tagline-text {
    font-size: 1rem;
    color: var(--color-text);
  }

  .home-logo-text {
    font-size: 28vw;
    margin-left: -0.04em;
  }

  .home-legal {
    display: none;
  }
}

@media (max-width: 767px) {
  .home-col-tagline {
    max-width: 70%;
    padding-right: 50px;
  }

  .home-logo-text {
    font-size: 42vw;
  }
}

@media (max-width: 480px) {
  .home-fullpage {
    padding: 20px;
    padding-top: 28px;
  }

  .home-menu-btn {
    top: 20px;
    right: 12px;
  }

  .home-col-tagline {
    max-width: 80%;
  }

  .home-logo-text {
    font-size: 44vw;
  }
}
