/* ================================================================
   QUALZY — Any Project, Any Duration Page Styles
   All styles specific to features/any-project.html
   Class prefix: ap-
   ================================================================ */


/* HERO
   ---------------------------------------------------------------- */
.ap-hero {
  padding-top: 64px; /* nav height offset */
  background: var(--wh);
  position: relative;
  overflow: hidden;
}

/* Decorative blobs */
.ap-hd1 {
  position: absolute;
  top: -200px; right: -160px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: var(--op);
  z-index: 0;
}

.ap-hd1::after {
  content: '';
  position: absolute;
  inset: 90px;
  border-radius: 50%;
  background: var(--om);
}

.ap-hd2 {
  position: absolute;
  bottom: 60px; left: -80px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: var(--op);
  z-index: 0;
}

.ap-hsvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Hero inner content */
.ap-hi {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 48px 88px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ap-back {
  font-size: 13px;
  font-weight: 500;
  color: var(--mu);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 28px;
  align-self: flex-start;
  transition: color var(--t-base);
}

.ap-back:hover { color: var(--o); }

.ap-hi h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 6.5vw, 86px);
  font-weight: 900;
  line-height: 1.0;
  color: var(--dk);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.ap-hi h1 em {
  font-style: italic;
  color: var(--o);
}

.ap-hsub {
  font-size: 19px;
  color: var(--mid);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 580px;
  font-weight: 300;
}

.ap-hbtns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 52px;
}

/* Stat bar override */
.ap-hi .hst {
  max-width: 580px;
}

.ap-hi .hst .sn {
  font-size: 28px;
  line-height: 1.15;
}


/* PROJECT FORMATS (dark)
   ---------------------------------------------------------------- */
.ap-formats {
  background: var(--dk);
  padding: 100px 80px;
}

.ap-formats-inn {
  max-width: 1200px;
  margin: 0 auto;
}

.ap-formats-hd {
  text-align: center;
  margin-bottom: 72px;
}

.ap-formats-hd .sbod {
  margin: 0 auto;
}

.ap-formats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ap-fcard {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color var(--t-base), background var(--t-base);
}

.ap-fcard:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(232, 97, 44, 0.3);
}

.ap-fcard-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(232, 97, 44, 0.12);
  border: 1px solid rgba(232, 97, 44, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  flex-shrink: 0;
}

.ap-fcard-icon svg {
  width: 22px; height: 22px;
  stroke: var(--o);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ap-fcard-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ap-fcard-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.2;
}

.ap-fcard-text {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}

.ap-fcard-tag {
  display: inline-block;
  align-self: flex-start;
  background: rgba(232, 97, 44, 0.12);
  color: var(--o);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid rgba(232, 97, 44, 0.25);
  letter-spacing: 0.04em;
}


/* METHODOLOGY FREEDOM (light)
   ---------------------------------------------------------------- */
.ap-method {
  background: var(--wh);
}

.ap-method-hd {
  text-align: center;
  margin-bottom: 56px;
}

.ap-method-hd .sbod {
  margin: 0 auto;
}

.ap-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ap-mcard {
  background: #fff;
  border: 1.5px solid var(--rule);
  border-left: 3px solid var(--o);
  border-radius: 0 12px 12px 0;
  padding: 28px 26px;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.ap-mcard:hover {
  border-left-color: var(--o);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.ap-mcard-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--dk);
  margin-bottom: 10px;
  line-height: 1.25;
}

.ap-mcard-text {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.7;
  font-weight: 300;
}


/* ACTIVITY TYPES (warm --op)
   ---------------------------------------------------------------- */
.ap-acts {
  background: var(--op);
}

.ap-acts-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  align-items: center;
}

.ap-acts-body {
  font-size: 16px;
  color: var(--mid);
  line-height: 1.7;
  font-weight: 300;
  margin-top: 16px;
  margin-bottom: 0;
}

.ap-acts-link {
  display: inline-block;
  margin-top: 28px;
  font-size: 15px;
  font-weight: 700;
  color: var(--o);
  text-decoration: none;
  border-bottom: 1.5px solid rgba(232, 97, 44, 0.3);
  padding-bottom: 2px;
  transition: border-color var(--t-base), color var(--t-base);
}

.ap-acts-link:hover {
  color: var(--o2);
  border-color: var(--o2);
}

/* Activity type chips */
.ap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

a.ap-chip,
.ap-chip {
  display: inline-block;
  background: #fff;
  color: var(--o);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1.5px solid rgba(232, 97, 44, 0.25);
  transition: background var(--t-base), border-color var(--t-base);
  white-space: nowrap;
  text-decoration: none;
}

.ap-chip:hover {
  background: var(--om);
  border-color: rgba(232, 97, 44, 0.4);
}


/* WITHIN-PROJECT SEGMENTATION (dark)
   ---------------------------------------------------------------- */
