/* ====================================================================
   1:1 copy of the "Multi-faceted Expertise" cards from majobasolutions.com
   Source: Majoba Solutions/src/styles/tokens.css + components/Services.css
   Keep in sync with that project; do not restyle here.
   ==================================================================== */

/* ============================================
   DESIGN TOKENS - Editorial Living Color Theme
   ============================================ */
:root {
  /* Palette - core */
  --cream: #F5F0EB;
  --white: #FAFAF7;
  --black: #1A1A1A;
  --coral: #E8653A;
  --gray-100: #F0ECE6;
  --gray-200: #E0DBD4;
  --gray-300: #B5AFA7;
  --gray-400: #8A847C;
  --gray-500: #6B655D;
  --gray-600: #4A4540;
  --dark: #1A1A1A;

  /* Palette - living colors */
  --teal: #2A9D8F;
  --amber: #D4A853;
  --forest: #4A7C59;
  --blush: #C97B6B;
  --slate-blue: #5B7B9A;

  /* Semantic colors */
  --bg-primary: var(--cream);
  --bg-secondary: var(--white);
  --bg-dark: var(--dark);
  --text-primary: var(--black);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-400);
  --text-on-dark: var(--cream);
  --accent: var(--coral);
  --border-light: var(--gray-200);
  --border-dark: rgba(255, 255, 255, 0.15);

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --sp-xs: 0.5rem;
  --sp-sm: 1rem;
  --sp-md: 1.5rem;
  --sp-lg: 2.5rem;
  --sp-xl: 4rem;
  --sp-2xl: 4.5rem;
  --sp-3xl: 5.5rem;
  --sp-4xl: 7rem;

  /* Layout */
  --max-w: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  /* Motion */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.4s;
  --dur-slow: 0.8s;
}

/* ── Mobile: tighter spacing ── */
@media (max-width: 768px) {
  :root {
    --sp-lg: 2rem;
    --sp-xl: 2rem;
    --sp-2xl: 2.5rem;
    --sp-3xl: 3rem;
    --sp-4xl: 4rem;
  }
}

.services {
  background: var(--bg-primary);
  padding: var(--sp-3xl) 0;
}

.servicesInner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.servicesHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-2xl);
}

.servicesLabel {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--sp-md);
}

.servicesTitle {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-primary);
}

.servicesBlurb {
  max-width: 320px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ── Grid ── */
.svcGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 2.5rem);
}

/* ═══════════════════════════════════════════════
   CARD · grid-stacking, border via ::after
   ═══════════════════════════════════════════════ */
.svcCard {
  position: relative;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 100%;
  aspect-ratio: 3 / 4;
  background: var(--gray-100);
  cursor: default;
}

