/* ==========================================================================
   SERVICE PAGES — split hero, package picker, "what you get" track, cases.
   Loaded only by the six service pages (landing, corporate, ecommerce,
   design, branding, seo) and their /en/ twins, after animations.css.

   Everything else those pages use — .horizontal, .tier__features, .faq-item,
   .cta-banner, .stats — already lives in pages.css. Only the pieces unique to
   this layout are here.

   Prefix: .cx-*
   ========================================================================== */


/* ==========================================================================
   1. SHARED PRIMITIVES
   ========================================================================== */
.cx-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.cx-head {
  padding-block: var(--space-xl) var(--space-lg);
  padding-inline: var(--gutter);
}

.cx-head__heading {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: var(--tracking-tight);
  margin-top: var(--space-sm);
}

.cx-head__heading .accent {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  color: var(--signal);
}


/* ==========================================================================
   2. SPLIT HERO — headline left, three counting numbers right
   ========================================================================== */
.cx-hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: center;
  min-height: 88vh;
  min-height: 88svh;
  padding: clamp(120px, 15vh, 180px) var(--gutter) var(--space-lg);
  position: relative;
  overflow: hidden;
}

.cx-hero__bg {
  position: absolute;
  inset: -20% -10%;
  background: radial-gradient(circle at 78% 26%, rgba(250, 250, 250, 0.077), transparent 58%);
  pointer-events: none;
  z-index: 0;
}

.cx-hero-split > *:not(.cx-hero__bg) { position: relative; z-index: 1; }

.cx-hero__crumbs {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-muted);
}

.cx-hero__crumbs a { color: var(--color-text-secondary); }
.cx-hero__crumbs a:hover { color: var(--color-text-primary); }
.cx-hero__crumbs span { margin-inline: 0.4em; }

.cx-hero-split__heading {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: var(--tracking-tight);
  margin-block: var(--space-sm) 0;
}

.cx-hero-split__heading .accent {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  color: var(--signal);
}

.cx-hero-split__sub {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.4vw, 21px);
  line-height: var(--leading-snug);
  color: var(--color-text-secondary);
  margin-top: var(--space-md);
  max-width: 46ch;
}

.cx-facts {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border-left: 1px solid var(--color-border);
  padding-left: var(--space-md);
}

.cx-fact__num {
  font-family: var(--font-display);
  font-size: clamp(40px, 4.4vw, 72px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  display: flex;
  align-items: baseline;
}

.cx-fact__num .unit {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  color: var(--signal);
  font-size: 0.55em;
  margin-left: 0.12em;
}

.cx-fact__label {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 0.4em;
}


/* ==========================================================================
   3. PACKAGE PICKER
   ========================================================================== */
.cx-picker {
  padding-inline: var(--gutter);
  padding-bottom: var(--space-2xl);
}

.cx-picker__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.cx-picker__tab {
  text-align: left;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--color-text-secondary);
  transition: border-color var(--dur-fast) var(--ease-smooth),
              color var(--dur-fast) var(--ease-smooth),
              background var(--dur-fast) var(--ease-smooth),
              transform var(--dur-normal) var(--ease-out-expo);
}

.cx-picker__tab:hover { border-color: var(--color-border-strong); transform: translateY(-4px); }

.cx-picker__tab[aria-selected="true"] {
  border-color: var(--signal);
  background: linear-gradient(160deg, rgba(250, 250, 250, 0.056), transparent 70%);
  color: var(--color-text-primary);
}

.cx-picker__tab-num {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-widest);
  color: var(--color-text-muted);
  margin-bottom: 0.8em;
}

.cx-picker__tab[aria-selected="true"] .cx-picker__tab-num { color: var(--signal); }

.cx-picker__tab-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: var(--tracking-normal);
}

/* Narrow lead column (name, positioning line, term, CTA) + wide feature
   column, so an eight-item list reads as a list, not a wrapped paragraph. */
.cx-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: var(--space-lg);
  align-items: start;
  padding: clamp(28px, 4vw, 56px);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(250, 250, 250, 0.025), transparent 60%);
}

/* All panels occupy the same grid cell → the wrapper is as tall as the tallest
   package, so the card never resizes when a different tab is picked. */
.cx-picker__panels { display: grid; }
.cx-picker__panels > .cx-panel { grid-area: 1 / 1; }

/* visibility (not display) keeps the panel measured for the height above while
   still removing it from the tab order and the accessibility tree. */
.cx-panel {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.cx-panel.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.cx-panel__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 58px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: var(--tracking-tight);
}

