/* ============================================================
   PECULIEX — HOME
   Homepage-only styles. Shared tokens live in styles.css,
   the shared design layer in site.css, the header in navbar.css.

   Two layout modes:
   - static  (default)  phones, portrait tablets, reduced motion
   - cinema  (media query below)  pinned hero reel + horizontal works
   home.js mirrors the same media query (HX_CINEMA).
   ============================================================ */

/* ============================================================
   HERO
   ============================================================ */
.hx-hero {
  position: relative;
  background: var(--hx-ink);
  color: #fff;
}
.hx-hero-pin {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: var(--hx-ink);
}

.hx-hero-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--nav-top) + var(--nav-height) + clamp(28px, 6svh, 64px));
  padding-bottom: clamp(28px, 6vw, 44px);
}
.hx-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: clamp(18px, 2.8svh, 32px);
}
.tag-hero-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 7px 18px;
  box-shadow: 0 4px 22px rgba(189, 245, 0, 0.3);
}
.hx-hero-loc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}
.hx-hero-loc::before {
  content: ''; width: 28px; height: 1px; background: rgba(255, 255, 255, 0.35);
}

.hx-hero-title {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: clamp(34px, 10vw, 76px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
  text-wrap: balance;
}
.hx-line { display: block; }
.hx-hero-title .hx-accent {
  color: var(--hx-lime);
  font-size: 1.12em;
  line-height: 0.8;
  padding-right: 0.04em;
}

.hx-hero-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  margin-top: clamp(22px, 4svh, 44px);
}
.hx-hero-sub {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.68);
  max-width: 34ch;
}

/* ---------- Showreel ---------- */
.hx-reel {
  position: relative;
  z-index: 4;
  display: block;
  width: auto;
  margin: 0 var(--hx-mx) clamp(24px, 5vw, 36px);
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  text-align: left;
}
.hx-reel-frame {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: 20px;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 30px 80px rgba(0, 0, 0, 0.6);
}
.hx-reel video { display: block; width: 100%; height: 100%; object-fit: cover; }
.hx-reel-cap {
  position: absolute;
  left: calc(var(--hx-mx) + 30px);
  bottom: clamp(24px, 4vw, 44px);
  display: none;
  align-items: center;
  gap: 12px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}
.hx-reel-cap i { width: 8px; height: 8px; border-radius: 50%; background: var(--hx-lime); animation: hxBlink 1.6s steps(2) infinite; }
@keyframes hxBlink { 50% { opacity: 0.25; } }

/* rotating "showreel" seal on the top-right corner of the small reel */
.hx-reel-badge { display: none; }

/* ---------- Trusted-by strip (running client logos) ---------- */
.hx-proof {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 0 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  /* logo files are dark-on-white JPGs: they get inverted to white-on-black and
     "screen" drops the black. The blend has to sit on this element, a direct
     child of the hero's stacking context, or the black tiles show through. */
  mix-blend-mode: screen;
}
.hx-proof-label {
  padding: 0 var(--hx-mx);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.hx-proof-label span { color: rgba(255, 255, 255, 0.38); }
.hx-marquee-track img {
  display: block;
  height: clamp(40px, 3.5vw, 56px);
  width: auto;
  max-width: none;
  border-radius: 10px;
  /* brightness lifts pale brand colours (gold, pink) so every mark reads as white */
  filter: invert(1) grayscale(1) brightness(3.2);
  opacity: 0.78;
  transition: filter 0.5s ease, opacity 0.5s ease, transform 0.6s var(--hx-ease);
}
@media (hover: hover) {
  .hx-marquee-track li:hover img { filter: none; opacity: 1; transform: scale(1.1); }
}

/* ============================================================
   IMPACT IN NUMBERS
   ============================================================ */
.hx-impact {
  position: relative;
  background: var(--hx-ink);
  color: #fff;
  padding: clamp(88px, 12vw, 190px) 0 clamp(88px, 11vw, 170px);
  overflow: hidden;
}
.hx-impact::before {
  content: '';
  position: absolute;
  left: 50%; top: 0;
  width: 90vmax; height: 60vmax;
  transform: translate(-50%, -62%);
  background: radial-gradient(ellipse, rgba(139, 44, 245, 0.2), transparent 62%);
  pointer-events: none;
}
.hx-impact { --hx-line: rgba(255, 255, 255, 0.14); --hx-mute: rgba(255, 255, 255, 0.56); }
.hx-impact .container { position: relative; }
.hx-impact .hx-eyebrow { color: rgba(255, 255, 255, 0.6); }
.hx-impact .hx-h2 em { color: var(--hx-lime); }
.hx-impact-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(44px, 6.5vw, 104px);
}
.hx-spark {
  flex: none;
  width: clamp(56px, 9vw, 148px);
  height: clamp(56px, 9vw, 148px);
  color: var(--hx-lime);
  margin-bottom: 0.4vw;
}
.hx-spark svg { display: block; width: 100%; height: 100%; }

