/* Afilab — hoja de estilos única. Sin frameworks, sin fuentes externas. */

:root {
  --paper: #f5f6f7;
  --ink: #14171a;
  --graphite: #5a6168;
  --line: #d6d9dd;
  --accent: #2b3cff;
  --accent-dark: #1b28c9;
  --white: #ffffff;
  --max: 1100px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 0.75rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Cabecera ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand img { height: 2.75rem; width: auto; }

.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--accent-dark); text-decoration: underline; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

/* ---------- Botones ---------- */

.btn {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--white);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); }

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

.nav .btn { color: var(--white); padding: 0.55rem 1.1rem; }
.nav .btn:hover { color: var(--white); text-decoration: none; }

/* ---------- Hero ---------- */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem); }

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.03em; margin: 0; }

h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.75rem);
  font-weight: 750;
}

.lead {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  color: var(--graphite);
  max-width: 34rem;
  margin: 1.5rem 0 2rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-note { margin: 1.75rem 0 0; color: var(--graphite); font-size: 0.95rem; }

.hero-art img {
  width: 100%;
  /* El fondo blanco de la foto se funde con el fondo de la página */
  mix-blend-mode: multiply;
}

/* ---------- Secciones ---------- */

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.section--white { background: var(--white); }

.section h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 720;
  max-width: 22ch;
}

.section-intro {
  color: var(--graphite);
  max-width: 38rem;
  margin: 1rem 0 0;
}

/* Servicios: filas, no tarjetas */
.rows { margin: 2.5rem 0 0; padding: 0; list-style: none; }

.row {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1.3fr;
  gap: 1rem 3rem;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}
.row:last-child { border-bottom: 1px solid var(--line); }
.row h3 { font-size: 1.6rem; font-weight: 700; }
.row p { margin: 0 0 0.75rem; max-width: 36rem; }
.row p:last-child { margin-bottom: 0; }

