/* DASSI — landing page. Sistema de diseño mínimo, sin dependencias externas. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #f7f5f2;
  --bg: oklch(97.5% 0.006 95);
  --bg-elevated: #ffffff;
  --bg-elevated: oklch(100% 0 0);
  --ink: #1c2330;
  --ink: oklch(22% 0.02 260);
  --ink-soft: #4c5566;
  --ink-soft: oklch(42% 0.03 260);
  --accent: #177996;
  --accent: oklch(53.7% 0.094 223.7);
  --accent-strong: #005470;
  --accent-strong: oklch(41% 0.094 223.7);
  --cta: #CB4500;
  --cta: oklch(57.3% 0.181 39.8);
  --cta-strong: #A71F00;
  --cta-strong: oklch(47% 0.181 39.8);
  --line: #dcdfe3;
  --line: oklch(88% 0.01 260);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bricolage Grotesque", var(--font-sans);

  --wrap: 72rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 1rem + 2vw, 2.5rem);
}

/* Etiqueta utilitaria: versalitas de la display en vez de la mono del sistema */
.hero-note, .service-tag, .why-kicker, .process-num, .contact-list {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

/* Accesibilidad transversal */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0.25rem;
  transition: top 150ms ease-out;
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid transparent;
  z-index: 10;
  transition: border-color 200ms, box-shadow 200ms;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px color-mix(in oklch, var(--ink) 40%, transparent); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
  flex-wrap: wrap;
}
.wordmark { display: flex; align-items: center; }
.logo { display: block; height: 2rem; width: auto; }
.site-nav {
  display: flex;
  gap: clamp(1rem, 0.6rem + 1vw, 2rem);
  font-size: 0.95rem;
}
.site-nav a { text-decoration: none; color: var(--ink-soft); position: relative; padding-block: 0.25rem; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--cta);
  transform: scaleX(0); transform-origin: left; transition: transform 250ms var(--ease-out);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after, .site-nav a.current::after { transform: scaleX(1); }
