/* ==========================================================================
   PSCROLL — Sticky Phone Scroll Section  (v2 — dark interior, crossfade)
   ========================================================================== */

.pscroll-section {
  background-color: rgba(225, 222, 203, 0.65);
  height: 500vh;
  position: relative;
  z-index: 3;
}

.pscroll-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  overflow: hidden;
  padding: 0 5vw;
  box-sizing: border-box;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LEFT — step number + title + description
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.pscroll-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  position: relative;
}

.pscroll-slides {
  position: relative;
  height: 320px;
}

/* Base state: hidden below */
.pscroll-slide {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(calc(-50% + 36px));
  transition:
    opacity  0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Entering / visible */
.pscroll-slide.active {
  opacity: 1;
  transform: translateY(-50%);
  pointer-events: auto;
}

/* Exiting — slides up and fades out */
.pscroll-slide.exiting {
  opacity: 0;
  transform: translateY(calc(-50% - 36px));
}

.pscroll-step-num {
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #8f8f8f;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.pscroll-step-line {
  display: block;
  width: 48px;
  height: 1px;
  background: rgba(21, 21, 20, 0.12);
}

.pscroll-title {
  font-family: var(--sans, 'Archivo', sans-serif);
  font-size: clamp(28px, 3.2vw, 50px);
  font-weight: 700;
  color: #000000;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
}

.pscroll-desc {
  font-family: var(--sans, 'Archivo', sans-serif);
  font-size: clamp(13px, 1.3vw, 16px);
  color: #555550;
  line-height: 1.7;
  max-width: 360px;
  margin: 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CENTRE — Phone mockup
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.pscroll-phone-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 2.5vw;
  perspective: 1000px; /* Enable 3D perspective */
  transform-style: preserve-3d;
}

.pscroll-phone {
  width: 272px;
  height: 554px;
  background: #181818;
  border-radius: 48px;
  border: 1.5px solid #2c2c2c;
  box-shadow:
    0 0 0 5px #121212,
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    rgba(0, 0, 0, 0.01) 0px 520px 146px 0px,
    rgba(0, 0, 0, 0.04) 0px 333px 133px 0px,
    rgba(0, 0, 0, 0.26) 0px 83px 83px 0px,
    rgba(0, 0, 0, 0.29) 0px 21px 46px 0px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Dynamic island notch */
.pscroll-notch {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 26px;
  background: #101010;
  border-radius: 20px;
  z-index: 20;
  box-shadow: 0 0 0 1.5px #1c1c1c;
}

.pscroll-screen-viewport {
  position: absolute;
  inset: 0;
  border-radius: 48px;
  overflow: hidden;
}

/* ── Phone screens: DARK interior ── */
.pscroll-screen {
  position: absolute;
  inset: 0;
  background: #0f0f11;
  padding: 50px 18px 18px;
  box-sizing: border-box;
  overflow: hidden;

  /* Start hidden below — reveal upward */
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.pscroll-screen.active {
  opacity: 1;
  transform: translateY(0);
}

/* Previous screen fades up and out */
.pscroll-screen.exiting {
  opacity: 0;
  transform: translateY(-20px);
}

/* ── Screen header ── */
.ps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-top: 4px;
}

.ps-app-name {
  font-family: var(--sans, 'Archivo', sans-serif);
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.ps-badge {
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 7.5px;
  color: #8e8e93;
  background: #1c1c1e;
  padding: 3px 8px;
  border-radius: 20px;
}

/* ── Screen 1: Comparison bars (monochromatic white/grey) ── */
.ps-comp-bars {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 14px;
}

.ps-comp-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ps-comp-label {
  font-size: 8.5px;
  color: #8e8e93;
  width: 72px;
  flex-shrink: 0;
  font-family: var(--mono, 'Space Mono', monospace);
}

.ps-comp-bar-track {
  flex: 1;
  height: 7px;
  background: #1c1c1e;
  border-radius: 20px;
  overflow: hidden;
}

.ps-comp-bar {
  height: 100%;
  border-radius: 20px;
}

.ps-comp-pct {
  font-size: 9px;
  font-weight: 700;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--mono, 'Space Mono', monospace);
}

.ps-kpi-row {
  display: flex;
  gap: 7px;
  margin-top: 6px;
}

.ps-kpi {
  flex: 1;
  background: #1c1c1e;
  border: 1px solid #2c2c2e;
  border-radius: 10px;
  padding: 9px 6px;
  text-align: center;
}

.ps-kpi-val {
  display: block;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--kc, #ffffff);
  font-family: var(--mono, 'Space Mono', monospace);
  margin-bottom: 3px;
}

.ps-kpi-lbl {
  display: block;
  font-size: 7px;
  color: #8e8e93;
  font-family: var(--sans, 'Archivo', sans-serif);
}

/* ── Screen 2: Gantt (monochromatic white/grey) ── */
.ps-gantt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.ps-gantt-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ps-gantt-label {
  font-size: 8px;
  color: #8e8e93;
  width: 78px;
  flex-shrink: 0;
  font-family: var(--mono, 'Space Mono', monospace);
}

.ps-gantt-track {
  flex: 1;
  height: 12px;
  background: #1c1c1e;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.ps-gantt-bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
}

.ps-milestone-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.ps-chip {
  font-size: 7.5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--mono, 'Space Mono', monospace);
  font-weight: 700;
}

/* ── Screen 3: Donut + checklist (dark background) ── */
.ps-donut-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.ps-donut {
  width: 96px;
  height: 96px;
}

.ps-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ps-check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  color: #ffffff;
  font-family: var(--sans, 'Archivo', sans-serif);
}

