/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--negro-sensor); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--negro-sensor);
  color: var(--blanco-flash);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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

/* aviso solo al abrir el archivo con doble clic (file://) */
.file-note {
  position: fixed; inset: 0;
  z-index: calc(var(--z-loader) + 1);
  display: grid; place-content: center;
  margin: 0; padding: 24px;
  background: var(--negro-sensor);
  color: var(--blanco-flash);
  font: 400 16px / 1.6 var(--font-mono);
  text-align: center;
}
.file-note code { color: var(--rojo-rec); }

.skip {
  position: fixed; left: 12px; top: 12px; z-index: calc(var(--z-flash) + 1);
  padding: 10px 14px; background: var(--blanco-flash); color: var(--negro-sensor);
  font: 500 var(--hud-size)/1 var(--font-mono);
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

/* parpadeo a 118 BPM (punto REC de los CTA y de servicios) */
@keyframes blink { 50% { opacity: 0; } }

/* ---------- botón REC (oscuro) ----------
   (sin uso desde que se quitó "Pide presupuesto"; se queda para el próximo CTA)
   (antes en hero-main.css; el hero antiguo está en legacy/css/hero-main.css) */
.btn-rec {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  background: var(--negro-sensor);
  color: var(--blanco-flash);
  font: 600 1rem / 1 var(--font-display);
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 999px;
}
.btn-rec__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rojo-rec);
  animation: blink var(--beat) steps(1, end) infinite;
}
/* al pasar el ratón el punto deja de parpadear y se queda fijo */
.btn-rec:hover .btn-rec__dot,
.btn-rec:focus-visible .btn-rec__dot { animation: none; opacity: 1; }

/* movimiento reducido: el punto no parpadea */
@media (prefers-reduced-motion: reduce) {
  .btn-rec__dot { animation: none; }
}

/* LEGACY PRE-HERO: el CTA claro (.cta) y el flash blanco (.flash) están en legacy/css/hud.css y
   en la historia de git (base.css antes del prompt 3). */

