/* ============================================================
   CODEFY PORTFOLIO — Shared Stylesheet
   codefy.css  ·  Apple-inspired redesign
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;1,300&display=swap');

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Palette — Apple-inspired */
  --black:        #1D1D1F;
  --gray-1:       #2D2D2F;
  --gray-2:       #3A3A3A;
  --gray-3:       #6E6E73;
  --gray-4:       #86868B;
  --gray-5:       #AEAEB2;
  --gray-6:       #D2D2D7;
  --smoke:        #F5F5F7;
  --white:        #FFFFFF;
  --accent:       #0071E3;
  --accent-soft:  #B3D5F5;
  --accent-tint:  #EBF5FF;
  --accent-deep:  #0051A2;
  --green-soft:   #EAF4EE;
  --green-ink:    #1D7944;
  --amber-soft:   #FEF5E7;
  --amber-ink:    #9A6E1A;
  --red-soft:     #FFF0EF;
  --red-ink:      #FF3B30;
  --cover-bg:     #FFFFFF;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fw-thin:   200;
  --fw-light:  300;
  --fw-reg:    400;
  --fw-mid:    500;
  --fw-semi:   600;
  --fw-bold:   700;

  /* Spacing */
  --section-v:  120px;
  --section-h:  80px;
  --max-w:      1280px;
  --nav-h:      48px;

  /* Radius */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-pill: 999px;

  /* Transitions */
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms;
  --t-mid:  380ms;
  --t-slow: 640ms;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-weight: var(--fw-reg);
  font-size: 17px;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   3. TYPOGRAPHY SCALE
   ============================================================ */
.label {
  font-size: 11px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-4);
}

.label--accent { color: var(--accent); }

/* Hero headline */
.title-hero {
  font-size: clamp(48px, 8.5vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.04em;
  font-weight: var(--fw-bold);
  color: var(--black);
}

.title-hero .thin {
  font-weight: var(--fw-light);
  opacity: 0.3;
  letter-spacing: -0.03em;
}

/* Section title */
.title-lg {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* Sub-section title */
.title-md {
  font-size: clamp(22px, 2.8vw, 36px);
  font-weight: var(--fw-semi);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* Large body copy */
.body-lg {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.7;
  color: var(--gray-3);
  font-weight: var(--fw-reg);
}

.body-md {
  font-size: 15px;
  line-height: 1.65;
  color: var(--gray-3);
}

/* Tabular numbers */
.stat-value, .metric-value, [data-numeric] {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   4. SECTION WRAPPER
   ============================================================ */
.section {
  padding: var(--section-v) var(--section-h);
  position: relative;
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Floating section number */
.section-num {
  position: absolute;
  top: 32px;
  right: var(--section-h);
  font-size: 11px;
  font-weight: var(--fw-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}

.section--dark {
  background: var(--black);
  color: var(--white);
}

.section--dark .body-lg { color: var(--gray-5); }
.section--dark .label   { color: var(--gray-5); }

.section--smoke { background: var(--smoke); }

/* ============================================================
   5. NAVIGATION — ultra-minimal Apple style
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--section-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: transform var(--t-mid) var(--ease),
              opacity var(--t-mid) var(--ease);
}

.nav.nav--hidden {
  transform: translateY(-100%);
  opacity: 0;
}

.nav__logo {
  font-size: 15px;
  font-weight: var(--fw-semi);
  letter-spacing: -0.02em;
  color: var(--black);
}

.nav__links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  font-size: 13px;
  font-weight: var(--fw-reg);
  color: var(--gray-3);
  letter-spacing: 0;
  transition: color var(--t-fast);
}

.nav__links a:hover { color: var(--black); }

.nav__counter {
  font-size: 12px;
  font-weight: var(--fw-reg);
  letter-spacing: 0.06em;
  color: var(--gray-5);
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: right;
}

/* ============================================================
   6. SCROLL PROGRESS BAR
   ============================================================ */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 200;
  background: var(--black);
  transition: width 50ms linear;
  pointer-events: none;
}

/* ============================================================
   7. PAGE LOADER
   ============================================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}

#loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__text {
  font-size: 12px;
  font-weight: var(--fw-light);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.loader__line {
  width: 100px;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  transform-origin: left center;
  animation: loaderLine 1.4s var(--ease) forwards;
}

@keyframes loaderLine {
  0%   { transform: scaleX(0); opacity: 0.4; }
  50%  { transform: scaleX(1); opacity: 0.7; }
  100% { transform: scaleX(0); opacity: 0; transform-origin: right center; }
}

/* ============================================================
   8. REVEAL OBSERVER
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 260ms; }
.reveal[data-delay="4"] { transition-delay: 380ms; }
.reveal[data-delay="5"] { transition-delay: 500ms; }

/* ============================================================
   9. TAGS
   ============================================================ */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: var(--fw-mid);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag--default { background: var(--smoke); color: var(--gray-3); }
.tag--accent  { background: var(--accent-tint); color: var(--accent-deep); }
.tag--green   { background: var(--green-soft);  color: var(--green-ink); }
.tag--amber   { background: var(--amber-soft);  color: var(--amber-ink); }

/* ============================================================
   10. HOME COVER — Apple-style centered hero
   ============================================================ */
.cover {
  min-height: 100vh;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--nav-h) var(--section-h) 0;
  position: relative;
  overflow: hidden;
}

/* Subtle radial gradient background accent */
.cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(0,113,227,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.cover__eyebrow {
  font-size: 12px;
  font-weight: var(--fw-mid);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-4);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.cover__eyebrow::before,
.cover__eyebrow::after {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--gray-6);
  display: block;
}

.cover__title {
  font-size: clamp(56px, 9vw, 104px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em;
  line-height: 0.93;
  color: var(--black);
  margin-bottom: 28px;
  position: relative;
}

.cover__subtitle {
  font-size: clamp(16px, 1.8vw, 21px);
  font-weight: var(--fw-reg);
  line-height: 1.55;
  color: var(--gray-3);
  max-width: 500px;
  margin-bottom: 44px;
  position: relative;
}

.cover__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 15px 30px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: var(--fw-mid);
  letter-spacing: -0.01em;
  transition: background var(--t-fast), transform var(--t-fast);
  text-decoration: none;
  margin-bottom: 80px;
  position: relative;
}

.cover__cta:hover {
  background: var(--gray-2);
  transform: translateY(-1px);
}

.cover__cta svg {
  width: 14px;
  height: 14px;
  transition: transform var(--t-fast);
}

.cover__cta:hover svg { transform: translateY(2px); }

/* Stats bar at the bottom of hero */
.cover__stats-bar {
  display: flex;
  gap: 0;
  align-items: stretch;
  width: 100%;
  max-width: 680px;
  border-top: 1px solid var(--gray-6);
  position: relative;
}

.cover__stat {
  flex: 1;
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--gray-6);
}

.cover__stat:last-child { border-right: none; }

.cover__stat-value {
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
  color: var(--black);
  font-variant-numeric: tabular-nums;
}

.cover__stat-label {
  font-size: 11px;
  font-weight: var(--fw-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-4);
}

/* ============================================================
   11. CASES GRID — Large Apple-style cards
   ============================================================ */
.cases-section {
  padding: var(--section-v) var(--section-h);
  background: var(--white);
}

.cases-header {
  text-align: center;
  margin-bottom: 64px;
}

.cases-header .label {
  display: block;
  margin-bottom: 12px;
}

.cases-header .title-lg {
  color: var(--black);
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.cases-grid .case-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 680px;
  justify-self: center;
  width: 100%;
}

.case-card {
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--smoke);
  cursor: pointer;
  transition: transform var(--t-mid) var(--ease),
              box-shadow var(--t-mid) var(--ease);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.case-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}

.case-card__thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--gray-6);
  position: relative;
}

.case-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}

.case-card:hover .case-card__thumb img { transform: scale(1.04); }

.case-card__thumb--placeholder {
  background: linear-gradient(145deg, #EBEBEB 0%, #E0E0E2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-card__thumb--placeholder::after {
  content: attr(data-label);
  font-size: 11px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-5);
}

