/*
  styles.css — Lopez&Lopez shared layout & components
  Depends on css/tokens.css being loaded first. No component here should
  hardcode a color, font, or size that already has a token — add a token
  instead of a literal value.
*/

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  border-radius: var(--radio);
}

html {
  color-scheme: light;
}

/* Sticky footer: body is the column flex container so the cajetín
   sits at the true bottom of the viewport on short-content pages
   instead of only being pushed down by content height. This doesn't
   touch padding-inline, the gutter that insets header/main/cajetín
   from the viewport edge — that's a horizontal inset on the flex
   container itself and is unaffected by turning it into a flex
   column. */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-inline: var(--gutter);
  padding-block: 0;
  background: var(--color-fondo);
  color: var(--color-texto);
  font-family: var(--fuente-cuerpo);
  font-size: var(--tam-cuerpo);
  line-height: var(--interlineado-cuerpo);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border-radius: var(--radio);
}

a {
  color: var(--color-enlace);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--olivo);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--fuente-display);
  color: var(--color-texto-fuerte);
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
  max-width: var(--medida-cuerpo);
}

.sheet {
  max-width: 64rem;
  margin: 0 auto;
}

/* ── Type scale utility classes ────────────────────────────────────── */
.tipo-hero {
  font-family: var(--fuente-display);
  font-weight: 700;
  font-size: var(--tam-hero);
  line-height: var(--interlineado-hero);
  letter-spacing: var(--tracking-hero);
  font-stretch: 105%;
}

.tipo-apertura-seccion {
  font-family: var(--fuente-display);
  font-weight: 650;
  font-size: var(--tam-apertura-seccion);
  line-height: var(--interlineado-apertura-seccion);
  letter-spacing: var(--tracking-apertura-seccion);
}

h2 {
  font-weight: 650;
  font-size: var(--tam-h2);
  line-height: var(--interlineado-h2);
  letter-spacing: var(--tracking-h2);
}

.tipo-h3, h3 {
  font-weight: 600;
  font-size: var(--tam-h3);
  line-height: var(--interlineado-h3);
  letter-spacing: var(--tracking-h3);
}

.tipo-lede {
  font-family: var(--fuente-cuerpo);
  font-weight: 400;
  font-size: var(--tam-lede);
  line-height: var(--interlineado-lede);
  letter-spacing: var(--tracking-lede);
  max-width: 38em;
}

.tipo-meta {
  font-family: var(--fuente-display);
  font-weight: 600;
  font-size: var(--tam-meta);
  line-height: var(--interlineado-meta);
  letter-spacing: var(--tracking-meta);
}

/* ── Site header ────────────────────────────────────────────────────── */
/* --alto-header: the header's own rendered height — padding-block×2 +
   the logo (its tallest element) + the 1px border-bottom — redeclared
   below at the mobile logo size. Not a raw design token, a computed
   layout constant derived from other tokens plus the logo's literal
   height, but kept on :root because two components outside this
   header (.indice-secciones, .seccion-contenido) need to read it too,
   not just descendants of .site-header. */
:root {
  --alto-header: calc(2 * var(--espacio-6) + 64px + 1px);
}

.site-header {
  position: sticky;
  top: 0;
  /* Above .indice-secciones's own sticky nav (z-index: 1) and ordinary
     page content, so it stays opaque and on top while scrolling. */
  z-index: 10;
  flex: 0 0 auto;
  /* Explicit, not left to inherit body's background — once sticky,
     content (e.g. Inicio's Olivo hero) scrolls underneath this box, and
     without its own opaque fill that content would show through. */
  background: var(--color-fondo);
  border-bottom: 1px solid var(--color-texto-fuerte);
  /* Full-bleed to the viewport edge — same cancel-and-reapply-the-
     gutter technique as .franja-completa — so a sticky header doesn't
     leave the body's own side padding visible as empty margins while
     content scrolls beneath it. .header-inner's own max-width + margin:
     auto still center the logo/nav at the same horizontal position as
     before, since this padding-inline reintroduces the exact gutter
     inset .header-inner previously got from body. The border-bottom
     above now renders full-width too, as a natural side effect. */
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  /* 0.6x the logo's height (the ratio --espacio-5/40px and
     --espacio-7/80px both held) is 38.4px at the current 64px logo.
     --espacio-6 (32px) is closer to that than --espacio-7 (48px) —
     6.4px off vs. 9.6px — so it wins on proportion; it also undoes
     the 80px/48px pairing that made the header read as too dominant
     overall, not just the logo. */
  padding-block: var(--espacio-6);
}