.svcCard::after {
  content: '';
  grid-column: 1;
  grid-row: 1;
  border: 1px solid var(--card-color);
  opacity: 0.3;
  z-index: 6;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.svcCard:hover::after,
.svcCard.is-active::after {
  opacity: 1;
}

/* ═══════════════════════════════════════════════
   POSTER LAYERS · rotation only, centered
   ═══════════════════════════════════════════════ */
.svcCard__poster {
  grid-column: 1;
  grid-row: 1;
  background: var(--card-color);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  transition:
    opacity 0.4s ease,
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.svcCard__poster--1 { z-index: 3; filter: brightness(1); }
.svcCard__poster--2 { z-index: 2; filter: brightness(1.2); }
.svcCard__poster--3 { z-index: 1; filter: brightness(1.45); }

.svcCard:hover .svcCard__poster,
.svcCard.is-active .svcCard__poster {
  opacity: 1;
}

.svcCard:hover .svcCard__poster--1,
.svcCard.is-active .svcCard__poster--1 {
  transform: rotate(-3deg);
}

.svcCard:hover .svcCard__poster--2,
.svcCard.is-active .svcCard__poster--2 {
  transform: rotate(5deg);
}

.svcCard:hover .svcCard__poster--3,
.svcCard.is-active .svcCard__poster--3 {
  transform: rotate(12deg);
}

/* ═══════════════════════════════════════════════
   CARD CONTENT · z-index 5, always on top
   ═══════════════════════════════════════════════ */
.svcCard__content {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.2rem, 2.5vw, 2rem);
}

.svcCard__num {
  font-family: var(--font-sans);
  font-size: clamp(0.8rem, 1vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-bottom: 0.4em;
  color: var(--card-color);
  transition: color 0.4s ease;
}

.svcCard__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  font-weight: 400;
  line-height: 1.12;
  white-space: pre-line;
  color: var(--card-color);
  transition: color 0.4s ease;
}

.svcCard:hover .svcCard__num,
.svcCard.is-active .svcCard__num,
.svcCard:hover .svcCard__title,
.svcCard.is-active .svcCard__title {
  color: #fff;
}

/* ── Bottom zone ── */
.svcCard__bottom {
  display: flex;
  flex-direction: column;
}

/* Description + CTA · revealed on hover/active */
.svcCard__reveal {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease 0.08s;
}

.svcCard:hover .svcCard__reveal,
.svcCard.is-active .svcCard__reveal {
  max-height: 250px;
  opacity: 1;
}

.svcCard__desc {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: var(--sp-sm);
}

/* CTA · big clickable box button */
.svcCard__ctaBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--card-color);
  background: #fff;
  padding: 0.75em 1.6em;
  border-radius: 2px;
  margin-bottom: var(--sp-sm);
  transition: background 0.3s ease, transform 0.2s ease;
  cursor: pointer;
}

.svcCard__ctaBtn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

/* ── Explore button · MOBILE ONLY ── */
.svcCard__explore {
  display: none;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--card-color);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-bottom: 0.8rem;
  transition: opacity 0.3s ease;
}

/* Hide when active (mobile) */
.svcCard.is-active .svcCard__explore {
  opacity: 0;
  pointer-events: none;
}

/* Source label */
.svcCard__source {
  font-family: var(--font-sans);
  font-size: clamp(0.5rem, 0.7vw, 0.62rem);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--card-color);
  transition: color 0.4s ease;
}

.svcCard:hover .svcCard__source,
.svcCard.is-active .svcCard__source {
  color: rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .servicesHeader {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-md);
  }

  .servicesBlurb { max-width: 100%; }

  .svcGrid {
    grid-template-columns: 1fr;
    gap: var(--sp-lg);
  }

  .svcCard { aspect-ratio: 4 / 3; }

  /* Mobile: disable hover, use click only */
  .svcCard:hover .svcCard__poster { opacity: 0; transform: none; }
  .svcCard:hover .svcCard__reveal { max-height: 0; opacity: 0; }
  .svcCard:hover .svcCard__num,
  .svcCard:hover .svcCard__title { color: var(--card-color); }
  .svcCard:hover .svcCard__source { color: var(--card-color); }

  /* Explore visible on mobile only */
  .svcCard__explore {
    display: inline-flex;
    font-size: 0.75rem;
  }

  /* Active state on mobile */
  .svcCard.is-active .svcCard__poster { opacity: 1; }
  .svcCard.is-active .svcCard__poster--1 { transform: rotate(-3deg); }
  .svcCard.is-active .svcCard__poster--2 { transform: rotate(5deg); }
  .svcCard.is-active .svcCard__poster--3 { transform: rotate(12deg); }
  .svcCard.is-active .svcCard__reveal { max-height: 250px; opacity: 1; }
  .svcCard.is-active .svcCard__num,
  .svcCard.is-active .svcCard__title { color: #fff; }
  .svcCard.is-active .svcCard__source { color: rgba(255, 255, 255, 0.5); }
  .svcCard.is-active .svcCard__explore { opacity: 0; pointer-events: none; }
}
