/* =========================================================
   Vinicio Chinchilla — sistema visual (estilo subscrr.app)
   Crema cálido · tinta cálida · acento #FF2500 · grano
   Inter · Inter Tight · Bebas Neue
   ========================================================= */

:root {
  --orange: #ff2500;
  --orange-rgb: 255, 37, 0;
  --peach-soft: #fbe6d3;
  --sec-blue: #e6ecfb;
  --sec-sand: #eae6dc;
  --peri: #aec4f7;
  --peri-ink: #4c63c7;
  --ink: #1a1712;
  --muted: #7c766c;
  --bg: #f4f2ec;
  --bg-2: #eae6dc;
  --card: #ffffff;
  --line: rgba(26, 23, 18, 0.1);
  --prose: rgba(26, 23, 18, 0.82);
  --demo-ok: #e6ecfb;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Inter Tight", var(--font);
  --nk-font: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --mono: var(--font);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --pad: clamp(20px, 5vw, 84px);
  --wrap: 1320px;
  --r-lg: 40px;

  /* alto del header: lo actualiza el JS */
  --nav-offset: 78px;

  /* espaciado unificado de secciones */
  --section-y: clamp(80px, 12vh, 150px);
  --block-gap: clamp(30px, 5vh, 48px);
  --item-gap: 22px;
  --pin-y: clamp(18px, 3vh, 36px);

  --shadow-sm: 0 4px 16px -6px rgba(30, 28, 24, 0.16);
  --shadow: 0 26px 60px -28px rgba(38, 34, 28, 0.34);
  --shadow-lg: 0 50px 110px -40px rgba(38, 34, 28, 0.42);

  --grain-blend: multiply;
  --grain-op: 0.35;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.7);

  --nav-tint: rgba(255, 255, 255, 0.22);
  --nav-tint-scrolled: rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] {
  --peach-soft: #2a160b;
  --sec-blue: #10203a;
  --sec-sand: #1c1913;
  --peri: rgba(255, 255, 255, 0.4);
  --peri-ink: rgba(255, 255, 255, 0.5);
  --ink: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.5);
  --bg: #0a0a0a;
  --bg-2: #161616;
  --card: #141414;
  --line: rgba(255, 255, 255, 0.08);
  --prose: rgba(255, 255, 255, 0.72);
  --demo-ok: #141414;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 60px -24px rgba(0, 0, 0, 0.6);
  --grain-blend: overlay;
  --grain-op: 0.22;
  --glass-bg: rgba(18, 18, 18, 0.6);
  --glass-line: rgba(255, 255, 255, 0.1);
  --nav-tint: rgba(16, 16, 16, 0.45);
  --nav-tint-scrolled: rgba(14, 14, 14, 0.75);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  height: auto;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background 0.4s ease, color 0.4s ease;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

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

ul, ol {
  list-style: none;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.04;
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}

section[id], #top, #form {
  scroll-margin-top: 96px;
}

/* ---------- Secciones: alto según contenido ---------- */
main > section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---------- Temas fijos por sección (alterno claro/oscuro) ---------- */
.sec-light {
  --ink: #1a1712;
  --muted: #7c766c;
  --prose: rgba(26, 23, 18, 0.82);
  --line: rgba(26, 23, 18, 0.12);
  --card: #ffffff;
  --bg-2: #eae6dc;
  --peri-ink: #4c63c7;
  color: var(--ink);
}

.sec-dark {
  --ink: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.55);
  --prose: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.14);
  --card: #17171c;
  --bg-2: #101014;
  --peri-ink: rgba(255, 255, 255, 0.5);
  color: var(--ink);
}

#problemas {
  background: #f4f2ec;
}

#servicios {
  background: #0a0a0a;
}

#ejemplos {
  background: #ffffff;
}

#como-trabajo {
  background: #0a0a0a;
}

#faq {
  background: #f4f2ec;
}

#contacto {
  background: #0a0a0a;
}

/* ajustes de componentes sobre fondo oscuro fijo */
.sec-dark .field__input {
  background: #1c1c22;
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--ink);
}

.sec-dark .field__input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(var(--orange-rgb), 0.25);
}