/* Ilustraciones de los servicios: mismo lenguaje de dibujo técnico que la portada */
.ill { width: 100%; max-width: 14rem; justify-self: start; }
.ill svg { display: block; width: 100%; height: auto; }
.ill .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ill .face { fill: var(--white); }
.ill .face-only { fill: var(--white); stroke: none; }
.ill .face-soft { fill: #e6e8eb; }
.ill .face-dark { fill: #cfd3d9; }
.ill .layers { stroke-width: 1.4; }
.ill .layer-new { fill: #e3e6ff; stroke: var(--accent); stroke-width: 1.6; }
.ill .thin { fill: none; stroke: var(--graphite); stroke-width: 1.2; }
.ill .acc { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.ill .acc--thick { stroke-width: 3; }
.ill .accfill { fill: var(--accent); }
.ill .beam { fill: var(--accent); fill-opacity: 0.14; stroke: none; }
.ill .dots { fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 0.1 6; stroke-linecap: round; }
.ill .dots--fine { stroke-width: 2; stroke-dasharray: 0.1 7; opacity: 0.7; }
.ill .center { fill: none; stroke: var(--graphite); stroke-width: 1; stroke-dasharray: 10 3 2 3; }
.ill .ext { fill: none; stroke: var(--accent); stroke-width: 1; }
.ill .dim { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.ill text { font: 600 13px system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; fill: var(--accent-dark); }

/* Equipo y materiales */
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 2.5rem 0 0; }
.specs > div {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 1.1rem;
  align-items: start;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}
.specs > div:nth-child(odd) { padding-right: 2rem; }
.specs dt { grid-column: 2; font-weight: 700; margin: 0 0 0.25rem; }
.specs dd { grid-column: 2; margin: 0; color: var(--graphite); max-width: 28rem; }

/* Pictogramas pequeños: mismo trazo que las ilustraciones de los servicios */
.ill--pic { width: 3.5rem; max-width: none; grid-row: 1 / span 2; justify-self: start; }
.ill--pic .line { stroke-width: 2.4; }
.ill--pic .acc { stroke-width: 2.4; }
.ill--pic .thin { stroke-width: 1.8; }
.ill--pic .layer-new { stroke-width: 2.2; }
.ill--pic .dots { stroke-width: 2.8; stroke-dasharray: 0.1 5; }

/* Bobinas de filamento vistas de frente, en blanco y negro */
.ill--pic .hair { fill: none; stroke: var(--graphite); stroke-width: 1.2; }
.ill--pic .dot { fill: var(--ink); stroke: none; }

/* Pasos: sí es una secuencia real */
.steps { list-style: none; counter-reset: paso; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.steps li { counter-increment: paso; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before {
  content: counter(paso);
  display: block;
  font-size: 2rem;
  font-weight: 750;
  color: var(--accent-dark);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.steps h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.steps p { margin: 0; color: var(--graphite); font-size: 0.98rem; }

/* Galería / Instagram */
.feed { margin: 2.5rem 0 1.5rem; }

.feed-fallback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: 1.75rem;
  border: 1.5px solid var(--line);
  background: var(--paper);
}
.feed-fallback p { margin: 0; max-width: 28rem; }

/* Llamada final */
.cta { background: var(--ink); color: var(--white); border-top: 0; }
.cta h2 { color: var(--white); max-width: 20ch; }
.cta p { color: #c9ced3; max-width: 34rem; margin: 1rem 0 2rem; }
.cta .btn { background: var(--white); border-color: var(--white); color: var(--ink); }
.cta .btn:hover { background: #e7e9ff; border-color: #e7e9ff; color: var(--ink); }

/* ---------- Páginas interiores ---------- */

.page { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem); }
.page h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 18ch; }
.page .lead { margin-bottom: 0; }

.prose { max-width: 42rem; }
.prose h2 { font-size: 1.4rem; margin: 2.25rem 0 0.6rem; letter-spacing: -0.015em; }
.prose p, .prose li { margin: 0 0 0.9rem; }
.prose ul { padding-left: 1.25rem; }
.prose .todo { background: #fff3b0; padding: 0 0.25em; border-radius: 0.15rem; }

/* ---------- Formulario ---------- */

.form { max-width: 40rem; margin-top: 2.5rem; display: grid; gap: 1.4rem; }

.field { display: grid; gap: 0.4rem; }
.field label, .field legend { font-weight: 600; }
.field .hint { color: var(--graphite); font-size: 0.92rem; margin: 0; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea,
.field input[type="file"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid #9aa1a8;
  border-radius: 0.25rem;
  padding: 0.75rem 0.85rem;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }

.field--check { display: flex; gap: 0.7rem; align-items: flex-start; }
.field--check input { margin-top: 0.35rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.field--check label { font-weight: 400; font-size: 0.95rem; }

.field--trap { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.notice {
  max-width: 40rem;
  padding: 1rem 1.1rem;
  border-left: 4px solid #b3261e;
  background: #fdecea;
  margin-top: 2rem;
}
.notice[hidden] { display: none; }

/* ---------- Pie ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; color: var(--graphite); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem 2.5rem; }
.site-footer a { color: var(--graphite); }
.site-footer a:hover { color: var(--ink); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.site-footer p { margin: 0 0 0.3rem; }

/* ---------- Móvil ---------- */

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 26rem; }
  .row { grid-template-columns: 1fr; gap: 0.75rem; padding: 1.6rem 0; }
  .ill { max-width: 12rem; }
  .specs { grid-template-columns: 1fr; }
  .specs > div:nth-child(odd) { padding-right: 0; }
  .steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .nav a:not(.btn) { display: none; }
  .steps { grid-template-columns: 1fr; }
  .brand img { height: 2rem; }
  .nav .btn { white-space: nowrap; font-size: 0.95rem; padding: 0.5rem 0.9rem; }
}
