/* Thor System S.A.S. — sobrio: blanco, negro forja, rojo de marca y líneas finas */

:root {
  --white: #ffffff;
  --ink: #0d0d10;
  --ink-soft: #44454c;
  --line: #d8d8dc;
  --tint: #f5f5f6;
  --red: #d9141c;
  --red-deep: #b50f16;
  --red-hot: #ff3b30;
  --black: #0d0d10;
  --radius: 3px;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* Ajuste suave: la página se acomoda al inicio de una sección si pasa cerca */
html { scroll-padding-top: 69px; scroll-snap-type: y proximity; }
.hero, main section { scroll-snap-align: start; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); }
a:hover { color: var(--black); }

:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.brand:hover { color: var(--ink); }
.seal {
  width: 46px;
  height: 46px;
  flex: none;
}
.seal img { width: 100%; height: 100%; object-fit: contain; display: block; }

.site-header nav { display: flex; align-items: center; gap: 26px; }
.site-header nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}
.site-header nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px; width: 0;
  background: var(--ink);
  transition: width .2s ease;
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a:hover::after { width: 100%; }
.site-header nav a.nav-cta {
  background: var(--red);
  color: #fff;
  padding: 9px 18px;
  border-radius: var(--radius);
  transition: background .15s;
}
.site-header nav a.nav-cta::after { display: none; }
.site-header nav a.nav-cta:hover { background: var(--red-deep); color: #fff; }
.nav-toggle { display: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  padding: 13px 24px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--red);
  border: 1.5px solid var(--red);
  border-radius: var(--radius);
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { color: #fff; background: var(--red-deep); border-color: var(--red-deep); }
.btn.ghost { color: var(--ink); background: transparent; border-color: var(--ink); }
.btn.ghost:hover { color: #fff; background: var(--ink); border-color: var(--ink); }

.actions { display: flex; gap: 12px 16px; flex-wrap: wrap; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 69px);
  min-height: calc(100svh - 69px);
  padding: 72px 0 80px;
  background: url("hero.webp") center / cover no-repeat var(--black);
  color: #fff;
}
.hero::before {
  /* Va sobre las pantallas animadas y mantiene legible el texto */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(90deg, rgba(13, 13, 16, .9) 0%, rgba(13, 13, 16, .66) 50%, rgba(13, 13, 16, .22) 100%);
}
.hero-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#screens { z-index: -3; }
#letters { z-index: -1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.95rem);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -.012em;
  text-wrap: balance;
  margin: 0 0 20px;
}
.hero p {
  color: #fff;
  max-width: 520px;
  font-size: 1.125rem;
  margin: 0 0 30px;
}
.hero .since {
  margin: 0 0 14px;
  font-size: .95rem;
  font-weight: 500;
}
/* Sobre negro, el botón de contorno y el foco pasan a blanco */
.hero :focus-visible { outline-color: #fff; }
.hero .btn.ghost { color: #fff; background: rgba(13, 13, 16, .55); border-color: #fff; }
.hero .btn.ghost:hover { color: var(--ink); background: #fff; border-color: #fff; }

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
}
.medal {
  position: relative;
  width: clamp(240px, 36vw, 420px);
  aspect-ratio: 1;
}
/* El resplandor separa el borde negro del escudo del fondo negro */
.medal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 26px rgba(255, 59, 48, .5));
}
.ring {
  position: absolute;
  top: 50%; left: 50%;
  width: clamp(240px, 36vw, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--red);
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Secuencia de entrada: el martillo cae, golpea, la onda se expande */
@keyframes strike {
  0%   { opacity: 0; transform: translateY(-190px) rotate(-5deg) scale(1.25); }
  50%  { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
  60%  { transform: scale(.955); }
  74%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}
@keyframes shock {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.1); }
}
@keyframes shake {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-3px, 2px); }
  80% { transform: translate(2px, -1px); }
}

.js .medal { animation: strike 1s ease-in .2s both; }
.js .ring  { animation: shock 1s ease-out .7s both; }
.js .ring + .ring { animation-delay: .86s; }
.js .stage { animation: shake .45s ease-out .7s; }

/* ---------- Secciones ---------- */
/* Cada sección ocupa al menos una pantalla, para que se sienta como una página propia */
section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 69px);
  min-height: calc(100svh - 69px);
  padding: 84px 0;
  background: var(--white);
}
section.alt { background: var(--tint); }
section:focus, .hero:focus { outline: none; }

/* Cambio de sección: la actual se va y la nueva entra */
main { transition: opacity .18s ease, transform .18s ease; }
main.is-leaving { opacity: 0; transform: translateY(-16px); }
main.is-entering { opacity: 0; transform: translateY(24px); transition: none; }


