/* X-Truth Technologies — estilos del portafolio.
   Todo sale de las variables de :root (colores, tamaños de letra y espacios):
   para cambiar el azul de la marca alcanza con tocar --accent. */

/* ---------- variables ---------- */
:root {
  --bg: #0b0b0c;          /* fondo negro */
  --surface: #151517;     /* un tono más claro, para separar bloques sin líneas */
  --surface-2: #222226;   /* paneles y botones cuadrados */
  --ink: #f3f3f1;         /* texto blanco */
  --muted: #a9a9a5;       /* texto secundario */
  --accent: #2f5bff;      /* azul de la marca: solo en las acciones */
  --accent-hover: #4a72ff;
  --accent-ink: #ffffff;
  --paper: #f3f3f1;       /* fondo blanco de Preguntas */
  --paper-ink: #0b0b0c;

  --font: "Clash Grotesk", "Segoe UI", system-ui, sans-serif;

  /* cinco tamaños de letra, nada más */
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  --step-display: clamp(2.6rem, 0.5rem + 7vw, 7.25rem);

  --margin: clamp(1.25rem, 3.4vw, 4.5rem);   /* margen de los costados */
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(6rem, 11vw, 11rem);       /* espacio entre secciones */
  --radius: 0;                               /* esquinas rectas en toda la página */

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-reveal: 800ms;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--step-body); line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, figure, ol, ul, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
strong { font-weight: 500; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
:target { scroll-margin-top: 1.5rem; }

.wrap { padding-inline: var(--margin); }
.display { font-size: var(--step-display); line-height: 0.95; letter-spacing: -0.03em; }
.head { font-size: var(--step-head); line-height: 1; letter-spacing: -0.025em; }
.lead { font-size: var(--step-lead); line-height: 1.25; letter-spacing: -0.01em; }
.small { font-size: var(--step-small); line-height: 1.45; }
.muted { color: var(--muted); }

.skip { position: absolute; left: var(--margin); top: -4rem; z-index: 10; background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem; text-decoration: none; }
.skip:focus { top: 0.75rem; }

/* ---------- botones y enlaces ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3.25rem; padding: 0 1.5rem;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--radius);
  font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
  touch-action: manipulation; user-select: none;
}
.button:active { transform: scale(0.97); }
.button-small { min-height: 2.75rem; padding: 0 1rem; }
.wa-icon { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }
.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.22em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease; }
.link-plain { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; transition: color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--accent-hover); }
  .link:hover { text-decoration-color: currentColor; }
  .link-plain:hover { color: var(--muted); }
}

/* ---------- barra de arriba ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1.1rem; }
.wordmark { font-weight: 500; text-decoration: none; letter-spacing: -0.01em; }
.nav { display: none; gap: 2rem; margin-left: auto; }
.nav a { text-decoration-line: underline; }
@media (min-width: 60em) { .nav { display: flex; } }

/* ---------- inicio ---------- */
.hero { min-height: calc(100svh - 4.75rem); display: flex; flex-direction: column; padding-top: clamp(1rem, 5vh, 3.5rem); }
.hero h1 { max-width: 14ch; box-sizing: content-box; }
.strip {
  --strip-h: clamp(13.75rem, 34vh, 21.25rem);
  position: relative; /* así el script mide cada pantalla desde el borde de la tira */
  display: flex; gap: 10px; height: var(--strip-h); margin-top: clamp(1.75rem, 5vh, 3.5rem);
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: var(--margin); scroll-padding-inline: var(--margin);
  overscroll-behavior-x: contain;
}
.strip::-webkit-scrollbar { display: none; }
.frame { flex: none; height: 100%; overflow: hidden; scroll-snap-align: center; background: var(--surface); }
.frame img, .frame video { height: 100%; width: auto; }
.frame video { aspect-ratio: 360 / 780; object-fit: cover; }
.strip-live .frame { filter: brightness(0.55); transition: filter 420ms ease; }
.strip-live .frame.is-lit, .strip-live .frame:focus-visible { filter: none; }
@media (hover: hover) and (pointer: fine) { .strip-live .frame:hover { filter: none; } }
.strip-title { margin-top: 0.75rem; min-height: 1.45em; color: var(--muted); transition: transform 420ms var(--ease-out); }
.strip-live + .strip-title { padding-inline: 0; }
.hero-foot { margin-top: auto; padding-top: 2rem; padding-bottom: clamp(1.5rem, 5vh, 2.75rem); display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.hero-line { max-width: 40ch; }

/* ---------- trabajos ---------- */
.work { display: grid; grid-template-columns: minmax(9rem, 13%) minmax(0, 1fr); column-gap: var(--gutter); padding-block: var(--section); }
.rail { position: sticky; top: 1.5rem; align-self: start; display: grid; gap: 0.75rem; }
.rail .head { font-size: var(--step-lead); }
.project + .project { margin-top: clamp(3.5rem, 6vw, 5rem); }
.pstrip { display: flex; gap: 8px; height: 190px; overflow: hidden; margin-right: calc(var(--margin) * -1); text-decoration: none; }
.pstrip img { height: 100%; width: auto; flex: none; transition: opacity 300ms ease; }
.projects:has(.project:hover) .project:not(:hover) .pstrip img { opacity: 0.4; }
.pline { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; margin-top: 0.75rem; }
.pname { font-size: inherit; font-weight: 500; }
.pname a { text-decoration: none; }
.pkind { color: var(--muted); }
.pyear { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.pbody { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 3rem; margin-top: 1.25rem; }
.pbody p { max-width: 58ch; }

/* ---------- servicios ---------- */
.services { background: var(--surface); padding-block: var(--section); }
.services-in { padding-left: max(var(--margin), 22vw); }
.services .head { margin-bottom: 2.5rem; }

.try { max-width: 47.5rem; display: grid; gap: 0.9rem; margin-bottom: clamp(4rem, 8vw, 6.5rem); }
.try-label { font-size: var(--step-lead); line-height: 1.25; }
.field {
  width: 100%; min-height: 3.5rem; padding: 0.75rem 1rem;
  background: var(--surface-2); color: var(--ink); border: 0; border-radius: var(--radius);
  font-size: max(1rem, var(--step-body));
  transition: background-color var(--t-hover) ease;
}
.field::placeholder { color: var(--muted); opacity: 1; }
.field:focus { background: #2a2a2f; }
.rubros { display: flex; flex-wrap: wrap; gap: 6px; }
.rubros legend { margin-bottom: 0.5rem; }
.rubros label { position: relative; }
.rubros input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rubros span {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem;
  background: var(--surface-2); color: var(--ink); cursor: pointer;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.rubros input:checked + span { background: var(--ink); color: var(--bg); }
.rubros input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rubros label:active span { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .rubros input:not(:checked) + span:hover { background: #2e2e33; } }

.module { display: grid; grid-template-columns: 22.5rem minmax(0, 34ch); column-gap: 1.75rem; align-items: start; }
.module + .module { margin-top: clamp(4.5rem, 8vw, 7rem); }
.mtext { display: grid; gap: 0.8rem; }
.mtext .lead { font-weight: 500; }
.panel { overflow: hidden; }
.try-cta { margin-top: clamp(4.5rem, 8vw, 7rem); display: grid; justify-items: start; gap: 0.9rem; max-width: 47.5rem; }

/* Las muestras imitan lo que el cliente ve en Google, en WhatsApp y en el navegador,
   por eso usan la letra y los colores de esas pantallas. */
.panel-light { background: #ffffff; color: #202124; font-family: Arial, Helvetica, sans-serif; }
.serp { padding: 1.25rem 1.25rem 1.4rem; display: grid; gap: 0.45rem; }
.serp-site { display: flex; align-items: center; gap: 0.75rem; font-size: 14px; line-height: 1.35; color: #202124; }
.serp-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #e8eaed; color: #3c4043; display: grid; place-items: center; font-size: 13px; }
.serp-url { color: #4d5156; font-size: 12.5px; word-break: break-all; }
.serp-title { color: #1a0dab; font-size: 20px; line-height: 1.3; }
.serp-desc { color: #4d5156; font-size: 14px; line-height: 1.55; }

.panel-chat { background: #0b141a; color: #e9edef; font-family: Arial, Helvetica, sans-serif; }
.chat { padding: 0 0 1.1rem; display: grid; gap: 0.5rem; font-size: 14.5px; line-height: 1.4; }
.chat-head { display: flex; align-items: center; gap: 0.7rem; background: #202c33; padding: 0.7rem 1rem; margin-bottom: 0.4rem; line-height: 1.3; }
.chat-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #2f5bff; color: #fff; display: grid; place-items: center; font-size: 14px; }
.chat-status { color: #8696a0; font-size: 13px; }
.msg { max-width: 84%; padding: 0.45rem 0.6rem 0.35rem; border-radius: 8px; display: grid; }
.msg-in { background: #202c33; margin-left: 0.9rem; justify-self: start; border-top-left-radius: 0; }
.msg-out { background: #005c4b; margin-right: 0.9rem; justify-self: end; border-top-right-radius: 0; }
.msg-time { justify-self: end; color: #d1dbd8; font-size: 11.5px; margin-top: 0.15rem; }

.browser { padding: 1rem 1.1rem 1.25rem; display: grid; gap: 0.9rem; }
.browser-bar { display: flex; align-items: center; gap: 0.6rem; background: #f1f3f4; border-radius: 999px; padding: 0.55rem 1rem; font-size: 14px; color: #202124; }
.browser-note { display: flex; align-items: center; gap: 0.5rem; font-size: 15px; color: #188038; }
.browser-sub { color: #5f6368; font-size: 13.5px; line-height: 1.5; padding-left: 1.6rem; }
.lock { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* ---------- cómo trabajamos ---------- */
.process { padding-block: var(--section); }
.process-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.row-buttons { display: flex; gap: 8px; }
.square { width: 48px; height: 48px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.square svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.25; }
.square:active { transform: scale(0.94); }
.square:disabled { opacity: 0.4; cursor: default; }
@media (hover: hover) and (pointer: fine) { .square:not(:disabled):hover { background: var(--ink); color: var(--bg); } }
.progress { margin-top: 1.5rem; }
.progress-track { display: block; height: 6px; background: var(--surface-2); overflow: hidden; }
.progress-fill { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(var(--p, 0.25)); transition: transform 200ms linear; }
.row {
  display: flex; gap: 32px; margin-top: 2.5rem; padding: 0 var(--margin) 0.5rem; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--margin); scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.row::-webkit-scrollbar { display: none; }
.moment { flex: 0 0 17.5rem; scroll-snap-align: start; display: flex; flex-direction: column; }
.moment-title { font-size: var(--step-body); font-weight: 500; }
.moment p { margin-top: 0.4rem; color: var(--muted); min-height: 4.4em; }
.moment img { margin-top: var(--gap, 64px); width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; background: var(--surface); }

/* ---------- preguntas ---------- */
.faq { background: var(--paper); color: var(--paper-ink); padding-block: var(--section); }
.faq-in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.faq .head { grid-column: 1 / 4; }
.faq-text { grid-column: 5 / 13; columns: 2; column-gap: 56px; }
.faq-text p { break-inside: avoid; margin-bottom: 1.25rem; line-height: 1.55; }
.faq ::selection { background: var(--paper-ink); color: var(--paper); }

/* ---------- contacto ---------- */
.contact { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 1rem; padding-block: clamp(6rem, 11vw, 10rem) clamp(5rem, 8vw, 7.5rem); align-items: start; }
.contact-line { grid-column: 1 / 6; max-width: 30ch; }
.contact-pic { grid-column: 8 / 10; width: 10rem; height: auto; aspect-ratio: 1; object-fit: cover; object-position: top; background: var(--surface); }
.contact-links { grid-column: 10 / 13; display: grid; gap: 0.6rem; align-content: start; }
.contact-q { font-size: var(--step-body); font-weight: 500; margin-bottom: 0.6rem; }
.contact-links .link-plain { font-size: var(--step-body); }
.contact-place { grid-column: 10 / 13; }

/* ---------- pie ---------- */
.foot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; padding: 8px; }
.tile { background: var(--surface); padding: 1.25rem; min-height: 13.75rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; text-decoration: none; }
.tile-statement { grid-column: 1 / 5; }
.tile-statement p:first-child { font-size: var(--step-lead); line-height: 1.25; max-width: 22ch; }
.tile-nav { grid-column: 5 / 8; justify-content: flex-start; gap: 0.4rem; }
.tile-nav a { text-decoration-line: underline; text-decoration-color: transparent; }
.tile-place { grid-column: 8 / 10; justify-content: flex-start; gap: 0.2rem; }
.tile-mail { grid-column: 10 / 13; justify-content: flex-end; }
.foot-phone { font-size: var(--step-lead); }
.tile-mark { grid-column: 1 / 9; min-height: 20rem; background: var(--ink); color: var(--bg); align-items: center; justify-content: center; }
.tile-mark .display { letter-spacing: -0.04em; }
.tile-go { grid-column: 9 / 13; min-height: 20rem; background: var(--accent); color: var(--accent-ink); transition: background-color var(--t-hover) ease; }
.tile-go .lead { max-width: 12ch; font-weight: 500; }
.arrow { width: 48px; height: 48px; align-self: flex-end; fill: none; stroke: currentColor; stroke-width: 4; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .tile-go:hover { background: var(--accent-hover); }
  .tile-go:hover .arrow { transform: translate(4px, -4px); }
}
.tile-go:active .arrow { transform: translate(4px, -4px); }

/* ---------- botón flotante de WhatsApp ---------- */
.float-wa {
  position: fixed; z-index: 20; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 3.25rem; padding: 0 1.1rem;
  background: var(--accent); color: var(--accent-ink); font-weight: 500; text-decoration: none;
  outline: 2px solid var(--bg); outline-offset: 0;
  transform: translateY(160%); transition: transform 360ms var(--ease-out), background-color var(--t-hover) ease;
}
.float-wa.is-on { transform: none; }
.float-wa:active { transform: scale(0.96); }
.float-wa:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .float-wa:hover { background: var(--accent-hover); } }
html:not(.js) .float-wa { transform: none; }

/* ---------- tablet ---------- */
@media (max-width: 64em) {
  .services-in { padding-left: var(--margin); }
  .faq .head { grid-column: 1 / -1; margin-bottom: 2rem; }
  .faq-text { grid-column: 1 / -1; }
  .contact-line { grid-column: 1 / -1; margin-bottom: 1.5rem; }
  .contact-pic { grid-column: 1 / 3; width: 100%; }
  .contact-links, .contact-place { grid-column: 4 / -1; }
  .contact-place { grid-row: 3; }
}

/* ---------- celular ---------- */
@media (max-width: 47.99em) {
  .hero { min-height: calc(100svh - 4.5rem); padding-top: 0.75rem; }
  .strip { --strip-h: 40svh; gap: 8px; }
  .frame-wide { display: none; }
  .hero-foot { flex-direction: column; align-items: stretch; gap: 1.25rem; padding-top: 1.25rem; }
  .hero-foot .button { width: 100%; }

  .work { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; margin-bottom: 1.75rem; }
  .pstrip { height: 120px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .pstrip::-webkit-scrollbar { display: none; }
  .pstrip img { scroll-snap-align: start; }
  .pline { grid-template-columns: 1fr auto; }
  .pkind { display: none; }
  .pbody .link-plain { padding-block: 0.4rem; }

  .module { grid-template-columns: minmax(0, 1fr); row-gap: 1rem; }
  .module + .module { margin-top: 4rem; }
  .panel { max-width: 22.5rem; }

  .row-buttons { display: none; }
  .row { gap: 16px; }
  .moment { flex-basis: 72vw; }
  .moment img { margin-top: calc(var(--gap, 64px) * 0.45); }

  .faq-text { columns: 1; }
  .faq-text p { margin-bottom: 1.1rem; }

  .contact { grid-template-columns: 6rem minmax(0, 1fr); column-gap: 1rem; row-gap: 1.5rem; }
  .contact-line { grid-column: 1 / -1; max-width: none; margin-bottom: 0; }
  .contact-pic { grid-column: 1; width: 6rem; }
  .contact-links { grid-column: 2; }
  .contact-place { grid-column: 1 / -1; grid-row: auto; }

  .foot { grid-template-columns: 1fr 1fr; grid-auto-flow: dense; gap: 6px; padding: 6px; }
  .tile { min-height: 9rem; }
  .tile-mark { grid-column: 1 / -1; order: -2; min-height: 10rem; }
  .tile-go { grid-column: 1 / -1; order: -1; min-height: 10rem; }
  .tile-nav { grid-column: 1; order: 1; }
  .tile-mail { grid-column: 2; order: 2; }
  .tile-place { grid-column: 1; order: 3; }
  .tile-statement { grid-column: 2; order: 4; }
  .tile-statement p:first-child { font-size: var(--step-body); }
  .foot-phone { font-size: var(--step-body); }
}

/* ---------- movimiento (sin JavaScript, todo queda visible) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(20px); animation: rise var(--t-reveal) var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
  .js .strip .frame { opacity: 0; transform: translateX(48px); animation: glide 1000ms var(--ease-out) forwards; animation-delay: calc(var(--f, 0) * 70ms + 200ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .strip-live .frame.is-lit img { animation: drift 9s ease-in-out infinite alternate; }
  .pstrip img { transition: opacity 300ms ease, transform 600ms var(--ease-out); }
  .project:hover .pstrip img { transform: translateY(-4px); }
  .msg-out.is-new { animation: pop 420ms var(--ease-out); }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes glide { to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.05); } }
@keyframes pop { from { opacity: 0.2; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .strip, .row { scroll-behavior: auto; }
  .float-wa { transition: none; }
}
