/* ============================================
   Top Page Styles
   ============================================ */

/* ── Dark BG Overrides for Top Page ── */

.hero__scroll-hint span {
  color: rgba(0, 0, 0, 0.5);
}

.hero__scroll-line {
  background: rgba(0, 0, 0, 0.15);
}

.hero__scroll-line::after {
  background: #93c5fd;
}

/* Intro section */
.intro__heading {
  color: #111;
}

.intro__text {
  color: #111;
}

.intro__deco-line {
  background: linear-gradient(90deg, #60a5fa, #22d3ee);
}

/* Section labels */
.heading-label {
  color: #1a3a5c;
}

.heading-section {
  color: #111;
}

/* Wave dividers — transparent on dark bg */
.section-divider svg path {
  fill: transparent;
}

.section-divider--flip svg path {
  fill: transparent;
}

/* Section bg override */
.section--bg,
.contents-nav {
  background: transparent;
}

/* Stack cards — keep white cards on dark bg */
.stack-card {
  background: rgba(255, 255, 255, 0.97);
}

/* Data section */
.data-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.data-card__value {
  color: #1a3a5c;
}

.data-card__value small {
  color: #333;
}

.data-card__label {
  color: #111;
}

.data-card:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.data-card::before {
  background: linear-gradient(90deg, #60a5fa, #22d3ee);
}

.data-highlights__more .btn--outline {
  border-color: rgba(0, 0, 0, 0.3);
  color: #111;
}

.data-highlights__more .btn--outline:hover {
  border-color: rgba(0, 0, 0, 0.5);
}

/* Hero outline button */
.hero__actions .btn--outline {
  border-color: rgba(0, 0, 0, 0.3);
  color: #111;
}

.hero__actions .btn--outline:hover {
  border-color: rgba(0, 0, 0, 0.5);
}


/* ── Loading Screen ── */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 32px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.loading-screen__line {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #111;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateY(16px);
}

.loading-screen__line--1 {
  font-size: 1.6rem;
  animation: loadingLineIn 0.5s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.loading-screen__line--2 {
  font-size: 2.4rem;
  animation: loadingLineIn 0.5s 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.loading-screen__bar {
  width: 280px;
  height: 6px;
  background: rgba(26, 58, 92, 0.1);
  border-radius: 6px;
  overflow: hidden;
  opacity: 0;
  animation: loadingFadeIn 0.3s 0.6s forwards;
}

.loading-screen__bar-fill {
  width: 0;
  height: 100%;
  background: #1a3a5c;
  border-radius: 6px;
  animation: loadingBar 1.0s 0.7s ease-in-out forwards;
}

@keyframes loadingFadeIn {
  to { opacity: 1; }
}

@keyframes loadingBar {
  0% { width: 0; }
  60% { width: 80%; }
  100% { width: 100%; }
}

/* ── Rolling Triangle ── */
.rolling-tri {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  /* Initial position — will be overridden by JS */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.rolling-tri__svg {
  width: 320px;
  height: 320px;
  display: block;
}

/* Trail afterimages */
.rolling-tri__trail {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  height: 320px;
}

.rolling-tri__trail--1 {
  opacity: 0.6;
}

.rolling-tri__trail--2 {
  opacity: 0.3;
}

@media (max-width: 900px) {
  .rolling-tri { display: none; }
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  z-index: 2;
}

.hero__inner {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding-top: 72px;
  gap: 48px;
}

/* ── Text content — left side ── */
.hero__content {
  flex: 1;
  min-width: 0;
  padding: 40px 0;
}

.hero__title {
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.3s cubic-bezier(0.23, 1, 0.32, 1),
              transform 1.3s cubic-bezier(0.23, 1, 0.32, 1);
  transition-delay: 0.3s;
}

.hero.is-loaded .hero__title {
  opacity: 1;
  transform: translateY(0);
}

.hero__title-img {
  display: block;
  width: 130%;
  max-width: 780px;
  height: auto;
}

.hero__catch {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 20px;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.3s cubic-bezier(0.23, 1, 0.32, 1),
              transform 1.3s cubic-bezier(0.23, 1, 0.32, 1);
  transition-delay: 0.55s;
}

.hero.is-loaded .hero__catch {
  opacity: 1;
  transform: translateY(0);
}

.hero__catch-accent {
  color: #1a3a5c;
  -webkit-text-fill-color: #1a3a5c;
}

.hero__desc {
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.7);
  line-height: 2;
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease-smooth), transform 1s var(--ease-smooth);
  transition-delay: 0.75s;
}

.hero.is-loaded .hero__desc {
  opacity: 1;
  transform: translateY(0);
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease-smooth), transform 1s var(--ease-smooth);
  transition-delay: 0.95s;
}

.hero.is-loaded .hero__actions {
  opacity: 1;
  transform: translateY(0);
}

/* ── Person photo — right side, floating ── */
.hero__photo {
  flex: 0 0 auto;
  width: 480px;
  height: 580px;
  border-radius: 60% 40% 40% 60% / 50% 60% 40% 50%;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s ease 0.5s, transform 1.2s cubic-bezier(0.23, 1, 0.32, 1) 0.5s;
}

.hero.is-loaded .hero__photo {
  opacity: 1;
  transform: translateY(0);
  animation: photoFloat 5s ease-in-out infinite alternate;
  animation-delay: 1.7s;
}

@keyframes photoFloat {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-14px); }
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Scroll Hint */
.hero__scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero__scroll-hint span {
  font-family: var(--font-en);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-primary);
  animation: scrollLine 2s infinite;
}

