/* ==========================================================================
   Inside SmallPie — page helpers
   NOTE: relies on global.css (buttons, glass, grids already there)
   - Light page base; dark sections paint themselves
   - Portrait team cards (less crop), responsive grid
   - Compare slider layering hardened
   - CTA bar theme-aware
   - SVG map: simulate glass (no CSS backdrop blur on SVG)
   ========================================================================== */


/* === 1) PAGE BASE ======================================================= */

body.inside-page {
  background: #fff; /* page starts light; dark sections still use their own paints */
}


/* === 2) PROOF BADGES (tiny fact tags) =================================== */

.proof-badge {
  display: inline-block;
  margin: 4px 8px 0 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .02em;
  color: #000000;
  background: rgba(13,10,12,.06);
  border: 1px solid rgba(13,10,12,.10);
}
.story-section .proof-badge + .proof-badge { margin-left: 6px; }


/* === 3) TEAM (DARK) — portrait cards, responsive grid =================== */

#team .outsourced-inner {
  /* one column: text + grid stack, vertically centred via section flex */
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 2.4vw, 18px);
}

#team .outsourced-text {
  margin: 0;
}

#team .outsourced-cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2.2vw, 16px);
  align-items: stretch;
}

@media (max-width: 1180px) {
  #team .outsourced-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  #team .outsourced-cards {
    grid-template-columns: 1fr;
  }
}

/* TEAM CARD — clean photo + breathing name band, no global glass */
.team-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #050507;
  box-shadow: var(--shadow-2);
}

/* kill global liquid-glass stack from .bento-card */
.team-card::before,
.team-card::after {
  content: none !important;
}

/* PHOTO AREA — tall portrait, no gap to label */
.team-card .team-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  margin: 0;
  display: block;
  border-radius: 18px 18px 0 0;
}

@supports not (aspect-ratio: 3 / 4) {
  .team-card .team-photo::before {
    content: "";
    display: block;
    padding-top: calc(100% * 4 / 3);
  }
  .team-card .team-photo img {
    position: absolute;
    inset: 0;
  }
}

.team-card .team-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 38%;
}

/* subtle gradient over photo */
.team-card .team-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.42));
  pointer-events: none;
  transition: background .22s ease;
}

/* small screens — slightly taller portrait */
@media (max-width: 720px) {
  .team-card .team-photo {
    aspect-ratio: 2 / 3;
  }
  @supports not (aspect-ratio: 2 / 3) {
    .team-card .team-photo::before {
      padding-top: calc(100% * 3 / 2);
    }
  }
}

/* NAME BAND — sits directly under photo, full-width, breathing pink/gold */
.team-card .team-name {
  position: relative;
  margin: 0;
  padding: 12px 18px 14px;
  font-weight: 900;
  font-size: clamp(20px, 2.4vw, 24px);
  color: #ffffff;
  background: #050507;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 56px;
  border-radius: 0 0 18px 18px;
  overflow: hidden;
}

/* text above fx */
.team-card .team-name span,
.team-card .team-name strong,
.team-card .team-name em {
  position: relative;
  z-index: 3;
}

/* pink glow (top-left) — bright when gold is low */
.team-card .team-name::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0% 0%, var(--pink) 0, transparent 55%);
  mix-blend-mode: screen;
  opacity: .15;
  pointer-events: none;
  animation: teamNamePinkPulse 7s ease-in-out infinite;
  z-index: 1;
}

/* gold glow (bottom-right) — bright when pink is low */
.team-card .team-name::after {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 100% 100%, var(--gold) 0, transparent 55%);
  mix-blend-mode: screen;
  opacity: .15;
  pointer-events: none;
  animation: teamNameGoldPulse 7s ease-in-out infinite;
  z-index: 2;
}

/* FUN FACT OVERLAY — full card, above everything */
.team-card .team-fact {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: #ffffff;
  background: rgba(0,0,0,.70);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
}

.team-card:hover .team-fact,
.team-card.is-open .team-fact {
  opacity: 1;
  transform: none;
}

.team-card:hover .team-photo::after,
.team-card.is-open .team-photo::after {
  background: linear-gradient(180deg, rgba(0,0,0,.26), rgba(0,0,0,.70));
}

/* per-person focal tweaks */
.team-card[data-team="ivan"] .team-photo img { object-position: 50% 32%; }
.team-card[data-team="anna"] .team-photo img { object-position: 46% 34%; }
.team-card[data-team="kate"] .team-photo img { object-position: 50% 42%; }