.header-inner {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--espacio-5);
  flex-wrap: wrap;
}

.logo-link {
  display: block;
  flex: 0 0 auto;
}

/* Inline SVG (not <img>), so the global `img { display: block }` reset
   doesn't reach it — set that explicitly here to avoid inline-element
   baseline gap. */
.logo-mark {
  display: block;
  height: 64px;
  width: auto;
}

/* Dark-field logo variants (design plan §2). The default, no-modifier
   state needs no override here — the SVG's own embedded <style> ships
   the correct light-ground colors already (.cls-1 grafito, .cls-2
   olivo, .cls-3 oro). Add one of these modifier classes to the
   <svg class="logo-mark"> element itself when it sits on that field.
   Not used live yet — the header is always on a light ground today;
   this is here for the Inicio hero (Olivo field) and the cajetín
   (Tinta field), once built. */
.logo-mark--on-olivo .cls-1,
.logo-mark--on-olivo .cls-2 {
  fill: var(--color-campo-olivo-texto);
}

.logo-mark--on-olivo .cls-3 {
  /* Gold keeps its half on the Olivo field — unchanged from default,
     stated explicitly so the plan's rule stays visible in code. No
     semantic "accent on Olivo" token exists (only Tinta needed one),
     so this references the raw brand token directly, same as the
     SVG's own default fill. */
  fill: var(--oro);
}

.logo-mark--on-tinta .cls-1 {
  fill: var(--color-campo-tinta-texto);
}

.logo-mark--on-tinta .cls-2 {
  /* Olivo is too dark to read on Tinta (3.1:1) — lifts to Olivo claro
     (5.3:1) so the interlock stays legible. */
  fill: var(--color-campo-tinta-olivo);
}

.logo-mark--on-tinta .cls-3 {
  /* Gold stays gold on Tinta — unchanged from default, stated
     explicitly for the same reason as above. */
  fill: var(--color-campo-tinta-acento);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--espacio-5);
}

.site-nav li {
  display: flex;
}

/* `a` fills its full row/cell rather than shrinking to its text run, so
   the tappable area is the whole link box, not just the glyphs. */
.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--fuente-display);
  font-weight: 550;
  font-size: var(--tam-interfaz);
  line-height: var(--interlineado-interfaz);
  letter-spacing: var(--tracking-interfaz);
  font-stretch: 92%;
  color: var(--color-texto-fuerte);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-enlace);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* Hidden on desktop; the mobile media query below turns this into a
   visible hamburger/toggle button and drives .site-nav open/closed. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: var(--espacio-4);
  background: transparent;
  color: var(--color-texto-fuerte);
  border: 1px solid var(--color-texto-fuerte);
  cursor: pointer;
}

.nav-toggle-text {
  font-family: var(--fuente-display);
  font-weight: 550;
  font-size: var(--tam-interfaz);
  letter-spacing: var(--tracking-interfaz);
}

.nav-toggle:hover {
  color: var(--color-enlace);
  border-color: var(--color-enlace);
}

/* ── Page shell (placeholder content wrapper) ─────────────────────── */
.page-shell {
  flex: 1;
  max-width: 64rem;
  margin: 0 auto;
  padding-block: clamp(2.6rem, 6vw, 4.2rem);
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  gap: var(--espacio-4);
}

/* ── Cajetín (footer) ───────────────────────────────────────────────── */
.cajetin {
  flex: 0 0 auto;
  background: var(--color-campo-tinta);
  color: var(--color-campo-tinta-texto);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--color-campo-tinta);
  /* Full-bleed to the viewport edge — same cancel-and-reapply-the-
     gutter technique as .franja-completa and .site-header — so this
     footer's own background/border box isn't narrower than the
     viewport. .cajetin-inner's own max-width + margin: auto still
     center its columns at the same horizontal position as before,
     since this padding-inline reintroduces the exact gutter inset
     .cajetin-inner previously got from body. */
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
}

/* Exactly 3 regular fields (Razón social / Contacto / Última revisión)
   sit in row 1, with the wide Legal field spanning its own row below —
   a fixed 3-way split rather than auto-fit's minmax-driven track
   count, which computed more tracks than there were fields to fill
   them once Domicilio/Teléfono were removed, clustering the remaining
   3 fields left and leaving unused track space on the right. */