h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -.008em;
  margin: 0 0 12px;
}
h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0 0 8px; font-size: 1.3rem; }
.lead { color: var(--ink-soft); max-width: 680px; margin: 0 0 42px; }

/* Revelado al hacer scroll */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* Servicios: un solo bloque con divisiones finas, foto y servicios de cada tema */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
}
.service {
  position: relative;
  display: flex;
  flex-direction: column;
  transition: background .2s;
}
.service + .service { border-left: 1px solid var(--line); }
.service::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.service:hover { background: var(--tint); }
.service:hover::before { transform: scaleX(1); }
.service img,
.app-side img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
}
.service:first-child img { object-position: 50% 0; } /* La cámara está arriba en la foto */
.app-side img { margin-bottom: 18px; }
.service-body {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 42px 32px 30px;
}
.service-icon {
  position: absolute;
  top: -24px;
  left: 32px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--red);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 50%;
}
.service-icon svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.service h3 { font-size: 1.5rem; margin-bottom: 6px; }
.service .tagline { margin: 0 0 10px; color: var(--ink); font-size: 1.09rem; font-weight: 500; line-height: 1.4; }
.service p { margin: 0 0 16px; color: var(--ink-soft); }
.service-link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 12px;
  color: var(--red);
  font-weight: 500;
  text-decoration: none;
}
.service-link:hover { color: var(--red-deep); text-decoration: underline; text-underline-offset: 4px; }
.services-note { margin: 12px 0 0; color: var(--ink-soft); font-size: .9rem; }

/* Cierre de servicios: orienta a quien aún no sabe qué necesita */
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin-top: 48px;
  padding: 30px 32px;
  background: var(--black);
  color: #fff;
}
.cta-band :focus-visible { outline-color: #fff; }
.cta-band h3 { margin-bottom: 4px; }
.cta-band p { margin: 0; }

/* Aplicaciones: una fila por programa, sin cajas */
.apps { border-top: 1px solid var(--ink); }
.app {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 64px;
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}
.app .name { font-size: 1.65rem; line-height: 1.2; margin: 0; }
.app .kind { color: var(--red); font-weight: 500; margin: 4px 0 14px; }
.app .desc { color: var(--ink-soft); margin: 0 0 22px; }
.features { margin: 0; padding: 0; list-style: none; }
.features li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.features li:first-child { padding-top: 0; }
.features li:last-child { border-bottom: 0; }
/* Flujo de Kerub: pasos numerados con foto pequeña */
.flow { grid-column: 1 / -1; }
.flow h4 { margin: 0 0 14px; font-family: var(--font-body); font-size: 1.05rem; font-weight: 600; }
.flow ol {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: paso;
}
.flow ol > li { position: relative; display: flex; flex-direction: column; counter-increment: paso; }
.flow ol > li::before {
  content: counter(paso);
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 600;
}
.flow img { display: block; width: 100%; height: 118px; margin-bottom: 10px; object-fit: cover; }
.flow strong { font-weight: 600; line-height: 1.3; }
.flow span { margin-top: 2px; color: var(--ink-soft); font-size: .92rem; line-height: 1.4; }
.flow-safe { margin-top: 26px; padding: 24px 26px; background: var(--white); border: 1px solid var(--line); }
.flow-safe p { margin: 0 0 12px; color: var(--ink-soft); }
.flow-safe ul.checks { margin-bottom: 12px; }
.app-user { margin: 14px 0 0; font-size: .92rem; }
.app-user a { color: var(--ink-soft); }
.app-user a:hover { color: var(--red); }
.doc .kind { margin: 0 0 8px; color: var(--red); font-weight: 500; }
.doc .actions { margin-top: 24px; }
.apps-next { max-width: 760px; margin: 30px 0 0; color: var(--ink-soft); font-size: .97rem; }

ul.checks { padding: 0; list-style: none; margin: 0; }
ul.checks li { padding-left: 20px; position: relative; margin-bottom: 9px; color: var(--ink); }
ul.checks li::before {
  content: "";
  position: absolute;
  left: 2px; top: .68em;
  width: 6px; height: 6px;
  background: var(--red);
}

/* Clientes */
.client-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.client {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 16px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  text-align: center;
  transition: border-color .15s;
}
.client:hover { border-color: var(--ink); }
.client img {
  width: 100%;
  height: 72px;
  object-fit: contain;
}
.client-name-logo {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 72px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
}
.client-name { color: var(--ink-soft); font-size: .9rem; line-height: 1.3; }
/* Su logo disponible es blanco: se muestra sobre negro sin alterarlo */
.client-dark { background: var(--black); border-color: var(--black); }
.client-dark .client-name { color: #fff; }
.client-note { margin: 18px 0 0; color: var(--ink-soft); font-size: .9rem; }

/* WhatsApp */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 22px;
}
.panel {
  height: 100%;
  padding: 32px 30px;
  background: var(--white);
  border: 1px solid var(--line);
}
.panel h3 { margin-bottom: 16px; }
.contact-paths { margin: 30px 0 40px; }
.contact-paths p { margin: 0 0 22px; color: var(--ink-soft); }
.panel h4 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 18px 0 8px;
  color: var(--red);
}
.panel h4:first-of-type { margin-top: 0; }