/* Opposite-phase breathing */
@keyframes teamNamePinkPulse {
  0%, 100% {
    opacity: .55;
    transform: translate3d(0,0,0) scale(1.02);
  }
  50% {
    opacity: .12;
    transform: translate3d(0,-1px,0) scale(1);
  }
}

@keyframes teamNameGoldPulse {
  0%, 100% {
    opacity: .12;
    transform: translate3d(0,0,0) scale(1);
  }
  50% {
    opacity: .55;
    transform: translate3d(0,1px,0) scale(1.02);
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .team-card .team-fact,
  .team-card .team-photo::after {
    transition: none;
  }
  .team-card .team-name::before,
  .team-card .team-name::after {
    animation: none;
    opacity: .18;
  }
}


/* === 4) COMPARE SLIDER (fixed layering/mask) ============================ */

.compare-slider { position: relative; overflow: hidden; }
#different .compare-slider { margin-top: clamp(6px, 1.2vw, 10px); }

/* base rail */
.compare-slider .slider { position: relative; min-height: 320px; }
@media (min-width: 1024px) { .compare-slider .slider { min-height: 360px; } }

/* layers (explicit z-index for safety) */
.compare-slider .slider__layer { position: absolute; inset: 0; z-index: 0; }
.compare-slider .slider__layer img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; object-fit: cover; object-position: center;
}
.compare-slider .slider__agency  { background: #f7f7f9; color: #000000; }
.compare-slider .slider__boutique{ background: #000000; color: #fff; }

/* moving mask (boutique on top, clipped by width) */
.compare-slider .slider__mask {
  position: absolute; inset: 0;
  width: 80%;                /* start: 80% boutique visible */
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

/* handle (always above everything) */
.compare-slider .slider__handle {
  position: absolute; top: 50%; left: 80%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9);
  background: linear-gradient(135deg, rgba(244,143,177,.95), rgba(244,196,48,.95));
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  cursor: ew-resize;
  user-select: none; touch-action: none;
  z-index: 2;
}
.compare-slider .slider__handle::before,
.compare-slider .slider__handle::after {
  content: ""; position: absolute; top: 50%; width: 8px; height: 8px;
  border-top: 2px solid #fff; border-right: 2px solid #fff;
}
.compare-slider .slider__handle::before { left: 10px;  transform: translateY(-50%) rotate(225deg); }
.compare-slider .slider__handle::after  { right: 10px; transform: translateY(-50%) rotate(45deg); }

/* optional: agency image focus bias */
.compare-slider .slider__agency img { object-position: 50% 45%; }


/* === 5) VALUES ACCORDION ================================================= */

.values-acc {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px;
}

.acc-item {
  border-radius: 16px; overflow: hidden;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(13,10,12,.10);
  box-shadow: var(--shadow-1, 0 6px 20px rgba(0,0,0,.06));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.acc-head {
  -webkit-appearance: none; appearance: none;
  width: 100%; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px 18px; border: 0; background: transparent; cursor: pointer;
  font-weight: 700; font-size: clamp(18px, 2vw, 20px);
  line-height: 1.1; color: #0d0a0c;
  -webkit-text-fill-color: currentColor;
  -webkit-tap-highlight-color: transparent;
}
.acc-head .chev { flex: 0 0 auto; transition: transform .2s ease; }
.acc-head[aria-expanded="true"] .chev { transform: rotate(180deg); }

.acc-panel {
  background: rgba(255,255,255,.9);
  border-top: 1px solid rgba(13,10,12,.10);
  overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height .36s ease, opacity .22s ease;
}

.acc-body {
  padding: 14px 18px 18px;
  color: #0d0a0c; font-size: clamp(15px, 1.5vw, 17px); line-height: 1.6;
}

.acc-item:has(.acc-head[aria-expanded="true"]) {
  background:
    linear-gradient(180deg, rgba(244,143,177,.10), rgba(244,196,48,.10)),
    rgba(255,255,255,.72);
  border-color: rgba(13,10,12,.14);
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
}
.acc-item:has(.acc-head[aria-expanded="true"]) .acc-panel {
  max-height: 800px; opacity: 1; /* NOTE: if content >800px, consider JS height calc */
}

.acc-head:focus-visible {
  outline: 2px solid rgba(244,196,48,.9);
  outline-offset: 2px; border-radius: 12px;
}

@media (max-width: 420px) {
  .acc-head { padding: 16px; font-size: clamp(19px, 6vw, 24px); }
  .acc-body { padding: 12px 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .acc-item, .acc-head, .acc-panel { transition: none !important; }
}


/* === 6) CTA BAR (shared, theme-aware) =================================== */

.cta-bar {
  margin-top: clamp(20px, 4vw, 28px);
  padding: clamp(14px, 2.6vw, 18px);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  /* default: dark-section styling */
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
}
.cta-bar__copy { margin: 0; font-weight: 700; }

/* variant for light sections (if needed) */
.cta-bar--light {
  background: rgba(13,10,12,.04);
  border-color: rgba(13,10,12,.10);
  color: #0d0a0c;
}


/* === 7) WHITE PAINT utility (keeps bubbles visible globally) ============= */

.paint-white {
  position: relative;
  background: #fff;
}


/* === 8) Minor spacing per section ======================================= */

#intro .story-copy .cta { margin-top: 10px; }
#different .compare-slider { margin-top: clamp(14px, 2vw, 20px); }
#values .values-title { margin-bottom: clamp(12px, 2vw, 18px); }
#insights .insights-head { align-items: center; }

/* slightly tighter than global for this page */
.section-pad { padding: clamp(64px, 8.8vw, 120px) var(--page-gutter); }


/* === 9) COMMUNITY MAP (DARK) ============================================ */

#nz-map.paint-black { background: #000000; }

#nz-map .outsourced-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3.2vw, 40px);
  align-items: start;
}
@media (max-width: 980px) {
  #nz-map .outsourced-inner { grid-template-columns: 1fr; }
}

#nz-map .nz-map-figure { position: relative; border-radius: 18px; overflow: hidden; }

#nz-map .nz-map { width: 100%; display: block; }
#nz-map .nz-map svg { width: 100%; height: auto; display: block; color: #fff; }

/* “Glass” tokens for SVG regions (simulated; no real backdrop blur on SVG) */
#nz-map {
  --glass-fill: rgba(255,255,255,.08);
  --glass-fill-hover: rgba(255,255,255,.12);
  --glass-stroke: rgba(255,255,255,.35);
  --glass-stroke-hover: rgba(255,255,255,.50);
}

/* regions: tint + stroke + subtle shadows (portable across browsers) */
#nz-map .region {
  fill: var(--glass-fill);
  stroke: var(--glass-stroke);
  stroke-width: 1;
  transition: fill .18s ease, stroke .18s ease, filter .18s ease;
  outline: none; cursor: pointer;
}
#nz-map .region:hover,
#nz-map .region:focus {
  fill: var(--glass-fill-hover);
  stroke: var(--glass-stroke-hover);
}
#nz-map .region.is-active {
  fill: url(#sp-grad) !important;
  stroke: rgba(255,255,255,.85);
  stroke-width: 1.2;
  filter:
    drop-shadow(0 2px 6px rgba(244,196,48,.18))
    drop-shadow(0 6px 16px rgba(244,143,177,.12));
}

