/* Features scroller — cinematic scroll-driven demo */

body.features-page header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 1px solid rgba(12, 15, 22, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  z-index: 200;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

body.features-page.nav-visible header {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

body.features-page main {
  padding: 0;
}

body.features-page footer {
  margin-top: 0;
}

.features-scroller {
  --phone-w: min(280px, 78vw);
  --phone-h: calc(var(--phone-w) * 2.05);
  --features-phone-bottom-gap: 5rem;
  --screen-radius: 28px;
  --green-deep: #0a3d2e;
  --green-mid: #1a7a52;
  --green-light: #4ecf8a;
  --accent: #139700;
  --segment-headline-size: clamp(32px, 4.4vw, 54px);
  --segment-subcopy-size: clamp(17px, 2.2vw, 21px);
  position: relative;
  background: linear-gradient(
    145deg,
    #062a1f 0%,
    #0f4d35 28%,
    #1a7a52 55%,
    #3cb878 78%,
    #8ee4b0 100%
  );
}

.scroller-track {
  height: 100vh;
  position: relative;
}

.scroller-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: top 0.35s ease, height 0.35s ease;
}

@media (min-width: 768px) {
  body.features-page header {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.features-page .scroller-stage {
    top: var(--features-header-offset, 64px);
    height: calc(100vh - var(--features-header-offset, 64px));
    align-items: flex-start;
    justify-content: center;
  }

  body.features-page .stage-layout {
    padding-top: var(--features-nav-phone-gap, 7vh);
    padding-bottom: var(--features-phone-bottom-gap, 5rem);
    box-sizing: border-box;
    min-height: 100%;
  }

  body.features-page .phone-wrap {
    transform-origin: 50% 0%;
  }
}

.scroller-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(142, 228, 176, 0.35), transparent 70%);
  pointer-events: none;
}

/* ---------- Stage layout ---------- */
.stage-layout {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(56px, 8vw, 112px);
  width: 100%;
  max-width: 1100px;
  padding: 0 clamp(18px, 4vw, 40px);
  z-index: 10;
}

.stage-content {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-copy {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 440px;
  display: flex;
  align-items: center;
}

.finale-slogan {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.finale-slogan[aria-hidden="false"] {
  pointer-events: auto;
  z-index: 60;
}

.stage-copy:has(.finale-slogan[aria-hidden="false"]) .scene-captions {
  pointer-events: none;
}

.finale-slogan-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.finale-slogan h2 {
  margin: 0;
  color: white;
  font-size: var(--segment-headline-size);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.finale-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  pointer-events: auto;
}

.finale-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 16px);
  text-decoration: none;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.finale-btn-primary {
  background: white;
  color: var(--green-deep);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.finale-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.finale-btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

.finale-btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: white;
}

/* ---------- Phone shell ---------- */
.phone-wrap {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  transform-origin: center center;
  will-change: transform;
  z-index: 10;
}

.phone-frame {
  width: 100%;
  height: 100%;
  border-radius: 40px;
  background: linear-gradient(145deg, #2a2a2e, #0d0d0f);
  padding: 10px;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.phone-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: #0d0d0f;
  border-radius: 0 0 16px 16px;
  z-index: 20;
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: var(--screen-radius);
  overflow: hidden;
  background: #f5f7fa;
  position: relative;
}

/* ---------- App UI layers inside phone ---------- */
.app-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.app-layer.active {
  opacity: 1;
  pointer-events: auto;
}

.app-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 36px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
}

.app-status .status-dots {
  font-size: 6px;
  letter-spacing: 2px;
  line-height: 1;
}

.app-header {
  padding: 4px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.app-header .team-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

/* Home feed preview */
.feed-preview {
  padding: 0 12px;
}

.feed-card {
  background: white;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  margin-bottom: 10px;
}

.feed-card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.feed-card .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #139700, #0b84ff);
}

.feed-card .name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.feed-card .time {
  font-size: 10px;
  color: #6b7280;
}

.feed-card p {
  margin: 0;
  font-size: 11px;
  color: #374151;
  line-height: 1.4;
}

/* Bottom nav */
.app-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 8px 22px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(8px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #9ca3af;
  font-size: 9px;
  font-weight: 600;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.messages .nav-icon-wrap {
  position: relative;
}

.nav-item.messages.active .nav-icon-wrap,
.nav-item.messages.highlight {
  color: var(--accent);
}

.nav-item.messages.highlight svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 6px rgba(19, 151, 0, 0.5));
}