/* ============================================================
   SELECTED WORKS
   ============================================================ */
.hx-works {
  position: relative;
  background: var(--color-surface-container-lowest);
  color: var(--color-on-background);
  transition: background-color 0.5s ease;
}
.hx-works-pin { position: relative; padding: clamp(72px, 13vw, 120px) 0 clamp(48px, 9vw, 88px); }
.hx-works-intro { padding: 0 var(--hx-mx); margin-bottom: clamp(32px, 6vw, 52px); }
.hx-works-lede {
  max-width: 34ch;
  margin: clamp(18px, 2vw, 28px) 0 clamp(22px, 2.4vw, 34px);
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.55;
  color: var(--color-on-surface-variant);
}
.hx-works-track {
  display: flex;
  gap: 16px;
  padding: 0 var(--hx-mx) 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--hx-mx);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hx-works-track::-webkit-scrollbar { display: none; }
.hx-work { flex: none; width: min(78vw, 440px); scroll-snap-align: start; }
.hx-work-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 18px;
  background: var(--color-surface-container);
  box-shadow: 0 0 0 1px rgba(17, 17, 26, 0.06);
  transform: translateZ(0);
}
.hx-work-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.3s var(--hx-ease);
}
.hx-work-cap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 14px;
  row-gap: 10px;
  padding-top: 16px;
}
.hx-work-idx {
  font-family: var(--hx-serif);
  font-style: italic;
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1;
  color: var(--color-primary);
}
.hx-work-name {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: clamp(20px, 2vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
}
.hx-work-tag {
  grid-column: 2;
  justify-self: start;
  font-family: var(--font-label);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-outline-variant);
  color: var(--color-on-surface-variant);
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}
.hx-works-end {
  flex: none;
  display: grid;
  place-items: center;
  width: min(62vw, 300px);
  scroll-snap-align: start;
}
.hx-orb {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  width: clamp(170px, 17vw, 270px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--color-outline-variant);
  text-align: center;
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.45s ease, border-color 0.45s ease;
}
.hx-orb::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: 50%;
  background: var(--hx-purple);
  transform: scale(0);
  transition: transform 0.7s var(--hx-ease);
  z-index: -1;
}
.hx-orb svg { width: 26px; height: 26px; transition: transform 0.6s var(--hx-ease); }
@media (hover: hover) {
  .hx-work:hover .hx-work-media img { transform: scale(1.035); }
  .hx-work:hover .hx-work-tag { background: var(--color-on-background); border-color: var(--color-on-background); color: var(--color-background); }
  .hx-orb:hover { color: #fff; border-color: var(--hx-purple); }
  .hx-orb:hover::before { transform: scale(1); }
  .hx-orb:hover svg { transform: translate(4px, -4px); }
}
.hx-works-bar {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  margin-top: clamp(24px, 4vw, 36px);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-on-surface-variant);
}
.hx-works-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hx-works-count b { color: var(--color-on-background); font-weight: 800; }
.hx-works-progress { position: relative; flex: 1; height: 2px; background: var(--color-outline-variant); overflow: hidden; border-radius: 2px; }
.hx-works-progress i { position: absolute; inset: 0; background: var(--color-primary); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }
.hx-works-hint { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.hx-hint-scroll { display: none; }
.hx-works-hint svg { width: 28px; height: 12px; animation: hxNudge 1.8s var(--hx-ease) infinite; }
@keyframes hxNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

/* ============================================================
   MANIFESTO
   ============================================================ */
.hx-manifesto {
  position: relative;
  padding: clamp(88px, 13vw, 210px) 0 clamp(64px, 9vw, 140px);
}
.hx-manifesto-grid { display: grid; gap: clamp(36px, 6vw, 72px); }
.hx-manifesto .tag-acid { margin-bottom: clamp(22px, 2.4vw, 34px); }
.hx-manifesto-body { align-self: end; }
.hx-manifesto-text {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(22px, 2.55vw, 44px);
  line-height: 1.24;
  letter-spacing: -0.025em;
  color: var(--color-on-background);
  max-width: 24em;
  margin-bottom: clamp(28px, 3vw, 44px);
}
.hx-manifesto .hx-h2 { font-size: clamp(40px, 6.2vw, 116px); }
@media (min-width: 1024px) {
  .hx-manifesto-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .hx-manifesto-body { padding-top: clamp(40px, 8vw, 140px); }
}

/* ============================================================
   METHODOLOGY
   ============================================================ */
.hx-method { position: relative; padding: clamp(64px, 9vw, 140px) 0 clamp(88px, 12vw, 190px); }
.hx-method-grid { display: grid; gap: clamp(36px, 6vw, 72px); }
.hx-method-head p {
  max-width: 32ch;
  margin-top: clamp(18px, 2vw, 28px);
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.55;
  color: var(--color-on-surface-variant);
}
.hx-method-head .hx-h2 { font-size: clamp(38px, 5.4vw, 96px); }
@media (min-width: 1024px) {
  .hx-method-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
  .hx-method-head { position: sticky; top: calc(var(--nav-top) + var(--nav-height) + 48px); }
}

/* ============================================================
   CTA BANNER (kept from the original page)
   ============================================================ */
.prismatic-gradient { background: var(--gradient-prismatic); }
.cta-banner { position: relative; border-radius: var(--radius-2xl); overflow: hidden; padding: clamp(60px, 8vw, 112px) clamp(24px, 5vw, 64px); text-align: center; }
.cta-banner::before { content: ''; position: absolute; inset: 0; background: rgba(248, 249, 250, 0.08); pointer-events: none; }
.cta-glass-1 { position: absolute; top: -96px; left: -96px; width: 256px; height: 256px; background: rgba(255, 255, 255, 0.2); border-radius: 50%; filter: blur(60px); pointer-events: none; }
.cta-glass-2 { position: absolute; bottom: -96px; right: -96px; width: 256px; height: 256px; background: rgba(0, 0, 0, 0.2); border-radius: 50%; filter: blur(60px); pointer-events: none; }
.cta-content { position: relative; z-index: 2; max-width: 800px; margin: 0 auto; }
.cta-content h2 { color: #fff; margin-bottom: 32px; font-weight: 800; line-height: 1.1; }
.cta-content p { color: rgba(255, 255, 255, 0.88); font-size: clamp(16px, 1.8vw, 24px); margin-bottom: 48px; font-weight: 300; }
@media (max-width: 480px) { .cta-banner { padding: clamp(40px, 8vw, 80px) clamp(16px, 5vw, 40px); } }

/* ============================================================
   CINEMA MODE — pinned hero reel + horizontal works
   ============================================================ */
@media (min-width: 1024px) and (min-height: 640px) and (min-aspect-ratio: 4/3) and (prefers-reduced-motion: no-preference) {

  /* ----- hero ----- */
  .hx-hero-pin { height: 100svh; min-height: 0; }
  .hx-hero-inner {
    flex: none;
    height: 100%;
    padding-top: calc(var(--nav-top) + var(--nav-height) + clamp(22px, 5svh, 60px));
    padding-bottom: calc(var(--hx-strip) + 28px);
  }
  /* the longest line ("Have a marketing problem.") spans the container exactly;
     --hx-fit is that line's width in em; the svh term keeps line two clear of the reel on short viewports */
  .hx-hero-title {
    --hx-fit: 16.1;
    font-size: min(calc((min(100vw, var(--container-max)) - 2 * var(--margin-desktop)) / var(--hx-fit)), calc(33.8svh - 165px));
    line-height: 0.92;
    letter-spacing: -0.045em;
    text-wrap: nowrap;
  }
  .hx-line { white-space: nowrap; }
  .hx-hero-foot { flex-direction: row; align-items: center; gap: 30px; max-width: 58%; }

  /* the reel is a full-viewport layer scaled down into the corner; scroll scales it back up */
  .hx-reel {
    position: absolute;
    inset: 0;
    margin: 0;
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    transform-origin: 100% 100%;
    transform: translate(calc(-1 * var(--hx-mx)), calc(-1 * (var(--hx-strip) + 28px))) scale(var(--hx-reel-s));
    will-change: transform;
  }
  .hx-reel-frame {
    border-radius: calc(20px / var(--hx-reel-s));
    box-shadow: 0 0 0 calc(1px / var(--hx-reel-s)) rgba(255, 255, 255, 0.16), 0 calc(30px / var(--hx-reel-s)) calc(90px / var(--hx-reel-s)) rgba(0, 0, 0, 0.6);
  }
  .hx-reel-cap { display: inline-flex; opacity: 0; }

  .hx-reel-badge {
    position: absolute;
    z-index: 5;
    right: calc(var(--hx-mx) - 34px);
    bottom: calc(var(--hx-strip) + 28px + 100% * var(--hx-reel-s) - 82px);
    width: 116px; height: 116px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--hx-lime);
    color: #0b0b0f;
    pointer-events: none;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  }
  .hx-reel-badge svg.hx-seal { position: absolute; inset: 0; width: 100%; height: 100%; animation: hxSpin 14s linear infinite; }
  .hx-reel-badge svg.hx-play { width: 26px; height: 26px; margin-left: 4px; }
  .hx-seal text { font-family: var(--font-label); font-size: 10.6px; font-weight: 800; letter-spacing: 0.21em; text-transform: uppercase; fill: currentColor; }
  @keyframes hxSpin { to { transform: rotate(360deg); } }

  .hx-proof {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: var(--hx-strip);
    flex-direction: row;
    align-items: center;
    gap: clamp(24px, 3vw, 56px);
    /* extra inset keeps the label clear of the floating WhatsApp button */
    padding: 0 0 0 calc(var(--hx-mx) + 30px);
  }
  .hx-proof-label { flex: none; padding: 0; }
  .hx-proof-label span { display: block; }
  .hx-marquee { flex: 1; }

  /* ----- works ----- */
  .hx-works-pin {
    --hx-work-h: min(calc(100svh - 318px), 680px);
    height: 100vh;
    height: 100svh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .hx-works-intro {
    position: absolute;
    left: var(--hx-mx);
    top: calc(var(--nav-top) + var(--nav-height) + 18px);
    bottom: 76px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: clamp(320px, 31vw, 620px);
    padding: 0;
    margin: 0;
    z-index: 0;
  }
  .hx-works-track {
    position: relative;
    z-index: 1;
    flex: 1;
    align-items: center;
    gap: clamp(28px, 3vw, 60px);
    width: max-content;
    overflow: visible;
    scroll-snap-type: none;
    padding: calc(var(--nav-top) + var(--nav-height) + 18px) var(--hx-mx) 0 calc(var(--hx-mx) + clamp(350px, 34vw, 680px));
    will-change: transform;
  }
  .hx-work { width: auto; }
  .hx-work-media { height: var(--hx-work-h); aspect-ratio: 16 / 9; border-radius: 22px; }
  .hx-work-cap { grid-template-columns: auto 1fr auto; padding-top: 20px; }
  .hx-work-tag { grid-column: auto; justify-self: end; align-self: center; }
  .hx-works-intro .hx-h2 { font-size: clamp(40px, 5.1vw, 98px); }
  .hx-hint-scroll { display: inline; }
  .hx-hint-swipe { display: none; }
  .hx-works-end { width: clamp(300px, 30vw, 520px); height: var(--hx-work-h); }
  /* inset both ends so the counter and hint clear the floating buttons */
  .hx-works-bar { flex: none; height: 76px; margin: 0 auto; padding-left: calc(var(--hx-mx) + 30px); padding-right: calc(var(--hx-mx) + 30px); }
}

/* landscape tablets / reduced motion keep the 16:9 art in the swipe carousel */
@media (min-width: 1024px) {
  .hx-work-media { aspect-ratio: 16 / 9; }
  .hx-work { width: min(62vw, 760px); }
}
@media (min-width: 1024px) and (min-height: 640px) and (min-aspect-ratio: 4/3) and (prefers-reduced-motion: no-preference) {
  .hx-work { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hx-aurora, .hx-eyebrow i, .hx-works-hint svg, .hx-reel-cap i { animation: none; }
  .hx-step-title { color: var(--color-on-background); }
  .hx-step-desc { opacity: 1; }
}

/* ============================================================
   PARKED: interactive client card deck (section is display:none).
   Moved here unchanged from index.html.
   ============================================================ */
/* ===== CLIENTS CARD DECK SECTION ===== */
.clients-deck-section {
  position: relative;
  overflow: hidden;
  background: var(--color-background);
  padding: 100px 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: auto;
}
.clients-deck-section.dealt { min-height: auto; }

/* Ambient orbs */
.cd-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}
.cd-orb-1 { width: 520px; height: 520px; background: rgba(139,44,245,0.25); top: -120px; left: -100px; }
.cd-orb-2 { width: 440px; height: 440px; background: rgba(205,72,0,0.18); top: 30%; right: -80px; }
.cd-orb-3 { width: 380px; height: 380px; background: rgba(86,113,0,0.15); bottom: -80px; left: 30%; }

/* Header */
.cd-header-wrap {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 24px;
  margin-bottom: 40px;
}

/* Deck Container */
.cd-deck-container {
  position: relative;
  width: 100%;
  flex-grow: 1;
  min-height: 280px;
  z-index: 5;
  perspective: 1500px;
  /* reveal from below as the section scrolls into view */
  opacity: 0;
  transform: translateY(56px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.22,1,.36,1);
}
.clients-deck-section.dealt .cd-deck-container { min-height: 440px; opacity: 1; transform: none; }

/* Card deck area */
.cd-deck-area {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(.22,1,.36,1);
}
.cd-deck-area.active { pointer-events: all; }

/* Footer / Controls */
.cd-footer-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60px;
  margin-top: 20px;
}

.cd-deal-btn {
  transition: opacity 0.4s, transform 0.4s;
}
.cd-deal-btn.out {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  position: absolute;
}

/* Reset button */
.cd-reset-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139,44,245,0.1);
  border-radius: var(--radius-full);
  padding: 12px 28px;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-on-surface-variant);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.4s 0.1s, background 0.2s, transform 0.4s 0.1s, box-shadow 0.3s;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.cd-reset-btn.show { opacity: 1; pointer-events: all; transform: translateY(0); }