@keyframes scrollLine {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* ── Section Divider ── */
.section-divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin-top: -1px;
  position: relative;
  z-index: 2;
}

.section-divider svg {
  width: 100%;
  height: 80px;
  display: block;
}

.section-divider--flip {
  transform: scaleY(-1);
  margin-top: 0;
  margin-bottom: -1px;
}

/* ── Introduction ── */
.intro {
  text-align: center;
  position: relative;
}

.intro__heading {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.6;
  color: #111;
  margin-bottom: 32px;
}

.intro__text {
  font-size: 0.95rem;
  color: #111;
  line-height: 2.2;
  max-width: 640px;
  margin: 0 auto;
}

/* Decorative line after intro */
.intro__deco-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  margin: 48px auto 0;
  border-radius: 2px;
  opacity: 0;
  transform: scaleX(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: 0.3s;
}

.intro__deco-line.is-visible {
  opacity: 1;
  transform: scaleX(1);
}

/* ── Contents Navigation — Slide-in ── */
.contents-nav__header {
  margin-bottom: 48px;
}

.contents-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
}

.contents-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  opacity: 0;
  transform: translateY(40px);
  transition: transform 0.6s var(--ease-out), opacity 0.7s ease;
  text-decoration: none;
}

.contents-card.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.contents-card.is-revealed:nth-child(1) { transition-delay: 0s; }
.contents-card.is-revealed:nth-child(2) { transition-delay: 0.1s; }
.contents-card.is-revealed:nth-child(3) { transition-delay: 0.2s; }
.contents-card.is-revealed:nth-child(4) { transition-delay: 0.3s; }

.contents-card__img {
  position: absolute;
  inset: 0;
}

.contents-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-smooth);
}

.contents-card:hover .contents-card__img img {
  transform: scale(1.08);
}

/* Bottom gradient overlay */
.contents-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.25) 50%,
    transparent 100%
  );
  z-index: 1;
  transition: background 0.4s ease;
}

.contents-card:hover::after {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.35) 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
}

/* Text overlay at bottom */
.contents-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  z-index: 2;
}

.contents-card__number {
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.contents-card__title {
  font-family: var(--font-en);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.contents-card__sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
}

/* ── Data Highlights ── */
.data-highlights {
  position: relative;
}

.data-highlights__header {
  text-align: center;
  margin-bottom: 48px;
}

.data-highlights__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.data-card {
  background: var(--color-bg-soft);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}

.data-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-smooth);
}

.data-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.08);
}

.data-card:hover::before {
  transform: scaleX(1);
}

.data-card__value {
  font-family: var(--font-en);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 8px;
}

.data-card__value small {
  font-size: 0.45em;
  font-weight: 600;
  color: var(--color-text-light);
}

.data-card__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-light);
}

.data-highlights__more {
  text-align: center;
}

/* ── CTA Section ── */
.cta-section {
  position: relative;
  padding: 100px 0;
  overflow: hidden;
}

.cta-section__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-black) 0%, #1a365d 50%, var(--color-primary-dark) 100%);
  background-size: 200% 200%;
  animation: ctaGradient 8s ease-in-out infinite alternate;
  z-index: -1;
}