/* Datos */
dl.facts { margin: 0; max-width: 780px; }
dl.facts div {
  display: flex;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
dl.facts div:first-child { border-top: 1px solid var(--ink); }
dl.facts dt { font-weight: 600; min-width: 170px; color: var(--ink); }
dl.facts dd { margin: 0; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 34px 0;
  font-size: .95rem;
}
.site-footer a { color: var(--ink); font-weight: 500; }
.site-footer a:hover { color: var(--red); }
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* ---------- Documentos legales ---------- */
.doc { padding-top: 56px; padding-bottom: 80px; max-width: 820px; }
.doc h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 8px;
}
.doc .updated { color: var(--ink-soft); margin: 0 0 34px; }
.doc h2 { font-size: 1.35rem; margin: 38px 0 10px; }
.doc p, .doc li { color: var(--ink); }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 7px; }
.doc .credit-city { font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stage { order: -1; min-height: 0; }
  .medal, .ring { width: clamp(170px, 30vw, 260px); }
  .hero {
    /* El espacio inferior deja ver al operador frente a las pantallas */
    padding: 28px 0 240px;
    background-image: url("hero-movil.webp");
    background-position: center bottom;
    background-size: max(100%, 540px) auto;
  }
  .hero::before { background: linear-gradient(to top, rgba(13, 13, 16, .04) 0, rgba(13, 13, 16, .12) 190px, rgba(13, 13, 16, .88) 300px, rgba(13, 13, 16, .88) 100%); }
  .hero-grid { gap: 22px; }
  .app { grid-template-columns: 1fr; }
  .flow ol { grid-template-columns: repeat(2, 1fr); }
  .services { grid-template-columns: 1fr; }
  .service + .service { border-top: 1px solid var(--line); border-left: 0; }
  .client-grid { grid-template-columns: repeat(3, 1fr); }
  .hero p { font-size: 1.0625rem; margin-bottom: 24px; }
  .hero .since { margin-bottom: 10px; }

  /* Sin botón de menú (páginas legales o sin JS) los enlaces bajan a otra fila */
  .site-header .wrap { flex-wrap: wrap; }
  .site-header nav { flex-wrap: wrap; gap: 8px 14px; padding-bottom: 10px; }
  html:not(.js) .site-header { position: static; }
  html:not(.js) .site-header .wrap { padding-top: 8px; }
  html:not(.js) .site-header nav a { font-size: .95rem; }
  html:not(.js) .site-header nav a.nav-cta { padding: 7px 14px; }

  /* Con botón de menú */
  .js .nav-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--white);
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    cursor: pointer;
  }
  .nav-toggle svg {
    width: 24px; height: 24px;
    fill: none;
    stroke: var(--black);
    stroke-width: 1.75;
    stroke-linecap: round;
  }
  .nav-toggle .close,
  .nav-toggle[aria-expanded="true"] .bars { display: none; }
  .nav-toggle[aria-expanded="true"] .close { display: block; }

  .js .nav-toggle + nav { display: none; }
  .js .nav-toggle + nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    left: 0; right: 0; top: 100%;
    padding: 8px 22px 22px;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    background: var(--white);
    border-bottom: 1px solid var(--line);
  }
  .js .nav-toggle + nav a { padding: 12px 0; }
  .js .nav-toggle + nav a::after { display: none; }
  .js .nav-toggle + nav a:not(.nav-cta):hover { color: var(--red); }
  .js .nav-toggle + nav a.nav-cta { margin-top: 10px; padding: 13px 20px; text-align: center; }
}
@media (max-width: 600px) {
  section { padding: 64px 0; }
  .service-body { padding: 40px 22px 26px; }
  .service-icon { left: 22px; }
  .client-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .contact-paths .panel { padding: 26px 20px; }
  .contact-paths .btn { padding-left: 20px; padding-right: 20px; }
  .cta-band { padding: 26px 22px; }
  dl.facts div { flex-direction: column; gap: 2px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .js .medal { opacity: 1 !important; }
}