.cd-reset-btn:hover {
  background: rgba(255,255,255,0.92);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(139,44,245,0.12);
  border-color: rgba(139,44,245,0.2);
}

/* Individual card wrapper */
.cd-card-wrap {
  position: absolute;
  width: 200px;
  height: 256px;
  cursor: pointer;
  will-change: transform, left, top;
  transition: transform 0.45s cubic-bezier(.22,1,.36,1), box-shadow 0.3s ease;
}

.cd-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
}
/* hover lift (straighten + raise) is applied via JS using each card's base angle */

.cd-card-face, .cd-card-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
}

/* "Read story" hint that appears on hover */
.cd-card-cta {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #15131c;
  background: rgba(255,255,255,0.95);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.cd-card-wrap:hover .cd-card-cta { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Colourful card front (gradient set per-card via inline style) */
.cd-card-face {
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 16px 38px rgba(17,17,26,0.24), inset 0 1px 0 rgba(255,255,255,0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.8vw, 18px);
  padding: clamp(16px, 2.6vw, 26px) clamp(12px, 2vw, 20px);
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}
/* soft top sheen for depth */
.cd-card-face::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255,255,255,0.30), transparent 58%);
  pointer-events: none;
}

/* Per-card glow — disabled for a clean professional look */
.cd-card-glow { display: none; }