.ap-seg {
  background: var(--dk);
  padding: 100px 80px;
}

.ap-seg-inn {
  max-width: 1200px;
  margin: 0 auto;
}

.ap-seg-hd {
  text-align: center;
  margin-bottom: 64px;
}

.ap-seg-hd .sbod {
  margin: 0 auto;
}

.ap-seg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.ap-seg-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px 28px;
  transition: border-color var(--t-base), background var(--t-base);
}

.ap-seg-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(232, 97, 44, 0.3);
}

.ap-seg-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(232, 97, 44, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.ap-seg-icon svg {
  width: 22px; height: 22px;
  stroke: var(--o);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ap-seg-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.3;
}

.ap-seg-card p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.65;
}

/* Multi-market callout */
.ap-seg-callout {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid rgba(232, 97, 44, 0.6);
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.ap-seg-callout-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.ap-seg-callout-icon svg {
  width: 18px; height: 18px;
  stroke: rgba(232, 97, 44, 0.7);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ap-seg-callout p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.65;
}


/* DURATION FLEXIBILITY (light)
   ---------------------------------------------------------------- */
.ap-duration {
  background: var(--wh);
}

.ap-duration-hd {
  text-align: center;
  margin-bottom: 72px;
}

.ap-duration-hd .sbod {
  margin: 0 auto;
}

/* Timeline — horizontal on desktop, vertical on mobile */
.ap-timeline {
  width: 100%;
  overflow-x: auto;
  /* padding prevents dot box-shadows being clipped at the edges */
  padding: 0 12px 12px;
  margin: 0 -12px;
  width: calc(100% + 24px);
  box-sizing: border-box;
}

.ap-tl-track {
  display: flex;
  align-items: flex-start;
  min-width: 720px;
  position: relative;
  padding-top: 32px;
}

/* Baseline grey line — animates in via scaleX */
.ap-tl-track::before {
  content: '';
  position: absolute;
  top: 44px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--rule);
  z-index: 0;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ap-timeline.vis .ap-tl-track::before {
  transform: scaleX(1);
}

.ap-tl-segment {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

.ap-tl-segment--last {
  flex: 0 0 auto;
  padding-right: 8px;
}

/* Horizontal orange bars — animate width from 0 */
.ap-tl-bar {
  position: absolute;
  top: 44px;
  left: 16px;
  height: 2px;
  background: linear-gradient(to right, var(--o), rgba(232,97,44,.35));
  z-index: 1;
  width: calc(100% - 16px);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ap-timeline.vis .ap-tl-bar--1 { transform: scaleX(1); transition-delay: 0.5s; }
.ap-timeline.vis .ap-tl-bar--2 { transform: scaleX(1); transition-delay: 0.85s; }
.ap-timeline.vis .ap-tl-bar--3 { transform: scaleX(1); transition-delay: 1.2s; }
.ap-timeline.vis .ap-tl-bar--4 { transform: scaleX(1); transition-delay: 1.55s; }

/* Dots — scale in with staggered delay */
.ap-tl-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--o);
  border: 3px solid var(--wh);
  box-shadow: 0 0 0 2px var(--o);
  position: relative;
  z-index: 2;
  margin-top: 36px;
  flex-shrink: 0;
  transform: scale(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Stagger each dot — nth-of-type won't work across segments, so use segment nth-child */
.ap-timeline.vis .ap-tl-segment:nth-child(1) .ap-tl-dot { transform: scale(1); transition-delay: 0.3s; }
.ap-timeline.vis .ap-tl-segment:nth-child(2) .ap-tl-dot { transform: scale(1); transition-delay: 0.65s; }
.ap-timeline.vis .ap-tl-segment:nth-child(3) .ap-tl-dot { transform: scale(1); transition-delay: 1.0s; }
.ap-timeline.vis .ap-tl-segment:nth-child(4) .ap-tl-dot { transform: scale(1); transition-delay: 1.35s; }
.ap-timeline.vis .ap-tl-segment:nth-child(5) .ap-tl-dot { transform: scale(1); transition-delay: 1.7s; }

.ap-tl-dot--first {
  box-shadow: 0 0 0 2px var(--o), 0 0 0 6px rgba(232,97,44,.18);
}

/* Pulse ring on the first dot after it appears */
.ap-tl-dot--first::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(232,97,44,.35);
  opacity: 0;
  transform: scale(0.6);
}

.ap-timeline.vis .ap-tl-dot--first::after {
  animation: tlDotPulse 2s ease-out 0.7s infinite;
}

@keyframes tlDotPulse {
  0%   { opacity: 0.7; transform: scale(0.8); }
  100% { opacity: 0;   transform: scale(1.6); }
}

.ap-tl-dot--last {
  background: var(--dk);
  box-shadow: 0 0 0 2px var(--dk);
}

/* Labels — fade + slide up with stagger */
.ap-tl-label {
  margin-top: 16px;
  padding-right: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ap-timeline.vis .ap-tl-segment:nth-child(1) .ap-tl-label { opacity: 1; transform: none; transition-delay: 0.4s; }
.ap-timeline.vis .ap-tl-segment:nth-child(2) .ap-tl-label { opacity: 1; transform: none; transition-delay: 0.75s; }
.ap-timeline.vis .ap-tl-segment:nth-child(3) .ap-tl-label { opacity: 1; transform: none; transition-delay: 1.1s; }
.ap-timeline.vis .ap-tl-segment:nth-child(4) .ap-tl-label { opacity: 1; transform: none; transition-delay: 1.45s; }
.ap-timeline.vis .ap-tl-segment:nth-child(5) .ap-tl-label { opacity: 1; transform: none; transition-delay: 1.8s; }

.ap-tl-label--last {
  padding-right: 0;
}

.ap-tl-period {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--o);
  margin-bottom: 4px;
}

.ap-tl-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--dk);
  margin-bottom: 4px;
  line-height: 1.2;
}

