/* -- SCROLL SECTION -- */
.scroll-section {
  height: 300vh;
  position: relative;
  z-index: 1;
}

.sticky-canvas {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
}

.layout {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 36% 64%;
  align-items: flex-start;
  margin-top: var(--ps-entry-margin, 1.5rem);
}

/* -- TEXT PANEL -- */
.text-panel {
  padding: 0 2rem 0 5vw;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.slides-wrapper {
  position: relative;
}

.text-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  will-change: opacity, transform;
}
.text-slide.active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.text-slide.exit {
  opacity: 0;
  transform: translateY(-16px);
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.85rem;
  background: rgba(49, 151, 149, 0.1);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.stage-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.text-slide h2 {
  font-family: "Processity", serif;
  font-size: clamp(2.3rem, 3.6vw, 3.8rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 0.7rem;
}
.text-slide h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--ink-mid);
}

.text-slide .kicker {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.text-slide p {
  font-size: 0.975rem;
  line-height: 1.75;
  color: var(--ink-soft);
  font-weight: 300;
  max-width: 42ch;
}

/* -- PROGRESS DOTS -- */
.progress-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.1rem;
}

.pdot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(31, 35, 41, 0.16);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  padding: 0;
}
.pdot.active {
  background: var(--accent);
  width: 22px;
}
.pdot:hover:not(.active) {
  background: rgba(49, 151, 149, 0.35);
}

/* -- VIZ PANEL -- */
.viz-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.5rem 1.5rem 0;
}

.platform-svg {
  width: 100%;
  max-width: 920px;
  height: auto;
  overflow: visible;
}

/* -- MOBILE "BRICKS ON A FOUNDATION" VISUALIZATION (replaces the SVG on small screens) -- */
.mobile-modules {
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

/* Fixed 3x3 grid: each module always occupies its cell, only fades in/out,
   so the overall height never changes between stages. */
.mmod-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.mmod {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
  pointer-events: none;
}

.mmod:not(.hidden) {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.mmod-icon {
  width: 26px;
  height: 26px;
}

.mmod-label {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  color: #fff;
  text-align: center;
  line-height: 1.2;
}

/* -- FOUNDATION BAR -- */
.mmod-base {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--green-800, #1f4d3f);
  border-radius: 14px;
}

.mmod-base-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
}
.mmod-base-icon svg {
  width: 22px;
  height: 22px;
}

.mmod-base-text {
  flex: 1;
  min-width: 0;
}
.mmod-base-label {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: #fff;
}
.mmod-base-subtitle {
  font-size: 0.78rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
}

/* -- SVG MODULE ANIMATIONS -- */
.mod {
  transition:
    opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.18s ease;
  will-change: opacity, transform;
}

.mod.hidden {
  opacity: 0;
  transform: scale(0.65);
  pointer-events: none;
}

.mod:not(.hidden) {
  cursor: pointer;
}
.mod:not(.hidden):hover {
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.18));
}

.conn {
  transition: opacity 0.4s ease;
  stroke-dasharray: 5 4;
  animation: flowDash 20s linear infinite;
}
.conn.hidden {
  opacity: 0;
}

@keyframes flowDash {
  to {
    stroke-dashoffset: -200;
  }
}

.hub-ring {
  animation: pulseRing 4s ease-in-out infinite;
  transform-origin: 380px 255px;
}
@keyframes pulseRing {
  0%,
  100% {
    opacity: 0.1;
    r: 80;
  }
  50% {
    opacity: 0.2;
    r: 96;
  }
}

/* -- PLATFORM INTRO -- */
.platform-intro {
  position: relative;
  z-index: 1;
  background: var(--gray-50);
  padding: 4rem 5vw;
}

.platform-intro-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem;
  border-radius: 24px;
  background: linear-gradient(140deg, var(--blue-50) 0%, var(--teal-50) 100%);
}

.platform-intro-inner .section-eyebrow {
  display: block;
  margin-bottom: 1rem;
}

.platform-intro h2 {
  font-family: "Processity", serif;
  font-size: clamp(1.9rem, 3.6vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 1rem;
}
.platform-intro h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
}

.platform-intro p {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--ink-soft);
  line-height: 1.75;
  max-width: 50ch;
}

.platform-scroll-cta {
  text-align: center;
  padding: 3rem 5vw 1rem;
}
