/* TRAPICHE v71 — production stability + spacing + responsive polish */

/* --------------------------------------------------------------------------
   Layer contract
   The hero scroll journey is a temporary viewport layer. Every real section
   after the hero is an opaque document sheet and must never reveal it.
   -------------------------------------------------------------------------- */
.project-scroll-journey[aria-hidden="true"] {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
/* V71 — the last hero slide remains as a fixed visual plane while the
   following Work sheet enters. The JS retires this layer as soon as Work
   reaches the viewport top, so it cannot bleed into downstream sections. */
.project-scroll-journey.is-handoff {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
}
.work-section,
.capabilities-section,
.approach-section,
.studio-section,
.problem-section,
.build-section,
.principles-section {
  position: relative;
  isolation: isolate;
  z-index: 82;
}
.work-section,
.capabilities-section,
.problem-section,
.principles-section { background-color: var(--paper); }
.build-section { background-color: #10100f; }

/* --------------------------------------------------------------------------
   Global vertical rhythm
   -------------------------------------------------------------------------- */
.work-section {
  padding-top: clamp(82px, 9.5vh, 122px);
  padding-bottom: clamp(88px, 10.5vh, 136px);
}
.capabilities-section {
  padding-top: clamp(92px, 11vh, 138px) !important;
  padding-bottom: clamp(92px, 11vh, 138px) !important;
}
.approach-section--v56 {
  padding-top: clamp(94px, 11vh, 138px) !important;
  padding-bottom: clamp(96px, 11vh, 140px) !important;
}

/* Studio keeps the approved inversion, but releases sooner and cleanly. */
@media (min-width: 801px) and (prefers-reduced-motion: no-preference) {
  .studio-section { height: 205vh !important; }
}

/* Problem narrative: enough travel for five states without an empty tail. */
@media (min-width: 821px) {
  .problem-section { height: 220svh !important; }
  .problem-stage {
    padding-top: clamp(88px, 10vh, 112px);
    padding-bottom: clamp(30px, 4vh, 46px);
  }
  .problem-frame {
    grid-template-columns: minmax(180px, .38fr) minmax(0, 1.62fr) 86px;
    gap: clamp(22px, 3.4vw, 58px);
  }
  .problem-copy { min-height: clamp(270px, 39vh, 430px); }
  .problem-card h2 { font-size: clamp(46px, 5.7vw, 98px); max-width: 1030px; }
  .problem-card p { margin-top: clamp(20px, 3vh, 32px); }
}

.build-section {
  padding-top: clamp(94px, 11vh, 132px);
  padding-bottom: clamp(78px, 9vh, 108px);
}
.build-head { margin-bottom: clamp(48px, 6vh, 76px); }
.principles-section { padding-top: clamp(86px, 10vh, 124px); }
.principles-head { padding-bottom: clamp(46px, 5.5vh, 68px); }
.final-cta { min-height: 72svh; }

/* --------------------------------------------------------------------------
   Notebook / short desktop: preserve composition without vertical crowding.
   -------------------------------------------------------------------------- */
@media (min-width: 821px) and (max-height: 800px) {
  :root { --header-height: 78px; }
  .site-header { height: 78px; }
  .work-section { padding-top: 76px; padding-bottom: 86px; }
  .capabilities-section { padding-top: 82px !important; padding-bottom: 88px !important; }
  .approach-section--v56 { padding-top: 82px !important; padding-bottom: 88px !important; }
  .approach-stage--v56 { margin-top: 62px !important; }
  .approach-step--v56 { min-height: 280px; padding-top: 26px !important; padding-bottom: 34px !important; }
  .studio-shell { padding-top: 28px; padding-bottom: 28px; }
  .problem-stage { padding-top: 76px; padding-bottom: 24px; }
  .problem-copy { min-height: 250px; }
  .problem-card__index { margin-bottom: 14px; }
  .problem-card p { font-size: 15px; }
  .build-section { padding-top: 82px; padding-bottom: 82px; }
  .build-head { margin-bottom: 46px; }
  .build-canvas { min-height: 500px; }
  .principle-row { min-height: 138px; }
}

/* --------------------------------------------------------------------------
   Tablet / mobile audit
   No desktop pins, no fixed journey, tighter spacing, safe typography.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  html, body { overflow-x: clip; }
  .project-scroll-journey { display: none !important; }

  .work-section { padding: 70px 22px 78px; }
  .work-head { margin-bottom: 30px; }
  .work-title-block h2 { font-size: clamp(44px, 12.5vw, 64px); }
  .work-card--feature { height: clamp(320px, 96vw, 390px); }
  .work-card--compact { height: clamp(205px, 62vw, 245px); }
  .work-card__meta strong { font-size: clamp(22px, 7vw, 30px); }

  .capabilities-section { padding: 78px 22px 80px !important; }
  .services-module { margin-top: 52px; }
  .services-module__grid { gap: 20px; }
  .services-module__stage { border-radius: 12px; }
  .service-selector { min-height: 62px; }
  .services-module__details { min-height: 164px; }

  .approach-section--v56 { padding: 76px 22px 82px !important; }
  .approach-head--v56 .approach-kicker { margin-bottom: 38px !important; }
  .approach-head--v56 .approach-title-wrap h2 { font-size: clamp(44px, 12.2vw, 66px) !important; }
  .approach-stage--v56 { margin-top: 54px !important; }
  .approach-step--v56 { min-height: 220px; padding: 26px 20px 30px !important; }

  .studio-shell { padding: 68px 22px 58px; min-height: 0; }
  .studio-top { margin-bottom: 44px; }
  .studio-discipline + .studio-discipline { margin-top: 58px; padding-top: 50px; }
  .studio-discipline h3 { font-size: clamp(50px, 14vw, 76px); }
  .studio-merge { padding-top: 66px; margin-top: 62px; }
  .studio-merge h2 { font-size: clamp(50px, 14vw, 78px); }
  .studio-bottom { margin-top: 44px; }

  .problem-stage { padding: 76px 22px 62px; }
  .problem-aside { margin: 40px 0 38px; }
  .problem-copy { gap: 34px; }
  .problem-card { padding-bottom: 34px; }
  .problem-card h2 { font-size: clamp(38px, 11.4vw, 58px); line-height: .94; }
  .problem-card p { font-size: 14px; line-height: 1.55; }

  .build-section { padding: 78px 22px 68px; }
  .build-head { margin-bottom: 38px; }
  .build-head h2 { font-size: clamp(44px, 12.6vw, 64px); }
  .build-menu { margin-bottom: 28px; }
  .build-option { min-height: 62px; }
  .build-option__name { font-size: 20px; }
  .build-canvas { min-height: 370px; }
  .build-browser,
  .build-dashboard,
  .build-brand-board,
  .build-campaign-board,
  .build-map { inset: 5%; }

  .principles-section { padding-top: 78px; }
  .principles-head { padding: 0 22px 44px; }
  .principles-head h2 { font-size: clamp(44px, 12.5vw, 66px); }
  .principle-row { min-height: 150px; padding: 24px 22px; }
  .principle-row h3 { font-size: clamp(31px, 9vw, 48px); }
  .final-cta { min-height: 64svh; padding: 78px 22px; }
  .final-cta h2 { font-size: clamp(52px, 15.5vw, 82px); }
}

@media (max-width: 430px) {
  .work-card__meta,
  .work-card--compact .work-card__meta { left: 48px; right: 14px; bottom: 15px; }
  .work-card__arrow { width: 34px; height: 34px; }
  .service-selector { grid-template-columns: 27px 28px minmax(0,1fr) 16px; }
  .service-selector > strong { font-size: 21px; }
  .build-canvas { min-height: 340px; }
  .build-dashboard { grid-template-columns: 78px 1fr; }
  .dash-main { padding: 16px; gap: 10px; }
  .dash-stats { gap: 8px; }
  .principle-row { grid-template-columns: 30px 1fr; gap: 14px; }
}

/* Mobile hero audit: one clear card, no ghost deck leaking outside the viewport. */
@media (max-width: 820px) {
  .hero-visual {
    margin: 18px 0 0 !important;
    min-height: 420px;
    overflow: hidden !important;
  }
  .project-stage,
  .project-stage.is-archive-stage,
  .project-stage.is-mosaic-stage {
    width: 100% !important;
    height: 420px !important;
    margin: 0 !important;
    transform: none !important;
  }
  .project-cards { inset: 0 !important; }
  .project-card-wrap,
  .project-stage.is-archive-stage .project-card-wrap,
  .project-stage.is-mosaic-stage .project-card-wrap {
    inset: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  .project-card-wrap.is-active,
  .project-stage.is-archive-stage .project-card-wrap.is-active,
  .project-stage.is-mosaic-stage .project-card-wrap.is-active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 5 !important;
  }
  .project-windowbar { min-height: 42px; padding: 0 14px; }
  .project-media__tag { left: 16px; bottom: 116px; }
  .project-meta { left: 16px; right: 16px; bottom: 18px; gap: 12px; }
  .project-meta__text strong { font-size: clamp(23px, 7vw, 30px); }
  .project-meta__link { font-size: 7px; white-space: nowrap; }
  .slider-controls { left: 14px !important; bottom: 12px !important; }
}

/* No gesture travel is needed when the desktop sequence is instantaneous. */
@media (min-width:821px) and (prefers-reduced-motion:reduce) {
 .problem-section { height:auto !important; }
 .problem-stage { height:100svh; }
}