/* Monogram — frosted white chip on the colourful card */
.cd-card-monogram {
  width: clamp(46px, 6.2vw, 64px);
  height: clamp(46px, 6.2vw, 64px);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 800;
  flex-shrink: 0;
  background: rgba(255,255,255,0.22);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: relative; z-index: 1;
}

.cd-card-name {
  font-family: var(--font-headline);
  font-size: clamp(12.5px, 1.5vw, 16px);
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.32;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 14px rgba(0,0,0,0.75), 0 0 4px rgba(0,0,0,0.5);
  position: relative; z-index: 1;
  padding: 0 4px;
}

.cd-card-sector {
  font-family: var(--font-label);
  font-size: clamp(9px, 1.1vw, 11px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
  position: relative; z-index: 1;
}

/* Card back */
.cd-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 18px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow:
    0 16px 44px rgba(139,44,245,0.16),
    inset 0 1px 0 rgba(255,255,255,0.7);
  border-radius: var(--radius-xl);
}

.cd-back-tag {
  font-family: var(--font-label);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
  font-weight: 600;
}

.cd-back-detail {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  text-align: center;
  line-height: 1.55;
  opacity: 0.92;
}

/* Stacked state */
.cd-card-wrap.stacked {
  left: 50% !important;
  top: 50% !important;
  margin-left: -100px;
  margin-top: -128px;
}