.case-card__body {
  padding: 24px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--white);
}

.case-card__num {
  font-size: 10px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.case-card__title {
  font-size: 18px;
  font-weight: var(--fw-semi);
  letter-spacing: -0.02em;
  color: var(--black);
}

.case-card__desc {
  font-size: 14px;
  color: var(--gray-3);
  line-height: 1.5;
  flex: 1;
}

.case-card__tags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.case-card__tags .tag {
  font-size: 10px;
  padding: 3px 10px;
}

/* ============================================================
   12. CTA SECTION
   ============================================================ */
.cta-section {
  background: var(--black);
  padding: var(--section-v) var(--section-h);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle light glow */
.cta-section::before {
  content: '';
  position: absolute;
  bottom: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 50%;
  background: radial-gradient(ellipse, rgba(0,113,227,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.cta-section .title-hero {
  color: var(--white);
  margin-bottom: 36px;
  position: relative;
}

.cta-section .title-hero .thin {
  color: rgba(255,255,255,0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 36px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: var(--fw-mid);
  letter-spacing: -0.01em;
  transition: all var(--t-mid) var(--ease);
  text-decoration: none;
  cursor: pointer;
}

.btn--white {
  background: var(--white);
  color: var(--black);
}

.btn--white:hover {
  background: var(--smoke);
  transform: translateY(-2px);
}

.btn--accent {
  background: var(--accent);
  color: var(--white);
}

.btn--accent:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
}

.cta-footer {
  margin-top: 80px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  font-weight: var(--fw-mid);
  position: relative;
}

/* ============================================================
   13. CASE PAGE — HEADER
   ============================================================ */
.case-header {
  padding: calc(var(--nav-h) + var(--section-v)) var(--section-h) var(--section-v);
  background: var(--white);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--gray-6);
}

/* Light gradient accent */
.case-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 20% 50%, rgba(0,113,227,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-5);
  margin-bottom: 28px;
  flex-wrap: wrap;
  position: relative;
}

.breadcrumb a {
  color: var(--gray-4);
  transition: color var(--t-fast);
}

.breadcrumb a:hover { color: var(--black); }
.breadcrumb span { color: var(--gray-6); }

.case-header .label    { display: block; margin-bottom: 12px; position: relative; }
.case-header .title-lg { margin-bottom: 10px; position: relative; }

.case-header__subtitle {
  font-size: 19px;
  color: var(--gray-3);
  font-weight: var(--fw-light);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
  position: relative;
}

.case-header .body-lg {
  max-width: 600px;
  margin-bottom: 28px;
  position: relative;
}

/* ============================================================
   14. METRICS ROW
   ============================================================ */
.metrics-section {
  padding: var(--section-v) var(--section-h);
  background: var(--smoke);
  border-bottom: 1px solid var(--gray-6);
}

.metrics-row {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.metric-card {
  padding: 40px 36px;
  background: var(--white);
  border-radius: var(--r-xl);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.metric-card--green {
  background: var(--green-soft);
  border-color: rgba(29,121,68,0.12);
}

.metric-card--blue {
  background: var(--accent-tint);
  border-color: rgba(0,113,227,0.12);
}

.metric-card--amber {
  background: var(--amber-soft);
  border-color: rgba(154,110,26,0.12);
}

.metric-value {
  font-size: clamp(34px, 4vw, 56px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 8px;
}

.metric-card--green .metric-value { color: var(--green-ink); }
.metric-card--blue  .metric-value { color: var(--accent-deep); }
.metric-card--amber .metric-value { color: var(--amber-ink); }

.metric-name {
  font-size: 13px;
  font-weight: var(--fw-semi);
  color: var(--gray-2);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.metric-context {
  font-size: 13px;
  color: var(--gray-3);
  line-height: 1.5;
}

.metric-prob {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: rgba(0,0,0,0.05);
  color: var(--gray-3);
}

/* ============================================================
   15. SLIDER ANTES/DESPUÉS (kept for design-only cases)
   ============================================================ */
.slider-section {
  padding: var(--section-v) var(--section-h);
  background: var(--white);
}

.slider-section + .slider-section { padding-top: 0; }

.slider-section__inner { max-width: var(--max-w); margin: 0 auto; }

.slider-section__header { margin-bottom: 28px; }
.slider-section__header .label { display: block; margin-bottom: 8px; }
.slider-section__header .title-md {
  font-size: 20px;
  font-weight: var(--fw-semi);
  color: var(--gray-2);
}

/* Before/After container */
.ba-wrap {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--smoke);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: col-resize;
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
}

.ba-wrap--desktop { aspect-ratio: 16 / 10; }
.ba-wrap--mobile  { aspect-ratio: 9 / 16; max-width: 360px; margin: 0 auto; }

.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-img--after {
  clip-path: inset(0 50% 0 0);
  will-change: clip-path;
}

.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--white);
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0,0,0,0.15);
  transition: left 0.05s linear;
  will-change: left;
}

.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: left 0.05s linear;
  will-change: left;
}

.ba-handle svg { width: 20px; height: 20px; flex-shrink: 0; }

.ba-label {
  position: absolute;
  top: 16px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.ba-label--before {
  left: 16px;
  background: rgba(29,29,31,0.75);
  color: var(--white);
  backdrop-filter: blur(4px);
}

.ba-label--after {
  right: 16px;
  background: var(--accent);
  color: var(--white);
}

.ba-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(29,29,31,0.6);
  color: var(--white);
  font-size: 11px;
  font-weight: var(--fw-mid);
  letter-spacing: 0.05em;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  backdrop-filter: blur(4px);
  pointer-events: none;
  white-space: nowrap;
  animation: hintPulse 2s ease-in-out infinite;
  transition: opacity var(--t-mid);
}

.ba-hint.hidden { opacity: 0; }

@keyframes hintPulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

.ba-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--smoke);
  color: var(--gray-5);
}

.ba-placeholder__icon { width: 48px; height: 48px; opacity: 0.4; }

.ba-placeholder p {
  font-size: 12px;
  font-weight: var(--fw-mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  text-align: center;
  max-width: 200px;
  line-height: 1.4;
}

/* ============================================================
   16. STACK + PROCESS SECTION
   ============================================================ */
.stack-section {
  padding: var(--section-v) var(--section-h);
  background: var(--smoke);
}

.stack-section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.stack-block h3,
.process-block h3 {
  font-size: 11px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-4);
  margin-bottom: 20px;
}

.stack-pills { display: flex; flex-wrap: wrap; gap: 8px; }

.stack-pill {
  padding: 8px 18px;
  background: var(--white);
  border: 1px solid var(--gray-6);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: var(--fw-mid);
  color: var(--gray-2);
  letter-spacing: -0.01em;
}

.process-block p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--gray-2);
}

/* ============================================================
   17. PROJECT FOCUS (design-only cases)
   ============================================================ */
.focus-section {
  padding: var(--section-v) var(--section-h);
  background: var(--smoke);
}

.focus-section__inner { max-width: var(--max-w); margin: 0 auto; }

.focus-block { max-width: 640px; }

.focus-block h3 {
  font-size: 11px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-4);
  margin-bottom: 20px;
}

.focus-block p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--gray-2);
  margin-bottom: 16px;
}

.focus-note {
  display: inline-block;
  padding: 10px 20px;
  background: var(--amber-soft);
  border-left: 3px solid var(--amber-ink);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13px;
  color: var(--amber-ink);
  margin-top: 8px;
}

/* ============================================================
   18. CASE NAVIGATION
   ============================================================ */
.case-nav {
  padding: 48px var(--section-h);
  background: var(--white);
  border-top: 1px solid var(--gray-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.case-nav__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
}

.case-nav__link--prev { align-items: flex-start; }
.case-nav__link--next { align-items: flex-end; text-align: right; }

.case-nav__dir {
  font-size: 11px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-5);
}

.case-nav__label {
  font-size: 16px;
  font-weight: var(--fw-semi);
  color: var(--black);
  letter-spacing: -0.01em;
  transition: color var(--t-fast);
}