.cx-panel__tagline {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: var(--leading-snug);
  color: var(--color-text-secondary);
  margin: 0;
  max-width: 26ch;
}

.cx-panel__lead {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: flex-start;
}

.cx-panel__lead .btn { margin-top: var(--space-xs); }

.cx-panel__term {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--signal);
  padding-top: var(--space-xs);
}

/* The ✓ / — lists reuse .tier__features from pages.css so the marks stay
   identical to the rest of the site. */
.cx-panel__body { min-width: 0; }

.cx-panel__split {
  margin: var(--space-md) 0 0;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-muted);
}


/* ==========================================================================
   4. "WHAT YOU GET" — cards riding the pinned horizontal track
   ========================================================================== */
.cx-hcard {
  flex: 0 0 clamp(280px, 30vw, 440px);
  height: 62%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(250, 250, 250, 0.028), transparent 55%);
  transition: border-color var(--dur-normal) var(--ease-smooth);
}

.cx-hcard:hover { border-color: var(--color-border-strong); }

.cx-hcard__num {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-widest);
  color: var(--signal);
}

.cx-hcard__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 54px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  margin-top: auto;
}

.cx-hcard__meta {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

/* Intro card — states what the track is, so the pin does not feel abrupt. */
.cx-hcard--intro {
  border: none;
  background: none;
  justify-content: center;
  flex: 0 0 clamp(300px, 34vw, 520px);
}

.cx-hcard--intro .cx-hcard__title {
  font-size: var(--text-heading);
  font-weight: 600;
  margin-top: var(--space-sm);
}


/* ==========================================================================
   5. CASES — huge type, cover floats under the cursor (hover-reveal.js)
   ========================================================================== */
.cx-cases {
  padding-inline: var(--gutter);
  padding-block: var(--space-xl);
}

.cx-cases__list { border-top: 1px solid var(--color-border); }

.cx-case-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: clamp(28px, 5vh, 56px);
  border-bottom: 1px solid var(--color-border);
  transition: color var(--dur-normal) var(--ease-smooth),
              padding var(--dur-normal) var(--ease-out-expo);
}

.cx-case-row:hover { color: var(--signal); padding-inline: var(--space-sm); }

.cx-case-row__name {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 110px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: var(--tracking-tight);
  text-transform: uppercase;
}

.cx-case-row__meta {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Hover preview that shows the WHOLE screenshot. The stock .hover-reveal is a
   fixed 16/11 box with object-fit:cover, which crops badly — Zimenko's cover is
   portrait (973×1217) next to King Gym's landscape (1600×1000). Letting the
   figure shrink-wrap the image keeps each cover's own aspect intact.
   Scoped to body.cx-hr-fit so the homepage keeps the stock behaviour. */
body.cx-hr-fit .hover-reveal {
  width: auto;
  height: auto;
  aspect-ratio: auto;
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(250, 250, 250, 0.042), rgba(18, 18, 18, 0.96));
  border-color: var(--color-border-strong);
}

body.cx-hr-fit .hover-reveal__img {
  width: auto;
  height: auto;
  max-width: min(34vw, 480px);
  /* Caps the portrait covers so the preview never grows past half the screen
     and hangs off the edge — hover-reveal.js centres it on the cursor. */
  max-height: 52vh;
  object-fit: contain;
  border-radius: 10px;
}


/* ==========================================================================
   6. RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .cx-hero-split { grid-template-columns: 1fr; align-items: start; gap: var(--space-md); }
  .cx-facts { flex-direction: row; flex-wrap: wrap; gap: var(--space-md); border-left: none; padding-left: 0; }
  .cx-picker__tabs { grid-template-columns: 1fr; }
  .cx-panel { grid-template-columns: 1fr; gap: var(--space-md); }
}

@media (max-width: 760px) {
  .cx-case-row { flex-direction: column; align-items: flex-start; gap: 0.4em; }

  /* horizontal.js pins at every width (same as the homepage), so the track
     stays horizontal here — the cards just need a phone-sized basis. Without
     one they collapse into ragged, uneven columns. */
  .cx-hcard { flex: 0 0 78vw; height: 58%; padding: var(--space-md) var(--space-sm); }
  .cx-hcard--intro { flex: 0 0 82vw; }
  .cx-hcard__title { font-size: clamp(26px, 8vw, 40px); }
  .cx-hcard--intro .cx-hcard__title { font-size: clamp(24px, 7vw, 34px); }
}


/* ==========================================================================
   7. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .cx-case-row,
  .cx-picker__tab { transition: none; }
  .cx-picker__tab:hover { transform: none; }
}