/* Flying animation */
.cd-card-wrap.flying {
  transition:
    left 0.75s cubic-bezier(.22,1,.36,1),
    top 0.75s cubic-bezier(.22,1,.36,1),
    transform 0.75s cubic-bezier(.22,1,.36,1),
    opacity 0.5s;
}

.cd-card-wrap.returning {
  transition:
    left 0.55s cubic-bezier(.4,0,.2,1),
    top 0.55s cubic-bezier(.4,0,.2,1),
    transform 0.55s cubic-bezier(.4,0,.2,1),
    opacity 0.4s;
}
/* settled fan state — snappy transform for hover, smooth left/top for collect */
.cd-card-wrap.fanned {
  transition:
    transform 0.45s cubic-bezier(.22,1,.36,1),
    left 0.6s cubic-bezier(.22,1,.36,1),
    top 0.6s cubic-bezier(.22,1,.36,1),
    box-shadow 0.3s ease;
}
.cd-card-wrap.fanned:hover {
  box-shadow: 0 26px 60px rgba(17,17,26,0.18);
}

/* ===== CLIENT POP-UP MODAL ===== */
.cd-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.cd-modal.open { opacity: 1; pointer-events: auto; }
.cd-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,8,20,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cd-modal-card {
  position: relative;
  z-index: 2;
  width: min(440px, 92vw);
  border-radius: 26px;
  padding: 52px 34px 40px;
  text-align: center;
  /* colour set per-card via JS to match the chosen card */
  background: var(--color-primary);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 40px 100px rgba(0,0,0,0.4);
  transform: translateY(24px) scale(0.94);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(.22,1,.36,1), opacity 0.4s ease;
  overflow: hidden;
}
.cd-modal.open .cd-modal-card { transform: none; opacity: 1; }
.cd-modal-name {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: clamp(24px, 3.2vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.28);
  margin-bottom: 10px;
}
.cd-modal-sector {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  margin-bottom: 24px;
}
.cd-modal-divider {
  width: 44px; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.7);
  margin: 0 auto 22px;
}
.cd-modal-tag {
  font-family: var(--font-label);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}