.sec-dark .slide__visual--a { background: linear-gradient(160deg, #2a160b, var(--bg-2)); }
.sec-dark .slide__visual--b { background: linear-gradient(160deg, #17203a, var(--bg-2)); }
.sec-dark .slide__visual--c { background: linear-gradient(160deg, #2a160b, var(--bg-2)); }
.sec-dark .slide__visual--d { background: linear-gradient(160deg, #14202e, var(--bg-2)); }

.sec-dark .jrn__media {
  background: var(--bg-2);
}

/* barras y detalles de los visuales: visibles sobre fondo oscuro */
.sec-dark .viz-order__chip b,
.sec-dark .viz-order__row b,
.sec-dark .viz-track__task b {
  background: rgba(255, 255, 255, 0.22);
}

.sec-dark .viz-order__chip,
.sec-dark .viz-order__row,
.sec-dark .viz-track__task,
.sec-dark .viz-link__node {
  background: #141418;
  border-color: rgba(255, 255, 255, 0.14);
}

.sec-dark .viz-flow__line {
  background: #141418;
  border-color: rgba(255, 255, 255, 0.14);
}

.sec-dark .viz-flow__tag {
  background: #141418;
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.6);
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 2000;
  padding: 12px 18px;
  background: var(--orange);
  color: #fff;
  border-radius: 100px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Grano ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: var(--grain-op);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* ---------- Cursor personalizado ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition:
    width 0.35s var(--ease),
    height 0.35s var(--ease),
    background 0.25s ease,
    border-color 0.25s ease,
    opacity 0.2s ease;
  will-change: transform;
}

.cursor.is-on {
  opacity: 0.9;
}

.cursor.is-hover {
  width: 46px;
  height: 46px;
  background: rgba(var(--orange-rgb), 0.18);
  border-color: var(--orange);
}

body.has-cursor,
body.has-cursor * {
  cursor: none !important;
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--peri-ink);
  margin-bottom: 20px;
}

/* ---------- Botones ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  padding: 15px 26px;
  border-radius: 100px;
  border: 1.5px solid transparent;
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--spring),
    box-shadow 0.3s var(--ease),
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    color 0.3s var(--ease);
  min-height: 52px;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn:active {
  transform: scale(0.98);
}

.btn--solid {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 18px 40px -18px rgba(var(--orange-rgb), 0.55);
}

.btn--solid:hover {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 28px 60px -20px rgba(var(--orange-rgb), 0.7);
}

.btn--ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--ink);
}

.btn--on-dark {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.btn--on-dark:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn--sm {
  padding: 11px 20px;
  font-size: 14px;
  min-height: 44px;
}

.btn--lg {
  padding: 18px 34px;
  font-size: 16px;
  min-height: 58px;
}

.btn--full {
  width: 100%;
}

/* Link "Learn more" */
.sect__more,
.dev__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--orange);
  font-size: clamp(16px, 1.3vw, 20px);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: opacity 0.3s var(--ease), gap 0.3s var(--ease);
}

.sect__more:hover,
.dev__link:hover {
  opacity: 0.75;
  gap: 12px;
}

.sect__more svg,
.dev__link svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

/* Ticks */
.ticks {
  display: grid;
  gap: 14px;
}

.ticks li {
  position: relative;
  padding-left: 30px;
  color: var(--prose);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--orange)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4 10-11'/%3E%3C/svg%3E")
    center / 10px no-repeat;
}

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px var(--pad);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    transform 0.5s var(--ease),
    background 0.3s var(--ease),
    border-color 0.3s var(--ease),
    padding 0.3s var(--ease);
}

.nav.is-solid {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--glass-line);
}

.nav.is-hidden {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  margin-right: auto;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--orange);
  color: #fff;
  font-family: var(--nk-font);
  font-size: 19px;
  line-height: 1;
  padding-top: 2px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.nav__links > a,
.nav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.25s var(--ease);
}

.nav__links > a:hover,
.nav__trigger:hover {
  color: var(--ink);
}

.nav__chev {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  transition: transform 0.25s var(--ease);
}

.nav__item {
  position: relative;
}

.nav__item.is-open .nav__chev {
  transform: rotate(180deg);
}

/* Mega menu */
.mega {
  position: absolute;
  top: 100%;
  left: -16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  padding-top: 10px;
}

.nav__item.is-open .mega,
.nav__item:hover .mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega__panel {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.mega__link {
  padding: 7px 16px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.mega__link:hover {
  color: var(--orange);
}

/* Burger */
.nav__burger {
  display: none;
  width: 40px;
  height: 40px;
  position: relative;
}

.nav__burger i {
  position: absolute;
  left: 9px;
  right: 9px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}

.nav__burger i:nth-child(1) {
  top: 15px;
}

.nav__burger i:nth-child(2) {
  top: 23px;
}

.nav__burger[aria-expanded="true"] i:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.nav__burger[aria-expanded="true"] i:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}

/* ---------- HERO FILM ---------- */
.film {
  position: relative;
  min-height: 100vh;
  min-height: 100lvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  overflow: clip;
}

.film__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.film__canvas {
  width: 100%;
  height: 100%;
  display: block;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(var(--orange-rgb), 0.12), transparent 60%),
    linear-gradient(180deg, #0b0908 0%, #0a0a0a 55%, #120c08 100%);
}

.film__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 10, 10, 0.5) 0%, rgba(10, 10, 10, 0.12) 35%, rgba(10, 10, 10, 0.82) 100%);
}

.film__copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.film__first {
  min-height: 100vh;
  min-height: 100lvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--nav-offset) + 18px);
}

.film__label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: clamp(18px, 3vh, 30px);
}

.film__title {
  font-family: var(--nk-font);
  font-weight: 400;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 0.92;
  font-size: clamp(52px, 9.5vw, 150px);
  max-width: 1100px;
}

.film__ln {
  display: block;
}

.film__w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.film__w.is-on {
  opacity: 1;
  transform: none;
}

.film__sub {
  margin: clamp(18px, 3vh, 32px) 0 clamp(24px, 4vh, 40px);
  font-family: var(--display);
  font-size: clamp(18px, 1.9vw, 30px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: #fff;
}

.film__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(28px, 4.5vh, 48px);
}

.film__manifesto {
  padding: clamp(8vh, 12vh, 16vh) 0 clamp(12vh, 18vh, 24vh);
  max-width: 1120px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(24px, 3.6vw, 52px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: #fff;
}

.reveal-words .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.reveal-words .word > span {
  display: inline-block;
  opacity: 0.22;
  transform: translateY(0.25em);
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
}

.reveal-words .word.is-on > span {
  opacity: 1;
  transform: none;
}

/* ---------- Escenas 3D de los escenarios ---------- */
.viz3d {
  width: 100%;
  min-height: 280px;
}

.viz3d__scene {
  position: relative;
  width: 100%;
  height: 300px;
  perspective: 950px;
  transform-style: preserve-3d;
  transition: transform 0.7s var(--ease);
}

.viz3d:hover .viz3d__scene,
.viz3d.is-active .viz3d__scene {
  transform: rotateY(-8deg) rotateX(5deg) scale(1.04);
}

/* panel de pedidos 3D */
.viz3d__device {
  position: absolute;
  right: 5%;
  top: 50%;
  width: 168px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  display: grid;
  gap: 9px;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transform: translateY(-50%) rotateX(12deg) rotateY(-20deg) translateZ(40px);
  animation: viz3dFloat 6s var(--ease) infinite;
}

.viz3d__device-head {
  height: 9px;
  width: 55%;
  border-radius: 5px;
  background: var(--orange);
  opacity: 0.9;
}

.viz3d__device-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.viz3d__device-row i {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--orange);
  animation: viz3dRow 3.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.55s);
}

.viz3d__device-row b {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-2);
}

