/* ==========================================================================
   Grupo Pritec — Sistema de diseño
   Tokens en OKLCH, layout intrínseco, sin frameworks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Marca */
  --brand:        oklch(74.8% 0.170 125.4);
  --brand-hover:  oklch(68% 0.160 125.4);
  --brand-strong: oklch(52% 0.130 126);
  --accent-lg:    oklch(60% 0.155 125.4);
  --brand-soft:   oklch(95.2% 0.048 120);
  --brand-soft-2: oklch(97.4% 0.028 121);
  --brand-ink:    oklch(26% 0.070 126);

  /* Neutros */
  --paper:        oklch(98.4% 0.004 106.5);
  --paper-2:      oklch(96.1% 0.009 113.2);
  --surface:      oklch(100% 0 0);
  --ink-900:      oklch(20.2% 0.018 127.4);
  --ink-800:      oklch(23.9% 0.020 129.4);
  --ink-700:      oklch(28.7% 0.024 128);
  --ink-600:      oklch(33.8% 0.027 125.5);

  /* Semánticos (se re-mapean en contextos oscuros) */
  --bg:           var(--paper);
  --bg-alt:       var(--paper-2);
  --card:         var(--surface);
  --fg:           var(--ink-900);
  --fg-soft:      oklch(33.8% 0.027 125.5);
  --fg-muted:     oklch(48% 0.020 128);
  --line:         oklch(90.1% 0.019 116.6);
  --line-strong:  oklch(83% 0.024 118);

  /* Tipografía */
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-body: clamp(1rem, 0.96rem + 0.18vw, 1.075rem);
  --fs-display: clamp(2.5rem, 1.15rem + 4.9vw, 4.35rem);
  --fs-h2: clamp(1.85rem, 1.1rem + 2.6vw, 3.05rem);
  --fs-h3: clamp(1.25rem, 1.05rem + 0.7vw, 1.6rem);
  --fs-lead: clamp(1.06rem, 1rem + 0.4vw, 1.3rem);

  /* Layout */
  --maxw: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 18px;
  --radius-lg: 26px;
  --radius-sm: 12px;
  --header-h: 74px;

  /* Sombras */
  --shadow-sm: 0 1px 2px oklch(20% 0.02 127 / 0.06), 0 4px 14px -6px oklch(20% 0.02 127 / 0.10);
  --shadow-md: 0 2px 6px oklch(20% 0.02 127 / 0.05), 0 18px 40px -20px oklch(20% 0.02 127 / 0.24);
  --shadow-lg: 0 30px 70px -40px oklch(20% 0.02 127 / 0.45);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          oklch(17.6% 0.012 128);
  --bg-alt:      oklch(20.8% 0.014 128);
  --card:        oklch(21.4% 0.014 128);
  --fg:          oklch(96.5% 0.008 110);
  --fg-soft:     oklch(87% 0.012 118);
  --fg-muted:    oklch(70% 0.016 122);
  --line:        oklch(28.5% 0.018 128);
  --line-strong: oklch(36% 0.022 126);
  --brand:       oklch(80% 0.170 125.4);
  --brand-hover: oklch(84% 0.160 125.4);
  --brand-strong: oklch(78% 0.165 125.4);
  --accent-lg:    oklch(80% 0.170 125.4);
  --brand-soft:  oklch(30% 0.055 124);
  --brand-soft-2: oklch(24% 0.040 125);
  --brand-ink:   oklch(20% 0.06 126);
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.3), 0 4px 14px -6px oklch(0% 0 0 / 0.5);
  --shadow-md: 0 2px 6px oklch(0% 0 0 / 0.3), 0 18px 40px -20px oklch(0% 0 0 / 0.6);
  --shadow-lg: 0 30px 70px -40px oklch(0% 0 0 / 0.8);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:          oklch(17.6% 0.012 128);
    --bg-alt:      oklch(20.8% 0.014 128);
    --card:        oklch(21.4% 0.014 128);
    --fg:          oklch(96.5% 0.008 110);
    --fg-soft:     oklch(87% 0.012 118);
    --fg-muted:    oklch(70% 0.016 122);
    --line:        oklch(28.5% 0.018 128);
    --line-strong: oklch(36% 0.022 126);
    --brand:       oklch(80% 0.170 125.4);
    --brand-hover: oklch(84% 0.160 125.4);
    --brand-strong: oklch(78% 0.165 125.4);
    --accent-lg:    oklch(80% 0.170 125.4);
    --brand-soft:  oklch(30% 0.055 124);
    --brand-soft-2: oklch(24% 0.040 125);
    --brand-ink:   oklch(20% 0.06 126);
    --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.3), 0 4px 14px -6px oklch(0% 0 0 / 0.5);
    --shadow-md: 0 2px 6px oklch(0% 0 0 / 0.3), 0 18px 40px -20px oklch(0% 0 0 / 0.6);
    --shadow-lg: 0 30px 70px -40px oklch(0% 0 0 / 0.8);
  }
}