.cajetin-inner {
  max-width: 64rem;
  margin: 0 auto;
  border: 1px solid #3A3A32;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.cajetin-field {
  padding: var(--espacio-3) var(--espacio-4) var(--espacio-4);
  border-right: 1px solid #3A3A32;
  border-bottom: 1px solid #3A3A32;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.cajetin-field:last-child {
  border-right: 0;
}

/* Última revisión (the 3rd regular field) now sits flush against the
   grid's own right edge — without this its border-right would double
   up against .cajetin-inner's own border there. :last-child (above)
   doesn't reach it: the wide Legal field is the true last child. */
.cajetin-field:nth-child(3) {
  border-right: 0;
}

.cajetin-field--wide {
  grid-column: 1 / -1;
  border-right: 0;
  border-bottom: 0;
}

.cajetin-label {
  font-family: var(--fuente-display);
  font-weight: 600;
  font-size: var(--tam-meta);
  letter-spacing: var(--tracking-meta);
  color: var(--color-meta);
}

.cajetin-value {
  font-family: var(--fuente-display);
  font-weight: 550;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--color-campo-tinta-texto);
  font-variant-numeric: tabular-nums;
}

.cajetin-value--acento {
  color: var(--color-campo-tinta-acento);
}

.cajetin-value a {
  color: var(--color-campo-tinta-texto);
}

.cajetin-value a:hover {
  color: var(--color-campo-tinta-acento);
}

/* ── Inicio page ────────────────────────────────────────────────────── */
/* body carries the sitewide gutter as padding-inline. Full-bleed bands
   (the hero, the closing CTA) need to reach the true viewport edge, so
   this cancels that padding with a negative margin and reapplies it as
   padding on the same element — inner content still sits at the gutter
   inset, only the background spans edge to edge. */
.franja-completa {
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
}

.inicio {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero-inicio {
  position: relative;
  overflow: hidden;
  background: var(--color-campo-olivo);
}

.hero-inicio-inner {
  position: relative;
  max-width: 84rem;
  margin-inline: auto;
  min-height: 26rem;
  padding-block: clamp(3.5rem, 9vw, 7rem);
  display: flex;
  align-items: center;
}

.hero-inicio-texto {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  display: flex;
  flex-direction: column;
  gap: var(--espacio-5);
}

.hero-inicio-titulo {
  color: var(--blanco);
}

/* Secondary hero copy sits on Papel, not pure Blanco — contrast rule
   from the design plan (§2). */
.hero-inicio-subhead {
  color: var(--color-campo-olivo-texto);
}

.hero-inicio-ctas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--espacio-6);
}

.boton-primario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: var(--espacio-5);
  background: var(--oro);
  color: var(--tinta);
  font-family: var(--fuente-display);
  font-weight: 600;
  font-size: var(--tam-interfaz);
  letter-spacing: var(--tracking-interfaz);
  text-decoration: none;
  white-space: nowrap;
  /* Also used on a real <button> (Contacto's submit) — border: 0
     strips the UA default button bezel that would otherwise show
     through, since the rest of the rule only overrides background. */
  border: 0;
  cursor: pointer;
}

.boton-primario:hover {
  background: var(--tinta);
  color: var(--oro);
}

.boton-primario:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Revisión (design plan §6) — Contacto's submit label crossfade
   (Enviar -> Enviando -> Enviado). JS toggles --oculta to fade the
   span out, swaps its text mid-transition, then fades it back in;
   see initFormularioContacto in js/main.js. The global
   prefers-reduced-motion: reduce override further down collapses
   this to a 0.01ms transition, but JS also skips the timed text-swap
   dance entirely under that preference, same as Encaje. */
.boton-etiqueta {
  display: inline-block;
  transition: opacity 100ms ease;
}

.boton-etiqueta--oculta {
  opacity: 0;
}

/* The two-part interlocking L, at hero scale, bleeding off the right
   and bottom edges of the section (clipped by .hero-inicio's own
   overflow: hidden, which — because the section is full-bleed via
   .franja-completa — sits flush with the true viewport edge on the
   right). Two stacked, identically-sized SVGs (not one SVG with two
   classed paths) so each half's Encaje transform is a plain CSS
   transform on its own box, in real px, unaffected by the internal
   viewBox scale. */