.ap-tl-desc {
  font-size: 12px;
  color: var(--mu);
  line-height: 1.45;
}

.ap-tl-dot--last ~ .ap-tl-label .ap-tl-period {
  color: var(--dk);
}

/* Reduced motion — skip animations */
@media (prefers-reduced-motion: reduce) {
  .ap-tl-track::before,
  .ap-tl-bar,
  .ap-tl-dot,
  .ap-tl-label {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
    animation: none !important;
  }
}


/* PLATFORM SUPPORT (dark)
   ---------------------------------------------------------------- */
.ap-support {
  background: var(--dk);
  padding: 100px 80px;
}

.ap-support-inn {
  max-width: 1200px;
  margin: 0 auto;
}

.ap-support-hd {
  text-align: center;
  margin-bottom: 64px;
}

.ap-support-hd .sbod {
  margin: 0 auto;
}

.ap-support-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.ap-scard {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px 28px;
  transition: border-color var(--t-base), background var(--t-base);
}

.ap-scard:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(232, 97, 44, 0.3);
}

.ap-scard-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(232, 97, 44, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.ap-scard-icon svg {
  width: 22px; height: 22px;
  stroke: var(--o);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ap-scard-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.3;
}

.ap-scard-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.65;
}


/* RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 900px) {

  /* Hero */
  .ap-hi { padding: 48px 24px 72px; }
  .ap-hi .hst .sn { font-size: 22px; }

  /* Dark section padding */
  .ap-formats { padding: 64px 24px; }
  .ap-seg     { padding: 64px 24px; }
  .ap-support { padding: 64px 24px; }

  /* Formats: 2-col → 1-col */
  .ap-formats-grid { grid-template-columns: 1fr; }

  /* Methodology: 3-col → 1-col */
  .ap-method-grid { grid-template-columns: 1fr; }

  /* Activity types: 2-col → 1-col */
  .ap-acts-grid { grid-template-columns: 1fr; gap: 40px; }

  /* Segmentation: 3-col → 1-col */
  .ap-seg-grid { grid-template-columns: 1fr; }

  /* Support: 4-col → 2-col */
  .ap-support-grid { grid-template-columns: 1fr 1fr; }

  /* Timeline: switch to vertical layout */
  .ap-timeline { overflow-x: visible; padding: 0 0 12px; margin: 0; width: 100%; }

  .ap-tl-track {
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    padding-top: 0;
    padding-left: 24px;
    gap: 0;
  }

  /* Replace horizontal line with vertical */
  .ap-tl-track::before {
    top: 8px;
    bottom: 8px;
    left: 30px;
    right: auto;
    width: 2px;
    height: auto;
    /* Vertical line animates scaleY instead */
    transform-origin: top center;
    transform: scaleY(0);
  }
  .ap-timeline.vis .ap-tl-track::before {
    transform: scaleY(1);
  }

  .ap-tl-segment {
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    flex: none;
    padding-bottom: 32px;
    gap: 20px;
  }

  .ap-tl-segment--last { padding-right: 0; padding-bottom: 0; }

  /* Hide horizontal bars on mobile */
  .ap-tl-bar { display: none; }

  .ap-tl-dot {
    margin-top: 4px;
    flex-shrink: 0;
  }

  .ap-tl-label {
    margin-top: 0;
    padding-right: 0;
  }
}

@media (max-width: 600px) {

  /* Support: 2-col → 1-col */
  .ap-support-grid { grid-template-columns: 1fr; }

  /* Chips wrap fine — no change needed */

  /* Seg callout: stack */
  .ap-seg-callout { flex-direction: column; gap: 10px; }

  /* Method cards: remove left border radius for full bleed */
  .ap-mcard { border-radius: 0 8px 8px 0; }
}