/* --------------------------------------------------------------------------
   2. Fuente
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   3. Reset y base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scrollbar-gutter: stable;
  scrollbar-color: var(--line-strong) transparent;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--fg-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 1, "cv11" 1;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--fg);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-display); font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; }
h4 { font-size: 1.05rem; letter-spacing: -0.01em; }

p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
}

/* El elemento <picture> no debe generar caja: así la imagen ocupa
   el 100 % del contenedor y object-fit funciona como se espera. */
picture { display: contents; }

img { height: auto; }

ul, ol { padding: 0; list-style: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2.5px solid var(--brand-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--brand);
  color: var(--brand-ink);
}

[hidden] { display: none !important; }

.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  vertical-align: -0.18em;
}

/* Transición entre páginas (MPA) */
@view-transition { navigation: auto; }

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - (var(--gutter) * 2), var(--maxw));
  margin-inline: auto;
}

.section { padding-block: clamp(3.75rem, 8vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--alt { background: var(--bg-alt); }

.section--dark {
  --bg: var(--ink-900);
  --card: var(--ink-800);
  --fg: oklch(97% 0.01 110);
  --fg-soft: oklch(90% 0.015 118);
  --fg-muted: oklch(72% 0.018 122);
  --line: oklch(30% 0.02 128);
  --line-strong: oklch(40% 0.025 126);
  --brand-soft: oklch(32% 0.06 124);
  background: var(--ink-900);
  color: var(--fg-soft);
  color-scheme: dark;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% -120%;
  z-index: 200;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 0.8rem 1.4rem;
  border-radius: 0 0 12px 12px;
  font-weight: 700;
  transition: translate 0.2s var(--ease);
}
.skip-link:focus-visible { translate: -50% 0; }

/* --------------------------------------------------------------------------
   5. Bloques de texto
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--fg-muted);
  text-wrap: pretty;
  max-width: 62ch;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.section-head > div { max-width: 62ch; }
.section-head p { margin-top: 1rem; color: var(--fg-muted); max-width: 54ch; }

.text-accent { color: var(--brand-strong); }

/* --------------------------------------------------------------------------
   6. Botones
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0.85em 1.45em;
  border-radius: 999px;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: -0.012em;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  white-space: nowrap;
}
.btn .icon { transition: translate 0.25s var(--ease); }
.btn:hover .icon { translate: 2px 0; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  --btn-bg: var(--brand);
  --btn-fg: var(--brand-ink);
  box-shadow: 0 1px 0 oklch(100% 0 0 / 0.35) inset;
}
.btn--primary:hover { --btn-bg: var(--brand-hover); box-shadow: var(--shadow-md); }
.btn--primary:hover .icon { translate: 3px 0; }

.btn--dark { --btn-bg: var(--ink-900); --btn-fg: oklch(98% 0.01 110); }
.btn--dark:hover { --btn-bg: var(--ink-700); }

.btn--ghost { --btn-bd: var(--line-strong); }
.btn--ghost:hover { --btn-bg: var(--bg-alt); --btn-bd: var(--fg-muted); }

.btn--light { --btn-bg: oklch(100% 0 0); --btn-fg: var(--ink-900); }
.btn--light:hover { --btn-bg: oklch(96% 0.01 110); }

.btn--outline-light { --btn-bd: oklch(45% 0.03 125); --btn-fg: oklch(97% 0.01 110); }
.btn--outline-light:hover { --btn-bg: oklch(100% 0 0 / 0.08); --btn-bd: oklch(60% 0.04 125); }

.btn--sm { padding: 0.65em 1.1em; font-size: 0.86rem; }
.btn--lg { padding: 1em 1.75em; font-size: 1rem; }
.btn--block { width: 100%; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-weight: 700;
  color: var(--fg);
  font-size: 0.94rem;
}
.link-arrow .icon { transition: translate 0.25s var(--ease); }
.link-arrow:hover { color: var(--brand-strong); }
.link-arrow:hover .icon { translate: 3px 0; }

/* --------------------------------------------------------------------------
   7. Cabecera y navegación
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
  flex-shrink: 0;
  min-width: 0;
}
.brand__mark { width: auto; height: 40px; }
.brand__text { display: grid; line-height: 1.1; min-width: 0; }
.brand__name {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-transform: uppercase;
  white-space: nowrap;
}
.brand__tag {
  font-size: 0.63rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 650;
  margin-top: 2px;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .brand__tag { display: none; }
  .brand__mark { height: 34px; }
  .header__inner { gap: 0.75rem; }
  .header__actions { gap: 0.2rem; }
  .icon-btn { width: 38px; height: 38px; }
}

@media (max-width: 400px) {
  .header__phone { display: none; }
}

.nav { display: none; }

@media (min-width: 1080px) {
  .nav { display: block; }
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  font-weight: 650;
  font-size: 0.93rem;
  color: var(--fg-soft);
  transition: color 0.2s, background 0.2s;
}
.nav__link:hover,
.nav__link.is-active { color: var(--fg); background: var(--bg-alt); }
.nav__link .icon { width: 0.95em; height: 0.95em; opacity: 0.6; transition: rotate 0.25s var(--ease); }
.nav__item--has-menu:hover > .nav__link .icon { rotate: 180deg; }

/* Mega menú */
.nav__item--has-menu { position: relative; }

.mega {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  translate: -50% 0;
  width: min(860px, 88vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  translate: -50% 8px;
  transition: opacity 0.22s var(--ease), translate 0.22s var(--ease), visibility 0.22s;
}
.nav__item--has-menu:hover .mega,
.nav__item--has-menu:focus-within .mega {
  opacity: 1;
  visibility: visible;
  translate: -50% 0;
}

.mega__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.mega__col-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  padding-bottom: 0.7rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.mega__col-title .icon { color: var(--brand-strong); }
.mega__col ul { display: grid; gap: 0.1rem; }
.mega__col a {
  display: block;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--fg-muted);
  transition: background 0.18s, color 0.18s;
}
.mega__col a:hover { background: var(--bg-alt); color: var(--fg); }

.mega__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

/* Acciones de cabecera */
.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--fg-soft);
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--fg); border-color: var(--line); }
.icon-btn .icon { width: 21px; height: 21px; }

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.header__cta { display: none; }
@media (min-width: 620px) { .header__cta { display: inline-flex; } }

