/* ============================================================
   HOMEPAGE — art first
   Three full-height art panels for the three games, then one
   section per game with the artwork leading and a few lines of
   copy. Motion: one entrance on load, slow scroll reveals, and a
   gentle scroll-linked drift on the art where the browser supports
   it. Builds on style.css (Cinzel + Karla, ocean background, gold).
   ============================================================ */

/* --- HERO: carousel, one game at a time --- */
.hero-carousel {
  position: relative;
  margin-top: 64px;
  height: calc(100vh - 64px);
  min-height: 560px;
  overflow: hidden;
  background: #000;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s ease, visibility 0s linear 1.2s;
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 1.2s ease, visibility 0s;
  z-index: 1;
}

.slide-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
}

.slide.is-active .slide-art { animation: slideZoom 8s linear both; }

@keyframes slideZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.07); }
}

.slide--board .slide-art { object-position: 50% 55%; }
.slide--tiderun .slide-art { object-position: 50% 50%; }
.slide--online .slide-art { object-position: 50% 50%; }

.slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 30%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 55%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 45%);
  pointer-events: none;
}

.slide-caption {
  position: absolute;
  z-index: 2;
  left: clamp(1.5rem, 6vw, 6rem);
  right: clamp(1.5rem, 6vw, 6rem);
  bottom: clamp(5.5rem, 14vh, 8rem);
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s cubic-bezier(0.2, 0, 0, 1) 0.35s, transform 0.9s cubic-bezier(0.2, 0, 0, 1) 0.35s;
}

.slide.is-active .slide-caption {
  opacity: 1;
  transform: none;
}

.slide-num {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
}

.slide-name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
  color: var(--text);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.slide-status {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.slide-caption .cta-button { margin-top: 0.9rem; }

.hero-line {
  position: absolute;
  z-index: 2;
  top: 1.5rem;
  left: clamp(1.5rem, 6vw, 6rem);
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  font-weight: 400;
  color: var(--text-dim);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

/* tabs: one per game, with a progress bar during autoplay */
.hero-tabs {
  position: absolute;
  z-index: 3;
  left: clamp(1.5rem, 6vw, 6rem);
  right: clamp(1.5rem, 6vw, 6rem);
  bottom: 1.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.hero-tab {
  position: relative;
  padding: 0.9rem 0 0;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.68);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: color 0.4s;
}

.hero-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
}

.hero-tab::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
}

.hero-tab:hover { color: var(--text); }
.hero-tab.is-active { color: var(--text); }

.hero-tab.is-active::after { animation: tabFill var(--slide-ms, 6500ms) linear forwards; }
.hero-carousel.is-paused .hero-tab.is-active::after { animation-play-state: paused; }
.hero-carousel.no-autoplay .hero-tab.is-active::after { animation: none; transform: scaleX(1); }

@keyframes tabFill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.hero-tab small {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.hero-arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--r-sm);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s, background 0.3s, border-color 0.3s;
}

.hero-arrow--prev { left: 1.25rem; }
.hero-arrow--next { right: 1.25rem; }

.hero-carousel:hover .hero-arrow,
.hero-arrow:focus-visible { opacity: 1; }

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: var(--gold);
  color: var(--gold);
}

/* --- MOTION: scroll reveal + drift --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s cubic-bezier(0.2, 0, 0, 1), transform 1.1s cubic-bezier(0.2, 0, 0, 1);
  transition-delay: var(--d, 0s);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@supports (animation-timeline: view()) {
  .drift {
    animation: drift linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }

  @keyframes drift {
    from { transform: translateY(5%); }
    to   { transform: translateY(-5%); }
  }
}

/* --- PRODUCT SECTIONS --- */
.product { padding: var(--section-pad); }

.product-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.product-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1rem;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.product-index {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.product-kicker {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.product-head .badge { margin-left: 0; }

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: center;
}

.product-layout--reverse .product-visual { order: -1; }

.product-title-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

.product-app-icon {
  width: 68px;
  height: 68px;
  border-radius: 17px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(240, 192, 64, 0.25);
  flex-shrink: 0;
}

.product-heading {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1;
  color: var(--text);
}

.product-heading em {
  font-style: normal;
  color: var(--gold);
}

.product-sub {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.product-body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 2rem;
  max-width: 40ch;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
}

.product-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-visual--top { align-items: flex-start; }

/* 01: feather the product photo so its black edge melts into the section */
.itb-image {
  -webkit-mask-image: radial-gradient(ellipse 72% 64% at 50% 46%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 64% at 50% 46%, #000 62%, transparent 100%);
}

/* 02: trailer in the phone frame */
.product-phone .phone-frame { width: clamp(220px, 24vw, 300px); }

.product-phone video,
.product-phone .phone-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* 03: three phones, fishing in front, campaign and almanac behind */
.product-layout--wide { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }

.phone-trio {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
}

.phone-trio .phone-frame { width: clamp(150px, 14vw, 190px); }
.phone-trio-main .phone-frame { width: clamp(200px, 19vw, 250px); }

.phone-trio-main { position: relative; z-index: 2; }

.phone-trio-side {
  position: relative;
  z-index: 1;
  margin-bottom: 2rem;
}

.phone-trio-side--l { margin-right: -2.25rem; }
.phone-trio-side--r { margin-left: -2.25rem; }

.phone-trio .phone-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  background: #000;
}

/* --- MOBILE --- */
@media (max-width: 900px) {
  .hero-carousel { height: calc(100svh - 64px); min-height: 520px; }
  .slide-caption { bottom: 4.75rem; }
  .hero-tabs { gap: 0.6rem; bottom: 1.5rem; }
  .hero-tab { font-size: 0; padding: 1.25rem 0 0; }
  .hero-tab small { display: none; }
  .hero-arrow { display: none; }

  .product-layout,
  .product-layout--wide {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .product-layout--reverse .product-visual { order: 0; }
}

@media (max-width: 768px) {
  .hero-line { display: none; }
  .product-inner { padding: 0 1.5rem; }
  .product-head { margin-bottom: 2.5rem; }
  .product-phone .phone-frame { width: clamp(220px, 58vw, 300px); }
  .phone-trio .phone-frame { width: 27vw; }
  .phone-trio-main .phone-frame { width: 40vw; }
  .phone-trio-side { margin-bottom: 1.25rem; }
  .phone-trio-side--l { margin-right: -5vw; }
  .phone-trio-side--r { margin-left: -5vw; }
}