.ps-check-icon {
  font-size: 8px;
  color: #000000;
  background: #ffffff;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 900;
}

.ps-check-status {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 700;
  font-family: var(--mono, 'Space Mono', monospace);
}

/* ── Screen 4: Revenue bars ── */
.ps-rev-chart {
  margin-bottom: 12px;
}

.ps-rev-bars {
  display: flex;
  gap: 7px;
  align-items: flex-end;
  height: 130px;
}

.ps-rev-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.ps-rev-bar-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  min-height: 0;
  background: #1c1c1e;
  border-radius: 5px 5px 0 0;
}

.ps-rev-bar {
  width: 100%;
  border-radius: 5px 5px 0 0;
}

.ps-rev-yr {
  font-size: 7px;
  color: #8e8e93;
  margin-top: 4px;
  font-family: var(--mono, 'Space Mono', monospace);
}

.ps-rev-amt {
  font-size: 6.5px;
  color: #8e8e93;
  font-family: var(--mono, 'Space Mono', monospace);
}

.ps-rev-stats {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.ps-rev-stat {
  font-size: 9.5px;
  color: #8e8e93;
  font-family: var(--sans, 'Archivo', sans-serif);
  text-align: center;
}

.ps-rev-stat span {
  font-weight: 700;
  font-size: 12px;
  margin-right: 3px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RIGHT — context cards
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.pscroll-right {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 5.5vw;
  position: relative;
  height: 100%;
}

.pscroll-cards {
  position: relative;
  width: 220px;
  height: 280px;
}

.pscroll-card {
  position: absolute;
  inset: 0;
  background: #ffffff;
  border: 1px solid rgba(21, 21, 20, 0.08);
  border-radius: 18px;
  padding: 22px 20px;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);

  /* Fade + slide animation */
  opacity: 0;
  transform: translateY(24px);
  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;
}

.pscroll-card.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pscroll-card.exiting {
  opacity: 0;
  transform: translateY(-20px);
}

.psc-tag {
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8f8f8f;
  margin-bottom: 14px;
}

.psc-stat {
  font-family: var(--sans, 'Archivo', sans-serif);
  font-size: 44px;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 6px;
}

.psc-label {
  font-family: var(--sans, 'Archivo', sans-serif);
  font-size: 11px;
  color: #4a4a45;
  line-height: 1.4;
  margin-bottom: 16px;
}

.psc-contrast-sub {
  color: #555550;
}

.psc-divider {
  height: 1px;
  background: rgba(21, 21, 20, 0.08);
  margin-bottom: 14px;
}

.psc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
}

.psc-key {
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 9px;
  color: #8f8f8f;
}

.psc-val {
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 9px;
  font-weight: 700;
  color: #151514;
}

.psc-green  { color: #10b981 !important; }
.psc-purple { color: #8b5cf6 !important; }
.psc-amber  { color: #f59e0b !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PROGRESS pills
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.pscroll-progress {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
}

.pscroll-pip {
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: rgba(21, 21, 20, 0.1);
  transition: background 0.35s ease, width 0.35s ease;
}

.pscroll-pip.active {
  background: #000000;
  width: 44px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 1100px) {
  .pscroll-sticky {
    grid-template-columns: 1fr auto;
  }
  .pscroll-right { display: none; }
}

@media (max-width: 800px) {
  .pscroll-sticky {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 72px 5vw 32px;
    gap: 36px;
    align-content: center;
  }

  .pscroll-left { height: auto; }

  .pscroll-slide {
    position: static;
    transform: none;
    opacity: 0;
  }
  .pscroll-slide.active { transform: none; opacity: 1; }
  .pscroll-slide.exiting { transform: none; opacity: 0; }

  .pscroll-phone { width: 220px; height: 440px; }
  .pscroll-title  { font-size: 26px; }
}

/* ── 3D Phone & Glare Styles ── */
.pscroll-glare {
  position: absolute;
  inset: 0;
  z-index: 50;
  border-radius: 48px;
  mix-blend-mode: overlay;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.9) 10%, rgba(255, 255, 255, 0.75) 20%, rgba(255, 255, 255, 0) 80%);
  transition: opacity 0.25s ease;
  will-change: background, opacity;
}

.pscroll-phone-wrap {
  perspective: 1500px !important;
}

.pscroll-phone {
  transform-style: preserve-3d !important;
}

.pscroll-screen-viewport {
  transform-style: preserve-3d !important;
}

.pscroll-screen {
  transform-style: preserve-3d !important;
}

/* Float inner elements of active screen in 3D Space */
.pscroll-screen.active > * {
  transform: translateZ(28px);
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.pscroll-phone:hover .pscroll-screen.active > * {
  transform: translateZ(46px);
}