.menu-btn { display: inline-grid; }
@media (min-width: 1080px) { .menu-btn { display: none; } }

/* Menú móvil */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--fg);
  overscroll-behavior: contain;
}
.mobile-menu::backdrop {
  background: oklch(20% 0.02 127 / 0.4);
  backdrop-filter: blur(4px);
}
.mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  padding-inline: var(--gutter);
}
.mobile-menu__body {
  padding: 1.5rem var(--gutter) 3rem;
  overflow-y: auto;
  height: calc(100% - var(--header-h));
  display: grid;
  align-content: start;
  gap: 1.5rem;
}
.mobile-menu__nav { display: grid; gap: 0.15rem; }
.mobile-menu__nav > li > a,
.mobile-menu__nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
}
.mobile-menu__nav summary::-webkit-details-marker { display: none; }
.mobile-menu__nav summary .icon { transition: rotate 0.25s var(--ease); opacity: 0.5; }
.mobile-menu__nav details[open] summary .icon { rotate: 180deg; }
.mobile-menu__sub { display: grid; gap: 0.1rem; padding: 0.6rem 0 0.9rem 0.9rem; }
.mobile-menu__sub a { display: block; padding: 0.45rem 0; font-size: 0.95rem; color: var(--fg-muted); }
.mobile-menu__sub a:hover { color: var(--brand-strong); }
.mobile-menu__contact { display: grid; gap: 0.55rem; font-size: 0.95rem; }
.mobile-menu__contact a { display: flex; align-items: center; gap: 0.6rem; color: var(--fg-soft); }
.mobile-menu__contact .icon { color: var(--brand-strong); }

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: clip;
  background: var(--bg-alt);
  color: var(--fg-soft);
  isolation: isolate;
  padding-block: clamp(2.75rem, 5.5vw, 5rem) clamp(3.25rem, 6.5vw, 5.5rem);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(105% 85% at 92% -18%, color-mix(in oklch, var(--brand) 34%, transparent), transparent 62%),
    radial-gradient(85% 70% at 2% 110%, color-mix(in oklch, var(--brand) 15%, transparent), transparent 62%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, color-mix(in oklch, var(--fg) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklch, var(--fg) 6%, transparent) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(120% 90% at 60% 30%, #000 25%, transparent 76%);
  -webkit-mask-image: radial-gradient(120% 90% at 60% 30%, #000 25%, transparent 76%);
}

.hero__inner {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 980px) {
  .hero__inner { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(2.5rem, 4vw, 4.5rem); }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.42em 0.95em 0.42em 0.6em;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin-bottom: 1.5rem;
}
.hero__eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--brand) 26%, transparent);
}