.cta-section__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(37, 99, 235, 0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
}

@keyframes ctaGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.cta-section__content {
  text-align: center;
  color: #fff;
}

.cta-section__title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.6;
}

.cta-section__desc {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
}

.cta-section__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Hide on SP ── */
.hide-sp { display: inline; }


/* ── Responsive ── */
@media (max-width: 900px) {
  .hero__inner {
    flex-direction: column;
    text-align: center;
    padding-top: 100px;
    gap: 32px;
  }

  .hero__photo {
    width: 300px;
    height: 360px;
    order: -1;
  }

  .hero__title-img {
    max-width: 480px;
    margin: 0 auto;
  }

  .hero__catch {
    font-size: 1.2rem;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__scroll-hint {
    display: none;
  }

  .contents-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .data-highlights__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .hide-sp { display: none; }

  .section-divider svg {
    height: 48px;
  }
}

  .flow-timeline {
    padding-left: 40px;
  }

  .flow-timeline__line {
    left: 16px;
  }

  .flow-timeline__badge {
    left: -40px;
    width: 32px;
    height: 32px;
    font-size: 0.65rem;
    top: 16px;
  }

  .flow-timeline__card {
    padding: 20px;
    gap: 16px;
  }

  .flow-timeline__icon {
    width: 44px;
    height: 44px;
  }

  .flow-timeline__icon svg {
    width: 22px;
    height: 22px;
  }

  .flow-timeline__item {
    padding-bottom: 28px;
  }
}

@media (max-width: 480px) {
  .hero__title-img {
    max-width: 360px;
  }

  .hero__catch {
    font-size: 1rem;
  }

  .contents-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .data-card__value {
    font-size: 2.2rem;
  }

  .cta-section__title {
    font-size: 1.6rem;
  }

  .loading-screen__line--1 {
    font-size: 1.2rem;
  }

  .loading-screen__line--2 {
    font-size: 1.8rem;
  }
}

/* ── Selection Flow ── */
.selection-flow {
  padding-bottom: 40px;
}

.selection-flow__header {
  text-align: center;
  margin-bottom: 48px;
}

/* ── Flow Timeline ── */
.flow-timeline {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding-left: 48px;
}

.flow-timeline__line {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), rgba(26, 58, 92, 0.15));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.flow-timeline.is-visible .flow-timeline__line {
  transform: scaleY(1);
}

.flow-timeline__item {
  position: relative;
  padding-bottom: 40px;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.flow-timeline__item:last-child {
  padding-bottom: 0;
}

.flow-timeline.is-visible .flow-timeline__item:nth-child(2) { transition-delay: 0.15s; }
.flow-timeline.is-visible .flow-timeline__item:nth-child(3) { transition-delay: 0.3s; }
.flow-timeline.is-visible .flow-timeline__item:nth-child(4) { transition-delay: 0.45s; }
.flow-timeline.is-visible .flow-timeline__item:nth-child(5) { transition-delay: 0.6s; }

.flow-timeline.is-visible .flow-timeline__item {
  opacity: 1;
  transform: translateX(0);
}

/* Badge (number circle on the line) */
.flow-timeline__badge {
  position: absolute;
  left: -48px;
  top: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0 0 4px #f5f7fa;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}

.flow-timeline__item:hover .flow-timeline__badge {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px #f5f7fa, 0 4px 16px rgba(26, 58, 92, 0.2);
}

/* Card */
.flow-timeline__card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px 28px;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
}

.flow-timeline__item:hover .flow-timeline__card {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: 0 8px 24px rgba(26, 58, 92, 0.08);
}

.flow-timeline__icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: rgba(26, 58, 92, 0.06);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.flow-timeline__item:hover .flow-timeline__icon {
  background: var(--color-primary);
}

.flow-timeline__icon svg {
  width: 26px;
  height: 26px;
  color: var(--color-primary);
  transition: color 0.3s ease;
}

.flow-timeline__item:hover .flow-timeline__icon svg {
  color: #fff;
}

.flow-timeline__body {
  flex: 1;
  min-width: 0;
}

.flow-timeline__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 6px;
}

.flow-timeline__desc {
  font-size: 0.82rem;
  color: var(--color-text-light);
  line-height: 1.7;
}

.selection-flow__note {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.6);
  margin-top: 40px;
}