.cd-modal-detail {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.7;
  color: #fff;
  max-width: 34ch;
  margin: 0 auto;
}
.cd-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.3s ease, transform 0.3s ease;
  z-index: 3;
}
.cd-modal-close:hover { background: rgba(255,255,255,0.32); transform: rotate(90deg); }

/* Responsive */
@media (max-width: 767px) {
  .cd-stage { min-height: 60vh; padding: 60px 24px; }
  .cd-card-wrap { width: 160px; height: 206px; }
  .cd-card-wrap.stacked { margin-left: -80px; margin-top: -103px; }
  .cd-card-face { gap: 12px; padding: 18px 14px; }
  .cd-card-monogram { width: 54px; height: 54px; font-size: 14px; }
  .cd-card-name { font-size: 12.5px; }
  .cd-reset-btn { bottom: 20px; padding: 10px 22px; font-size: 12px; }
}
@media (max-width: 480px) {
  .cd-card-wrap { width: 144px; height: 186px; }
  .cd-card-wrap.stacked { margin-left: -72px; margin-top: -93px; }
  .cd-card-face { gap: 10px; padding: 14px 12px; }
  .cd-card-monogram { width: 48px; height: 48px; font-size: 13px; }
  .cd-card-name { font-size: 11.5px; }
  .cd-card-sector { font-size: 9.5px; }
}