.site-nav a.current { color: var(--ink); }
.only-narrow { display: none; }
/* Móvil: una sola fila (logo + CTA). La página es corta y lineal; la nav sobra ahí. */
@media (max-width: 40rem) {
  .site-nav { display: none; }
  .header-inner { flex-wrap: nowrap; padding-block: 0.7rem; }
  .only-wide { display: none; }
  .only-narrow { display: inline; }
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 44px;
  transition: transform 180ms ease-out, background-color 180ms ease-out, border-color 180ms, box-shadow 180ms;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-cta { background: var(--cta); color: var(--bg-elevated); box-shadow: 0 6px 16px -8px var(--cta); }
.btn-cta:hover { background: var(--cta-strong); box-shadow: 0 10px 22px -10px var(--cta); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-small { padding: 0.55rem 1rem; font-size: 0.85rem; min-height: 40px; }
.btn-large { padding: 1rem 1.8rem; font-size: 1.05rem; }
/* Móvil: cuando los botones se apilan, ambos toman el ancho completo (mismo ancho, más fáciles de tocar). */
@media (max-width: 40rem) {
  .hero-actions, .contact-actions { flex-direction: column; }
  .hero-actions .btn, .contact-actions .btn { width: 100%; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5.5rem) clamp(3rem, 2rem + 4vw, 6rem); overflow: clip; }
.hero-inner { display: grid; gap: 2.5rem; align-items: center; }
.hero-content { display: grid; gap: 1.6rem; max-width: 40rem; }
@media (min-width: 56rem) {
  .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); column-gap: 3rem; }
}
.hero h1 {
  font-size: clamp(2.2rem, 1.2rem + 3.6vw, 3.6rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.025em;
}
/* Subrayado que se dibuja bajo "funcione mejor." */
.mark {
  background-image: linear-gradient(var(--cta), var(--cta));
  background-repeat: no-repeat;
  background-position: 0 92%;
  background-size: 100% 0.12em;
  padding-bottom: 0.04em;
}
.hero-sub {
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 40rem;
}
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero-note { font-size: 0.9rem; color: var(--ink-soft); }

.hero-art { width: 100%; height: auto; overflow: visible; max-width: 38rem; justify-self: center; }
/* Paralaje con `translate` (propiedad individual): se suma a las animaciones de `transform` sin pisarlas. */
.hero-art .layer { transition: translate 600ms var(--ease-out); }
.hero-art .layer-back  { translate: calc(var(--px, 0) * -6px) calc(var(--py, 0) * -6px); }
.hero-art .layer-mid   { translate: calc(var(--px, 0) * 6px)  calc(var(--py, 0) * 6px); }
.hero-art .layer-front { translate: calc(var(--px, 0) * 14px) calc(var(--py, 0) * 14px); }
.hero-art .pulse { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .hero-content > * { animation: rise 700ms var(--ease-out) both; }
  .hero-content > :nth-child(2) { animation-delay: 80ms; }
  .hero-content > :nth-child(3) { animation-delay: 160ms; }
  .hero-content > :nth-child(4) { animation-delay: 240ms; }
  .mark { animation: underline 900ms var(--ease-out) 500ms both; }

  /* Secuencia: las fuentes llegan torcidas y se ordenan, las líneas se dibujan, el panel aparece. */
  .hero-art .src { transform-box: fill-box; transform-origin: center; animation: settle 1100ms var(--ease-out) both; }
  .hero-art .s1 { --r: -7deg; animation-delay: 150ms; }
  .hero-art .s2 { --r: 5deg;  animation-delay: 250ms; }
  .hero-art .s3 { --r: -4deg; animation-delay: 350ms; }
  .hero-art .s4 { --r: 8deg;  animation-delay: 450ms; }
  .hero-art .link { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 900ms var(--ease-out) forwards; }
  .hero-art .l1 { animation-delay: 700ms; } .hero-art .l2 { animation-delay: 780ms; }
  .hero-art .l3 { animation-delay: 860ms; } .hero-art .l4 { animation-delay: 940ms; }
  .hero-art .l5 { animation-delay: 1250ms; }
  .hero-art .node { transform-box: fill-box; transform-origin: center; animation: pop 600ms var(--ease-out) 1050ms both; }
  .hero-art .node-ring { transform-box: fill-box; transform-origin: center; animation: ring 2.4s ease-out 1.8s infinite; }
  .hero-art .panel { animation: rise 800ms var(--ease-out) 1300ms both; }
  .hero-art .chart-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1400ms var(--ease-out) 1700ms forwards; }
  .hero-art .chart-area { animation: fade 800ms ease-out 2400ms both; }
  .hero-art .chart-dot { transform-box: fill-box; transform-origin: center; animation: pop 500ms var(--ease-out) 2900ms both; }
  .hero-art .alert { animation: rise 600ms var(--ease-out) 3300ms both; }
  .hero-art .orbit { transform-box: fill-box; transform-origin: center; animation: spin 60s linear infinite; }

  /* Datos que viajan de cada fuente al nodo y del nodo al panel, en bucle. */
  .hero-art .pulse { offset-rotate: 0deg; animation: travel 2.6s cubic-bezier(0.5, 0, 0.3, 1) infinite; }
  .hero-art .p1 { offset-path: path("M146 62 C 220 62, 220 212, 274 216"); animation-delay: 2.0s; }
  .hero-art .p2 { offset-path: path("M146 162 C 210 162, 230 214, 274 218"); animation-delay: 2.7s; }
  .hero-art .p3 { offset-path: path("M146 272 C 210 272, 230 224, 274 222"); animation-delay: 3.4s; }
  .hero-art .p4 { offset-path: path("M146 372 C 220 372, 220 228, 274 224"); animation-delay: 4.1s; }
  .hero-art .p5 { offset-path: path("M326 220 L 372 220"); animation-duration: 1.3s; animation-delay: 2.4s; }
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes underline { from { background-size: 0% 0.12em; } }
@keyframes settle { from { opacity: 0; transform: translateX(-24px) rotate(var(--r)); } 60% { opacity: 1; transform: rotate(var(--r)); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } }
@keyframes ring { from { opacity: 0.8; transform: scale(1); } to { opacity: 0; transform: scale(2.2); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes travel { 0% { offset-distance: 0%; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }

/* ---------- Secciones generales ---------- */
section { padding-block: clamp(3.5rem, 2rem + 4vw, 6.5rem); }
section h2 {
  font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.8rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-lede {
  margin-top: 0.8rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
  max-width: 38rem;
}

/* Aparición al scroll: la clase .reveal la agrega main.js, así sin JS todo queda visible. */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); }
  .reveal.in { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out) var(--d, 0ms), transform 700ms var(--ease-out) var(--d, 0ms); }
}

/* ---------- Por qué DASSI: editorial, sin tarjetas ---------- */
.why-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 2.5rem 3rem;
}
.why-grid article { border-top: 2px solid var(--ink); padding-top: 1.25rem; display: grid; gap: 0.6rem; align-content: start; }
.why-kicker {
  font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.why-grid h3 { font-size: 1.2rem; font-weight: 700; }
.why-grid p:not(.why-kicker) { color: var(--ink-soft); }

/* ---------- Servicios ---------- */
.services { background: var(--bg-elevated); border-block: 1px solid var(--line); }
.services-grid {
  margin-top: 2.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.25rem;
}
.service-card {
  --mx: 50%; --my: 0%;
  position: relative;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background:
    radial-gradient(22rem circle at var(--mx) var(--my), color-mix(in oklch, var(--accent) 9%, transparent), transparent 70%),
    var(--bg);
  transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out), border-color 250ms;
}
.service-card:hover { transform: translateY(-4px); border-color: color-mix(in oklch, var(--accent) 35%, var(--line)); box-shadow: 0 18px 36px -22px color-mix(in oklch, var(--ink) 35%, transparent); }
.service-card h3 { font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem); font-weight: 700; margin-bottom: 0.5rem; line-height: 1.2; }
.service-card p { color: var(--ink-soft); }
.service-tag {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-strong);
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  padding: 0.3rem 0.7rem;
  border-radius: 0.4rem;
}