.hero-inicio-marca {
  position: absolute;
  right: -14vw;
  bottom: -16vh;
  width: 58vw;
  max-width: 62rem;
  aspect-ratio: 118 / 99;
  pointer-events: none;
}

.marca-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Same on-olivo swap already established for the header logo's
   .logo-mark--on-olivo modifier: the olivo half lifts to Papel for
   contrast, the gold half keeps its own Oro. */
.marca-hero-olivo path {
  fill: var(--color-campo-olivo-texto);
}

.marca-hero-oro path {
  fill: var(--oro);
}

.marca-hero-olivo,
.marca-hero-oro {
  transform: translate(0, 0);
}

/* MOTION — Encaje (design plan §6). Triggered from js/main.js on every
   page load/refresh (session-gating was deliberately removed per
   client request, not scoped to once per session): the two halves
   settle into place from a 24px offset along their own diagonal
   (~17px/~17px component) with an 80ms stagger. Scoped to
   prefers-reduced-motion: no-preference so a reduced-motion visitor
   (or one whose JS never runs) always sees the settled end state with
   no transform and no transition. */
@media (prefers-reduced-motion: no-preference) {
  .hero-inicio-marca:not(.encaje-listo) .marca-hero-olivo,
  .hero-inicio-marca:not(.encaje-listo) .marca-hero-oro {
    transition: transform 420ms cubic-bezier(.2, 0, 0, 1);
  }

  .hero-inicio-marca:not(.encaje-listo) .marca-hero-oro {
    transition-delay: 80ms;
  }

  /* Start state: offset applied with transition suppressed so it lands
     instantly, before js/main.js removes this class on the next frame
     and lets the rule above animate the settle back to translate(0,0). */
  .hero-inicio-marca.encaje-listo .marca-hero-olivo,
  .hero-inicio-marca.encaje-listo .marca-hero-oro {
    transition: none;
  }

  .hero-inicio-marca.encaje-listo .marca-hero-olivo {
    transform: translate(-17px, 17px);
  }

  .hero-inicio-marca.encaje-listo .marca-hero-oro {
    transform: translate(17px, -17px);
  }
}

/* ── Campo de trabajo ───────────────────────────────────────────────── */
.campo-trabajo {
  padding-block: clamp(3rem, 7vw, 5rem);
}

.lista-servicios {
  list-style: none;
  margin: var(--espacio-6) 0 0;
  padding: 0;
}

.lista-servicios-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--espacio-2) var(--espacio-6);
  padding-block: var(--espacio-5);
}

.lista-servicios-item:not(:first-child) {
  border-top: 1px solid var(--color-regla);
}

.lista-servicios-nombre {
  font-family: var(--fuente-display);
  font-weight: 600;
  color: var(--color-texto-fuerte);
}

.lista-servicios-entregable {
  color: var(--color-meta);
  font-size: var(--tam-interfaz);
}

/* ── Método ─────────────────────────────────────────────────────────── */
.metodo {
  padding-block: clamp(3rem, 7vw, 5rem);
}

.metodo-secuencia {
  list-style: none;
  margin: var(--espacio-7) 0 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.metodo-estacion {
  display: flex;
  align-items: center;
  gap: var(--espacio-3);
}

.metodo-estacion:not(:last-child) {
  flex: 1 1 auto;
}

/* The connecting rule — one of the wireframe's own functional marks
   (like a table divider), not a decorative extra against the sheet's
   rule budget. Fills whatever space is left in the station after its
   marker and label, so reading left to right gives
   ■ Diagnóstico ──── ■ Propuesta ──── ■ Seguimiento. */
.metodo-estacion:not(:last-child)::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--color-regla);
  margin-inline-start: var(--espacio-3);
}

.metodo-marca {
  width: 0.6rem;
  height: 0.6rem;
  flex: 0 0 auto;
  background: var(--olivo);
}

.metodo-nombre {
  font-family: var(--fuente-display);
  font-weight: 600;
  font-size: var(--tam-interfaz);
  letter-spacing: var(--tracking-interfaz);
  color: var(--color-texto-fuerte);
  white-space: nowrap;
}

/* Scale modifier for the same component, used on Metodología where
   the sequence is the page's own subject rather than an Inicio
   summary — same markup/pattern, just larger, so it reads as more
   prominent without becoming a second, differently-built version of
   the same idea. */