.nav-item.messages.highlight .msg-dot {
  opacity: 1;
  transform: scale(1);
}

.msg-dot {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid white;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Notification backdrop ---------- */
.notification-backdrop {
  position: absolute;
  inset: 0;
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  background: rgba(245, 247, 250, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------- Push notification ---------- */
.push-notification {
  position: absolute;
  top: 52px;
  left: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transform: translateY(-120%);
  opacity: 0;
  z-index: 30;
}

.push-notification .push-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.push-notification .push-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.push-notification .push-body strong {
  display: block;
  font-size: 12px;
  color: #0f172a;
  margin-bottom: 2px;
}

.push-notification .push-body span {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.35;
}

.push-icon-merch {
  background: #0b84ff;
}

.push-notification-merch {
  z-index: 31;
}

/* ---------- Merch store ---------- */
.merch-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #f5f7fa;
  overflow: hidden;
}

.merch-view .app-status,
.merch-view .app-header {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  background: #f5f7fa;
}

.merch-scroll-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.merch-scroll {
  padding: 0 12px 80px;
  will-change: transform;
}

.merch-banner {
  background: linear-gradient(135deg, #139700, #0b84ff);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  text-align: center;
}

.merch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.merch-item {
  background: white;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.merch-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.merch-img-shirt {
  background: linear-gradient(145deg, #139700 30%, #0a5c00 100%);
}

.merch-img-shirt::after {
  content: '👕';
}

.merch-img-hat {
  background: linear-gradient(145deg, #6f4e37 20%, #3d2914 100%);
}

.merch-img-hat::after {
  content: '☕';
}

.merch-img-hoodie {
  background: linear-gradient(145deg, #374151 20%, #111827 100%);
}

.merch-img-hoodie::after {
  content: '🧥';
}

.merch-img-bottle {
  background: linear-gradient(145deg, #0b84ff 20%, #065a9e 100%);
}

.merch-img-bottle::after {
  content: '🥤';
}

.merch-item strong {
  display: block;
  font-size: 10px;
  color: #0f172a;
  margin-bottom: 2px;
}

.merch-price {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
}

/* ---------- Fullscreen video layer ---------- */
.fullscreen-video {
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.fullscreen-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fullscreen-video .video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 40%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.fullscreen-video .celebration-text {
  color: white;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  opacity: 0;
}

.coach-arms {
  position: absolute;
  bottom: 80px;
  right: 12%;
  font-size: 48px;
  opacity: 0;
  transform: scale(0.5);
}

.parents-cheer {
  position: absolute;
  top: 20%;
  left: 8%;
  right: 8%;
  display: flex;
  justify-content: space-between;
  opacity: 0;
}

.parents-cheer span {
  font-size: 28px;
  animation: cheer 0.6s ease-in-out infinite alternate;
}

.parents-cheer span:nth-child(2) { animation-delay: 0.15s; }
.parents-cheer span:nth-child(3) { animation-delay: 0.3s; }

@keyframes cheer {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-8px) scale(1.1); }
}

/* ---------- Post detail (video in feed) ---------- */
.post-detail {
  position: absolute;
  inset: 0;
  background: #f5f7fa;
}

.post-detail .post-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: #0f172a;
  overflow: hidden;
}

.post-detail .post-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-detail .post-actions {
  display: flex;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.post-detail .action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
}

.post-detail .action-btn.liked {
  color: var(--accent);
}

.comments-section {
  padding: 8px 14px 80px;
  overflow: hidden;
}

.comment {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(12px);
}

.comment .c-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
}

.comment .c-body {
  background: white;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.4;
  color: #374151;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.comment .c-body strong {
  display: block;
  font-size: 10px;
  color: #0f172a;
  margin-bottom: 2px;
}

/* Floating thumbs */
.floating-thumbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 15;
}

.thumb-float {
  position: absolute;
  font-size: 22px;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ---------- Messages view ---------- */
.messages-view {
  position: absolute;
  inset: 0;
  background: #f5f7fa;
}

.messages-view .msg-header {
  padding: 44px 16px 12px;
  background: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.messages-view .msg-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.msg-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(16px) scale(0.95);
}

.msg-bubble.incoming {
  align-self: flex-start;
  background: white;
  color: #374151;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.msg-bubble.outgoing {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-bubble .sender {
  font-weight: 700;
  font-size: 10px;
  margin-bottom: 2px;
  opacity: 0.85;
}

/* ---------- Scene caption list ---------- */
.scene-captions {
  position: relative;
  width: 100%;
  z-index: 50;
  pointer-events: auto;
}

.scene-captions-viewport {
  position: relative;
  height: min(340px, 44vh);
  overflow: hidden;
  overscroll-behavior: contain;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
}

.scene-captions-track {
  will-change: transform;
}

.caption-item {
  padding: 18px 0;
  text-align: left;
  color: rgba(255, 255, 255, 0.38);
  transform-origin: left center;
  will-change: transform, opacity;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  transition: color 0.4s ease;
}

.caption-item:hover:not(.active) {
  color: rgba(255, 255, 255, 0.58);
}

.caption-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 4px;
  border-radius: 4px;
}

.caption-item.active {
  color: #fff;
}

.caption-item h3 {
  margin: 0 0 8px;
  font-size: var(--segment-headline-size);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

.caption-item p {
  margin: 0;
  font-size: var(--segment-subcopy-size);
  line-height: 1.5;
  opacity: 0.75;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

.caption-item.active p {
  opacity: 0.95;
}

.caption-item:not(.active) h3,
.caption-item:not(.active) p {
  text-shadow: none;
}

/* ---------- Outro section below scroller ---------- */
.features-outro {
  background: #062a1f;
  color: white;
  padding: 80px 18px;
  text-align: center;
}

.features-outro h2 {
  font-size: clamp(28px, 5vw, 40px);
  margin: 0 0 12px;
  font-weight: 800;
}

.features-outro p {
  font-size: 18px;
  opacity: 0.85;
  max-width: 560px;
  margin: 0 auto 28px;
}

.features-outro .btn-primary {
  display: inline-flex;
  padding: 14px 32px;
  border-radius: 12px;
  background: white;
  color: var(--green-deep);
  font-weight: 700;
  text-decoration: none;
  font-size: 16px;
  transition: transform 0.2s ease;
}

.features-outro .btn-primary:hover {
  transform: translateY(-2px);
}

@media (max-width: 767px) {
  .features-scroller {
    --segment-headline-size: clamp(26px, 7vw, 38px);
    --segment-subcopy-size: clamp(16px, 4.4vw, 19px);
  }

  body.features-page.animation-complete .scroller-stage {
    top: var(--features-header-offset, 64px);
    height: calc(100vh - var(--features-header-offset, 64px));
  }

  .scroller-stage {
    align-items: stretch;
  }

  .stage-layout {
    flex-direction: column;
    align-items: stretch;
    align-self: stretch;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    padding: 0 24px 32px;
    box-sizing: border-box;
  }

  .stage-content {
    align-self: center;
    margin-top: 7rem;
    margin-bottom: 2rem;
  }

  body.features-page.animation-complete .stage-layout {
    padding-top: 15vh;
  }

  body.features-page.finale-mobile-only .stage-content {
    display: none;
  }

  body.features-page.finale-mobile-only .stage-layout {
    flex: 1;
    justify-content: center;
    padding-top: var(--features-nav-phone-gap, 7vh);
    min-height: 100%;
  }

  body.features-page.finale-mobile-only .stage-copy {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    flex: none;
    width: 100%;
  }

  body.features-page.finale-mobile-only .scene-captions {
    height: 0;
    min-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    pointer-events: none;
  }

  body.features-page.finale-mobile-only .scene-captions-viewport {
    height: 0;
    min-height: 0;
  }

  body.features-page.finale-mobile-only .finale-slogan {
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    text-align: center;
  }

  body.features-page.finale-mobile-only .finale-actions {
    margin-top: 18px;
  }

  .stage-copy {
    display: block;
    position: relative;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .scene-captions {
    width: 100%;
    box-sizing: border-box;
  }

  .scene-captions-viewport {
    height: min(280px, 38vh);
    width: 100%;
    box-sizing: border-box;
  }

  .scene-captions-track {
    width: 100%;
    box-sizing: border-box;
  }

  .caption-item {
    padding: 14px 0;
    text-align: center;
    transform-origin: center center;
    width: 100%;
    box-sizing: border-box;
  }

  .finale-slogan {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .finale-slogan-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .finale-slogan h2 {
    width: 100%;
  }

  .finale-actions {
    justify-content: center;
    width: 100%;
    gap: 10px;
  }

  .finale-btn {
    padding: 10px 12px;
    font-size: clamp(11px, 2.8vw, 14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .parents-cheer span {
    animation: none;
  }
}