/* Micro-ilustraciones: color desde tokens (los atributos SVG no leen variables CSS). */
.service-art { width: 7.5rem; height: 3.5rem; margin-bottom: 1.1rem; overflow: visible; }
.f-accent { fill: var(--accent); }
.f-cta { fill: var(--cta); }
.s-ink { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.s-line { stroke: var(--line); stroke-width: 1.5; }
.s-accent { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.s-cta { fill: none; stroke: var(--cta); stroke-width: 1.5; }
.art-auto .check { fill: none; stroke: var(--bg-elevated); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.art-auto .flow { stroke-dasharray: 3 4; }

@media (prefers-reduced-motion: no-preference) {
  /* Cada una se activa al pasar el cursor / foco, o una vez al entrar en pantalla (móvil). */
  .art-modulo .piece { transform: translateX(22px); transition: transform 600ms var(--ease-out); }
  .service-card:is(:hover, :focus-within, .play) .art-modulo .piece { transform: none; }

  .art-nube .ticks rect { transform-box: fill-box; transform-origin: bottom; }
  .service-card:is(:hover, :focus-within, .play) .art-nube .ticks rect { animation: tick 900ms var(--ease-out) both; }
  .art-nube .ticks rect:nth-child(2) { animation-delay: 50ms; } .art-nube .ticks rect:nth-child(3) { animation-delay: 100ms; }
  .art-nube .ticks rect:nth-child(4) { animation-delay: 150ms; } .art-nube .ticks rect:nth-child(5) { animation-delay: 200ms; }
  .art-nube .ticks rect:nth-child(6) { animation-delay: 250ms; } .art-nube .ticks rect:nth-child(7) { animation-delay: 300ms; }
  .art-nube .ticks rect:nth-child(8) { animation-delay: 350ms; } .art-nube .ticks rect:nth-child(9) { animation-delay: 400ms; }
  .art-nube .live-ring { transform-box: fill-box; transform-origin: center; animation: ring 2s ease-out infinite; }

  /* En reposo el gráfico está completo; al activarse vuelve a crecer desde abajo. */
  .art-datos .bars rect { transform-box: fill-box; transform-origin: bottom; }
  .service-card:is(:hover, :focus-within, .play) .art-datos .bars rect { animation: grow 700ms var(--ease-out) both; }
  .art-datos .bars rect:nth-child(2) { animation-delay: 60ms; } .art-datos .bars rect:nth-child(3) { animation-delay: 120ms; }
  .art-datos .bars rect:nth-child(4) { animation-delay: 180ms; } .art-datos .bars rect:nth-child(5) { animation-delay: 240ms; }

  .art-auto .gear { transform-box: fill-box; transform-origin: center; transition: transform 1200ms var(--ease-out); }
  .service-card:is(:hover, :focus-within, .play) .art-auto .gear { transform: rotate(180deg); }
  .art-auto .check { stroke-dasharray: 1; }
  .service-card:is(:hover, :focus-within, .play) .art-auto .check { animation: redraw 700ms var(--ease-out) 400ms both; }
  .service-card:is(:hover, :focus-within, .play) .art-auto .flow { animation: dash 700ms linear infinite; }
}
@keyframes tick { 0% { transform: scaleY(0.2); opacity: 0.3; } 60% { transform: scaleY(1.15); } 100% { transform: none; opacity: 1; } }
@keyframes dash { to { stroke-dashoffset: -7; } }
@keyframes grow { from { transform: scaleY(0.2); } }
@keyframes redraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---------- Cómo trabajamos: línea de tiempo ---------- */
.process-list {
  --fill: 1;
  position: relative;
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 2rem 2.5rem;
}
.process-list li { position: relative; padding-top: 4.25rem; }
.process-num {
  position: absolute; top: 0; left: 0;
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg); border: 2px solid var(--accent);
  color: var(--accent-strong); font-size: 1rem; font-weight: 700;
  z-index: 1;
}
.process-list h3 { margin-bottom: 0.5rem; font-size: 1.25rem; font-weight: 700; }
.process-list p { color: var(--ink-soft); }
/* Línea base y línea de progreso que se llena al hacer scroll (solo si hay 3 columnas). */
@media (min-width: 52rem) {
  .process-list::before, .process-list::after {
    content: ""; position: absolute; left: 1.5rem; right: 1.5rem; top: 1.5rem; height: 2px; background: var(--line);
  }
  .process-list::after { background: var(--accent); transform-origin: left; transform: scaleX(var(--fill)); }
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .process-list::after { animation: fill-line linear both; animation-timeline: view(); animation-range: entry 30% cover 55%; }
    }
  }
}
@keyframes fill-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Contacto ---------- */
.contact { position: relative; background: var(--ink); color: var(--bg); overflow: hidden; isolation: isolate; }
.contact-net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.55; }
.contact h2 { color: var(--bg-elevated); font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem); max-width: 22ch; }
.contact p { color: color-mix(in oklch, var(--bg) 80%, transparent); margin-top: 1rem; max-width: 36rem; font-size: 1.08rem; }
.contact-actions { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.btn-on-dark { color: var(--bg); border-color: color-mix(in oklch, var(--bg) 35%, transparent); }
.btn-on-dark:hover { border-color: var(--bg); }
.contact-list {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
  font-size: 1rem;
  color: color-mix(in oklch, var(--bg) 75%, transparent);
}
.contact-list a { color: var(--bg); text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--bg) 35%, transparent); text-underline-offset: 4px; }
.contact-list a:hover { text-decoration-color: var(--cta); }

/* Footer: cierre claro tras el bloque oscuro, con marca, secciones y contacto */
.site-footer { background: var(--bg); font-size: 0.95rem; }
.footer-inner {
  padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem) 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 1.5rem;
}
.footer-brand { grid-column: 1 / -1; display: grid; gap: 0.75rem; max-width: 22rem; }
.footer-brand .logo { height: 2.25rem; }
.footer-brand p { color: var(--ink-soft); text-wrap: balance; }
.footer-title {
  font-family: var(--font-display);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); margin-bottom: 0.75rem;
}
.footer-col ul { display: grid; gap: 0.5rem; color: var(--ink-soft); }
.footer-col a { color: var(--ink-soft); text-decoration: none; }
.footer-col a:hover { color: var(--cta); }
@media (min-width: 48rem) {
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding-block: 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-size: 0.85rem; color: var(--ink-soft);
}
.to-top { text-decoration: none; color: var(--ink-soft); min-height: 44px; display: inline-flex; align-items: center; gap: 0.35rem; }
.to-top:hover { color: var(--ink); }
.to-top span { transition: transform 200ms var(--ease-out); }
.to-top:hover span { transform: translateY(-3px); }