.metodo-secuencia--grande {
  margin-top: var(--espacio-8);
}

.metodo-secuencia--grande .metodo-estacion {
  gap: var(--espacio-4);
}

.metodo-secuencia--grande .metodo-estacion:not(:last-child)::after {
  margin-inline-start: var(--espacio-4);
}

.metodo-secuencia--grande .metodo-marca {
  width: 1rem;
  height: 1rem;
}

.metodo-secuencia--grande .metodo-nombre {
  font-size: var(--tam-h2);
}

/* ── PyME / Corporativo ─────────────────────────────────────────────── */
.segmentos {
  padding-block: clamp(3rem, 7vw, 5rem);
}

.segmentos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--espacio-7);
}

.segmento {
  display: flex;
  flex-direction: column;
  gap: var(--espacio-3);
}

/* ── Imagen de corte de sección (Inicio) ────────────────────────────── */
/* People-doing-technical-work register (plan §5 deviation, made
   deliberately: this consultancy doesn't build or operate physical
   sites, so a person reviewing technical information represents the
   company more accurately than an environment/infrastructure shot
   would). Formerly a full-bleed environment/infrastructure image with
   its own margin-cancelling math; now reuses .imagen-seccion
   for the same full-content-column sizing already used on Servicios
   and Metodología — same pattern, not a new one — so this wrapper only
   needs to carry its own vertical rhythm, the same role
   .imagen-corte-metodologia plays for that page's equivalent slot. */
.imagen-corte {
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

/* Real photography for this slot (first of the 3 image slots to move
   past placeholder). object-fit: cover guards against the source
   file's exact pixel ratio drifting from the enforced 16/9 — width
   needs stating explicitly since a plain <img> otherwise sizes to its
   intrinsic dimensions instead of filling its 100%-width container. */
.imagen-corte-foto {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ── CTA band ───────────────────────────────────────────────────────── */
.cta-banda {
  background: var(--color-campo-tinta);
  padding-block: clamp(3rem, 7vw, 5rem);
}

.cta-banda-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--espacio-6);
}

.cta-banda-texto {
  color: var(--color-campo-tinta-texto);
  margin: 0;
}

/* ── Servicios page ─────────────────────────────────────────────────── */
.intro-pagina {
  display: flex;
  flex-direction: column;
  gap: var(--espacio-3);
}

.tabla-servicios-seccion {
  display: flex;
  flex-direction: column;
  gap: var(--espacio-5);
}

/* Real table (design plan §4), not a card grid. table-layout stays
   auto (not fixed) so column widths follow content — the placeholder
   and eventual real copy varies enough in length per column that a
   fixed grid would either crowd the short columns or waste space on
   them. */
.tabla-servicios {
  width: 100%;
  border-collapse: collapse;
}

.tabla-servicios th,
.tabla-servicios td {
  text-align: left;
  vertical-align: top;
  padding: var(--espacio-4) var(--espacio-5) var(--espacio-4) 0;
}

.tabla-servicios th:last-child,
.tabla-servicios td:last-child {
  padding-right: 0;
}

.tabla-servicios thead th {
  font-family: var(--fuente-display);
  font-weight: 600;
  font-size: var(--tam-meta);
  letter-spacing: var(--tracking-meta);
  color: var(--color-meta);
  padding-top: 0;
  padding-bottom: var(--espacio-3);
  border-bottom: 1px solid var(--color-texto-fuerte);
}

/* Borders live on the cells, not the <tr> — border-bottom on a table
   row itself renders inconsistently under border-collapse across
   browsers, cell borders don't. */
.tabla-servicios-fila > th,
.tabla-servicios-fila > td {
  background: var(--color-fondo);
  border-bottom: 1px solid var(--color-regla);
  transition: background-color 140ms, border-color 140ms;
}

.tabla-servicios-fila th[scope="row"] {
  font-family: var(--fuente-display);
  font-weight: 600;
  color: var(--color-texto-fuerte);
}

.tabla-servicios-fila td {
  color: var(--color-texto);
  font-size: var(--tam-interfaz);
}

/* MOTION — Cambio de campo (design plan §6): ground Papel -> Blanco,
   rule Línea -> Olivo, 140ms. Keyboard focus gets the identical
   treatment via :focus-visible on the row itself (each row carries
   tabindex="0" for exactly this) — not a separate outline style, per
   the plan; the background/rule shift is the focus indicator. */
