/* ============================================================
   Red Sea Crown — Morph & motion
   Hero, pinned pill->panel, steps scrub, CTA orb, showcase, ambient
   Adapted from scroll-morph.skill (recolored teal/gold, RTL-tuned).
   ============================================================ */

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-block-size: 100svh;
  display: flex;
  align-items: center;
  padding-block: clamp(7rem, 5rem + 9vw, 11rem) var(--space-xl);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(
      90% 70% at 88% 6%,
      var(--gold-soft),
      transparent 50%
    ),
    radial-gradient(70% 60% at 8% 100%, var(--teal-soft), transparent 55%);
}

/* ambient morphing gold blob */
.hero__blob {
  position: absolute;
  z-index: -1;
  inline-size: clamp(280px, 38vw, 560px);
  aspect-ratio: 1;
  inset-block-start: 8%;
  inset-inline-start: -6%;
  background: radial-gradient(
    circle at 38% 38%,
    rgba(229, 202, 135, 0.55),
    rgba(229, 202, 135, 0.05) 70%
  );
  filter: blur(8px);
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  animation: blobMorph 16s var(--ease-expo) infinite alternate;
}

@keyframes blobMorph {
  0% {
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
    transform: rotate(0deg) scale(1);
  }
  50% {
    border-radius: 60% 40% 33% 67% / 59% 56% 44% 41%;
    transform: rotate(12deg) scale(1.08);
  }
  100% {
    border-radius: 38% 62% 52% 48% / 49% 38% 62% 51%;
    transform: rotate(-8deg) scale(0.98);
  }
}

.hero__inner {
  max-width: 60rem;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold);
  background: rgba(255, 255, 255, 0.6);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--teal-700);
  margin-block-end: var(--space-md);
}

.hero__eyebrow::before {
  content: "";
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--gold-deep);
}

.hero__title {
  font-size: var(--text-hero);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.hero__title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) rotate(2deg);
  animation: heroWord 0.9s var(--ease-expo) forwards;
}

.hero__title .word:nth-child(2) {
  animation-delay: 0.12s;
}
.hero__title .word:nth-child(3) {
  animation-delay: 0.24s;
  color: var(--gold-deep);
}

@keyframes heroWord {
  to {
    opacity: 1;
    transform: none;
  }
}

.hero__lead {
  margin-block: var(--space-md) var(--space-lg);
  font-size: var(--text-lead);
  font-weight: 300;
  color: var(--muted);
  max-width: 52ch;
  opacity: 0;
  animation: heroFade 0.9s var(--ease-expo) 0.4s forwards;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  opacity: 0;
  animation: heroFade 0.9s var(--ease-expo) 0.55s forwards;
}

.hero__scroll {
  position: absolute;
  inset-block-end: 1.8rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  color: var(--muted);
  opacity: 0;
  animation: heroFade 1s var(--ease-expo) 0.9s forwards;
}

.hero__scroll-line {
  inline-size: 1px;
  block-size: 42px;
  background: linear-gradient(var(--gold-deep), transparent);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  block-size: 14px;
  background: var(--gold-deep);
  animation: scrollDot 1.8s var(--ease-expo) infinite;
}

@keyframes scrollDot {
  0% {
    inset-block-start: -14px;
  }
  100% {
    inset-block-start: 42px;
  }
}

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

/* floating crown/plane motif */
.hero__motif {
  position: absolute;
  inset-block-start: 20%;
  inset-inline-end: 8%;
  inline-size: clamp(70px, 9vw, 120px);
  color: var(--gold-deep);
  opacity: 0.85;
  animation: floatY 7s ease-in-out infinite;
  z-index: -1;
}

@keyframes floatY {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-22px) rotate(3deg);
  }
}

/* ============================================================
   (B) PINNED PILL -> PANEL MORPH  (capabilities preview)
   ============================================================ */
.morph-stage {
  position: relative;
  block-size: 320vh;
}

.morph-pin {
  position: sticky;
  inset-block-start: 0;
  block-size: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.morph-card {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 220px;
  block-size: 220px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--gold), var(--gold-deep));
  overflow: hidden;
  box-shadow: var(--shadow-gold);
  will-change: width, height, transform, border-radius;
}

.mc-fill {
  position: absolute;
  inset: 0;
  background: var(--white);
  opacity: 0;
}

.mc-pill {
  position: relative;
  z-index: 2;
  color: var(--teal-deep);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
}

.mc-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  text-align: center;
  opacity: 0;
}

.mc-content h2 {
  font-size: var(--text-h2);
  max-width: 20ch;
}

.mc-content p {
  color: var(--muted);
  font-weight: 300;
  max-width: 52ch;
}

