/* Layout — editorial × dark industrial SaaS grid. */

.section {
  position: relative;
  padding: clamp(96px, 14vw, 168px) 0;
  z-index: var(--z-section);
}

/* Sekcja z subtelnym dachem — bardzo lekki overlay nad aurorą.
 * 3D nie jest już widoczne pod sekcjami content (canvas znika za hero),
 * więc nie potrzeba mocnego ciemnego dachu. */
.section--veiled::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(15, 23, 42, 0.18), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100dvh;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding-top: calc(var(--safe-top) + 120px);
  padding-bottom: clamp(48px, 8vw, 112px);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  z-index: var(--z-section);
}
.hero__inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.45fr);
  gap: var(--s-7);
  align-items: end;
}
.hero__copy {
  min-width: 0;
  max-width: min(78ch, 100%);
  position: relative;
}
.hero__aside {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  justify-self: end;
  width: 100%;
  max-width: 280px;
  padding-bottom: 4px;
}

@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__aside { max-width: 100%; justify-self: stretch; }
}

/* ── TICKER ── */
.ticker {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  z-index: var(--z-section);
}

/* ── Product split — c3 timeline + driven stage ── */
.product-split {
  margin: var(--s-8) auto 0;
  max-width: min(1280px, calc(100% - var(--gutter) * 2));
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}
.product-split__top {
  position: relative;
  padding: clamp(28px, 4vw, 44px) clamp(20px, 4vw, 48px) clamp(36px, 5vw, 52px);
  min-height: 200px;
}
.product-split__bottom {
  position: relative;
  padding: clamp(28px, 4vw, 44px) clamp(20px, 4vw, 48px) clamp(36px, 5vw, 52px);
  min-height: 320px;
}
.product-split__divider {
  height: 1px;
  margin: 0 clamp(20px, 4vw, 48px);
  background: var(--line-2);
}
.product-split__label {
  margin: 0 0 var(--s-5);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mute2);
}
.product-split__label-accent {
  color: var(--violet-2);
}
.product-timeline {
  position: relative;
  padding-top: 72px;
}
.product-timeline__track {
  position: relative;
  height: 2px;
  background: var(--line-2);
}
.product-timeline__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--violet-2) 0%, rgba(236, 72, 153, 0.45) 100%);
}
.product-timeline__playhead {
  position: absolute;
  top: -26px;
  left: 0;
  width: 2px;
  height: 54px;
  background: var(--violet-2);
  transform: translateX(-1px);
  z-index: 4;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.55);
}
.product-timeline__playhead::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--violet-2);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.65);
}
.product-timeline__stem {
  position: absolute;
  top: -44px;
  width: 1px;
  height: 40px;
  background: var(--line-2);
  transform: translateX(-50%);
  transition: background 0.35s ease;
}
.product-timeline__stem.is-lit {
  background: var(--violet-2);
}
.product-timeline__capsule {
  position: absolute;
  top: -88px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-mute2);
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 0.35s,
    border-color 0.35s,
    box-shadow 0.35s,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-timeline__capsule:focus-visible {
  outline: 2px solid var(--violet-2);
  outline-offset: 3px;
}
.product-timeline__capsule-num {
  font-size: 9px;
  letter-spacing: 0.18em;
  margin-right: 8px;
  opacity: 0.65;
}
.product-timeline__capsule.is-lit {
  color: var(--violet-2);
  border-color: rgba(139, 92, 246, 0.65);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
  transform: translateX(-50%) scale(1.04);
}
.product-timeline__capsule.is-lit .product-timeline__capsule-num {
  opacity: 1;
}
.product-stage {
  position: relative;
  min-height: 240px;
}
@media (max-width: 960px) {
  .product-timeline { padding-top: 0; overflow-x: auto; padding-bottom: var(--s-3); }
  .product-timeline__track { min-width: 720px; }
  .product-split__top { min-height: 160px; }
  .testi-wall__grid {
    grid-template-columns: repeat(2, 1fr);
    transform: none;
  }
}

/* ── Process steps ── */
.steps-wrap {
  position: relative;
  margin-top: var(--s-8);
}
.steps-flow {
  position: absolute;
  top: 36px;
  left: 8%;
  right: 8%;
  width: 84%;
  height: 14px;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 10px var(--accent-glow));
  transform-origin: left center;
  overflow: visible;
}
.steps-flow [data-flow-packet] {
  display: none;
}
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  position: relative;
  z-index: 1;
}
.step { position: relative; }

@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps-flow { display: none; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ── Testimonials — w3 advisor wall + 3 featured ── */
.testi-advisor {
  position: relative;
  margin: var(--s-7) auto 0;
  max-width: min(1480px, calc(100% - var(--gutter) * 2));
  width: 100%;
  min-height: 420px;
}
.testi-wall {
  position: relative;
  padding: clamp(20px, 3vw, 32px);
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  overflow: hidden;
  transition: opacity 0.65s ease, filter 0.65s ease;
}
.testi-wall.is-dimmed {
  opacity: 0.3;
  filter: blur(6px);
  pointer-events: none;
}
.testi-wall__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  perspective: 1400px;
  transform: rotateX(5deg);
  transform-origin: 50% 40%;
}
.testi-wall__scan {
  position: absolute;
  left: -5%;
  right: -5%;
  top: -20%;
  height: 180px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  background: linear-gradient(
    180deg,
    rgba(139, 92, 246, 0) 0%,
    rgba(139, 92, 246, 0.14) 38%,
    rgba(236, 72, 153, 0.38) 50%,
    rgba(139, 92, 246, 0.14) 62%,
    rgba(139, 92, 246, 0) 100%
  );
  filter: blur(10px);
  will-change: transform, opacity;
}
/* Mobile-first: featured w normalnym flow */
.testi-featured {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  align-items: stretch;
  width: 100%;
  max-width: none;
  pointer-events: none;
  opacity: 0;
}
.testi-featured.is-live {
  pointer-events: auto;
}
.testi-advisor.is-featured-open {
  min-height: 0;
  padding-bottom: var(--s-6);
}
.testi-advisor__close {
  min-width: 148px;
  font-size: 13px;
}
.testi-advisor.is-featured-open .testi-advisor__close {
  position: static;
  transform: none;
  z-index: 7;
  align-self: center;
  margin-bottom: var(--s-4);
  order: -1;
}