/* badges */
#nz-map .map-badge { pointer-events: none; }
#nz-map .map-badge circle { fill: rgba(255,255,255,.08); stroke: rgba(255,255,255,.18); stroke-width: 1; }
#nz-map .map-badge text {
  font: 700 11px/1 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  fill: #fff; text-anchor: middle; dominant-baseline: middle;
}
#nz-map .map-badge.is-active circle { fill: rgba(255,255,255,.16); }
@keyframes pulse-soft { 0%,100%{ opacity:.85; transform: scale(1);} 50%{ opacity:1; transform: scale(1.08);} }
#nz-map .map-badge.is-auckland { animation: pulse-soft 2.2s ease-in-out infinite; }
@media (max-width: 480px) {
  #nz-map .map-badge { display: none; }
  #nz-map .map-badge.is-active { display: block; }
}

/* copy next to the map */
#nz-map .nz-output { margin-top: 14px; }
#nz-map .nz-output .title { font-weight: 900; font-size: 18px; margin: 0 0 6px; color: #fff; }
#nz-map .nz-output .lead  { margin: 0; color: rgba(255,255,255,.88); }

/* keep titles/leads in dark sections above bubbles */
.outsourced-section .outs-h2,
.outsourced-section .lead { position: relative; z-index: 3; }


/* === 10) JOURNEY INSIDE #nz-map (same section, same styles) ============= */

/* place under two-column block; content sits above bubbles/lines */
#nz-map .journey-block {
  grid-column: 1 / -1;
  display: block;
  position: relative;
  margin-top: clamp(18px, 3vw, 28px);
}
#nz-map .journey-block .outs-h2,
#nz-map .journey-block .lead {
  color: #fff; position: relative; z-index: 3; mix-blend-mode: normal;
}