.case-nav__link:hover .case-nav__label { color: var(--accent); }
.case-nav__spacer { flex: 1; }

/* ============================================================
   19. CONTACT PAGE
   ============================================================ */
.contact-hero {
  min-height: 55vh;
  background: var(--white);
  padding: calc(var(--nav-h) + var(--section-v)) var(--section-h) var(--section-v);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  border-bottom: 1px solid var(--gray-6);
}

.contact-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 0% 100%, rgba(0,113,227,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.contact-hero .title-hero { max-width: 700px; margin-bottom: 24px; position: relative; }

.contact-info {
  padding: var(--section-v) var(--section-h);
  background: var(--white);
}

.contact-info__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.contact-col h3 {
  font-size: 11px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-4);
  margin-bottom: 32px;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.contact-item__label {
  font-size: 11px;
  font-weight: var(--fw-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-5);
}

.contact-item__value {
  font-size: 17px;
  font-weight: var(--fw-mid);
  color: var(--black);
  letter-spacing: -0.01em;
}

.contact-item__value a {
  color: var(--accent);
  transition: color var(--t-fast);
}

.contact-item__value a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.contact-item__sub {
  font-size: 13px;
  color: var(--gray-3);
}

.btn--outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border: 1.5px solid var(--accent);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: var(--fw-mid);
  color: var(--accent);
  letter-spacing: -0.01em;
  transition: all var(--t-mid) var(--ease);
  margin-top: 8px;
  text-decoration: none;
}

.btn--outline:hover {
  background: var(--accent);
  color: var(--white);
}

/* Client strip */
.client-strip {
  padding: 56px var(--section-h);
  background: var(--smoke);
  border-top: 1px solid var(--gray-6);
}

.client-strip__inner { max-width: var(--max-w); margin: 0 auto; }
.client-strip__label { display: block; margin-bottom: 32px; }

.client-strip__logos {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.client-strip__logo {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: var(--fw-mid);
  color: var(--gray-5);
  letter-spacing: 0.04em;
  border-right: 1px solid var(--gray-6);
  transition: color var(--t-fast);
}

.client-strip__logo:last-child { border-right: none; }
.client-strip__logo:hover { color: var(--gray-2); }

/* ============================================================
   20. RESPONSIVE — 1024px
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --section-h: 48px;
    --section-v: 80px;
  }

  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .metrics-row .metric-card:last-child:nth-child(3) { grid-column: 1 / -1; }
  .stack-section__inner { grid-template-columns: 1fr; gap: 40px; }
  .contact-info__inner  { grid-template-columns: 1fr; gap: 48px; }
}

/* ============================================================
   21. RESPONSIVE — 768px (mobile)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --section-h: 20px;
    --section-v: 64px;
    --nav-h: 52px;
  }

  .nav {
    padding: 0 20px;
  }

  .nav__links { display: none; }

  .cover__stats-bar {
    flex-wrap: wrap;
  }

  .cover__stat {
    flex: none;
    width: 50%;
    padding: 20px 0;
  }

  .cover__stat:nth-child(even) { border-right: none; }
  .cover__stat:nth-child(n+3)  { border-top: 1px solid var(--gray-6); }

  .cases-grid { grid-template-columns: 1fr; }

  .cases-grid .case-card:last-child:nth-child(odd) {
    grid-column: auto;
    max-width: none;
  }

  .metrics-row { grid-template-columns: 1fr; }
  .metrics-row .metric-card:last-child:nth-child(3) { grid-column: auto; }

  .ba-wrap--desktop { aspect-ratio: 4 / 3; }
  .ba-wrap--mobile  { max-width: 280px; }

  .case-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .case-nav__link--next {
    align-items: flex-start;
    text-align: left;
  }

  .contact-info__inner { grid-template-columns: 1fr; gap: 40px; }

  .client-strip__logos { flex-direction: column; align-items: stretch; }
  .client-strip__logo { border-right: none; border-bottom: 1px solid var(--gray-6); text-align: left; }
  .client-strip__logo:last-child { border-bottom: none; }

  .section-num { display: none; }
}

/* ============================================================
   22. UTILITY CLASSES
   ============================================================ */
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mt-64 { margin-top: 64px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ============================================================
   23. CASE VIEWER — Tabs · PDF · Anotaciones
   ============================================================ */

/* ── Section wrapper for stacked case sections ── */
.cv-section {
  padding: 0;
  background: var(--white);
}

.cv-section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-v) var(--section-h);
}

.cv-section__header {
  margin-bottom: 40px;
}

.cv-section__header .label {
  display: block;
  margin-bottom: 10px;
}

/* ── Stacked case sections ── */
.case-section {
  padding: var(--section-v) var(--section-h);
  border-top: 1px solid var(--gray-6);
  position: relative;
}

.case-section:first-of-type {
  border-top: none;
}

.case-section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.case-section__header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}

.case-section__num {
  font-size: 12px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  min-width: 24px;
}

.case-section__title {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: var(--fw-semi);
  letter-spacing: -0.02em;
  color: var(--black);
}

.case-section__badge {
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--green-soft);
  color: var(--green-ink);
}

.case-section__badge--removed {
  background: var(--amber-soft);
  color: var(--amber-ink);
}

/* ── Tab bar ── */
.cv-tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--gray-6);
  position: relative;
  margin-bottom: 0;
}

.cv-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: var(--fw-mid);
  letter-spacing: 0;
  color: var(--gray-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.cv-tab:hover { color: var(--black); }

.cv-tab.is-active {
  color: var(--black);
  border-bottom-color: var(--black);
  font-weight: var(--fw-semi);
}

.cv-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}

.cv-tab[data-tab="antes"]  .cv-tab__badge { background: var(--smoke); color: var(--gray-4); border: 1px solid var(--gray-6); }
.cv-tab[data-tab="despues"] .cv-tab__badge { background: var(--accent-tint); color: var(--accent); border: 1px solid rgba(0,113,227,0.2); }
.cv-tab.is-active[data-tab="antes"]   .cv-tab__badge { background: var(--gray-6); color: var(--black); }
.cv-tab.is-active[data-tab="despues"] .cv-tab__badge { background: var(--accent); color: var(--white); }

/* "Nueva página" placeholder tab state */
.cv-tab[data-tab="antes"].cv-tab--empty { opacity: 0.45; }

/* ── Panel ── */
.cv-panel {
  display: none;
  background: var(--white);
  border: 1px solid var(--gray-6);
  border-top: none;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
}

.cv-panel.is-active {
  display: flex;
  flex-direction: column;
}

/* ── Panel layout ── */
.cv-body {
  display: flex;
  min-height: 0;
  flex: 1;
}

.cv-viewer-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--gray-6);
}

/* ── Controls bar ── */
.cv-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: var(--smoke);
  border-bottom: 1px solid var(--gray-6);
  flex-shrink: 0;
}

.cv-btn-play {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  background: var(--black);
  color: var(--white);
  font-size: 12px;
  font-weight: var(--fw-mid);
  border: none;
  cursor: pointer;
  transition: background var(--t-fast);
  flex-shrink: 0;
}

.cv-btn-play:hover { background: var(--gray-2); }
.cv-btn-play svg   { width: 12px; height: 12px; flex-shrink: 0; }

.cv-speed-label {
  font-size: 11px;
  color: var(--gray-4);
  font-weight: var(--fw-mid);
  white-space: nowrap;
}

.cv-speed {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 3px;
  border-radius: 2px;
  background: var(--gray-6);
  outline: none;
  cursor: pointer;
}

.cv-speed::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--black);
  cursor: pointer;
}

.cv-controls__spacer { flex: 1; }

.cv-page-info {
  font-size: 11px;
  color: var(--gray-5);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── PDF scroll area ── */
.cv-pdf-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #EBEBEB;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-5) transparent;
  max-height: 72vh;
  min-height: 520px;
}

.cv-pdf-scroll::-webkit-scrollbar { width: 5px; }
.cv-pdf-scroll::-webkit-scrollbar-track { background: transparent; }
.cv-pdf-scroll::-webkit-scrollbar-thumb { background: var(--gray-5); border-radius: 3px; }