/* WhatsApp flotante (js/wa-float.js): solo móvil y solo con config.ready.whatsapp */
.wa-float {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 900;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1.5px solid #F35411;
  border-radius: 50%;
  background: #0b0909;
  color: #F35411;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.wa-float.is-on { opacity: 1; visibility: visible; transform: none; }
.wa-float:focus-visible { outline: 2px solid #F35411; outline-offset: 3px; }

/* ---------- CTA principal "Cuéntanos tu idea →" (en toda la web; js/core.js → el imán) ----------
   Píldora #F35411 (sobre los cierres naranjas, la variante tinta). Al pasar el ratón: rodillo de texto (0.35 s) a
   "Empezamos hoy", la flecha avanza y el punto REC late; el botón se acerca al cursor hasta 6 px (translate, desde
   js). En táctil: sin imán y el rodillo se ve una vez al tocar. `a.cta-pill` para ganar a las clases de cada página. */
a.cta-pill {
  --cta-bg: #F35411;
  --cta-fg: #0b0909;
  --cta-hover: #ff6a2b;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 26px 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  font: 500 16px / 1 var(--font-display);
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease;
}
a.cta-pill--ink { --cta-bg: #0b0909; --cta-fg: #f4f2ef; --cta-hover: #241d1c; }
a.cta-pill:hover,
a.cta-pill.is-roll { background: var(--cta-hover); }
a.cta-pill:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
/* el punto REC: una lamparita (aro de tinta y centro naranja), quieta; con el ratón encima, late */
.cta-pill__rec { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: #0b0909; }
.cta-pill__rec::after { content: ""; position: absolute; inset: 2.5px; border-radius: 50%; background: #F35411; opacity: 0.45; }
.cta-pill--ink .cta-pill__rec { background: rgb(244 242 239 / 0.14); }
a.cta-pill:hover .cta-pill__rec::after,
a.cta-pill.is-roll .cta-pill__rec::after { opacity: 1; animation: cta-rec 0.9s ease-in-out infinite; }
@keyframes cta-rec { 50% { opacity: 0.25; transform: scale(0.7); } }
/* el rodillo: los dos textos en la misma celda, el segundo esperando debajo */
.cta-pill__roll { display: inline-grid; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.cta-pill__roll > span { grid-area: 1 / 1; transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1); }
.cta-pill__roll > span + span { transform: translateY(110%); }
a.cta-pill:hover .cta-pill__roll > span:first-child,
a.cta-pill.is-roll .cta-pill__roll > span:first-child { transform: translateY(-110%); }
a.cta-pill:hover .cta-pill__roll > span + span,
a.cta-pill.is-roll .cta-pill__roll > span + span { transform: none; }
.cta-pill__arrow { display: inline-block; transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
a.cta-pill:hover .cta-pill__arrow,
a.cta-pill.is-roll .cta-pill__arrow { transform: translateX(5px); }
@media (prefers-reduced-motion: reduce) {
  .cta-pill__roll > span,
  .cta-pill__arrow { transition: none; }
  a.cta-pill:hover .cta-pill__rec::after { animation: none; }
}

/* "Sigue bajando" (js/core.js → initScrollHint): abajo en el centro, solo si el visitante se para. Una píldora pequeña
   de cristal ahumado (como la barra del menú: se lee sobre negro, naranja o el blanco del estudio), con el texto en
   mono y una línea fina por la que baja un punto naranja. */
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 16px;
  border: 1px solid rgb(244 242 239 / 0.14);
  border-radius: 999px;
  background: rgb(11 9 9 / 0.42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: rgb(244 242 239 / 0.86);
  font: 400 10px / 1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.scroll-hint.is-on { opacity: 1; transform: translate(-50%, 0); }
.scroll-hint i { position: relative; display: block; width: 1px; height: 16px; background: rgb(244 242 239 / 0.25); overflow: hidden; }
.scroll-hint i::after {
  content: "";
  position: absolute;
  left: -1.5px;
  top: -4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #F35411;
  animation: scroll-hint 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes scroll-hint { 0% { transform: translateY(0); opacity: 0; } 20%, 75% { opacity: 1; } 100% { transform: translateY(20px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .scroll-hint { transition: opacity 0.3s ease; transform: translate(-50%, 0); }
  .scroll-hint i::after { animation: none; top: 6px; }
}

/* "Sigue bajando" lateral (js/core.js → initSideHint): fijo a la derecha, centrado en vertical, mientras dura el
   tramo (home: de "Dale al REC." al final del estudio). Sin cristal ni píldora: el texto girado (de abajo arriba)
   junto a una línea de 1 px que se rellena con el progreso del tramo (scaleY, desde arriba) y por la que baja el
   punto naranja. En papel sobre negro y naranja; en negro sobre lo claro (.is-ink-dark), con 0,4 s de transición. */
.side-hint {
  --line: 26vh;
  position: fixed;
  top: 50%;
  right: calc(22px + env(safe-area-inset-right, 0px));
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f4f2ef;
  font: 400 11px / 1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translate3d(8px, -50%, 0);
  transition: opacity 0.6s cubic-bezier(0.32, 0.72, 0, 1), transform 0.6s cubic-bezier(0.32, 0.72, 0, 1), color 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}
.side-hint.is-on { opacity: 1; transform: translate3d(0, -50%, 0); }
/* (un halo suave del color contrario: el estudio es una foto, con zonas oscuras aunque la sección sea clara) */
.side-hint { filter: drop-shadow(0 0 4px rgb(11 9 9 / 0.55)); }
.side-hint.is-ink-dark { color: #0b0909; filter: drop-shadow(0 0 3px rgb(244 242 239 / 0.9)) drop-shadow(0 0 8px rgb(244 242 239 / 0.6)); }
.side-hint__txt { writing-mode: vertical-rl; transform: rotate(180deg); opacity: 0.7; white-space: nowrap; }
/* (recorta arriba y abajo, no a los lados: el punto mide 4 px) */
.side-hint__line { position: relative; display: block; width: 1px; height: var(--line); clip-path: inset(0 -3px); }
.side-hint__line::before { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0.22; }
.side-hint__line b { position: absolute; inset: 0; background: currentColor; opacity: 0.6; transform: scaleY(0); transform-origin: 50% 0; }
/* el punto: una caja del alto de la línea con el punto en su pie, que baja de -100 % a 0 */
.side-hint__line s { position: absolute; inset: 0; animation: side-hint 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.side-hint__line s::after { content: ""; position: absolute; left: -1.5px; bottom: 0; width: 4px; height: 4px; border-radius: 50%; background: #F35411; }
@keyframes side-hint { 0% { transform: translateY(-100%); opacity: 0; } 15%, 80% { opacity: 1; } 100% { transform: translateY(0); opacity: 0; } }
@media (max-width: 767px) {
  /* (más arriba que el centro: en el estudio, la etiqueta AF barre el borde derecho a media pantalla y la ficha
     ocupa la mitad de abajo; por encima de la etiqueta, el borde queda libre) */
  .side-hint { --line: 18vh; top: 24%; right: calc(8px + env(safe-area-inset-right, 0px)); gap: 8px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .side-hint { transition: opacity 0.3s ease, color 0.4s ease; transform: translate3d(0, -50%, 0); }
  .side-hint__line s { animation: none; display: none; }
}

/* ---------- AR-B: el texto SIEMPRE por encima del destello ----------
   El canvas del destello es fijo, z-index 1 (3 mientras sale del hero o salta por el bento: js/hero-star.js,
   js/page-star.js). Todo lo que se lee va en z-index 4, por encima de los dos; fotos, vídeos y fondos se quedan
   debajo (el destello pasa por encima de ellos). :where() = especificidad 0: si un texto ya tiene su posición
   (absolute, sticky…) o su z-index, manda el suyo. Las secciones que creaban contexto propio con el texto dentro
   (manifiesto de Servicios, pin de "Cómo trabajamos", columnas de Contacto…) se arreglan en su CSS. */
:where(main) :where(h1, h2, h3, h4, h5, h6, p, dt, dd, label, legend, figcaption, blockquote, .btn, .cta-pill) { position: relative; z-index: 4; }
:where(main) :where(.steps__n, .pf-next__kicker, .pf-next__title, .pf-peek__more, .reel__link, .pj-btn, .pj-link, .pj-filter, .pj-reel__title, .pj-reel__time, .sv-for__more, .sv-for__name, .ct__send) { position: relative; z-index: 4; }

/* ---------- AY-H: móvil (< 768 px) — zonas táctiles de 44 px y texto que se lee a 12 px como mínimo ----------
   Botones y filas: min-height 44. Enlaces de texto (emails, "Ver un proyecto de…"): la zona crece con padding y un
   margen negativo igual, así que no se mueve nada (el subrayado se recoloca a la misma distancia del texto). El texto
   para leer o para navegar pasa de 11 a 12 px; los rótulos decorativos en mono (timecodes, números, "FIN DE LA SESIÓN")
   se quedan a 11 px, con su contraste. (html delante: estas hojas se cargan antes que fin.css, nav.css o contact.css) */
@media (max-width: 767px) {
  html .skip { display: inline-flex; align-items: center; min-height: 44px; }
  html .nav { --nav-text: 12px; }
  html .fin { --fin-row: 44px; }
  html .fin__list a, html .fin__up { font-size: 12px; }
  html .fin__copy, html .sv-mail__copy, html .ct__copy { min-height: 44px; font-size: 12px; }
  html .fin__prize a, html .fin__again { min-height: 44px; }
  html .of-proj { align-items: center; min-height: 44px; }
  html .ct__email, html .sv-mail a { display: inline-block; padding-block: 11px; margin-block: -11px; }
  html .ct__email { background-position: 0 calc(100% - 11px); }
  html .cf__label { font-size: 13px; }
}