/* rope lines layer under cards */
#nz-map .journey-lines {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}

/* steps: one column, full container width */
#nz-map .journey-steps {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr;
  gap: clamp(16px, 2.2vw, 22px);
  width: 100%;
}

/* cards (calm liquid-glass styling comes from global .glass primitives) */
#nz-map .journey-step {
  border-radius: 16px;
  width: 100%;
  min-height: 160px;
}
#nz-map .journey-step.hvr,
#nz-map .journey-step.hvr:hover,
#nz-map .journey-step.hvr:focus {
  transform: none !important;
  box-shadow: none !important;
}
#nz-map .journey-step .glass__overlay { mix-blend-mode: normal; }
#nz-map .journey-step .glass__filter  { opacity: 0; } /* no blur by default */
#nz-map .journey-step .glass__content { position: relative; z-index: 2; color: #fff; }

#nz-map .journey-step h3 {
  margin: .1em 0 .35em;
  font-weight: 900; font-size: clamp(18px, 2.4vw, 22px);
}
#nz-map .journey-step p {
  margin: 0; color: rgba(255,255,255,.88);
}
#nz-map .step-num { opacity: .78; margin-right: .35em; font-weight: 900; }

/* lit state when rope “hits” the card (subtle; hover remains separate) */
#nz-map .journey-step.is-lit .glass__overlay {
  background:
    linear-gradient(135deg, rgba(244,143,177,.18), rgba(244,196,48,.18)),
    var(--lg-tint-dark, transparent);
}
@keyframes journey-pop { 0%{transform:scale(1);} 55%{transform:scale(1.015);} 100%{transform:scale(1);} }
#nz-map .journey-step.is-lit { animation: journey-pop .42s cubic-bezier(.22,.61,.36,1); }
@media (prefers-reduced-motion: reduce) {
  #nz-map .journey-step.is-lit { animation: none; }
}


/* === 11) INSIGHTS (WHITE) — hook only ================================== */

#insights .insights-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-bottom: clamp(18px, 3vw, 26px);
}
#insights .insights-head h2 { margin: 0; font-weight: 900; font-size: clamp(26px, 4.6vw, 36px); }
@media (max-width: 960px) {
  #insights .insights-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}


/* === 12) REVEAL HOOK (uses global [data-reveal]) ======================== */

[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ================================
   Inside SmallPie — page-specific
   ================================ */

/* Intro + Team: full-height feel on desktop */
#intro.story-section.section-pad,
#team.outsourced-section.section-pad {
  min-height: 100svh;
  display: flex;
  align-items: center;
}

/* Keep same container width as rest of site */
#intro .story-inner,
#team .outsourced-inner {
  max-width: var(--content-width, 1200px);
  margin: 0 auto;
  padding-inline: var(--page-gutter);
  width: 100%;
}

/* Center intro grid vertically */
#intro .story-grid {
  align-items: center;
}

/* Hero portrait image — less stretched aspect on desktop */
#intro .story-media img {
  aspect-ratio: 2 / 3;
  width: 100%;
  max-width: 420px;
  height: auto;
  max-height: 70svh;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin-inline: auto;
}

/* Team vertical centering */
#team .outsourced-inner {
  align-content: center;
  gap: clamp(16px, 3.2vw, 28px);
  min-height: 100%;
}

/* Hero CTAs: no “jumping arrow”, same structure as header Contact */
.cta .btn-glass-grad,
.cta .btn-glass.btn-outline-dark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.cta .btn-glass-grad .btn__icon,
.cta .btn-glass.btn-outline-dark .btn__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.cta .btn__arrow {
  display: none !important;
}

/* Smooth anchor offset below sticky header */
#why-small {
  scroll-margin-top: 72px;
}

/* PROCESS / STEPS UI extras */
.values-acc .acc-item {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.values-acc .acc-item:hover {
  transform: translateY(-1px);
}
.values-acc .acc-head {
  cursor: pointer;
}
.values-acc .acc-body .btn-glass-grad {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* NZ MAP FX small extras */
.nz-map-figure {
  position: relative;
}
.nz-map .region {
  transition: transform 180ms ease, fill 180ms ease, filter 180ms ease;
  transform-origin: center;
}

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

@media (max-width: 960px) {
  #intro.story-section.section-pad,
  #team.outsourced-section.section-pad {
    padding-block: clamp(18px, 4.5vw, 32px);
    min-height: auto;
  }

  #intro .story-media img {
    max-width: 100%;
    max-height: 60svh;
  }
}