@media (min-width: 961px) {
  .testi-featured {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -46%);
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    width: calc(100% - clamp(24px, 5vw, 48px));
    max-width: 1240px;
    gap: clamp(16px, 2.5vw, 28px);
  }
  .testi-advisor.is-featured-open {
    min-height: clamp(540px, 62vw, 720px);
    padding-bottom: clamp(88px, 11vw, 128px);
  }
  .testi-advisor.is-featured-open .testi-advisor__close {
    position: absolute;
    left: 50%;
    bottom: clamp(8px, 1.5vw, 20px);
    transform: translateX(-50%);
    order: unset;
    margin-bottom: 0;
  }
}

@media (max-width: 960px) {
  .testi-advisor {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    min-height: 0;
  }
  .testi-advisor.is-featured-open {
    min-height: 0;
    padding-bottom: var(--s-8);
  }
  .testi-advisor.is-featured-open .testi-wall {
    display: none;
  }
  .testi-featured {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    flex-direction: column;
    width: 100%;
    max-width: none;
  }
  .testi-advisor.is-featured-open .testi-advisor__close {
    position: static;
    transform: none;
    order: -1;
    align-self: stretch;
    margin-bottom: var(--s-3);
    width: 100%;
    justify-content: center;
    background: var(--bg-card-solid);
    border: 1px solid var(--line-edge);
  }
  .testi-advisor__pick-hint {
    order: 4;
  }
  .section--testi {
    overflow: visible;
  }
}
.testi-advisor__pick-hint {
  margin: var(--s-5) auto 0;
  max-width: min(560px, calc(100% - var(--gutter) * 2));
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.testi-advisor.is-pick-mode .testi-wall {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}
@media (max-width: 520px) {
  .testi-wall__grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .product-split__bottom { min-height: 280px; }
}

/* ── Pricing ── */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  max-width: 1120px;
  margin: var(--s-8) auto 0;
}
@media (max-width: 980px) { .plans { grid-template-columns: 1fr; max-width: 460px; } }

/* ── FAQ — single column, max-width centered ── */
.faq {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-8);
  max-width: 820px;
  margin-inline: auto;
}

/* ── CTA ── */
.section--cta {
  padding-top: clamp(120px, 18vw, 200px);
  padding-bottom: clamp(120px, 18vw, 200px);
  position: relative;
  overflow-x: visible;
  overflow-y: hidden;
  min-height: 640px;
}

/* Physics canvas — pełnowymiarowy layer w sekcji */
.cta__stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
  touch-action: none;          /* zapobiega scrollowi gdy ciągniemy box na touch */
}
.cta__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.cta__inner {
  position: relative;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}
.cta__inner > *:not(h2):not(.cta__hint),
.cta__inner [data-cta-btn] {
  pointer-events: auto;
}
[data-cta-heading] {
  position: relative;
  z-index: 3;                  /* nad pudłami; ale collider physiczny jest pod nim */
  pointer-events: none;
}

.cta__hint {
  margin-top: var(--s-5);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute2);
  opacity: 0;
  animation: cta-hint-pulse 4s ease-in-out 1.5s infinite;
}
@keyframes cta-hint-pulse {
  0%, 100% { opacity: 0; }
  20%, 80% { opacity: 1; } /* pełna nieprzezroczystość w szczycie — kontrast WCAG */
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: var(--z-section);
  background:
    radial-gradient(ellipse 50% 60% at 50% 100%, var(--accent-soft), transparent 70%),
    var(--bg-deep);
  border-top: 1px solid var(--line);
  padding: var(--s-9) 0 var(--s-6);
  overflow: hidden;
}

/* Dekoracyjny outlined wordmark — gigant w tle, mask na delikatność */
.footer__decor {
  position: absolute;
  inset: auto 0 -20px 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.footer__wordmark {
  font-family: var(--font-display);
  font-size: clamp(140px, 22vw, 320px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.85;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.05) 60%, transparent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.footer .container { position: relative; z-index: 1; }

.footer__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-7);
  padding-bottom: var(--s-8);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s-7);
}
@media (max-width: 760px) {
  .footer__top { grid-template-columns: 1fr; }
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-7);
  margin-bottom: var(--s-8);
}
@media (max-width: 760px) { .footer__cols { grid-template-columns: 1fr 1fr; gap: var(--s-5); } }
@media (max-width: 480px) { .footer__cols { grid-template-columns: 1fr; gap: var(--s-4); } }

.footer__bottom {
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s-5);
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute2);
}
.footer__bottom-link {
  color: var(--ink-mute2);
  justify-self: end;
  transition: color var(--d-fast);
}
.footer__bottom-link:hover { color: var(--violet-2); }
@media (max-width: 760px) {
  .footer__bottom {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .footer__bottom-link { justify-self: center; }
}