.cv-pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.cv-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  box-shadow: 0 2px 20px rgba(0,0,0,0.14);
  background: var(--white);
}

/* Loading state */
.cv-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 40px;
  color: var(--gray-4);
  min-height: 400px;
}

.cv-loading__spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--gray-6);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.cv-loading__text {
  font-size: 12px;
  font-weight: var(--fw-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* No-PDF placeholder */
.cv-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 40px;
  min-height: 400px;
  background: var(--smoke);
  color: var(--gray-4);
  text-align: center;
}

.cv-placeholder svg          { width: 48px; height: 48px; opacity: 0.3; }
.cv-placeholder__title       { font-size: 14px; font-weight: var(--fw-mid); color: var(--gray-3); }
.cv-placeholder__path        { font-size: 12px; font-family: monospace; background: var(--white); border: 1px solid var(--gray-6); padding: 6px 14px; border-radius: var(--r-sm); color: var(--accent); margin-top: 4px; }
.cv-placeholder__hint        { font-size: 12px; color: var(--gray-5); max-width: 280px; line-height: 1.6; }

/* "Nueva página" placeholder panel */
.cv-panel-new-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 40px;
  min-height: 320px;
  background: var(--smoke);
  text-align: center;
  border: 1px solid var(--gray-6);
  border-top: none;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.cv-panel-new-page__icon {
  width: 48px;
  height: 48px;
  background: var(--green-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.cv-panel-new-page__title {
  font-size: 16px;
  font-weight: var(--fw-semi);
  color: var(--black);
  letter-spacing: -0.01em;
}

.cv-panel-new-page__body {
  font-size: 14px;
  color: var(--gray-3);
  max-width: 340px;
  line-height: 1.6;
}

/* ── Sidebar ── */
.cv-sidebar {
  width: 300px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 20px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-6) transparent;
  max-height: calc(72vh + 49px);
}

.cv-sidebar::-webkit-scrollbar { width: 4px; }
.cv-sidebar::-webkit-scrollbar-thumb { background: var(--gray-6); border-radius: 2px; }

.cv-sidebar__title {
  padding: 0 20px 14px;
  font-size: 10px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-5);
  border-bottom: 1px solid var(--gray-6);
  margin-bottom: 6px;
}

/* ── Annotations ── */
.cv-annotation {
  padding: 14px 20px;
  border-left: 2px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
  cursor: pointer;
}

.cv-annotation:hover { background: var(--smoke); }

.cv-annotation.is-active {
  background: var(--accent-tint);
  border-left-color: var(--accent);
}

.cv-ann-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.cv-ann-num {
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  color: var(--gray-5);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.cv-annotation.is-active .cv-ann-num { color: var(--accent); }

.cv-ann-title {
  font-size: 13px;
  font-weight: var(--fw-semi);
  color: var(--black);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.cv-ann-body {
  font-size: 12px;
  line-height: 1.6;
  color: var(--gray-3);
  margin-left: 20px;
}

.cv-ann-tag {
  display: inline-block;
  margin-top: 8px;
  margin-left: 20px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: var(--fw-semi);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cv-ann-tag--problem     { background: var(--red-soft);   color: var(--red-ink); }
.cv-ann-tag--ok          { background: var(--green-soft);  color: var(--green-ink); }
.cv-ann-tag--improvement { background: var(--accent-tint); color: var(--accent-deep); }

/* ── Progress track ── */
.cv-progress-track {
  height: 2px;
  background: var(--gray-6);
  position: relative;
  flex-shrink: 0;
}

.cv-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 80ms linear;
}

/* ── Sub-nav (legacy / kept for dabalash v1 compat) ── */
.cv-subnav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: var(--smoke);
  border-bottom: 1px solid var(--gray-6);
  flex-wrap: wrap;
}

.cv-subnav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: var(--fw-mid);
  color: var(--gray-3);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.cv-subnav-btn:hover { background: var(--white); color: var(--black); border-color: var(--gray-6); }

.cv-subnav-btn.is-active {
  background: var(--white);
  color: var(--black);
  border-color: var(--gray-6);
  font-weight: var(--fw-semi);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.cv-subnav-badge { font-size: 14px; line-height: 1; flex-shrink: 0; }

.cv-subnav-tag {
  font-size: 9px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--accent-tint);
  color: var(--accent);
  margin-left: 2px;
}

.cv-subnav-tag--new { background: var(--green-soft); color: var(--green-ink); }
.cv-subnav-tag--old { background: var(--amber-soft); color: var(--amber-ink); }

/* ── Device toggle ── */
.cv-device-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  background: var(--smoke);
  border-bottom: 1px solid var(--gray-6);
}

.cv-device-bar__label {
  font-size: 10px;
  font-weight: var(--fw-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-5);
  margin-right: 8px;
}

.cv-device-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: var(--fw-mid);
  color: var(--gray-3);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
}

.cv-device-btn:hover { color: var(--black); background: var(--white); }

.cv-device-btn.is-active {
  background: var(--white);
  color: var(--black);
  border-color: var(--gray-6);
  font-weight: var(--fw-semi);
}

.cv-device-btn.is-disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Annotation groups ── */
.cv-ann-group         { display: none; }
.cv-ann-group.is-active { display: block; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .cv-sidebar { width: 240px; }
}

@media (max-width: 768px) {
  .cv-body { flex-direction: column; }

  .cv-viewer-col {
    border-right: none;
    border-bottom: 1px solid var(--gray-6);
  }

  .cv-sidebar {
    width: 100%;
    max-height: 260px;
  }

  .cv-pdf-scroll { max-height: 50vh; min-height: 300px; }

  .cv-tab {
    padding: 10px 18px;
    font-size: 12px;
  }

  .cv-subnav { padding: 8px 10px; gap: 3px; }
  .cv-subnav-btn { padding: 5px 10px; font-size: 11px; }

  .case-section { padding: var(--section-v) var(--section-h); }
}

@media (prefers-reduced-motion: reduce) {
  .cv-loading__spinner { animation: none; opacity: 0.5; }
  .cv-pdf-scroll { scroll-behavior: auto; }
}

/* ============================================================
   30. CASE PAGE v2 — APPLE PRESENTATION STYLE (cp-*)
   ============================================================ */