@keyframes viz3dRow {
  0%, 100% { opacity: 0.25; }
  30%, 80% { opacity: 1; }
}

@keyframes viz3dFloat {
  0%, 100% { transform: translateY(-50%) rotateX(12deg) rotateY(-20deg) translateZ(40px); }
  50% { transform: translateY(calc(-50% - 9px)) rotateX(9deg) rotateY(-15deg) translateZ(54px); }
}

/* burbujas de chat (Instagram / WhatsApp) */
.viz3d__bubble {
  position: absolute;
  left: 3%;
  width: 118px;
  padding: 11px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px 15px 15px 5px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 6px;
  transform: rotateY(24deg) rotateX(6deg);
  animation: viz3dBubble 5.5s var(--ease) infinite;
}

.viz3d__bubble i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--peri-ink);
}

.viz3d__bubble b {
  height: 5px;
  border-radius: 3px;
  background: var(--bg-2);
}

.viz3d__bubble b:last-child {
  width: 62%;
}

.viz3d__bubble--1 { top: 4%; animation-delay: 0s; }
.viz3d__bubble--2 { top: 37%; left: 9%; animation-delay: 1.1s; }
.viz3d__bubble--3 { top: 70%; animation-delay: 2.2s; }

@keyframes viz3dBubble {
  0%, 100% { transform: rotateY(24deg) rotateX(6deg) translateY(0); }
  50% { transform: rotateY(17deg) rotateX(4deg) translateY(-9px); }
}

/* pedidos que vuelan hacia el panel */
.viz3d__order {
  position: absolute;
  left: 28%;
  top: 28%;
  width: 36px;
  height: 23px;
  border-radius: 7px;
  background: var(--orange);
  box-shadow: 0 12px 24px -8px rgba(var(--orange-rgb), 0.7);
  opacity: 0;
  animation: viz3dFly 4.2s var(--ease) infinite;
}

.viz3d__order--2 {
  top: 58%;
  background: var(--peri-ink);
  box-shadow: 0 12px 24px -8px rgba(76, 99, 199, 0.6);
  animation-delay: 2.1s;
}

@keyframes viz3dFly {
  0% { transform: translate3d(0, 0, 0) rotateY(20deg) scale(0.65); opacity: 0; }
  12% { opacity: 1; }
  72% { opacity: 1; }
  100% { transform: translate3d(125px, -14px, 70px) rotateY(-12deg) scale(1.05); opacity: 0; }
}

/* bultos 3D (distribuidora) */
.viz3d__cube {
  position: absolute;
  left: 4%;
  bottom: 15%;
  width: 42px;
  height: 42px;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(32deg);
  animation: viz3dCube 5s var(--ease) infinite;
  animation-delay: calc(var(--i) * 0.7s);
}

.viz3d__cube--2 { left: 17%; bottom: 30%; }
.viz3d__cube--3 { left: 30%; bottom: 13%; }

.viz3d__face {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 5px;
}

.viz3d__face--f {
  background: var(--orange);
  transform: translateZ(21px);
}

.viz3d__face--t {
  background: #ff7c62;
  transform: rotateX(90deg) translateZ(21px);
}

.viz3d__face--s {
  background: #b32412;
  transform: rotateY(90deg) translateZ(21px);
}

@keyframes viz3dCube {
  0%, 100% { transform: rotateX(-22deg) rotateY(32deg) translateY(0); }
  50% { transform: rotateX(-22deg) rotateY(52deg) translateY(-11px); }
}

/* ruta de reparto */
.viz3d__route {
  position: absolute;
  left: 4%;
  top: 8%;
  width: 92%;
  height: 84px;
  color: var(--muted);
  opacity: 0.85;
  transition: opacity 0.35s ease;
}

.viz3d:hover .viz3d__route,
.viz3d.is-active .viz3d__route {
  opacity: 1;
  color: var(--orange);
}

.viz3d--dist .viz3d__device {
  right: 4%;
  top: 58%;
  animation-delay: 0.8s;
}

.scenario__head {
  margin-bottom: clamp(18px, 2.6vh, 28px);
}

.scenario__head h3 {
  font-family: var(--display);
  font-size: clamp(23px, 2.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.scenario__head p {
  color: var(--prose);
  max-width: 560px;
}

.scenario__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.state {
  border-radius: 18px;
  padding: clamp(18px, 2.2vw, 26px);
  border: 1px solid var(--line);
}

.state--antes {
  background: rgba(var(--orange-rgb), 0.05);
}

.state--despues {
  background: var(--demo-ok);
}

.state__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.state__meta {
  color: var(--muted);
  font-size: 10px;
}

.state__steps {
  display: grid;
  gap: 12px;
}

.state__steps li {
  position: relative;
  padding-left: 30px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--prose);
}

/* antes: marca de atención */
.state--antes .state__steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--orange-rgb), 0.55);
  background:
    linear-gradient(rgba(var(--orange-rgb), 0.8), rgba(var(--orange-rgb), 0.8)) center / 8px 1.6px no-repeat;
}

/* después: check naranja */
.state--despues .state__steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--orange)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4 10-11'/%3E%3C/svg%3E")
    center / 10px no-repeat;
}

@media (max-width: 1024px) {
  .privacy__card {
    grid-template-columns: 1fr;
  }

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

  .scenario .slide__visual {
    order: -1;
    min-height: 270px;
  }

  .viz3d__scene {
    height: 270px;
  }
}

@media (max-width: 860px) {
  .scenario__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .viz3d__scene {
    height: 240px;
  }

  .viz3d__device {
    width: 140px;
  }

  .viz3d__bubble {
    width: 96px;
  }
}

/* ---------- RAIL (áreas) ---------- */
.rail-sec {
  padding: var(--section-y) 0;
  transition: padding-top 0.45s var(--ease);
}

.rail-sec__head {
  max-width: var(--wrap);
  margin: 0 auto clamp(30px, 5vh, 48px);
  padding: 0 var(--pad);
}

