/* BeFit — Our Story (Apple-inspired timeline) */

html:has([data-story-page]) {
  scroll-padding-top: 6rem;
}

.story-page {
  --story-max: 40rem;
  --story-pad: clamp(1.25rem, 4vw, 2rem);
  --story-ease: cubic-bezier(0.22, 1, 0.36, 1);
  background: #0b121c;
  color: #fff;
  padding-top: 5rem;
}

.story-hero {
  position: relative;
  min-height: min(88dvh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(4rem, 14vh, 8rem) var(--story-pad);
  overflow: hidden;
}

.story-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 20%, rgba(59, 130, 246, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(52, 211, 153, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #0d1520 0%, #0b121c 100%);
}

.story-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("screenshot-today.png") center 40% / cover no-repeat;
  opacity: 0.12;
  filter: saturate(0.6) blur(2px);
}

.story-hero__content {
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

.story-hero__eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #38bdf8;
}

.story-hero__title {
  margin: 0 0 1.5rem;
  font-size: clamp(2.25rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.story-hero__lead {
  margin: 0 auto;
  max-width: 28rem;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 500;
  line-height: 1.65;
  color: #cbd5e1;
}

.story-hero__lead br {
  display: block;
  margin-top: 0.65rem;
}

.story-hero__quote {
  margin: 2.5rem auto 0;
  padding: 1.5rem 1.75rem;
  max-width: 32rem;
  border-radius: 1.25rem;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.15);
  backdrop-filter: blur(8px);
}

.story-hero__quote p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.55;
  color: #f1f5f9;
  font-style: italic;
}

.story-intro {
  max-width: var(--story-max);
  margin: 0 auto;
  padding: clamp(3rem, 10vh, 5rem) var(--story-pad);
  text-align: center;
}

.story-intro__text {
  margin: 0;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: 500;
  line-height: 1.7;
  color: #94a3b8;
}

.story-timeline-wrap {
  position: relative;
  max-width: var(--story-max);
  margin: 0 auto;
  padding: 0 var(--story-pad) clamp(4rem, 12vh, 7rem);
}

.story-timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 2.75rem;
}

/* 垂直線 */
.story-timeline::before {
  content: "";
  position: absolute;
  left: 0.65rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.15) 0%,
    rgba(59, 130, 246, 0.35) 30%,
    rgba(52, 211, 153, 0.45) 70%,
    rgba(56, 189, 248, 0.5) 100%
  );
  transform-origin: top;
  transform: scaleY(var(--story-line, 0));
  transition: transform 1.2s var(--story-ease);
}

.story-page.is-line-ready .story-timeline::before {
  transform: scaleY(var(--story-line, 1));
}

.story-milestone {
  position: relative;
  padding-bottom: clamp(3rem, 8vh, 4.5rem);
}

.story-milestone:last-child {
  padding-bottom: 0;
}

.story-milestone__dot {
  position: absolute;
  left: -2.75rem;
  top: 0.35rem;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: 0;
  border-radius: 50%;
  background: #0b121c;
  border: 3px solid #3b82f6;
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.15),
    0 0 24px rgba(59, 130, 246, 0.35);
  z-index: 2;
  transition: transform 0.5s var(--story-ease), border-color 0.4s ease, box-shadow 0.4s ease;
}

.story-milestone.is-visible .story-milestone__dot {
  transform: scale(1.12);
}

.story-milestone--you .story-milestone__dot {
  width: 1.5rem;
  height: 1.5rem;
  left: calc(-2.75rem - 0.075rem);
  border-color: #34d399;
  box-shadow:
    0 0 0 6px rgba(52, 211, 153, 0.2),
    0 0 32px rgba(52, 211, 153, 0.45);
}

.story-milestone--future .story-milestone__dot {
  border-color: #38bdf8;
  background: linear-gradient(145deg, #1e3a8a, #0b121c);
}

.story-milestone__era {
  display: block;
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.story-milestone__title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
}

.story-milestone__body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
  color: #94a3b8;
}

.story-milestone__body strong {
  color: #e2e8f0;
  font-weight: 600;
}

.story-milestone--you .story-milestone__body {
  color: #cbd5e1;
}

.story-closing {
  max-width: var(--story-max);
  margin: 0 auto;
  padding: clamp(3rem, 10vh, 5rem) var(--story-pad) clamp(5rem, 14vh, 8rem);
  text-align: center;
}

.story-closing__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.5rem;
  border-radius: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.25), rgba(52, 211, 153, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.2);
}

.story-closing__title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.story-closing__text {
  margin: 0 auto 2rem;
  max-width: 26rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #94a3b8;
}

.story-closing__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.story-closing__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.25s ease;
}

.story-closing__btn--primary {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.35);
}

.story-closing__btn--primary:hover {
  background: #2563eb;
  transform: scale(1.02);
}

.story-closing__btn--ghost {
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

.story-closing__btn--ghost:hover {
  border-color: rgba(148, 163, 184, 0.45);
  color: #fff;
}

@media (min-width: 768px) {
  .story-timeline {
    padding-left: 3.25rem;
  }

  .story-timeline::before {
    left: 0.85rem;
  }

  .story-milestone__dot {
    left: -3.25rem;
  }

  .story-milestone--you .story-milestone__dot {
    left: calc(-3.25rem - 0.1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-timeline::before {
    transform: scaleY(1);
    transition: none;
  }

  .story-milestone__dot {
    transition: none;
  }
}
