/* ===================================================================
   Connectry Portfolio — Custom Styles
   ===================================================================
   Hero particle brain canvas, CTA face layout, unique section particles,
   light mode with pink/teal alternating backgrounds.
   ================================================================= */

/* ── CSS-first hidden state (prevents FOUC before JS reveals) ── */
.cn-hero__logo,
.cn-hero__title,
.cn-hero__subtitle,
.cn-hero__scroll {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(8px);
}

/* ===== HERO ===== */

.cn-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  background: #025661;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cn-hero__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.cn-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(ellipse at center, transparent 25%, rgba(2, 86, 97, 0.45) 100%);
  pointer-events: none;
}

.cn-hero__content {
  position: relative;
  z-index: 5;
  text-align: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 2rem;
}

.cn-hero__logo {
  width: clamp(150px, 22vw, 280px);
  height: auto;
  margin-bottom: 1.5rem;
}

.cn-hero__title {
  font-family: 'roca', serif;
  font-weight: 300;
  font-size: clamp(1.6rem, 3.2vw, 3rem);
  color: #fff;
  margin: 0 0 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.cn-hero__title strong {
  font-weight: 700;
}

.cn-hero__subtitle {
  font-size: clamp(0.85rem, 1.3vw, 1.1rem);
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0;
}

.cn-hero__scroll {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.cn-hero__scroll-text {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.cn-hero__scroll-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f4b1c1;
  animation: cnScrollBounce 1.8s ease-in-out infinite;
}

@keyframes cnScrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(12px); opacity: 0.4; }
}

/* Hero bottom bar */
.cn-hero__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 6;
  background: #f9e8ec;
  padding: 1.2rem 8vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #025661;
  font-size: 0.9rem;
}

.cn-hero__bottom-text {
  font-weight: 500;
}

.cn-hero__bottom-explore {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}


/* ===== ALTERNATING SECTION BACKGROUNDS ===== */

.cn-alt-bg {
  background: #f2fafd;
}


/* ===== CTA FACE LAYOUT ===== */

.cn-cta {
  position: relative;
  overflow: hidden;
  justify-content: flex-start;
  text-align: left;
}

.cn-cta .pf-cta__content {
  position: relative;
  z-index: 2;
  align-items: flex-start;
}

.cn-cta__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.cn-cta__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}

.cn-cta__bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 86, 97, 0.9) 0%, rgba(2, 86, 97, 0.7) 40%, rgba(2, 86, 97, 0.2) 70%, transparent 85%);
  z-index: 1;
}


/* CTA heading — white text on teal bg */
.cn-cta .pf-cta__heading {
  color: #fff;
}


/* ===== UNIQUE SECTION CANVAS ===== */

.cn-unique-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.pf-unique .pf-unique__layer {
  position: relative;
  z-index: 1;
}


/* ===== NEW BUILD TAG (Before/After replacement) ===== */

.cn-new-build {
  padding: calc(2rem + 2vh) 8vw;
  text-align: center;
  background: var(--pf-bg);
}

.cn-new-build__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  border-radius: 100px;
  background: rgba(244, 177, 193, 0.12);
  border: 1px solid rgba(244, 177, 193, 0.3);
  color: #025661;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.cn-new-build__tag svg {
  color: #f4b1c1;
}


/* ===== ANIMATION VIDEOS — square aspect ratio ===== */

.pf-animations__cell {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
}

.pf-animations__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ===== DEVBREAK: light mode in alt-bg wrapper ===== */

.cn-alt-bg .pf-devbreak {
  background: transparent;
}

.cn-alt-bg .pf-devbreak__cell {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}


/* ===== PINK ACCENT OVERRIDES ===== */

/* Pink (#f4b1c1) is too light for text on white — darken for accessibility */
.pf-stats__num {
  color: #025661;
}


/* ===== CARD STACK — Services cards from theconnectry.com ===== */