/* ── Hero dark ── */
.cp-hero {
  min-height: 100vh;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 48px) var(--section-h) 80px;
  position: relative;
  overflow: hidden;
}
.cp-hero::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,113,227,0.12) 0%, transparent 65%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cp-hero__back {
  position: absolute;
  top: calc(var(--nav-h) + 24px);
  left: var(--section-h);
  font-size: 13px;
  color: rgba(255,255,255,0.38);
  display: flex; align-items: center; gap: 6px;
  transition: color var(--t-fast);
  letter-spacing: -0.01em;
}
.cp-hero__back:hover { color: rgba(255,255,255,0.75); }
.cp-hero__eyebrow {
  font-size: 11px; font-weight: var(--fw-semi);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  position: relative;
}
.cp-hero__title {
  font-size: clamp(52px, 8vw, 96px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.045em;
  line-height: 0.93;
  color: var(--white);
  margin-bottom: 20px;
  position: relative;
}
.cp-hero__sub {
  font-size: clamp(15px, 1.8vw, 19px);
  font-weight: var(--fw-light);
  color: rgba(255,255,255,0.48);
  max-width: 440px;
  margin-bottom: 64px;
  line-height: 1.5;
  position: relative;
}
.cp-hero__metrics {
  display: flex;
  width: 100%; max-width: 680px;
  border-top: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.cp-hero__metric {
  flex: 1;
  padding: 32px 12px;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.cp-hero__metric:last-child { border-right: none; }
.cp-hero__metric-val {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cp-hero__metric-val--green { color: #30D158; }
.cp-hero__metric-val--blue  { color: #64D2FF; }
.cp-hero__metric-val--amber { color: #FFD60A; }
.cp-hero__metric-name {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-top: 8px;
}
.cp-hero__scroll-hint {
  position: absolute;
  bottom: 36px;
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: cp-pulse-down 2.4s ease-in-out infinite;
}
@keyframes cp-pulse-down {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50%       { transform: translateY(7px); opacity: 0.65; }
}

/* ── TOC / section nav ── */
.cp-toc {
  position: sticky;
  top: var(--nav-h);
  z-index: 30;
  background: rgba(29,29,31,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  overflow-x: auto;
  scrollbar-width: none;
}
.cp-toc::-webkit-scrollbar { display: none; }
.cp-toc__inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; gap: 4px;
  padding: 0 var(--section-h);
  height: 44px;
  white-space: nowrap;
}
.cp-toc__link {
  font-size: 12px; font-weight: var(--fw-mid);
  color: rgba(255,255,255,0.45);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  transition: color var(--t-fast), background var(--t-fast);
  text-decoration: none;
}
.cp-toc__link:hover { color: rgba(255,255,255,0.8); }
.cp-toc__link.is-active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

/* ── Overview strip ── */
.cp-overview {
  padding: 80px var(--section-h);
  background: var(--smoke);
  border-bottom: 1px solid var(--gray-6);
}
.cp-overview__inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 72px;
  align-items: start;
}
.cp-overview__text {
  font-size: 18px; color: var(--gray-2); line-height: 1.75;
}
.cp-overview__text strong { color: var(--black); font-weight: var(--fw-semi); }
.cp-overview__meta { display: flex; flex-direction: column; gap: 28px; }
.cp-overview__meta-label {
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gray-4); margin-bottom: 10px;
}
.cp-overview__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-overview__pill {
  font-size: 13px; font-weight: var(--fw-mid);
  padding: 6px 14px; background: var(--white);
  border: 1px solid var(--gray-6); border-radius: var(--r-pill);
  color: var(--black);
}

/* ── Section container ── */
.cp-section { position: relative; }

/* ── Section sticky header ── */
.cp-section-head {
  padding: 0 var(--section-h);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: calc(var(--nav-h) + 44px);
  z-index: 20;
  border-bottom: 1px solid var(--gray-6);
  border-top: 1px solid var(--gray-6);
}
.cp-section-head__inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  height: 48px;
}
.cp-section-head__num {
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent);
}
.cp-section-head__name {
  font-size: 16px; font-weight: var(--fw-semi);
  letter-spacing: -0.02em; color: var(--black);
}
.cp-section-head__badge {
  font-size: 9px; font-weight: var(--fw-semi);
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--green-soft); color: var(--green-ink);
}

/* ── Design block ── */
.cp-block {
  padding: 72px var(--section-h);
}
.cp-block--before { background: #1C1C1E; color: var(--white); }
.cp-block--after  { background: var(--white); }
.cp-block__inner  { max-width: var(--max-w); margin: 0 auto; }
.cp-block__header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.cp-block__status {
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 5px 13px; border-radius: var(--r-pill);
}
.cp-block--before .cp-block__status {
  background: rgba(255,59,48,0.14); color: #FF6B6B;
}
.cp-block--after .cp-block__status {
  background: var(--green-soft); color: var(--green-ink);
}
.cp-block__title {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: var(--fw-semi); letter-spacing: -0.02em;
}
.cp-block--before .cp-block__title { color: rgba(255,255,255,0.85); }
.cp-block--after  .cp-block__title { color: var(--black); }

/* Device view toggle */
.cp-device-toggle {
  display: flex; gap: 2px;
  margin-left: auto;
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-pill); padding: 3px;
}
.cp-block--after .cp-device-toggle { background: var(--smoke); }
.cp-device-toggle button {
  padding: 6px 18px;
  font-size: 12px; font-weight: var(--fw-mid);
  border-radius: var(--r-pill);
  color: rgba(255,255,255,0.45);
  transition: all var(--t-fast);
}
.cp-block--after .cp-device-toggle button { color: var(--gray-3); }
.cp-device-toggle button.is-active {
  background: var(--white) !important;
  color: var(--black) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.14);
}
.cp-device-toggle button:disabled,
.cp-device-toggle button.is-disabled {
  opacity: 0.3; cursor: not-allowed;
}

/* ── Device frame — base ── */
.cp-device {
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s var(--ease);
  position: relative;
}

/* Browser frame */
.cp-device--browser {
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 32px 80px rgba(0,0,0,0.45);
}
.cp-block--after .cp-device--browser {
  border-color: var(--gray-6);
  box-shadow: 0 24px 64px rgba(0,0,0,0.09);
}
.cp-device__chrome {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: #2A2A2C;
}
.cp-block--after .cp-device__chrome { background: #EBEBED; }
.cp-device__dots { display: flex; gap: 6px; flex-shrink: 0; }
.cp-device__dot  { width: 11px; height: 11px; border-radius: 50%; }
.cp-device__dot:nth-child(1) { background: #FF5F57; }
.cp-device__dot:nth-child(2) { background: #FEBC2E; }
.cp-device__dot:nth-child(3) { background: #28C840; }
.cp-device__url {
  flex: 1; max-width: 280px; margin: 0 auto;
  background: rgba(255,255,255,0.07);
  border-radius: 6px; padding: 4px 10px;
  font-size: 12px; color: rgba(255,255,255,0.38);
  text-align: center; letter-spacing: 0;
}
.cp-block--after .cp-device__url {
  background: rgba(255,255,255,0.9);
  color: var(--gray-3);
}
.cp-device__screen {
  height: 580px;
  background: #FAFAFA;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(120,120,128,0.35) transparent;
}
.cp-device__screen::-webkit-scrollbar { width: 5px; }
.cp-device__screen::-webkit-scrollbar-track { background: transparent; }
.cp-device__screen::-webkit-scrollbar-thumb {
  background: rgba(120,120,128,0.3);
  border-radius: 999px;
}
.cp-device__screen::-webkit-scrollbar-thumb:hover {
  background: rgba(120,120,128,0.55);
}
/* Page image fills width, natural height → scrollable */
.cp-page-img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

/* Phone frame */
.cp-device--phone {
  max-width: 340px; margin: 0 auto;
  border-radius: 50px;
  border: none !important;
  box-shadow: 0 40px 100px rgba(0,0,0,0.55), inset 0 0 0 2px #3A3A3A;
  background: #1A1A1A;
  padding: 14px 10px;
}
.cp-block--after .cp-device--phone {
  box-shadow: 0 32px 80px rgba(0,0,0,0.2), inset 0 0 0 2px #C8C8CC;
  background: #E0E0E0;
}
.cp-device--phone::before {
  content: '';
  display: block;
  width: 76px; height: 22px;
  background: #1A1A1A;
  border-radius: 0 0 14px 14px;
  margin: 0 auto 8px;
}
.cp-block--after .cp-device--phone::before { background: #E0E0E0; }
.cp-device--phone .cp-device__chrome { display: none; }
.cp-device--phone .cp-device__screen {
  border-radius: 40px;
  height: 650px;
}

/* Empty state inside device */
.cp-device__empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; gap: 14px;
  text-align: center; padding: 40px;
}
.cp-device__empty-icon { font-size: 36px; line-height: 1; }
.cp-device__empty-title {
  font-size: 15px; font-weight: var(--fw-semi);
  color: rgba(255,255,255,0.6);
  letter-spacing: -0.01em;
}
.cp-device__empty-sub {
  font-size: 12px; color: rgba(255,255,255,0.28); line-height: 1.5;
}
.cp-block--after .cp-device__empty-title { color: var(--gray-3); }
.cp-block--after .cp-device__empty-sub   { color: var(--gray-5); }

/* ── Callouts grid ── */
.cp-callouts {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(252px, 1fr));
  gap: 10px;
}
.cp-callout {
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease),
              box-shadow var(--t-fast);
}
.cp-callout.is-visible { opacity: 1; transform: none; }
.cp-callout:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.cp-block--after .cp-callout {
  border-color: var(--gray-6);
  background: var(--smoke);
  box-shadow: none;
}
.cp-block--after .cp-callout:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.07); }
.cp-callout__num {
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.28); margin-bottom: 7px;
}
.cp-block--after .cp-callout__num { color: var(--gray-5); }
.cp-callout__title {
  font-size: 14px; font-weight: var(--fw-semi);
  letter-spacing: -0.01em; color: var(--white);
  margin-bottom: 5px;
}
.cp-block--after .cp-callout__title { color: var(--black); }
.cp-callout__body {
  font-size: 12.5px; color: rgba(255,255,255,0.45); line-height: 1.55;
}
.cp-block--after .cp-callout__body { color: var(--gray-3); }
.cp-callout__tag {
  display: inline-block; margin-top: 9px;
  font-size: 9px; font-weight: var(--fw-semi);
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-pill);
}
.cp-callout__tag--problem     { background: rgba(255,59,48,0.14);  color: #FF6B6B; }
.cp-callout__tag--improvement { background: rgba(48,209,88,0.14);  color: #30D158; }
.cp-callout__tag--new         { background: rgba(100,210,255,0.14);color: #64D2FF; }
.cp-callout__tag--old         { background: rgba(255,214,10,0.1);  color: #FFD60A; }

/* ── Transition between antes/después ── */
.cp-transition {
  padding: 0;
  background: linear-gradient(180deg, #1C1C1E 50%, var(--white) 50%);
  display: flex; align-items: center; justify-content: center;
}
.cp-transition__pill {
  background: var(--accent);
  color: var(--white);
  font-size: 11px; font-weight: var(--fw-semi);
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 10px 24px; border-radius: var(--r-pill);
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 20px rgba(0,113,227,0.4);
  margin: 0;
  position: relative; z-index: 1;
}

/* ── Stack / process (dark) ── */
.cp-stack {
  padding: 96px var(--section-h);
  background: #161618;
  color: var(--white);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.cp-stack__inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 2fr; gap: 80px; align-items: start;
}
.cp-stack__meta-label {
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.cp-stack__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-stack__pill {
  font-size: 13px; font-weight: var(--fw-mid);
  padding: 7px 16px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
}
.cp-stack__process-label {
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.cp-stack__process-text {
  font-size: 17px; color: rgba(255,255,255,0.58); line-height: 1.75;
}

/* ── CTA ── */
.cp-cta {
  padding: 120px var(--section-h);
  background: var(--black);
  border-top: 1px solid rgba(255,255,255,0.07);
  text-align: center;
}
.cp-cta__title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em; color: var(--white);
  margin-bottom: 36px; line-height: 1;
}
.cp-cta__thin { font-weight: var(--fw-thin); opacity: 0.32; }
.cp-cta__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 17px 40px; background: var(--accent);
  color: var(--white); border-radius: var(--r-pill);
  font-size: 16px; font-weight: var(--fw-semi);
  letter-spacing: -0.01em;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.cp-cta__btn:hover {
  background: var(--accent-deep);
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(0,113,227,0.35);
}

/* ── Case navigation ── */
.cp-nav {
  display: flex; align-items: stretch;
  background: var(--black);
  border-top: 1px solid rgba(255,255,255,0.07);
}
.cp-nav__side {
  flex: 1; padding: 40px var(--section-h);
  display: flex; flex-direction: column; gap: 8px;
  transition: background var(--t-fast);
}
.cp-nav__side:hover { background: rgba(255,255,255,0.03); }
.cp-nav__side--next {
  text-align: right;
  border-left: 1px solid rgba(255,255,255,0.07);
}
.cp-nav__dir {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}
.cp-nav__label {
  font-size: 19px; font-weight: var(--fw-semi);
  letter-spacing: -0.02em; color: var(--white);
  transition: color var(--t-fast);
}
.cp-nav__side:hover .cp-nav__label { color: var(--accent); }
.cp-nav__empty { flex: 1; }

/* ── Responsive overrides ── */
@media (max-width: 1024px) {
  .cp-overview__inner { grid-template-columns: 1fr; gap: 48px; }
  .cp-stack__inner { grid-template-columns: 1fr; gap: 48px; }
  .cp-device__screen { height: 460px; }
  .cp-device--phone .cp-device__screen { height: 560px; }
  .cp-device--phone { max-width: 300px; }
}
@media (max-width: 768px) {
  .cp-hero, .cp-overview, .cp-block, .cp-stack, .cp-cta { padding-left: 20px; padding-right: 20px; }
  .cp-section-head, .cp-toc__inner { padding-left: 20px; padding-right: 20px; }
  .cp-hero__back { left: 20px; }
  .cp-device__screen { height: 340px; }
  .cp-device--phone { max-width: 260px; }
  .cp-device--phone .cp-device__screen { height: 440px; }
  .cp-callouts { grid-template-columns: 1fr; }
  .cp-nav { flex-direction: column; }
  .cp-nav__side--next { border-left: none; border-top: 1px solid rgba(255,255,255,0.07); text-align: left; }
  .cp-block__header { flex-wrap: wrap; }
  .cp-device-toggle { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cp-callout, .cp-hero__scroll-hint { animation: none !important; transition: none !important; }
  .cp-callout { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   31. CASE PAGE v3 — EDITORIAL (cpe-*)
   Solo diseño nuevo, layouts variados, auto-scroll
   ============================================================ */

/* ── Hero editorial ── */
.cpe-hero {
  background: var(--white);
  padding: calc(var(--nav-h) + 96px) var(--section-h) 0;
  position: relative;
}
.cpe-hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.cpe-hero__breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--gray-5);
  margin-bottom: 52px;
}
.cpe-hero__breadcrumb a { color: var(--gray-4); text-decoration: none; }
.cpe-hero__breadcrumb a:hover { color: var(--black); }
.cpe-hero__breadcrumb span { color: var(--gray-6); font-size: 10px; }
.cpe-hero__label {
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
  display: block;
}
/* Título grande con dualidad bold / thin (estilo Apple) */
.cpe-hero__title {
  font-size: clamp(68px, 9.5vw, 128px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.05em;
  line-height: 0.88;
  color: var(--black);
  margin-bottom: 36px;
}
.cpe-hero__title-thin {
  font-weight: 200;
  color: var(--black);
  opacity: 0.28;
}
/* Subtítulo: una sola línea, muy discreta */
.cpe-hero__sub {
  font-size: clamp(14px, 1.5vw, 17px);
  font-weight: 300;
  color: var(--gray-4);
  max-width: 440px;
  line-height: 1.6;
  margin-bottom: 72px;
  letter-spacing: 0.005em;
}
/* Strip de métricas — más espacio, solo número + label */
.cpe-hero__metrics {
  display: flex;
  border-top: 1px solid var(--gray-6);
  margin-bottom: 80px;
  max-width: 560px;
}
.cpe-hero__metric {
  flex: 1;
  padding: 28px 0;
  padding-right: 28px;
}
.cpe-hero__metric + .cpe-hero__metric {
  padding-right: 28px;
  padding-left: 28px;
  border-left: 1px solid var(--gray-6);
}
.cpe-hero__metric:last-child { padding-right: 0; }
.cpe-hero__metric-val {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: var(--fw-semi);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: block;
  color: var(--black);
}
/* Versión con color — discreta, solo un tinte */
.cpe-hero__metric-val--green { color: #2D6A4A; }
.cpe-hero__metric-val--blue  { color: #2B5BA8; }
.cpe-hero__metric-val--amber { color: #8A6020; }
/* detail eliminado del hero — queda en la sección de resultados */
.cpe-hero__metric-detail { display: none; }
.cpe-hero__metric-label {
  font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--gray-4); margin-top: 8px; display: block;
  font-weight: 400;
}
/* Hero device preview — más ancho, pantalla más alta, fade inferior */
.cpe-hero__preview-wrap {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
}
.cpe-hero__preview {
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.07);
  border-bottom: none;
  box-shadow: 0 -4px 0 var(--gray-6),
              0 -24px 80px rgba(0,0,0,0.05);
}
/* Gradient fade — el diseño se "derrama" hacia abajo */
.cpe-hero__preview-fade {
  height: 160px;
  background: linear-gradient(to bottom, transparent 0%, var(--white) 100%);
  margin-top: -160px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.cpe-hero__chrome {
  background: #F0F0F0;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.cpe-hero__dots { display: flex; gap: 6px; }
.cpe-hero__dot  { width: 11px; height: 11px; border-radius: 50%; }
.cpe-hero__dot:nth-child(1) { background: #FF5F57; }
.cpe-hero__dot:nth-child(2) { background: #FEBC2E; }
.cpe-hero__dot:nth-child(3) { background: #28C840; }
.cpe-hero__url {
  flex: 1; max-width: 280px; margin: 0 auto;
  background: var(--white);
  border-radius: 6px; padding: 5px 12px;
  font-size: 11px; color: var(--gray-4); text-align: center;
  border: 1px solid var(--gray-6);
}
.cpe-hero__screen {
  height: 620px;
  overflow: hidden;
  position: relative;
  background: #FAFAFA;
}
.cpe-hero__screen img {
  width: 100%; height: auto;
  display: block;
}

/* ── Metrics full section ── */
.cpe-results {
  padding: 80px var(--section-h);
  background: var(--smoke);
  border-bottom: 1px solid var(--gray-6);
}
.cpe-results__inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px;
  background: var(--gray-6);
  border: 1px solid var(--gray-6);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.cpe-result {
  background: var(--white);
  padding: 48px 40px;
}
.cpe-result__val {
  font-size: clamp(44px, 6vw, 72px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cpe-result__val--green { color: #1D7944; }
.cpe-result__val--blue  { color: var(--accent); }
.cpe-result__val--amber { color: #9A6E1A; }
.cpe-result__name {
  font-size: 15px; font-weight: var(--fw-semi);
  color: var(--black); margin-top: 14px;
  letter-spacing: -0.01em;
}
.cpe-result__detail {
  font-size: 13px; color: var(--gray-3);
  margin-top: 6px; line-height: 1.5;
}
.cpe-result__prob {
  display: inline-block; margin-top: 12px;
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--green-soft); color: var(--green-ink);
}
.cpe-result__prob--amber { background: var(--amber-soft); color: var(--amber-ink); }

/* ── Sticky text + scroll image layout ── */
.cpe-section {
  padding: 112px var(--section-h);
  position: relative;
}
.cpe-section--smoke { background: var(--smoke); }
.cpe-section--white { background: var(--white); }
.cpe-section--warm  { background: #FAF9F7; }

.cpe-section__bg-num {
  position: absolute;
  top: 48px; right: var(--section-h);
  font-size: clamp(80px, 12vw, 180px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.06em;
  color: var(--black); opacity: 0.025;
  line-height: 1; pointer-events: none;
  user-select: none;
}

.cpe-section__label {
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px; display: block;
}
.cpe-section__heading {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em; line-height: 1.0;
  color: var(--black); margin-bottom: 64px;
}
.cpe-section__heading em {
  font-style: normal; font-weight: 200; opacity: 0.35;
}

/* Sticky two-col */
.cpe-two-col {
  max-width: var(--max-w); margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 72px;
  align-items: start;
}
.cpe-two-col--reversed {
  grid-template-columns: 1fr 300px;
}
.cpe-two-col__notes {
  position: sticky;
  top: calc(var(--nav-h) + 100px);
  display: flex; flex-direction: column; gap: 36px;
}
.cpe-two-col--reversed .cpe-two-col__notes { order: 2; }
.cpe-two-col--reversed .cpe-two-col__device { order: 1; }

/* Editorial note */
.cpe-note {
  padding-left: 18px;
  border-left: 2px solid var(--gray-6);
  transition: border-color 0.3s;
}
.cpe-note.is-highlighted { border-left-color: var(--accent); }
.cpe-note__num {
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gray-5); margin-bottom: 6px;
}
.cpe-note__title {
  font-size: 15px; font-weight: var(--fw-semi);
  letter-spacing: -0.01em; color: var(--black); margin-bottom: 6px;
}
.cpe-note__body {
  font-size: 13px; color: var(--gray-3); line-height: 1.6;
}

/* ── Device frame (editorial, light) ── */
.cpe-device {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.07);
  box-shadow: 0 32px 80px rgba(0,0,0,0.10), 0 8px 24px rgba(0,0,0,0.05);
}
.cpe-device--phone {
  position: relative;
  max-width: 300px; margin: 0 auto;
  border-radius: 32px;
  background: transparent;
  padding: 0;
  border: 1.5px solid rgba(0,0,0,0.10);
  box-shadow: 0 24px 60px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.06);
}
.cpe-device--phone::before { display: none; }
.cpe-device--phone::after  { display: none; }
.cpe-device--phone .cpe-device__chrome { display: none; }
.cpe-device--phone .cpe-device__screen {
  border-radius: 30px;
  position: relative; z-index: 1;
}
.cpe-device__chrome {
  background: #EBEBED;
  padding: 9px 14px;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.cpe-device__dots { display: flex; gap: 5px; }
.cpe-device__dot  { width: 10px; height: 10px; border-radius: 50%; }
.cpe-device__dot:nth-child(1) { background: #FF5F57; }
.cpe-device__dot:nth-child(2) { background: #FEBC2E; }
.cpe-device__dot:nth-child(3) { background: #28C840; }
.cpe-device__url {
  flex: 1; max-width: 260px; margin: 0 auto;
  background: rgba(255,255,255,0.85);
  border-radius: 5px; padding: 4px 10px;
  font-size: 11px; color: var(--gray-4); text-align: center;
}
.cpe-device__screen {
  height: 700px;
  overflow-y: auto; overflow-x: hidden;
  background: #FAFAFA;
  scroll-behavior: auto;
  scrollbar-width: none;
}
.cpe-device__screen::-webkit-scrollbar { display: none; }
.cpe-device__screen img {
  width: 100%; height: auto; display: block;
  user-select: none; pointer-events: none;
}
/* Hover hint */
.cpe-device-wrap {
  position: relative;
  cursor: pointer;
}
.cpe-device-hint {
  position: absolute; bottom: 16px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px; font-weight: var(--fw-mid);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--white);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  padding: 6px 16px; border-radius: var(--r-pill);
  pointer-events: none;
  /* Empieza oculto — JS lo muestra brevemente al entrar al viewport */
  opacity: 0; transition: opacity 0.4s;
}
.cpe-device-wrap.hint-visible .cpe-device-hint { opacity: 1; }
.cpe-device-wrap.is-scrolling .cpe-device-hint,
.cpe-device-wrap:hover .cpe-device-hint { opacity: 0 !important; }

/* ── Full-width image section ── */
.cpe-fullwidth {
  padding: 112px var(--section-h);
}
.cpe-fullwidth__inner { max-width: var(--max-w); margin: 0 auto; }
.cpe-fullwidth__header {
  display: flex; align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap; gap: 16px;
}
.cpe-fullwidth__device {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--gray-6);
  box-shadow: 0 24px 64px rgba(0,0,0,0.07);
}
.cpe-fullwidth__screen {
  height: 860px;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.cpe-fullwidth__screen::-webkit-scrollbar { display: none; }
.cpe-fullwidth__screen img { width: 100%; height: auto; display: block; pointer-events: none; }
/* Notes row below */
.cpe-notes-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--gray-6);
}
.cpe-notes-row .cpe-note { padding-left: 0; border-left: none; padding-top: 16px; border-top: 2px solid var(--gray-6); }
.cpe-notes-row .cpe-note.is-highlighted { border-top-color: var(--accent); }

/* ── Duo layout (2 devices side by side) ── */
.cpe-duo {
  padding: 96px var(--section-h);
}
.cpe-duo__inner { max-width: var(--max-w); margin: 0 auto; }
.cpe-duo__header { margin-bottom: 48px; }
.cpe-duo__grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}
/* Dos teléfonos centrados (mobile showcase) */
.cpe-duo__phones {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  align-items: start;
}
.cpe-duo__phone-col {
  width: 300px;
  flex-shrink: 0;
}
.cpe-duo__caption {
  font-size: 12px; color: var(--gray-4);
  margin-top: 14px; letter-spacing: 0.02em;
  text-align: center;
}
/* Text side in duo */
.cpe-duo__notes {
  display: flex; flex-direction: column; gap: 32px;
  padding-top: 8px;
}

/* ── 4-phone strip para vista móvil completa ── */
.cpe-phones-strip {
  display: flex;
  justify-content: center;
  gap: 28px;
  align-items: start;
  overflow-x: auto;                /* scroll horizontal en pantallas chicas */
  padding-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cpe-phones-strip::-webkit-scrollbar { display: none; }
.cpe-phones-strip__col {
  flex: 0 0 248px;                 /* ancho fijo para que quepan 4 */
}
/* En el phone frame dentro del strip, altura moderada */
.cpe-phones-strip__col .cpe-device__screen {
  height: 460px;
}

/* ── Stack / context (bottom) ── */
.cpe-context {
  padding: 80px var(--section-h);
  background: var(--smoke);
  border-top: 1px solid var(--gray-6);
}
.cpe-context__inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 2fr; gap: 80px;
}
.cpe-context__meta-label {
  font-size: 10px; font-weight: var(--fw-semi);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.cpe-context__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cpe-context__pill {
  font-size: 13px; padding: 6px 14px;
  background: var(--white); border: 1px solid var(--gray-6);
  border-radius: var(--r-pill); color: var(--black);
  font-weight: var(--fw-mid);
}
.cpe-context__text {
  font-size: 17px; color: var(--gray-2); line-height: 1.75;
}

/* ── CTA ── */
.cpe-cta {
  padding: 120px var(--section-h);
  background: var(--black);
  text-align: center;
}
.cpe-cta__title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em; color: var(--white);
  margin-bottom: 36px; line-height: 1;
}
.cpe-cta__thin { font-weight: var(--fw-thin); opacity: 0.3; }
.cpe-cta__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 17px 40px; background: var(--accent);
  color: var(--white); border-radius: var(--r-pill);
  font-size: 16px; font-weight: var(--fw-semi);
  transition: background var(--t-fast), transform var(--t-fast);
}
.cpe-cta__btn:hover { background: var(--accent-deep); transform: scale(1.02); }

/* ── Case nav ── */
.cpe-nav {
  display: flex; background: var(--black);
  border-top: 1px solid rgba(255,255,255,0.07);
}
.cpe-nav__side {
  flex: 1; padding: 40px var(--section-h);
  display: flex; flex-direction: column; gap: 8px;
  transition: background var(--t-fast); color: inherit;
}
.cpe-nav__side:hover { background: rgba(255,255,255,0.03); }
.cpe-nav__side--next { text-align: right; border-left: 1px solid rgba(255,255,255,0.07); }
.cpe-nav__dir  { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.3); }
.cpe-nav__name { font-size: 19px; font-weight: var(--fw-semi); letter-spacing: -0.02em; color: var(--white); transition: color var(--t-fast); }
.cpe-nav__side:hover .cpe-nav__name { color: var(--accent); }
.cpe-nav__empty { flex: 1; background: var(--black); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .cpe-two-col, .cpe-two-col--reversed { grid-template-columns: 1fr; }
  .cpe-two-col__notes, .cpe-two-col--reversed .cpe-two-col__notes { position: static; order: 2; }
  .cpe-two-col--reversed .cpe-two-col__device { order: 1; }
  .cpe-notes-row { grid-template-columns: repeat(2, 1fr); }
  .cpe-duo__grid { grid-template-columns: 1fr; }
  .cpe-duo__grid .cpe-device--phone { max-width: 280px; }
  .cpe-results__inner { grid-template-columns: 1fr; }
  .cpe-context__inner { grid-template-columns: 1fr; gap: 48px; }
  .cpe-device__screen { height: 520px; }
  .cpe-fullwidth__screen { height: 680px; }
  .cpe-hero__screen { height: 440px; }
  .cpe-duo__phone-col { width: 260px; }
}
@media (max-width: 768px) {
  .cpe-hero, .cpe-section, .cpe-fullwidth, .cpe-duo, .cpe-context, .cpe-cta { padding-left: 20px; padding-right: 20px; }
  .cpe-section, .cpe-fullwidth, .cpe-duo { padding-top: 80px; padding-bottom: 80px; }
  .cpe-notes-row { grid-template-columns: 1fr; gap: 24px; }
  .cpe-hero__preview { border-radius: 10px 10px 0 0; }
  .cpe-hero__screen { height: 300px; }
  .cpe-hero__preview-fade { height: 80px; margin-top: -80px; }
  .cpe-device__screen { height: 500px; }
  .cpe-fullwidth__screen { height: 480px; }
  .cpe-hero__title { font-size: clamp(52px, 14vw, 88px); }
  .cpe-hero__metrics { max-width: 100%; }
  .cpe-nav { flex-direction: column; }
  .cpe-nav__side--next { border-left: none; border-top: 1px solid rgba(255,255,255,0.07); text-align: left; }
  .cpe-results__inner { grid-template-columns: 1fr; }
  .cpe-duo__phones { gap: 24px; }
  .cpe-duo__phone-col { width: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .cpe-device__screen { scroll-behavior: auto; }
}

/* ══════════════════════════════════════════════════════════
   32 — HERO COLLAB BADGE
   Wordmark del cliente × Codefy (tipográfico, sin imagen)
   ══════════════════════════════════════════════════════════ */
.cpe-hero__collab {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}
/* Logo imagen del cliente (PNG real) */
.cpe-hero__client-logo {
  height: clamp(28px, 3.2vw, 44px);
  width: auto;
  display: block;
  object-fit: contain;
}
/* Logo de Codefy (SVG negro) — un poco más pequeño, más discreto */
.cpe-hero__agency-logo {
  height: clamp(48px, 6vw, 80px);
  width: auto;
  display: block;
  object-fit: contain;
  opacity: 1;
}
.cpe-hero__wordmark {
  font-size: clamp(40px, 5vw, 68px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.045em;
  line-height: 1;
}
.cpe-hero__wordmark--client {
  color: #D4156B;
}
.cpe-hero__wordmark--agency {
  color: var(--gray-3);
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 300;
  letter-spacing: -0.01em;
}
.cpe-hero__collab-x {
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 200;
  color: var(--gray-4);
  line-height: 1;
  opacity: 0.6;
}
/* Subtítulo del caso (debajo del collab badge) */
.cpe-hero__case-sub {
  font-size: clamp(13px, 1.3vw, 15px);
  font-weight: 300;
  color: var(--gray-4);
  letter-spacing: 0.005em;
  margin-bottom: 72px;
  max-width: 520px;
  line-height: 1.65;
}
@media (max-width: 768px) {
  .cpe-hero__collab { gap: 14px; margin-bottom: 28px; }
  .cpe-hero__client-logo { height: clamp(28px, 8vw, 44px); }
  .cpe-hero__wordmark--agency { font-size: clamp(22px, 6vw, 36px); }
  .cpe-hero__collab-x { font-size: clamp(16px, 4vw, 24px); }
}

/* ══════════════════════════════════════════════════════════
   33 — CASE DOCK (navegación flotante entre casos)
   Píldora fija abajo — aparece solo en páginas de caso
   ══════════════════════════════════════════════════════════ */
.case-dock {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 999px;
  padding: 6px 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.30), 0 2px 8px rgba(0,0,0,0.20);
  border: 1px solid rgba(255,255,255,0.08);
  transition: opacity 0.3s, transform 0.3s;
}
/* Se oculta al hacer scroll down (igual que el nav) */
.case-dock--hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  pointer-events: none;
}
.case-dock__item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.50);
  transition: background 0.18s, color 0.18s;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.case-dock__item:hover {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.90);
}
.case-dock__item.is-active {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.case-dock__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
}
.case-dock__item.is-active .case-dock__dot {
  opacity: 1;
}
@media (max-width: 768px) {
  .case-dock { bottom: 16px; padding: 5px 6px; gap: 1px; }
  .case-dock__item { padding: 8px 10px; }
  .case-dock__name { display: none; }
  .case-dock__dot { width: 8px; height: 8px; }
  .case-dock__item.is-active .case-dock__name { display: inline; font-size: 11px; }
}