.hero h1 {
  color: var(--fg);
  max-width: 19ch;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent-lg);
}

.hero__text {
  margin-top: 1.5rem;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 52ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.1rem;
}

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--fg-muted);
}
.hero__trust li { display: flex; align-items: center; gap: 0.45em; }
.hero__trust .icon { color: var(--brand-strong); width: 1.1em; height: 1.1em; }

/* Composición de imágenes */
.hero__media {
  position: relative;
  display: grid;
  gap: 1rem;
}

.hero__figure {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3.4;
}
.hero__figure img,
.hero__figure picture { width: 100%; height: 100%; }
.hero__figure img { object-fit: cover; }
.hero__figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, oklch(15% 0.02 128 / 0.45));
  pointer-events: none;
}

.hero__badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: oklch(18% 0.02 128 / 0.72);
  border: 1px solid oklch(100% 0 0 / 0.18);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  font-size: 0.84rem;
  color: oklch(97% 0.01 110);
}
.hero__badge strong { display: block; font-size: 0.94rem; letter-spacing: -0.01em; }
.hero__badge span { color: oklch(78% 0.015 118); font-size: 0.78rem; }
.hero__badge .icon { color: var(--brand); width: 26px; height: 26px; }

/* --------------------------------------------------------------------------
   9. Barra de datos
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.stats > * { background: var(--bg); }
.stat { padding: 1.6rem clamp(1rem, 2vw, 1.9rem); }
.stat__num {
  display: block;
  font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--fg-muted);
}

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 1.15rem 1rem; }
  .stat__num { font-size: 1.55rem; }
  .stat__label { font-size: 0.78rem; }
}

/* --------------------------------------------------------------------------
   10. Tarjetas de área
   -------------------------------------------------------------------------- */
.areas {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.area-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
  container-type: inline-size;
}
.area-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-3px); }

.area-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
}
.area-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 0.6s var(--ease);
}
.area-card:hover .area-card__media img { scale: 1.045; }
.area-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, oklch(18% 0.02 128 / 0.05) 30%, oklch(18% 0.02 128 / 0.75));
}
.area-card__badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: oklch(100% 0 0 / 0.14);
  border: 1px solid oklch(100% 0 0 / 0.2);
  backdrop-filter: blur(8px);
  font-size: 0.75rem;
  font-weight: 700;
  color: oklch(98% 0.01 110);
  letter-spacing: 0.02em;
}
.area-card__badge .icon { width: 1.15em; height: 1.15em; color: var(--brand); }

.area-card__body { padding: 1.4rem 1.5rem 1.6rem; display: grid; gap: 0.7rem; }
.area-card__title { font-size: 1.3rem; }
.area-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}
.area-card__desc { font-size: 0.92rem; color: var(--fg-muted); line-height: 1.55; }

.area-card__list {
  display: grid;
  gap: 0.32rem;
  margin-top: 0.15rem;
  font-size: 0.86rem;
}
.area-card__list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg-soft);
}
.area-card__list li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   11. Tarjetas de servicio
   -------------------------------------------------------------------------- */
.cards {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.28s var(--ease), box-shadow 0.28s var(--ease), transform 0.28s var(--ease);
  container-type: inline-size;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.55s var(--ease); }
.card:hover .card__media img { scale: 1.05; }