.cn-card-stack {
  margin-top: 2rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

.cn-card-stack__cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.cn-card-stack__card {
  border-radius: 30px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s;
  color: #000;
}

.cn-card-stack__card--pink  { background: #f9e8ec; }
.cn-card-stack__card--blue  { background: #f2fafd; }
.cn-card-stack__card--cream { background: #f9f6f0; }
.cn-card-stack__card--grey  { background: #f0f0f0; }

.cn-card-stack__icon {
  width: 41.666%;
  aspect-ratio: 1;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,1) 15%, transparent 90%);
  display: grid;
  place-items: center;
  margin-bottom: 1.5rem;
}

.cn-card-stack__icon img {
  max-height: 50%;
  width: 50%;
  object-fit: contain;
}

/* Video container inside card — replaces icon */
.cn-card-stack__video {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.4);
}

.cn-card-stack__video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cn-card-stack__title {
  font-family: 'roca', serif;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.cn-card-stack__text {
  font-size: 0.85rem;
  color: rgba(0,0,0,0.6);
  line-height: 1.55;
  margin: 0;
}

/* Scattered state — cards are stacked/rotated by default, snap to grid on hover */
@media (min-width: 1200px) {
  .cn-card-stack__cards:not(:hover) .cn-card-stack__card:nth-child(1) {
    transform: translate(60%) rotate(16deg);
  }
  .cn-card-stack__cards:not(:hover) .cn-card-stack__card:nth-child(2) {
    transform: translate(15%, 5%) rotate(-9deg);
  }
  .cn-card-stack__cards:not(:hover) .cn-card-stack__card:nth-child(3) {
    transform: translate(-15%, -5%) rotate(12deg);
  }
  .cn-card-stack__cards:not(:hover) .cn-card-stack__card:nth-child(4) {
    transform: translate(-60%) rotate(-8deg);
  }
}

/* Hover text color — teal on hover like live site */
.cn-card-stack__card:hover {
  color: #025661;
}


/* ===== IMAGE STACK — What They Wanted (replaces founder image) ===== */

.cn-image-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
}

.cn-image-stack__figure {
  position: relative;
  z-index: 30;
  aspect-ratio: 2 / 1;
  border-radius: 30px;
  overflow: hidden;
  transform-origin: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 640px) {
  .cn-image-stack__figure {
    transform: translateY(10%) rotate(-2deg);
  }
}

.cn-wanted-stack:hover .cn-image-stack__figure {
  transform: translateY(0) rotate(0);
}

.cn-image-stack__figure > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cn-image-stack__watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58%;
  z-index: 10;
  opacity: 0;
  scale: 80%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cn-wanted-stack:hover .cn-image-stack__watermark {
  opacity: 1;
  scale: 100%;
}

.cn-image-stack__layer {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cn-image-stack__layer--pink {
  z-index: 20;
  background: #f9e8ec;
  transform-origin: top right;
}

.cn-image-stack__layer--green {
  z-index: 10;
  background: #f2fafd;
  transform-origin: top left;
}

@media (min-width: 640px) {
  .cn-image-stack__layer--pink {
    transform: translateX(8.333%) translateY(16px) rotate(3deg);
  }
  .cn-image-stack__layer--green {
    transform: translateY(-10%) rotate(-3deg);
  }
}

.cn-wanted-stack:hover .cn-image-stack__layer {
  transform: none;
}

.cn-image-stack__noise {
  position: absolute;
  width: 66%;
  opacity: 0.3;
}

.cn-image-stack__layer--pink .cn-image-stack__noise {
  top: 0;
  left: 0;
  transform: translate(-33%, -33%);
}

.cn-image-stack__layer--green .cn-image-stack__noise {
  top: 0;
  right: 0;
  transform: translate(33%, -33%);
}

/* What They Wanted — image stack needs different wrapper sizing */
.cn-wanted-stack .pf-wanted__visual {
  display: flex;
  align-items: center;
}

.cn-wanted-stack .pf-wanted__img-wrap {
  width: 100%;
}


/* ===== MOBILE ===== */

@media (max-width: 768px) {
  .cn-hero {
    min-height: 500px;
  }

  .cn-hero__scroll {
    bottom: 120px;
  }

  .cn-hero__bottom {
    font-size: 0.8rem;
    padding: 1rem 6vw;
  }

  /* CTA: face behind everything, overlay covers more on mobile */
  .cn-cta__bg-overlay {
    background: linear-gradient(180deg, rgba(2, 86, 97, 0.85) 0%, rgba(2, 86, 97, 0.7) 60%, rgba(2, 86, 97, 0.5) 100%);
  }

  .cn-cta__bg img {
    object-position: center top;
  }

  /* Card stack — 2 columns on mobile, no scatter */
  .cn-card-stack__cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .cn-card-stack__card {
    padding: 20px;
    border-radius: 20px;
  }

  .cn-card-stack__title {
    font-size: 1rem;
  }

  .cn-card-stack__text {
    font-size: 0.8rem;
  }

  .cn-card-stack__icon {
    margin-bottom: 1rem;
  }

  /* Image stack — no transforms on mobile */
  .cn-image-stack {
    aspect-ratio: auto;
  }

  .cn-image-stack__figure {
    border-radius: 20px;
  }

  .cn-image-stack__layer {
    border-radius: 20px;
  }

}