.tabla-servicios-fila:hover > th,
.tabla-servicios-fila:hover > td,
.tabla-servicios-fila:focus-visible > th,
.tabla-servicios-fila:focus-visible > td {
  background: var(--color-panel);
  border-color: var(--olivo);
}

.tabla-servicios-fila:focus-visible {
  outline: none;
}

/* In-page index for the five detail sections below the table. Sticky
   rather than a fixed sidebar column — the sheet is a single centered
   column everywhere else on the site, and a sticky top bar gets the
   "visible while scrolling the detail sections" behavior without
   introducing a second layout column just for this page. top is the
   site header's own rendered height (--alto-header), not 0 — the site
   header is sticky too, so this sticks directly below it instead of
   underneath/behind it. */
.indice-secciones {
  position: sticky;
  top: var(--alto-header);
  z-index: 1;
  background: var(--color-fondo);
  border-bottom: 1px solid var(--color-regla);
  padding-block: var(--espacio-3);
}

.indice-secciones ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--espacio-2) var(--espacio-5);
}

.indice-secciones a {
  font-family: var(--fuente-display);
  font-weight: 550;
  font-size: var(--tam-interfaz);
  letter-spacing: var(--tracking-interfaz);
  color: var(--color-texto-fuerte);
  text-decoration: none;
}

.indice-secciones a:hover {
  color: var(--color-enlace);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.seccion-contenido {
  display: flex;
  flex-direction: column;
  gap: var(--espacio-5);
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--color-regla);
  /* Keeps the section's own heading clear of both stacked sticky
     elements above it (the site header, then the sticky index) when a
     visitor jumps here via an anchor link. --espacio-8 alone was
     already the correct cushion for clearing the index by itself —
     --alto-header adds the newly-sticky site header's own height on
     top of that same cushion. */
  scroll-margin-top: calc(var(--alto-header) + var(--espacio-8));
}

/* Explicit modifier rather than :first-of-type — .intro-pagina and
   .tabla-servicios-seccion are also <section> elements ahead of the
   first .seccion-contenido, so :first-of-type never actually matched
   any of these (the true first section-typed sibling was
   .intro-pagina). A named class doesn't depend on sibling order at
   all, so it keeps working if sections are ever reordered. */
.seccion-contenido--primero {
  border-top: 0;
}

/* One image per service, right after that section's heading,
   functioning as a visual anchor for it. Built as people-doing-
   technical-work register (a deviation from the plan §5 document
   register originally specified for this slot, made during image
   generation), same as Inicio's and Metodología's slots. Full width
   of the section's content column, same as the comparative table
   above: .seccion-contenido is a column flex container, and flex items
   stretch to the full cross-axis width by default, so no width rule
   is needed here. */
.imagen-seccion {
  width: 100%;
}

/* Real photography for the 5 Servicios slots. object-fit: cover
   guards against the source files' exact pixel ratio drifting from
   the enforced 3/2 — width needs stating explicitly since a plain
   <img> otherwise sizes to its intrinsic dimensions instead of
   filling its 100%-width container (same reasoning as
   .imagen-corte-foto on Inicio). */
.imagen-servicio-foto {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* Metodología reuses .imagen-seccion for the same
   full-content-column sizing, but as a standalone section break
   rather than nested inside a .seccion-contenido flex column — so this
   wrapper carries its own vertical rhythm instead of inheriting one. */
.imagen-corte-metodologia {
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

.servicio-detalle-bloque {
  display: flex;
  flex-direction: column;
  gap: var(--espacio-2);
}

/* Shared dt/dl styling for two distinct uses: real FAQs (Servicios'
   .faq-lista/.faq-item) and plain label/value pairs (Contacto's
   .lista-datos/.dato-item, e.g. Correo/Horario) — same visual
   treatment, kept as one rule via a shared selector rather than
   duplicated, since neither name honestly describes the other's
   content. */
.faq-lista,
.lista-datos {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--espacio-4);
}

.faq-item,
.dato-item {
  display: flex;
  flex-direction: column;
  gap: var(--espacio-1);
}

.faq-item dt,
.dato-item dt {
  font-family: var(--fuente-display);
  font-weight: 600;
  color: var(--color-texto-fuerte);
}

.faq-item dd,
.dato-item dd {
  margin: 0;
  color: var(--color-texto);
}

/* ── Contacto page ──────────────────────────────────────────────────── */
/* Form on one side, direct info on the other. 3fr/2fr rather than an
   even split — the form carries more content (seven fields plus
   consent) than the info column (four label/value pairs) — stacked
   to a single column, form first, below the sitewide breakpoint. */
.contacto-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--espacio-8);
  align-items: start;
}