.mc-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  max-width: 60rem;
}

/* ============================================================
   (C) STEPS TIMELINE SCRUB  (how we work)
   ============================================================ */
.steps-progress {
  inline-size: min(620px, 84%);
  block-size: 6px;
  margin-inline: auto;
  margin-block-end: var(--space-lg);
  background: var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.steps-progress__fill {
  display: block;
  block-size: 100%;
  inline-size: 100%;
  background: linear-gradient(to left, var(--gold), var(--gold-deep));
  transform: scaleX(0);
  transform-origin: right; /* RTL */
  border-radius: var(--radius-pill);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(0.8rem, 0.3rem + 1vw, 1.3rem);
}

.step {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.3rem, 1rem + 1vw, 1.9rem);
  opacity: 0;
  transform: translateY(48px) scale(0.95);
  transition: opacity 0.6s var(--ease-expo), transform 0.6s var(--ease-expo),
    border-color 0.6s var(--ease-expo);
}

.step.on {
  opacity: 1;
  transform: none;
  border-color: var(--gold);
}

.step__num {
  inline-size: 46px;
  block-size: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--teal);
  margin-block-end: var(--space-sm);
  transition: background-color 0.55s var(--ease-expo),
    color 0.55s var(--ease-expo), border-color 0.55s var(--ease-expo);
}

.step.on .step__num {
  background: var(--teal);
  color: var(--gold);
  border-color: var(--teal);
}

.step__title {
  font-size: var(--text-h3);
  font-weight: 700;
  margin-block-end: 0.4rem;
}

.step__text {
  color: var(--muted);
  font-weight: 300;
  font-size: var(--text-sm);
}

/* ============================================================
   (F) GROW -> PIN -> EXIT  (closing CTA orb)
   ============================================================ */
.cta-stage {
  position: relative;
  block-size: 250vh;
}

.cta-pin {
  position: sticky;
  inset-block-start: 0;
  block-size: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cta-orb {
  inline-size: 80px;
  block-size: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(140deg, var(--teal), var(--teal-deep));
  color: var(--white);
  box-shadow: var(--shadow-lg);
  will-change: width, height, border-radius, transform;
}

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: clamp(1.5rem, 1rem + 4vw, 4rem);
  text-align: center;
  opacity: 0;
  will-change: opacity, transform;
}

.cta-inner h2 {
  color: var(--white);
  font-size: var(--text-h1);
  max-width: 18ch;
}

.cta-inner p {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 300;
  max-width: 48ch;
}

.cta-inner .hero__actions {
  opacity: 1;
  animation: none;
  justify-content: center;
}

/* ============================================================
   SHOWCASE reshape (about / generic media)
   ============================================================ */
.showcase {
  opacity: 0;
  will-change: transform, border-radius, opacity;
}

/* ============================================================
   REDUCED MOTION — resolve all morphs to final state
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero__title .word,
  .hero__lead,
  .hero__actions,
  .hero__scroll {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .hero__blob,
  .hero__motif,
  .hero__scroll-line::after {
    animation: none !important;
  }
  .step {
    opacity: 1 !important;
    transform: none !important;
  }
  .showcase {
    opacity: 1 !important;
    transform: none !important;
    border-radius: var(--radius-xl) !important;
  }

  /* Collapse the tall pinned stages into normal static panels so there
     is no long blank scroll region when motion is disabled. */
  .morph-stage,
  .cta-stage {
    block-size: auto !important;
    padding-block: var(--space-section);
  }
  .morph-pin,
  .cta-pin {
    position: static !important;
    block-size: auto !important;
    overflow: visible;
  }
  .morph-card,
  .cta-orb {
    inline-size: min(960px, 92%) !important;
    block-size: auto !important;
    border-radius: var(--radius-xl) !important;
    transform: none !important;
  }
  .morph-card {
    background: var(--white) !important;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
  }
  .mc-fill {
    opacity: 1 !important;
  }
  .mc-pill {
    display: none !important;
  }
  .mc-content,
  .cta-inner {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================
   RESPONSIVE — morph sections
   ============================================================ */
@media (max-width: 820px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .morph-stage {
    block-size: 280vh;
  }
}

@media (max-width: 620px) {
  /* keep the pinned panel content readable inside the smaller grown card */
  .mc-content {
    gap: var(--space-sm);
    padding: 1.4rem;
  }
  .mc-content p {
    display: none;
  }
  .mc-chips {
    gap: 0.45rem;
  }
  .mc-chips .chip {
    padding: 0.45rem 0.8rem;
    font-size: var(--text-xs);
  }
}

@media (max-width: 520px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}