.rail-sec__head h2 {
  font-size: clamp(40px, 6.5vw, 96px);
  line-height: 0.98;
}

.rail {
  --rail-pad: max(var(--pad), calc((100% - var(--wrap)) / 2 + var(--pad)));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding-inline: var(--rail-pad);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail__track {
  display: flex;
  gap: 20px;
  padding-inline: var(--rail-pad);
  width: max-content;
}

.rail__slide {
  scroll-snap-align: start;
  width: min(860px, calc(100vw - 2 * var(--pad)));
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(24px, 3vw, 44px);
}

.slide__text h3 {
  font-family: var(--display);
  font-size: clamp(26px, 2.8vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin-bottom: 12px;
}

.slide__text > p {
  color: var(--prose);
  margin-bottom: 18px;
  max-width: 460px;
}

.slide__text .ticks li {
  font-size: 14.5px;
}

.slide__visual {
  border-radius: 18px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.slide__visual--a { background: linear-gradient(150deg, #ffd9c2, var(--bg-2)); }
.slide__visual--b { background: linear-gradient(150deg, var(--peri), var(--bg-2)); }
.slide__visual--c { background: linear-gradient(150deg, #ffc7a0, var(--bg-2)); }
.slide__visual--d { background: linear-gradient(150deg, #d9e2fb, var(--bg-2)); }

[data-theme="dark"] .slide__visual--a { background: linear-gradient(150deg, #2A160B, var(--bg-2)); }
[data-theme="dark"] .slide__visual--b { background: linear-gradient(150deg, #17203a, var(--bg-2)); }
[data-theme="dark"] .slide__visual--c { background: linear-gradient(150deg, #2A160B, var(--bg-2)); }
[data-theme="dark"] .slide__visual--d { background: linear-gradient(150deg, #14202e, var(--bg-2)); }

/* ---------- Visuales interactivos de las cards ---------- */
.viz {
  width: 100%;
  max-width: 320px;
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 1 · Organización: del caos al orden */
.viz--order {
  display: grid;
  grid-template-columns: 1fr auto 1.25fr;
  gap: 12px;
  align-items: center;
}

.viz-order__chaos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.viz-order__chip {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transform: rotate(calc((var(--i) - 1.5) * 5deg)) translateY(calc((var(--i) % 2) * 5px - 2px));
  animation: chipFloat 4.5s var(--ease) infinite;
  animation-delay: calc(var(--i) * 0.55s);
  transition: transform 0.45s var(--spring), box-shadow 0.35s ease;
}

.viz-order__chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  opacity: 0.85;
}

.viz-order__chip b {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-2);
}

.viz-order__chip b:last-child {
  width: 65%;
}

@keyframes chipFloat {
  0%, 100% {
    transform: rotate(calc((var(--i) - 1.5) * 5deg)) translateY(calc((var(--i) % 2) * 5px - 2px));
  }
  50% {
    transform: rotate(calc((var(--i) - 1.5) * 2deg)) translateY(-4px);
  }
}

.viz-order__arrow {
  width: 22px;
  height: 22px;
  color: var(--orange);
  animation: arrowNudge 1.8s var(--ease) infinite;
}

@keyframes arrowNudge {
  0%, 100% { transform: translateX(0); opacity: 0.65; }
  50% { transform: translateX(5px); opacity: 1; }
}

.viz-order__list {
  display: grid;
  gap: 8px;
}

.viz-order__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateX(10px);
  animation: orderRow 5.5s var(--ease) infinite;
  animation-delay: calc(var(--i) * 0.45s + 1s);
}

.viz-order__row i {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--orange);
  opacity: 0.85;
}

.viz-order__row b {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-2);
}

.viz-order__row em {
  flex: 0 0 22px;
  height: 8px;
  border-radius: 100px;
  background: var(--peri);
}

@keyframes orderRow {
  0% { opacity: 0; transform: translateX(10px); }
  12%, 82% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(-4px); }
}

.viz--order:hover .viz-order__chip,
.viz--order.is-active .viz-order__chip {
  transform: rotate(0deg) translateY(0);
  animation-play-state: paused;
  box-shadow: var(--shadow);
}

/* 2 · Seguimiento: recordatorios y pendientes */
.viz--track {
  position: relative;
  flex-direction: column;
  gap: 16px;
  padding: 30px 4px 6px;
}

.viz-track__bell {
  position: absolute;
  top: 0;
  right: 6px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--orange);
  box-shadow: var(--shadow-sm);
  animation: bellSwing 4.6s var(--ease) infinite;
  transform-origin: 50% 12%;
}

.viz-track__bell svg {
  width: 21px;
  height: 21px;
}

.viz-track__ring {
  position: absolute;
  inset: -6px;
  border: 1.5px solid var(--orange);
  border-radius: 18px;
  opacity: 0;
  animation: ringPulse 4.6s var(--ease) infinite;
}

@keyframes bellSwing {
  0%, 8%, 100% { transform: rotate(0deg); }
  2% { transform: rotate(-9deg); }
  4% { transform: rotate(7deg); }
  6% { transform: rotate(-4deg); }
}

@keyframes ringPulse {
  0%, 6% { opacity: 0.55; transform: scale(0.85); }
  16%, 100% { opacity: 0; transform: scale(1.22); }
}

.viz-track__list {
  display: grid;
  gap: 10px;
  width: 100%;
}

.viz-track__task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
  animation: taskIn 5s var(--ease) infinite;
  animation-delay: calc(var(--i) * 0.6s);
}

@keyframes taskIn {
  0% { transform: translateY(6px); opacity: 0.6; }
  12%, 88% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-3px); opacity: 0.85; }
}

.viz-track__check {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s var(--spring);
}

.viz-track__check svg {
  width: 12px;
  height: 12px;
}

.viz-track__task.is-done .viz-track__check {
  background: var(--orange);
  border: 1px solid var(--orange);
  color: #fff;
}

.viz-track__task.is-pending .viz-track__check {
  background: transparent;
  border: 1.5px dashed var(--muted);
  color: transparent;
}

.viz-track__task b {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-2);
}

.viz-track__pill {
  font-family: var(--font);
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  border: 1px solid rgba(var(--orange-rgb), 0.4);
  background: rgba(var(--orange-rgb), 0.08);
  border-radius: 100px;
  padding: 4px 9px;
  animation: pillPulse 2.2s ease-in-out infinite;
  transition: opacity 0.35s ease;
}

@keyframes pillPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.viz--track:hover .viz-track__task.is-pending .viz-track__check,
.viz--track.is-active .viz-track__task.is-pending .viz-track__check {
  background: var(--orange);
  border: 1px solid var(--orange);
  color: #fff;
  transform: scale(1.12);
}

.viz--track:hover .viz-track__pill,
.viz--track.is-active .viz-track__pill {
  opacity: 0;
}

/* 3 · Procesos operativos: bucle automático */
.viz--flow {
  position: relative;
  flex-direction: column;
  gap: 22px;
  padding: 12px;
}

.viz-flow__gear {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--orange);
  box-shadow: var(--shadow-sm);
  animation: gearSpin 14s linear infinite;
  transition: border-color 0.3s ease;
}

.viz-flow__gear svg {
  width: 26px;
  height: 26px;
}

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

.viz-flow__line {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 100px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: visible;
}

.viz-flow__packet {
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 6px;
  background: var(--orange);
  box-shadow: 0 6px 16px -6px rgba(var(--orange-rgb), 0.7);
  animation: packetRun 3.6s var(--ease) infinite;
}

.viz-flow__packet--2 {
  background: var(--peri-ink);
  box-shadow: 0 6px 16px -6px rgba(76, 99, 199, 0.6);
  animation-delay: 1.8s;
}

@keyframes packetRun {
  0% { left: -4px; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: calc(100% - 14px); opacity: 0; }
}

.viz-flow__stages {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 6px;
}

.viz-flow__stages i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: transparent;
  animation: stagePulse 3.6s linear infinite;
  animation-delay: calc(var(--i) * 0.9s);
}

@keyframes stagePulse {
  0%, 20% { background: var(--orange); border-color: var(--orange); transform: scale(1.15); }
  35%, 100% { background: transparent; border-color: var(--line); transform: scale(1); }
}

.viz-flow__tag {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--card);
  color: var(--muted);
  font-size: 10px;
}

.viz--flow:hover .viz-flow__packet,
.viz--flow.is-active .viz-flow__packet {
  animation-duration: 1.6s;
}

.viz--flow:hover .viz-flow__gear,
.viz--flow.is-active .viz-flow__gear {
  animation-duration: 5s;
  border-color: var(--orange);
}

.viz--flow:hover .viz-flow__stages i,
.viz--flow.is-active .viz-flow__stages i {
  animation-duration: 1.6s;
}

/* 4 · Conexión entre herramientas */
.viz--link {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 220px;
}

.viz-link__wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--muted);
  opacity: 0.75;
  transition: opacity 0.35s ease, color 0.35s ease;
}

.viz--link:hover .viz-link__wires,
.viz--link.is-active .viz-link__wires {
  opacity: 1;
  color: var(--orange);
}

.viz-link__node {
  position: absolute;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  animation: nodeBob 5s var(--ease) infinite;
  transition: transform 0.35s var(--spring), border-color 0.3s ease, box-shadow 0.3s ease;
}

.viz-link__node svg {
  width: 25px;
  height: 25px;
}

.viz-link__node--form {
  left: 8%;
  top: 8%;
  animation-delay: 0s;
}

.viz-link__node--sheet {
  left: 8%;
  bottom: 6%;
  animation-delay: 1.2s;
}

.viz-link__node--bell {
  right: 8%;
  top: 50%;
  margin-top: -29px;
  color: var(--orange);
  animation-delay: 2.1s;
}

@keyframes nodeBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.viz--link:hover .viz-link__node,
.viz--link.is-active .viz-link__node {
  transform: translateY(-6px) scale(1.06);
  border-color: var(--orange);
  box-shadow: var(--shadow);
  animation-play-state: paused;
}

.rail__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(22px, 3.5vh, 36px);
}

.rail__dot {
  width: 9px;
  height: 9px;
  border-radius: 100px;
  background: var(--line);
  transition: background 0.25s ease, width 0.25s var(--ease);
}

.rail__dot.is-active {
  width: 28px;
  background: var(--orange);
}

.rail-sec__close {
  max-width: var(--wrap);
  margin: var(--block-gap) auto 0;
  padding: var(--block-gap) var(--pad) 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.rail-sec__close p {
  max-width: 560px;
  color: var(--prose);
  font-size: clamp(17px, 1.5vw, 21px);
  letter-spacing: -0.015em;
}

/* ---------- JOURNAL (soluciones) ---------- */
.jrn {
  padding: var(--section-y) var(--pad);
}

.jrn__head {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto var(--block-gap);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: var(--block-gap);
}

.jrn__title {
  font-family: var(--display);
  font-size: clamp(40px, 6.5vw, 96px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.jrn__grid {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--item-gap);
}

.jrn__card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(18px, 2vw, 28px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.jrn__card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.jrn__media {
  display: block;
  border-radius: 14px;
  background: var(--bg-2);
  padding: 18px 14px;
  color: var(--muted);
  overflow: hidden;
}

.jrn__media svg {
  width: 100%;
  height: auto;
}

.flow-line {
  animation: flowDashes 1.2s linear infinite;
}

@keyframes flowDashes {
  to { stroke-dashoffset: -22; }
}

.jrn__card .eyebrow {
  margin-bottom: 0;
}

.jrn__card h3 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.jrn__card p {
  color: var(--prose);
  font-size: 15px;
}

/* ---------- Cómo trabajo (rail horizontal 3D) ---------- */
.how {
  padding: var(--section-y) var(--pad);
  gap: var(--block-gap);
}

.how__head {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  flex-shrink: 0;
}

.how__title {
  font-family: var(--display);
  font-size: clamp(32px, 3.9vw, 56px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin-bottom: clamp(18px, 2.8vh, 30px);
  max-width: 16em;
}

.work__lead {
  margin-top: clamp(18px, 2.8vh, 30px);
  max-width: 560px;
  color: var(--prose);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.55;
}

.how__lead {
  color: var(--prose);
  max-width: 560px;
  font-size: clamp(16px, 1.4vw, 19px);
}




.how__rail {
  display: flex;
  gap: 26px;
  padding-inline: max(var(--pad), calc((100vw - var(--wrap)) / 2 + var(--pad)));
  margin-block: auto;
  will-change: transform;
}

.how-step {
  position: relative;
  flex: 0 0 min(560px, 78vw);
  scroll-snap-align: start;
  min-height: clamp(280px, 44vh, 460px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(26px, 3vw, 46px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  overflow: hidden;
  will-change: transform, opacity;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.how-step:hover {
  border-color: rgba(var(--orange-rgb), 0.45);
  box-shadow: var(--shadow-lg);
}

.how-step__ghost {
  position: absolute;
  top: -18px;
  right: 12px;
  font-family: var(--display);
  font-size: clamp(130px, 15vw, 210px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line);
  pointer-events: none;
  transition: -webkit-text-stroke-color 0.35s ease, transform 0.6s var(--ease);
}

.how-step:hover .how-step__ghost {
  -webkit-text-stroke-color: rgba(var(--orange-rgb), 0.55);
  transform: translateY(-8px);
}

.how-step h3 {
  font-family: var(--display);
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 13em;
}

.how-step p {
  color: var(--prose);
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.65;
  max-width: 30em;
}

.how__close {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(14px, 2vh, 22px) 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 22px;
  flex-shrink: 0;
}

.how__note {
  max-width: 560px;
  color: var(--prose);
  font-size: clamp(15px, 1.3vw, 19px);
  letter-spacing: -0.015em;
}

@media (max-width: 860px) {
  .how__title {
    font-size: clamp(24px, 6.2vw, 36px);
    margin-bottom: 10px;
  }

  .how__lead {
    font-size: 15px;
    line-height: 1.5;
  }

  .how__rail {
    gap: 18px;
    padding-inline: var(--pad);
  }

  .how-step {
    flex: 0 0 84vw;
    min-height: min(320px, 42vh);
  }

  .how-step h3 {
    font-size: clamp(23px, 6vw, 30px);
  }

  .how__close {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 12px;
  }

  .how__note {
    font-size: 14px;
    line-height: 1.5;
  }
}

/* fallback: sin movimiento (apilado vertical) */
@media (prefers-reduced-motion: reduce) {
  .how__rail {
    flex-direction: column;
    transform: none !important;
    padding-inline: var(--pad);
  }

  .how-step {
    flex: none;
    width: 100%;
    min-height: 0;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ---------- ABOUT photo ---------- */
.dev__photo {
  display: flex;
  justify-content: center;
}

.dev__photo-frame {
  width: min(100%, 420px);
  aspect-ratio: 4 / 5;
  border-radius: 26px;
  border: 1px dashed var(--line);
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  transition: transform 0.35s var(--ease);
}

.dev__photo-frame:hover {
  transform: translateY(-4px);
}

/* ---------- FAQ ---------- */
.faq {
  padding: var(--section-y) var(--pad);
}

.faq__head {
  width: 100%;
  max-width: 900px;
  margin: 0 auto var(--block-gap);
  text-align: center;
}

.faq__head h2 {
  font-family: var(--display);
  font-size: clamp(40px, 6.5vw, 96px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.faq__list {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.qa {
  border-top: 1px solid var(--line);
}

.qa:last-child {
  border-bottom: 1px solid var(--line);
}

.qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(16px, 2.2vh, 22px) 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--display);
  font-size: clamp(17px, 1.7vw, 22px);
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color 0.25s var(--ease);
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary:hover {
  color: var(--orange);
}

.qa summary i {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.qa summary i::before,
.qa summary i::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease);
}

.qa summary i::before {
  left: 0;
  right: 0;
  top: 10px;
  height: 2px;
}

.qa summary i::after {
  top: 0;
  bottom: 0;
  left: 10px;
  width: 2px;
}

.qa[open] summary i::after {
  transform: scaleY(0);
}

.qa p {
  padding: 0 0 clamp(16px, 2.2vh, 22px);
  color: var(--prose);
  max-width: 720px;
  animation: qaOpen 0.35s var(--ease);
}

@keyframes qaOpen {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ---------- CONTACTO (privacy card) ---------- */
.privacy {
  padding: var(--section-y) var(--pad);
}

.privacy__card {
  max-width: var(--wrap);
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(24px, 3vw, 44px);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 3vw, 44px);
  align-items: center;
}

.privacy__text {
  min-width: 0;
}

.privacy__line {
  font-family: var(--display);
  font-size: clamp(32px, 4.6vw, 68px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.98;
  max-width: 15em;
}

.privacy__lead {
  margin-top: 18px;
  max-width: 620px;
  color: var(--prose);
  font-size: clamp(16px, 1.4vw, 19px);
}

.privacy__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 34px;
}

.privacy__badges span {
  display: inline-flex;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--prose);
}

/* Formulario */
.form-card {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  color: inherit;
}

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field__label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.field__optional {
  color: var(--muted);
  font-weight: 400;
}

.field__input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 13px;
  font-size: 15px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field__input:hover {
  border-color: var(--muted);
}

.field__input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(var(--orange-rgb), 0.15);
}

.field__input[aria-invalid="true"] {
  border-color: var(--orange);
}

.field__input--area {
  resize: vertical;
  min-height: 110px;
}

/* WhatsApp unificado */
.field__wa {
  display: flex;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field__wa:hover {
  border-color: var(--muted);
}

.field__wa:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(var(--orange-rgb), 0.15);
}

.field__wa-code {
  width: 110px;
  min-width: 110px;
  padding: 14px 12px;
  background: rgba(26,23,18,0.03);
  border: none;
  border-right: 1.5px solid var(--line);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  outline: none;
}

.field__wa .field__input {
  flex: 1;
  border: none;
  border-radius: 0;
  background: transparent;
}

.field__wa .field__input:focus {
  outline: none;
  box-shadow: none;
}

.field__error {
  font-size: 12.5px;
  color: var(--orange);
}

.form__privacy {
  font-size: 12.5px;
  color: var(--muted);
}

.form__privacy a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form__success {
  background: var(--demo-ok);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 500;
}

/* ---------- FOOTER (siempre negro) ---------- */
.footer {
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding: clamp(32px, 5vh, 48px) var(--pad) 24px;
  background: #0a0a0a;
  --ink: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.5);
  --line: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  overflow: hidden;
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  max-width: var(--wrap);
  margin: 0 auto;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
}

.footer__tag {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14.5px;
}

.footer__cols {
  display: flex;
  gap: clamp(28px, 5vw, 70px);
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__col a {
  color: var(--muted);
  font-size: 14.5px;
  transition: color 0.25s var(--ease);
}

.footer__col a:hover {
  color: var(--ink);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  white-space: nowrap;
  margin-top: 4px;
  transition: color 0.3s;
}

.theme-switch:hover {
  color: var(--orange);
}

.theme-switch svg {
  width: 17px;
  height: 17px;
}

[data-theme="light"] .tgl-sun,
[data-theme="dark"] .tgl-moon {
  display: none;
}

.footer__bottom {
  max-width: var(--wrap);
  margin: clamp(28px, 4vh, 44px) auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Reveals ---------- */
.reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  transition-delay: var(--d, 0s);
}

.reveal-up.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .fig-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .dev,
  .import {
    grid-template-columns: 1fr;
  }

  .dev--flip .dev__text {
    order: 0;
  }

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

@media (max-width: 860px) {
  .nav__links {
    position: fixed;
    inset: 0 0 auto;
    top: 0;
    padding: 88px var(--pad) 28px;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    transform: translateY(-110%);
    transition: transform 0.45s var(--ease);
    z-index: -1;
    font-size: 18px;
  }

  .nav__links.is-open {
    transform: translateY(0);
  }

  .nav__links > a,
  .nav__trigger {
    width: 100%;
    padding: 14px 0;
    font-size: 18px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    justify-content: space-between;
  }

  .nav__item {
    width: 100%;
  }

  .mega {
    position: static;
    transform: none;
    opacity: 1;
    visibility: hidden;
    display: none;
    padding: 2px 0 10px;
  }

  .nav__item.is-open .mega {
    display: block;
    visibility: visible;
  }

  .nav__item:hover .mega {
    display: none;
  }

  .nav__item.is-open:hover .mega {
    display: block;
  }

  .mega__panel {
    width: 100%;
  }

  .mega__link {
    display: block;
    width: 100%;
    padding: 9px 4px 9px 16px;
    font-size: 15px;
    white-space: normal;
  }

  .nav__burger {
    display: block;
  }

  .nav .btn--sm {
    display: none;
  }

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

  .film__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .film__cta .btn {
    width: 100%;
  }

  .work__close,
  .rail-sec__close,
  .jrn__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer__row {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .film__first {
    padding-top: calc(var(--nav-offset) + 24px);
    padding-bottom: 24px;
    justify-content: center;
    gap: 0;
  }

  .film__label {
    margin-bottom: clamp(16px, 3vh, 26px);
    font-size: 10.5px;
  }

  .film__title {
    font-size: clamp(38px, 11.5vw, 58px);
    line-height: 0.98;
  }

  .film__cta {
    margin-top: clamp(26px, 4vh, 40px);
  }

  .film__manifesto {
    padding: 8vh 0 12vh;
    font-size: clamp(21px, 6vw, 30px);
    line-height: 1.25;
    letter-spacing: -0.025em;
  }

  .rail__slide {
    width: calc(100vw - 2 * var(--pad));
    border-radius: 20px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .film__w,
  .reveal-words .word > span,
  .reveal-up {
    opacity: 1;
    transform: none;
  }

  .cursor {
    display: none !important;
  }

  body.has-cursor,
  body.has-cursor * {
    cursor: auto !important;
  }
}

/* =========================================================
   Adaptación de altura en móvil: cada sección cabe
   en el alto disponible del dispositivo
   ========================================================= */
@media (max-width: 640px) {
  /* ritmo vertical compacto */
  :root {
    --section-y: clamp(28px, 5vh, 48px);
    --block-gap: clamp(14px, 2.5vh, 22px);
    --item-gap: 14px;
    --pin-y: clamp(12px, 2vh, 20px);
  }

  .rail-sec__head,
  .work__head,
  .jrn__head,
  .faq__head {
    gap: 10px;
  }

  .rail-sec__head h2,
  .work__head h2,
  .jrn__title,
  .faq__head h2 {
    font-size: clamp(28px, 7.2vw, 40px);
    line-height: 1.02;
  }

  .work__lead {
    margin-top: 14px;
    font-size: 14.5px;
    line-height: 1.55;
  }

  .how__lead {
    font-size: 14px;
    line-height: 1.5;
  }

  /* slides de áreas: contenido compacto */
  .rail__slide {
    padding: 18px;
    gap: 14px;
  }

  .slide__text h3 {
    font-size: clamp(20px, 5.4vw, 26px);
    margin-bottom: 8px;
  }

  .slide__text > p {
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.55;
  }

  .slide__text .ticks {
    gap: 5px;
  }

  .slide__text .ticks li {
    font-size: 13px;
    line-height: 1.5;
  }

  .slide__visual {
    min-height: 0;
    padding: 12px;
    border-radius: 14px;
  }

  .viz {
    min-height: 0;
  }

  .viz3d__scene {
    height: 190px;
  }

  .rail-sec__close,
  .work__close {
    margin-top: clamp(18px, 3vh, 28px);
    padding-top: clamp(14px, 2.4vh, 20px);
    gap: 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .rail-sec__close p,
  .work__close p,
  .how__note {
    font-size: 14.5px;
    line-height: 1.5;
  }

  .rail-sec__close .sect__more,
  .work__close .sect__more {
    align-self: flex-start;
  }

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

  .jrn__card {
    padding: 16px;
  }

  .jrn__media {
    padding: 12px 10px;
    border-radius: 12px;
  }

  .jrn__card h3 {
    font-size: 19px;
  }

  .jrn__card p {
    font-size: 13.5px;
    line-height: 1.55;
  }

  /* FAQ compacto */
  .qa summary {
    padding: clamp(13px, 2vh, 18px) 0;
    font-size: clamp(15px, 4.4vw, 18px);
    gap: 14px;
  }

  .qa p {
    padding-bottom: clamp(13px, 2vh, 18px);
    font-size: 14px;
    line-height: 1.6;
  }

  /* contacto: formulario compacto */
  .privacy__line {
    font-size: clamp(26px, 7vw, 34px);
    margin-bottom: 12px;
  }

  .privacy__lead {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.55;
  }

  .privacy__card {
    grid-template-columns: 1fr;
    padding: 22px;
    gap: 18px;
    border-radius: 22px;
  }

  .form-card {
    width: 100%;
  }

  .form {
    gap: 16px;
  }

  .field {
    gap: 7px;
  }

  .field__label {
    font-size: 13px;
    line-height: 1.4;
  }

  /* 16px evita el zoom automático de iOS al escribir */
  .field__input {
    padding: 13px 14px;
    font-size: 16px;
    border-radius: 12px;
  }

  .field__input--area {
    min-height: 110px;
  }

  .form-card .btn {
    width: 100%;
    min-height: 52px;
    padding: 14px 22px;
  }

  .form__privacy {
    font-size: 12px;
    line-height: 1.55;
  }

  /* paneles de los rails */
  .how-step {
    flex: 0 0 84vw;
    min-height: min(300px, 38vh);
    padding: 20px;
    border-radius: 20px;
  }

  .how-step h3 {
    font-size: clamp(21px, 5.6vw, 28px);
  }

  .how-step p {
    font-size: 14px;
    line-height: 1.55;
  }

  .how-step__ghost {
    font-size: clamp(90px, 26vw, 140px);
  }
}


/* ---------- Timeline vertical animado 3D (Cómo trabajo) ---------- */
.timeline {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  perspective: 1400px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 34px;
  bottom: 34px;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(
    180deg,
    var(--orange) 0%,
    rgba(var(--orange-rgb), 0.35) 100%
  );
  transform: scaleY(var(--grow, 0));
  transform-origin: top;
  transition: transform 0.15s linear;
}

.tl-step {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  gap: 28px;
  align-items: center;
  padding: clamp(16px, 2.6vh, 30px) 0;
}

/* la entrada la animan los hijos: neutralizo el reveal del bloque */
.tl-step.reveal-up {
  opacity: 1;
  transform: none;
  transition: none;
}

.tl-step__node {
  grid-column: 2;
  justify-self: center;
  z-index: 1;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  box-shadow: 0 14px 30px -12px rgba(var(--orange-rgb), 0.7);
  opacity: 0;
  transform: rotateY(-90deg) scale(0.6);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), box-shadow 0.35s ease;
}

.tl-step.is-in .tl-step__node {
  opacity: 1;
  transform: rotateY(0) scale(1);
}

.tl-step:hover .tl-step__node {
  transform: rotateY(0) scale(1.12);
  box-shadow: 0 20px 40px -12px rgba(var(--orange-rgb), 0.85);
}

.tl-step__body {
  grid-column: 3;
  opacity: 0;
  transform: translateX(52px) rotateY(-14deg);
  transition: opacity 0.8s var(--ease) 0.12s, transform 0.8s var(--ease) 0.12s;
}

.tl-step.is-in .tl-step__body {
  opacity: 1;
  transform: none;
}

.tl-step:hover .tl-step__body {
  transform: translateX(8px) rotateY(-3deg);
}

/* alternancia izquierda / derecha */
.tl-step:nth-of-type(even) .tl-step__body {
  grid-column: 1;
  text-align: right;
  transform: translateX(-52px) rotateY(14deg);
}

.tl-step:nth-of-type(even).is-in .tl-step__body {
  transform: none;
}

.tl-step:nth-of-type(even):hover .tl-step__body {
  transform: translateX(-8px) rotateY(3deg);
}

.tl-step__body h3 {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 8px;
}

.tl-step__body p {
  color: var(--prose);
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.65;
  max-width: 34em;
}

.tl-step:nth-of-type(even) .tl-step__body p {
  margin-left: auto;
}

@media (max-width: 860px) {
  .timeline::before {
    left: 24px;
    top: 26px;
    bottom: 26px;
  }

  .tl-step {
    grid-template-columns: 48px 1fr;
    gap: 16px;
    padding: 10px 0;
  }

  .tl-step__node {
    grid-column: 1;
    width: 48px;
    height: 48px;
    font-size: 15px;
    transform: rotateY(-90deg) scale(0.6);
  }

  .tl-step__body,
  .tl-step:nth-of-type(even) .tl-step__body {
    grid-column: 2;
    text-align: left;
    transform: translateX(30px) rotateY(-8deg);
  }

  .tl-step:nth-of-type(even).is-in .tl-step__body,
  .tl-step.is-in .tl-step__body {
    transform: none;
  }

  .tl-step:nth-of-type(even) .tl-step__body p {
    margin-left: 0;
  }

  .tl-step__body h3 {
    font-size: clamp(19px, 5vw, 24px);
    margin-bottom: 6px;
  }

  .tl-step__body p {
    font-size: 14px;
    line-height: 1.55;
  }
}