.card__icon {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: oklch(18% 0.02 128 / 0.72);
  border: 1px solid oklch(100% 0 0 / 0.18);
  color: var(--brand);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card__icon .icon { width: 21px; height: 21px; }

.card__body {
  padding: 1.35rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}
.card__kicker {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.card__title { font-size: 1.14rem; letter-spacing: -0.018em; }
.card__title a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.card__desc {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__more {
  margin-top: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--brand-strong);
}
.card__more .icon { width: 1em; height: 1em; transition: translate 0.25s var(--ease); }
.card:hover .card__more .icon { translate: 3px 0; }

/* --------------------------------------------------------------------------
   12. Bloque "por qué" / razones
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split--media-right > .split__media { order: 2; }
}

.split__media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 5 / 4;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}
.split__media img { width: 100%; height: 100%; object-fit: cover; }
.split__media--tall { aspect-ratio: 4 / 5; }

.reasons { display: grid; gap: 0; margin-top: 2rem; border-top: 1px solid var(--line); }
.reason {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.reason__num {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
  padding-top: 0.18rem;
  letter-spacing: 0.04em;
}
.reason h3 { font-size: 1.02rem; margin-bottom: 0.3rem; letter-spacing: -0.015em; }
.reason p { font-size: 0.91rem; color: var(--fg-muted); line-height: 1.55; }

/* --------------------------------------------------------------------------
   13. Proyectos
   -------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.projects-grid > :first-child {
  grid-column: span 2;
  grid-row: span 2;
}

@media (max-width: 760px) {
  .projects-grid > :first-child { grid-column: span 1; grid-row: span 1; }
}

.project-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-800);
  aspect-ratio: 4 / 3;
  height: 100%;
  color: #fff;
  container-type: inline-size;
}
.projects-grid > :first-child .project-card { aspect-ratio: auto; }

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 0.7s var(--ease), opacity 0.4s;
}
.project-card:hover img { scale: 1.05; }
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, oklch(15% 0.02 128 / 0.05) 25%, oklch(15% 0.02 128 / 0.88));
  transition: opacity 0.3s;
}
.project-card__body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 1.25rem 1.35rem;
  display: grid;
  gap: 0.35rem;
}
.project-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}
.project-card__title {
  font-size: 1.08rem;
  font-weight: 750;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.projects-grid > :first-child .project-card__title { font-size: clamp(1.15rem, 1rem + 1vw, 1.6rem); }
.project-card__loc { font-size: 0.8rem; color: oklch(80% 0.015 118); }

/* --------------------------------------------------------------------------
   14. Proceso
   -------------------------------------------------------------------------- */
.steps {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  counter-reset: step;
}
.step {
  position: relative;
  padding: 1.6rem 1.5rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  counter-increment: step;
}
.step::before {
  content: "0" counter(step);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--brand-strong);
  margin-bottom: 0.9rem;
}
.step h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.step p { font-size: 0.9rem; color: var(--fg-muted); line-height: 1.55; }

/* --------------------------------------------------------------------------
   15. Preguntas frecuentes
   -------------------------------------------------------------------------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  list-style: none;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--brand-strong); }
.faq summary .faq__icon {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  transition: border-color 0.25s, rotate 0.3s var(--ease);
}
.faq summary .faq__icon::before,
.faq summary .faq__icon::after {
  content: "";
  position: absolute;
  inset: 50% 4px auto;
  height: 1.5px;
  background: currentColor;
  translate: 0 -50%;
  transition: opacity 0.2s;
}
.faq summary .faq__icon::after { rotate: 90deg; }
.faq details[open] summary .faq__icon { border-color: var(--brand-strong); rotate: 180deg; }
.faq details[open] summary .faq__icon::after { opacity: 0; }
.faq__answer {
  padding: 0 0 1.3rem;
  max-width: 70ch;
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}
.faq details[open] .faq__answer { animation: fade-slide 0.35s var(--ease); }

@keyframes fade-slide {
  from { opacity: 0; translate: 0 -6px; }
  to { opacity: 1; translate: 0 0; }
}

/* --------------------------------------------------------------------------
   16. Banda CTA
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(130% 130% at 100% 0%, color-mix(in oklch, var(--brand) 36%, transparent), transparent 62%),
    var(--card);
  border: 1px solid color-mix(in oklch, var(--brand) 28%, var(--line));
  color: var(--fg-soft);
  padding: clamp(2.2rem, 5vw, 3.6rem);
  isolation: isolate;
  box-shadow: var(--shadow-sm);
}
.cta-band__inner {
  display: grid;
  gap: 1.75rem 3rem;
  align-items: center;
}
@media (min-width: 780px) {
  .cta-band__inner { grid-template-columns: minmax(0, 1.45fr) auto; }
}
.cta-band h2 { color: var(--fg); max-width: 22ch; }
.cta-band p { margin-top: 0.8rem; color: var(--fg-muted); max-width: 48ch; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* --------------------------------------------------------------------------
   17. Pie de página
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-alt);
  color: var(--fg-muted);
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  font-size: 0.92rem;
}
.footer__top {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  padding-bottom: 2.75rem;
  border-bottom: 1px solid var(--line);
}
.footer__brand { grid-column: 1 / -1; max-width: 36ch; }
@media (min-width: 900px) { .footer__brand { grid-column: span 2; } }

.footer__brand .brand__name { color: var(--fg); }
.footer__brand .brand__tag { color: var(--fg-muted); }
.footer__brand p { margin-top: 1.1rem; color: var(--fg-muted); line-height: 1.6; max-width: 34ch; }
.footer__mark { width: auto; height: 46px; margin-bottom: 1rem; }

.footer__title {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 1rem;
}
.footer__list { display: grid; gap: 0.55rem; }
.footer__list a { color: var(--fg-muted); transition: color 0.2s; }
.footer__list a:hover { color: var(--brand-strong); }

.footer__contact { display: grid; gap: 0.7rem; }
.footer__contact li { display: flex; gap: 0.65rem; align-items: start; }
.footer__contact .icon { color: var(--brand-strong); width: 18px; height: 18px; margin-top: 2px; }
.footer__contact a { color: var(--fg); font-weight: 600; }
.footer__contact a:hover { color: var(--brand-strong); }

.socials { display: flex; gap: 0.5rem; margin-top: 1.25rem; }
.socials a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  color: var(--fg-soft);
  background: var(--card);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.socials a:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.socials .icon { width: 18px; height: 18px; }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.75rem;
  font-size: 0.82rem;
  color: var(--fg-muted);
}
.footer__bottom a { color: var(--fg-soft); }
.footer__bottom a:hover { color: var(--brand-strong); }

/* Marca según el tema: color sobre fondos claros, blanca sobre oscuros */
.mark--light { display: none; }
:root[data-theme="dark"] .mark--color { display: none; }
:root[data-theme="dark"] .mark--light { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark--color { display: none; }
  :root:not([data-theme="light"]) .mark--light { display: block; }
}

/* Botón flotante WhatsApp */
.wa-float {
  position: fixed;
  right: clamp(1rem, 2.5vw, 1.75rem);
  bottom: clamp(1rem, 2.5vw, 1.75rem);
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.15rem 0.8rem 0.95rem;
  border-radius: 999px;
  background: oklch(63% 0.15 152);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 12px 30px -10px oklch(40% 0.12 152 / 0.6);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s;
}
.wa-float:hover { transform: translateY(-2px); background: oklch(58% 0.15 152); box-shadow: 0 18px 38px -12px oklch(40% 0.12 152 / 0.7); }
.wa-float .icon { width: 22px; height: 22px; }
.wa-float span { display: none; }
@media (min-width: 560px) { .wa-float span { display: inline; } }

/* Si la página ya muestra un botón de WhatsApp, el flotante se oculta */
body.has-wa-cta .wa-float { display: none; }

/* --------------------------------------------------------------------------
   18. Página interna: encabezado
   -------------------------------------------------------------------------- */
.page-head {
  position: relative;
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(2.5rem, 5vw, 3.75rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(80% 120% at 85% -20%, var(--brand-soft), transparent 60%),
    var(--bg-alt);
  overflow: clip;
}
.page-head__inner { max-width: 68ch; }
.page-head h1 { font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.5rem); }
.page-head p { margin-top: 1.1rem; color: var(--fg-muted); font-size: var(--fs-lead); line-height: 1.55; max-width: 60ch; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.75rem; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-bottom: 1.4rem;
}
.breadcrumb li { display: flex; align-items: center; gap: 0.45rem; }
.breadcrumb li:not(:last-child)::after { content: "/"; color: var(--line-strong); }
.breadcrumb a:hover { color: var(--brand-strong); }
.breadcrumb [aria-current="page"] { color: var(--fg); font-weight: 600; }

/* --------------------------------------------------------------------------
   19. Prosa (contenido Markdown)
   -------------------------------------------------------------------------- */
.prose { font-size: 1.02rem; line-height: 1.72; color: var(--fg-soft); max-width: 68ch; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  margin-top: 2.2em;
  margin-bottom: 0.2em;
  padding-top: 0.2em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.prose h3 { font-size: 1.14rem; margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose ul, .prose ol { display: grid; gap: 0.5em; padding-left: 0; }
.prose ul li { position: relative; padding-left: 1.4em; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.prose ol { counter-reset: item; }
.prose ol li { position: relative; padding-left: 1.9em; }
.prose ol li::before {
  counter-increment: item;
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0.15em;
  display: grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.76rem;
  font-weight: 800;
}
.prose strong { color: var(--fg); font-weight: 750; }
.prose a { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 1.1rem 1.4rem;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-alt);
  color: var(--fg-soft);
  font-size: 1.02rem;
}
.prose blockquote p { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose code {
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}
.prose pre {
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--ink-900);
  color: oklch(92% 0.01 110);
  overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose img { border-radius: var(--radius-sm); margin-block: 1.5em; }

/* --------------------------------------------------------------------------
   20. Ficha de servicio
   -------------------------------------------------------------------------- */
.service-layout {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
@media (min-width: 960px) {
  .service-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

.service-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
  margin-bottom: 2rem;
}
.service-hero img { width: 100%; height: 100%; object-fit: cover; }

.features {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  margin: 1.75rem 0 0;
  padding: 0;
}
.features li {
  display: flex;
  align-items: start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--fg-soft);
}
.features .icon {
  width: 18px;
  height: 18px;
  color: var(--brand-strong);
  margin-top: 1px;
  flex-shrink: 0;
}

.sidebar { display: grid; gap: 1.1rem; position: sticky; top: calc(var(--header-h) + 1.5rem); }
.sidebar-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}
.sidebar-card--dark {
  background: var(--ink-900);
  border-color: var(--ink-700);
  color: oklch(92% 0.012 115);
}
.sidebar-card--dark h3 { color: oklch(98% 0.008 110); }
.sidebar-card h3 { font-size: 1.1rem; margin-bottom: 0.6rem; }
.sidebar-card p { font-size: 0.9rem; color: var(--fg-muted); line-height: 1.55; }
.sidebar-card--dark p { color: oklch(76% 0.015 118); }
.sidebar-card .btn { margin-top: 1rem; }
.sidebar-list { display: grid; gap: 0.1rem; margin-top: 0.5rem; }
.sidebar-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.65rem;
  border-radius: 9px;
  font-size: 0.9rem;
  color: var(--fg-soft);
  transition: background 0.2s, color 0.2s;
}
.sidebar-list a:hover { background: var(--bg-alt); color: var(--brand-strong); }
.sidebar-list .icon { width: 0.95em; height: 0.95em; opacity: 0.45; }

/* Galería */
.gallery {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin-top: 2rem;
}
.gallery button {
  display: block;
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  cursor: zoom-in;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.4s var(--ease); }
.gallery button:hover img { scale: 1.06; }

/* Visor de imágenes */
.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
}
.lightbox::backdrop { background: oklch(10% 0.01 128 / 0.92); backdrop-filter: blur(6px); }
.lightbox__inner {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: oklch(100% 0 0 / 0.12);
  color: #fff;
  border: 1px solid oklch(100% 0 0 / 0.2);
  transition: background 0.2s;
}
.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover { background: oklch(100% 0 0 / 0.24); }
.lightbox__close { top: 1.25rem; right: 1.25rem; }
.lightbox__prev { left: 1rem; top: 50%; translate: 0 -50%; }
.lightbox__next { right: 1rem; top: 50%; translate: 0 -50%; }

/* --------------------------------------------------------------------------
   21. Formularios
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.field { display: grid; gap: 0.42rem; }
.field--full { grid-column: 1 / -1; }

.field label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.005em;
}
.field label .req { color: var(--brand-strong); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-size: 0.95rem;
  color: var(--fg);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field textarea { resize: vertical; min-height: 130px; field-sizing: content; max-height: 340px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--fg-muted); opacity: 0.7; }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--fg-muted); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 3.5px color-mix(in oklch, var(--brand) 28%, transparent);
}
.field input:user-invalid,
.field textarea:user-invalid { border-color: oklch(58% 0.19 25); }
.field__help { font-size: 0.78rem; color: var(--fg-muted); }
.field__error { font-size: 0.8rem; color: oklch(52% 0.19 25); font-weight: 600; }

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-note {
  display: flex;
  gap: 0.6rem;
  align-items: start;
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.5;
}
.form-note .icon { color: var(--brand-strong); width: 16px; height: 16px; margin-top: 2px; }

.alert {
  display: flex;
  gap: 0.7rem;
  align-items: start;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.alert--error { background: oklch(96% 0.03 25); color: oklch(38% 0.15 25); border: 1px solid oklch(88% 0.06 25); }
.alert--success { background: var(--brand-soft); color: oklch(32% 0.08 126); border: 1px solid oklch(85% 0.07 122); }
.alert .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* Contacto */
.contact-layout {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
@media (min-width: 940px) {
  .contact-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}

.contact-card {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.contact-info { display: grid; gap: 1.5rem; }
.contact-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
}
.contact-item__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.contact-item__icon .icon { width: 20px; height: 20px; }
.contact-item h3 { font-size: 0.9rem; margin-bottom: 0.2rem; letter-spacing: 0; }
.contact-item p, .contact-item a { font-size: 0.95rem; color: var(--fg-muted); line-height: 1.5; }
.contact-item a:hover { color: var(--brand-strong); }

.map-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 11;
  background: var(--bg-alt);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; filter: saturate(0.85); }

/* --------------------------------------------------------------------------
   22. Utilidades
   -------------------------------------------------------------------------- */
.mt-xs { margin-top: 0.5rem; }
.mt-sm { margin-top: 0.75rem; }
.mt-1 { margin-top: 1rem; }
.mt-md { margin-top: 1.5rem; }
.mt-2 { margin-top: 1.75rem; }
.mt-lg { margin-top: 2.25rem; }
.mt-xl { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 0.75rem; }
.mb-md { margin-bottom: 1.5rem; }

.maxw-40 { max-width: 40ch; }
.maxw-48 { max-width: 48ch; }
.maxw-56 { max-width: 56ch; }
.maxw-64 { max-width: 64ch; }

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.eyebrow--center { justify-content: center; }

.row-center {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 2rem;
}
.row-between {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.4rem;
}

.section--center {
  min-height: 62vh;
  display: grid;
  place-items: center;
}
.container--narrow {
  max-width: 620px;
  text-align: center;
}

.split--start { align-items: start; }
.sidebar--static { position: static; }
.split__media--portrait { aspect-ratio: 4 / 5; }
.prose--spaced { margin-top: 2rem; }
.gallery--spaced { margin-top: 2.5rem; }
.section-head--flush { margin-bottom: 0; }
.meta-row--spaced { margin-top: 1.25rem; }

.project-cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 8;
  margin-bottom: 2.5rem;
  background: var(--bg-alt);
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; }

