@font-face {
  font-family: Archivo;
  src: url(/assets/archivo.woff2) format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #eef1f0;
  --sheet: #f9fbfa;
  --ink: #14201f;
  --soft: #4c5a58;
  --line: #c9d1cf;
  --grid: #dfe5e3;
  --glass: #f0642b;
  --glass-text: #b03c0a;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 Archivo, system-ui, sans-serif;
}
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; padding: 0; }
h1, h2 { font-stretch: 112%; font-weight: 640; line-height: 1.08; letter-spacing: -0.022em; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.1875rem; line-height: 1.3; font-weight: 640; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--glass-text); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2.5rem, 75rem); margin-inline: auto; }
.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 2; padding: 0.5rem 1rem; background: var(--sheet); }

.btn, button.link, .link { font: inherit; font-weight: 600; cursor: pointer; }
.btn {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover { background: #ff7d45; }
.btn.small { padding: 0.5rem 1.05rem; font-size: 0.9375rem; white-space: nowrap; }
.btn.dark { background: var(--ink); color: var(--sheet); }
.btn.dark:hover { background: #2b3a38; }
.link { padding: 0.8rem 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 0.2em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.75rem; }

/* Cabecera */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-block: 1.25rem; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.1875rem; font-weight: 680; font-stretch: 112%; letter-spacing: -0.015em; text-decoration: none; }
.mark { width: 2.5rem; fill: none; stroke: var(--ink); stroke-width: 2.4; }
.mark .fill { fill: var(--glass); }
.top nav { display: flex; gap: 1.6rem; font-size: 0.9375rem; }
.top nav a, .lang { text-decoration: none; }
.top nav a:hover, .lang:hover { text-decoration: underline; }
.top-end { display: flex; align-items: center; gap: 1.25rem; font-size: 0.9375rem; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--gap); align-items: end; padding-block: clamp(2.5rem, 6vw, 5.5rem) clamp(2rem, 4vw, 3.5rem); }
h1 { font-size: clamp(2.35rem, 5.4vw, 4.4rem); line-height: 1.0; letter-spacing: -0.032em; }
.lede { font-size: 1.1875rem; line-height: 1.55; max-width: 36em; margin-bottom: 1.4rem; }

/* Figura */
.scope { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.scope-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 2rem; padding: 1rem 1.5rem; }
.scope h2 { font-size: 1.0625rem; font-stretch: 100%; letter-spacing: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; font-size: 0.9375rem; color: var(--soft); }
.legend li::before { content: ''; display: inline-block; width: 1.75rem; height: 0; margin-right: 0.55rem; vertical-align: middle; border-top: 2px solid #7f8d8b; }
.legend .k-out::before { border-top: 5px solid var(--glass); }
.plot {
  display: block;
  width: 100%;
  height: clamp(11rem, 24vw, 19rem);
  border-block: 1px solid var(--line);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 2rem,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 2rem 100%;
  fill: none;
}
.plot path { vector-effect: non-scaling-stroke; fill: none; stroke-linejoin: round; }
.target { stroke: var(--soft); stroke-width: 1; stroke-dasharray: 2 6; }
.t-in { stroke: #7f8d8b; stroke-width: 1.5; }
.t-out { stroke: var(--glass); stroke-width: 5; }
.controls { display: grid; grid-template-columns: repeat(3, 1fr); }
.controls button {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  gap: 0.35rem 0.75rem;
  padding: 1.15rem 1.5rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.controls button:last-child { border-right: 0; }
.controls button:disabled { cursor: default; }
.controls button:focus-visible { outline-offset: -4px; }
.controls button:not(:disabled):hover { background: var(--paper); }
.sw { position: relative; width: 2.5rem; height: 1.4rem; margin-top: 0.1rem; border-radius: 999px; background: #7f8d8b; transition: background 0.15s; }
.sw::after { content: ''; position: absolute; top: 0.2rem; left: 0.2rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--sheet); transition: translate 0.15s; }
[aria-pressed='true'] .sw { background: var(--ink); }
[aria-pressed='true'] .sw::after { translate: 1.1rem 0; }
.does { grid-column: 1 / -1; font-size: 0.9375rem; line-height: 1.45; color: var(--soft); }
figcaption { padding: 0.75rem 1.5rem; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--soft); }

/* Secciones */
.block { padding-top: clamp(4.5rem, 9vw, 8rem); }
.block-head { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0.75rem var(--gap); align-items: end; margin-bottom: clamp(1.75rem, 3.5vw, 3rem); }
.block-head p { max-width: 38em; color: var(--soft); }

.ratings { width: 100%; border-collapse: collapse; text-align: left; }
.ratings th, .ratings td { padding: 1.05rem 1.5rem 1.05rem 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.ratings thead th { font-size: 0.9375rem; font-weight: 500; color: var(--soft); border-bottom: 2px solid var(--ink); padding-block: 0.5rem; }
.ratings tbody th { width: 17%; font-weight: 640; font-size: 1.1875rem; font-stretch: 108%; }
.ratings td { width: 45%; }
.ratings td:last-child { width: 38%; }

.services { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.services article { grid-column: span 2; display: flex; flex-direction: column; gap: 0.6rem; padding: 1.75rem; background: var(--sheet); }
/* Los dos primeros, más anchos: diagnóstico y agentes. Los siguientes, de a tres y de a dos. */
.services article:nth-child(-n + 2), .services article:nth-child(n + 6) { grid-column: span 3; }
.services article:nth-child(2) { background: var(--glass); }
.services article:nth-child(2) .gets { border-color: var(--ink); }
.services article:nth-child(2) .gets, .services article:nth-child(2) .gets span { color: var(--ink); }
.gets { margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.45; color: var(--soft); }
.gets span { font-weight: 640; color: var(--glass-text); }
.services article > p:first-of-type { padding-bottom: 0.6rem; }

.process { margin-top: clamp(4.5rem, 9vw, 8rem); padding-block: clamp(3.5rem, 7vw, 6rem); background: var(--ink); color: var(--sheet); }
.process .block-head p, .process li p { color: #b9c6c3; }
.process ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); list-style: none; counter-reset: s; }
.process li { counter-increment: s; padding-top: 1.25rem; border-top: 3px solid var(--glass); }
.process li::before { content: counter(s); display: block; margin-bottom: 0.4rem; font-size: 2.25rem; line-height: 1; font-weight: 640; font-stretch: 112%; color: var(--glass); }
.process h3 { margin-bottom: 0.4rem; }
.process :focus-visible { outline-color: var(--glass); }

.software { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.25rem var(--gap); }
.software dt { font-weight: 640; font-size: 1.1875rem; margin-bottom: 0.2rem; }
.software dd { color: var(--soft); }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap) clamp(2rem, 6vw, 5rem); }
.about h2 { margin-bottom: 1rem; }
.about h3 { margin-bottom: 0.5rem; }
.stack div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding-block: 0.65rem; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.stack dt { font-weight: 640; }
.stack dd { color: var(--soft); }

.faq { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1.5rem var(--gap); }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { display: flex; justify-content: space-between; gap: 1.5rem; padding-block: 1.05rem; font-weight: 600; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-size: 1.5rem; line-height: 1; font-weight: 400; color: var(--glass-text); }
[open] > summary::after { content: '\2212'; }
details p { padding: 0 2.5rem 1.25rem 0; max-width: 42em; color: var(--soft); }

/* Contacto: un diodo Zener de vidrio, con su banda de cátodo y sus terminales */
.contact { padding-block: clamp(5rem, 10vw, 9rem); }
.diode { position: relative; }
.diode::before { content: ''; position: absolute; inset: calc(50% - 3px) 0 auto; height: 6px; background: #8f9c9a; }
.glass {
  position: relative;
  width: min(100% - 2.5rem, 66rem);
  margin-inline: auto;
  padding: clamp(2.25rem, 5vw, 4rem) clamp(5rem, 15vw, 13rem) clamp(2.25rem, 5vw, 4rem) clamp(1.75rem, 6vw, 5rem);
  border-radius: clamp(1.75rem, 6vw, 5rem);
  overflow: hidden;
  background: var(--glass);
}
.glass::after { content: ''; position: absolute; inset: 0 clamp(1.5rem, 5vw, 4.5rem) 0 auto; width: clamp(1.5rem, 5vw, 4rem); background: var(--ink); }
.glass h2 { margin-bottom: 1rem; }
.glass p { max-width: 36em; }
.glass .actions { margin-block: 1.5rem 0.75rem; }
.glass :focus-visible { outline-color: var(--ink); }
.email a { font-weight: 600; overflow-wrap: anywhere; }

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; padding-block: 1.75rem; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.foot p { color: var(--soft); }
.lost { display: grid; gap: 3rem; padding-block: 5rem; }
.lost h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-bottom: 0.5rem; }

@media (max-width: 60rem) {
  .top nav { display: none; }
  .services article, .services article:nth-child(n) { grid-column: span 3; }
  .services article:last-child:nth-child(odd) { grid-column: span 6; }
  .process ol { grid-template-columns: 1fr 1fr; }
  .software { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 46rem) {
  .hero, .block-head, .about, .faq, .controls, .process ol, .software { grid-template-columns: minmax(0, 1fr); }
  .services article, .services article:nth-child(n), .services article:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .software { gap: 1.5rem; }
  .controls button { border-right: 0; border-bottom: 1px solid var(--line); }
  .controls button:last-child { border-bottom: 0; }
  .ratings thead { position: absolute; left: -999rem; }
  .ratings, .ratings tbody, .ratings tr, .ratings tbody th, .ratings td, .ratings td:last-child { display: block; width: auto; }
  .ratings tr { padding-block: 1.1rem; border-bottom: 1px solid var(--line); }
  .ratings tbody th, .ratings td { padding: 0 0 0.5rem; border: 0; }
  .ratings td::before { content: attr(data-label); display: block; font-size: 0.875rem; color: var(--soft); }
  .stack div { grid-template-columns: 1fr; gap: 0; }
  .glass { padding-right: 5.25rem; }
}
@media (max-width: 26rem) {
  .top { flex-wrap: wrap; }
  .top-end { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