.formulario-contacto {
  display: flex;
  flex-direction: column;
  gap: var(--espacio-5);
}

.formulario-nota-requerido {
  margin: 0;
  font-family: var(--fuente-display);
  font-size: var(--tam-meta);
  letter-spacing: var(--tracking-meta);
  color: var(--color-meta);
}

.campo {
  display: flex;
  flex-direction: column;
  gap: var(--espacio-1);
}

.campo label {
  font-family: var(--fuente-display);
  font-weight: 550;
  font-size: var(--tam-interfaz);
  letter-spacing: var(--tracking-interfaz);
  color: var(--color-texto-fuerte);
}

/* Underline-only fields, no boxes (plan §4): border lives on the
   bottom edge only, background stays transparent, so a field reads
   as part of the page rather than a boxed control. */
.campo input,
.campo select,
.campo textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--color-regla);
  background: transparent;
  padding-block: var(--espacio-2);
  font-family: var(--fuente-cuerpo);
  font-size: var(--tam-cuerpo);
  color: var(--color-texto-fuerte);
  transition: border-color 140ms;
}

.campo textarea {
  resize: vertical;
  min-height: 8rem;
}

/* Suppresses the sitewide focus-visible outline on just these fields
   in favor of the underline itself shifting color — an outline box
   would read as a "box" appearing on focus, working against the
   underline-only rule. The color shift is still a clear, sufficiently
   contrasting focus indicator (same reasoning as Servicios' table
   rows replacing their default outline with a background/border
   shift). */
.campo input:focus-visible,
.campo select:focus-visible,
.campo textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--olivo);
}

.campo-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: var(--espacio-2);
  font-weight: 400;
  color: var(--color-texto);
}

.campo-checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: 0.2em;
  accent-color: var(--olivo);
}

.campo-checkbox a {
  color: var(--color-enlace);
}

/* Honeypot: hidden from real visitors both visually and from
   assistive tech, unreachable by keyboard. Off-canvas positioning
   rather than display: none — some bots specifically skip
   display: none fields since it's a well-known honeypot tell. */
.campo-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.formulario-acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espacio-4);
}

.formulario-estado {
  margin: 0;
  font-family: var(--fuente-display);
  font-size: var(--tam-interfaz);
}

.formulario-estado--exito {
  color: var(--olivo);
}

/* No error/danger hue exists in the locked three-color palette, so
   the error state leans on the message text itself plus the site's
   own strong-text color rather than inventing a new color. */
.formulario-estado--error {
  color: var(--color-texto-fuerte);
}