.not-found__code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.thanks-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  margin: 0 auto 1.75rem;
}
.thanks-icon .icon { width: 36px; height: 36px; }

.small-note { font-size: 0.9rem; color: var(--fg-muted); }
.link-inline { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 2px; }

/* Buscador */
.search-form {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
  max-width: 560px;
}
.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--fg);
  font-size: 0.95rem;
}
.search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 3.5px color-mix(in oklch, var(--brand) 28%, transparent);
}

.search-results {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.search-results > li { background: var(--bg); }
.search-results a {
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem 1.35rem;
  transition: background 0.2s;
}
.search-results a:hover { background: var(--bg-alt); }
.search-results .tag { justify-self: start; font-size: 0.7rem; }
.search-result__title {
  color: var(--fg);
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.015em;
}
.search-result__desc { font-size: 0.89rem; color: var(--fg-muted); line-height: 1.55; }

/* Visor */
.lightbox__count {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  translate: -50% 0;
  color: oklch(100% 0 0 / 0.72);
  font-size: 0.85rem;
}

/* Contacto */
.contact-card h2 { font-size: 1.35rem; margin-bottom: 0.4rem; }
.contact-card__intro { color: var(--fg-muted); font-size: 0.92rem; margin-bottom: 1.6rem; }
.contact-card .req { color: var(--brand-strong); }
.form-note--narrow { max-width: 34ch; }
.map-frame--spaced { margin-top: 1.5rem; }
.contact-info--spaced { margin-top: 0.9rem; }
.sidebar-card--dark .eyebrow { color: oklch(78% 0.02 120); }

/* --------------------------------------------------------------------------
   23. Varios
   -------------------------------------------------------------------------- */
.empty-state {
  padding: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  background: var(--bg-alt);
  color: var(--fg-muted);
}
.empty-state h2 { font-size: 1.3rem; margin-bottom: 0.6rem; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
  font-size: 0.84rem;
  color: var(--fg-muted);
}
.meta-row li { display: flex; align-items: center; gap: 0.4em; }
.meta-row .icon { width: 0.95em; height: 0.95em; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.28em 0.7em;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.divider { height: 1px; background: var(--line); border: 0; margin-block: clamp(2rem, 4vw, 3rem); }

/* Artículo */
.article-head { max-width: 70ch; }
.article-cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 8;
  margin-top: 2rem;
  background: var(--bg-alt);
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { margin-top: clamp(2rem, 4vw, 3rem); }

/* Rejilla de artículos */
.post-grid { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
}
.post-card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.post-card__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-alt); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.5s var(--ease); }
.post-card:hover .post-card__media img { scale: 1.05; }
.post-card__body { padding: 1.2rem 1.25rem 1.4rem; display: grid; gap: 0.5rem; align-content: start; flex: 1; }
.post-card__date { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.post-card__title { font-size: 1.06rem; line-height: 1.32; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card__excerpt { font-size: 0.88rem; color: var(--fg-muted); line-height: 1.55; }

/* --------------------------------------------------------------------------
   23. Animaciones de entrada (solo si el navegador las soporta)
   -------------------------------------------------------------------------- */
@keyframes reveal-in {
  from { opacity: 0; translate: 0 22px; }
  to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 8%;
    }
  }
}

/* --------------------------------------------------------------------------
   24. Impresión
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .wa-float, .cta-band, .sidebar, .hero__media { display: none !important; }
  .reveal { animation: none !important; opacity: 1 !important; translate: none !important; }
  body { background: #fff; color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
}