.contacto-directo {
  display: flex;
  flex-direction: column;
  gap: var(--espacio-4);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
/* Single breakpoint for the mobile nav, referenced here and in the
   matching JS check in js/main.js (window.innerWidth >= 700) — keep
   the two numbers in sync if this ever changes. Below it, four nav
   items plus the logo no longer fit the header in one row, so the
   nav collapses behind the toggle button instead of wrapping into an
   awkward second line of small, individually-wrapped links. */
@media (max-width: 699px) {
  /* The full mark+wordmark+tagline lockup is a wide, short shape
     (516.79:101.71 ≈ 5.08:1) — at any height that reads as dominant
     on desktop it's wider than a phone screen on its own, independent
     of the toggle button next to it. 48px is the largest height that
     still leaves room for the toggle at 375px (width: auto derives
     ~243.89px from the SVG's own intrinsic ratio, against ~245.2px
     available — see the calculation in this thread). */
  .logo-mark {
    height: 48px;
  }

  /* --alto-header recomputed for the 48px mobile logo — every
     consumer of it (.indice-secciones's sticky top,
     .seccion-contenido's scroll-margin-top) updates automatically. */
  :root {
    --alto-header: calc(2 * var(--espacio-6) + 48px + 1px);
  }

  .nav-toggle {
    display: inline-flex;
    order: 2;
  }

  .site-nav {
    display: none;
    flex: 1 1 100%;
    order: 3;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    margin-top: var(--espacio-4);
    border-top: 1px solid var(--color-regla);
  }

  .site-nav li {
    border-bottom: 1px solid var(--color-regla);
  }

  .site-nav a {
    width: 100%;
    min-height: 48px;
  }

  /* Cajetín: force a single column so label/value blocks stack
     vertically instead of the desktop 3-way split cramming into a
     narrow viewport. */
  .cajetin-inner {
    grid-template-columns: 1fr;
  }

  .cajetin-field {
    border-right: 0;
  }

  /* Inicio hero: the 7/5 split has no room to breathe under 700px, so
     it stacks — text first, full width, the mark dropped below it at
     a fixed (not viewport-relative) scale and pulled back into normal
     flow so it no longer floats beside/behind the copy. It still
     bleeds off the right edge (clipped by .hero-inicio's own overflow:
     hidden) so the Encaje motion and the "cut off, not boxed" mark
     treatment both survive on mobile — it just no longer also bleeds
     off the bottom, since there's no side column left for it to fill. */
  .hero-inicio-inner {
    min-height: 0;
  }

  .hero-inicio-texto {
    max-width: 100%;
  }

  .hero-inicio-marca {
    position: relative;
    right: auto;
    bottom: auto;
    width: 75vw;
    max-width: 26rem;
    margin-block-start: var(--espacio-8);
    margin-inline-start: auto;
    transform: translateX(12vw);
  }

  /* Método: the connecting rule only reads as a sequence when it's
     horizontal, and there's no room to keep the band on one line — so
     below 700px the rule is dropped and the three stations stack with
     plain vertical spacing instead of being rotated or shortened. */
  .metodo-secuencia {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--espacio-4);
  }

  .metodo-estacion:not(:last-child)::after {
    content: none;
  }

  /* The --grande scale (Metodología) is a desktop prominence choice —
     stacked in a column on mobile, it stays a size step above the
     Inicio-summary default but doesn't carry the full desktop scale. */
  .metodo-secuencia--grande .metodo-marca {
    width: 0.75rem;
    height: 0.75rem;
  }

  .metodo-secuencia--grande .metodo-nombre {
    font-size: var(--tam-h3);
  }

  /* PyME / Corporativo: single column. */
  .segmentos-grid {
    grid-template-columns: 1fr;
    gap: var(--espacio-6);
  }

  .cta-banda-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Servicios comparative table: stacked label/value blocks instead
     of a table that scrolls sideways — this must never scroll
     horizontally, per the plan. Table semantics stay in the markup
     (a screen reader still gets a real table); display: block just
     changes how it's laid out visually. Column labels reappear above
     each value via ::before, keyed to cell position with
     nth-of-type since the visual <thead> is hidden here. */
  .tabla-servicios,
  .tabla-servicios thead,
  .tabla-servicios tbody,
  .tabla-servicios-fila,
  .tabla-servicios th,
  .tabla-servicios td {
    display: block;
    width: 100%;
  }

  .tabla-servicios thead {
    display: none;
  }

  .tabla-servicios-fila {
    padding-block: var(--espacio-4);
    border-bottom: 1px solid var(--color-regla);
  }

  .tabla-servicios-fila > th,
  .tabla-servicios-fila > td {
    border-bottom: 0;
    padding: var(--espacio-1) 0;
  }

  .tabla-servicios-fila th[scope="row"] {
    padding-top: 0;
    font-size: var(--tam-h3);
  }

  .tabla-servicios-fila td:last-child {
    padding-bottom: 0;
  }

  .tabla-servicios-fila td::before {
    display: block;
    font-family: var(--fuente-display);
    font-size: var(--tam-meta);
    letter-spacing: var(--tracking-meta);
    color: var(--color-meta);
  }

  .tabla-servicios-fila td:nth-of-type(1)::before {
    content: "Disciplinas";
  }

  .tabla-servicios-fila td:nth-of-type(2)::before {
    content: "Cliente";
  }

  .tabla-servicios-fila td:nth-of-type(3)::before {
    content: "Entregable";
  }

  /* Contacto: form and direct info stack to a single column, form
     first (already first in the markup, so no order override needed). */
  .contacto-grid {
    grid-template-columns: 1fr;
    gap: var(--espacio-7);
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
