/* ==========================================================================
   nndrei.dev — hoja de estilos única
   --------------------------------------------------------------------------
   Orden del fichero:
     1. Tokens de diseño
     2. Reset y base
     3. Tipografía
     4. Layout (container, secciones)
     5. Componentes reutilizables
     6. Animaciones de entrada
     7. Páginas
     8. Responsive
   Cada componente lleva encima un comentario con su uso en el HTML.
   ========================================================================== */


/* ==========================================================================
   1. TOKENS DE DISEÑO
   ========================================================================== */

:root {
  /* --- Fondo y neutros --- */
  --bg-page: #F4F3F0;        /* fondo general, gris cálido muy claro */
  --surface: #FFFFFF;        /* tarjetas y píldoras */
  --text-primary: #1A1A18;
  --text-secondary: #5F5E5A;
  --text-muted: #6F6E69;     /* ajustado desde #8A8983: aquel daba 3.16:1 sobre
                                --bg-page y no pasaba AA en texto de 12-13px */
  --border: #E3E1DA;         /* único borde permitido (btn-secondary, inputs) */

  /* --- Azul · Desarrollo web --- */
  --blue-soft: #E6F1FB;
  --blue-mid: #378ADD;
  --blue-dark: #0C447C;
  --blue-tint: #85B7EB;      /* tono intermedio para los iconos duotono */

  /* --- Morado · Automatización IA + color de marca (CTAs) --- */
  --purple-soft: #EEEDFE;
  --purple-mid: #7F77DD;
  --purple-dark: #26215C;
  --purple-tint: #AFA9EC;

  /* --- Rosa · CRM y sistemas + Ruper/personal --- */
  --pink-soft: #FBEAF0;
  --pink-mid: #D4537E;
  --pink-dark: #4B1528;
  --pink-tint: #ED93B1;

  /* --- Ámbar · Mantenimiento --- */
  --amber-soft: #FAEEDA;
  --amber-mid: #EF9F27;
  --amber-dark: #412402;
  --amber-tint: #FAC775;

  /* --- Teal · RESERVADO: resultados, éxito y destacado del blog --- */
  --teal-soft: #E1F5EE;
  --teal-mid: #1D9E75;
  --teal-dark: #04342C;

  /* --- Rojo de error (solo validación de formulario) --- */
  --error: #A32D2D;
  /* --- Naranja de la etiqueta RETO en proyectos --- */
  --challenge: #993C1D;

  /* --- Formas --- */
  --radius-pill: 999px;      /* botones, badges, burbujas, filtros */
  --radius-card: 16px;       /* tarjetas */
  --radius-input: 12px;      /* campos de formulario */

  /* --- Medidas --- */
  --container: 960px;        /* ancho máximo general */
  --reading: 640px;          /* ancho máximo de contenido de lectura */

  /* --- Movimiento --- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 150ms;
  --dur-enter: 400ms;
}


/* ==========================================================================
   2. RESET Y BASE
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

ul { margin: 0; padding: 0; list-style: none; }

/* Focus ring accesible: único uso de box-shadow en todo el sitio. */
:focus-visible {
  outline: 2px solid var(--purple-dark);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Enlace de salto para teclado y lectores de pantalla. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 18px;
  background: var(--purple-dark);
  color: var(--purple-soft);
  border-radius: 0 0 var(--radius-input) 0;
  text-decoration: none;
  font-size: 13px;
}
.skip-link:focus { left: 0; }


/* ==========================================================================
   3. TIPOGRAFÍA
   Escala fija. Solo pesos 400 y 500 — nunca 600 ni 700.
   ========================================================================== */

h1, h2, h3 {
  margin: 0;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 17px; line-height: 1.35; }

p { margin: 0; }

.text-center { text-align: center; }

/* Etiqueta de sección. Cuando encabeza una sección va sobre un <h2>, para no
   saltarse un nivel de encabezado; la clase le quita el aspecto de título:
   <h2 class="section-label">Trabajo reciente</h2> */
.section-label {
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* Subtítulo bajo un h1 de hero. */
.lede {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}


/* ==========================================================================
   4. LAYOUT
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Contenedor estrecho para texto largo (posts, CV, legales). */
.container--reading { max-width: calc(var(--reading) + 48px); }

main { display: block; }

.section { padding: 56px 0; }
.section--tight { padding: 36px 0; }

/* Hero corto compartido por servicios / proyectos / notas / hablamos. */
.page-hero {
  padding: 56px 0 32px;
  text-align: center;
}
.page-hero h1 { margin-bottom: 12px; }
.page-hero .lede {
  max-width: 460px;
  margin: 0 auto;
}


/* ==========================================================================
   5. COMPONENTES
   ========================================================================== */

/* --------------------------------------------------------------------------
   .nav — cabecera sticky, idéntica en todas las páginas.
   Marcado: header.nav > .nav__inner > .nav__brand + .nav__toggle + nav.nav__menu
   El enlace de la página actual lleva class="is-active" y aria-current="page".
   En hablamos.html el CTA lleva además class="nav__cta is-active" (invertido).
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-page);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.nav__brand {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-primary);
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav__menu a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.nav__menu a:hover { color: var(--text-primary); }
.nav__menu a.is-active {
  color: var(--text-primary);
  font-weight: 500;
}

/* CTA del nav: píldora clara; invertida cuando estás en hablamos.html. */
.nav__cta {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--purple-soft);
  color: var(--purple-dark) !important;
  font-weight: 500;
  transition: background var(--dur-fast) var(--ease);
}
.nav__cta:hover { background: #E3E1FD; }
.nav__cta.is-active {
  background: var(--purple-dark);
  color: var(--purple-soft) !important;
}
.nav__cta.is-active:hover { background: #322B78; }

/* Botón hamburguesa: solo existe si hay JS (ver .js más abajo). */
.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav__toggle-bar {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text-primary);
}

/* --------------------------------------------------------------------------
   .footer — pie idéntico en todas las páginas. Sin borde superior: solo aire.
   -------------------------------------------------------------------------- */

.footer {
  padding: 48px 0 32px;
  background: var(--bg-page);
}

.footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__name { font-size: 14px; font-weight: 500; }
.footer__role { font-size: 13px; color: var(--text-secondary); }

.footer__links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__links a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}
.footer__links a:hover { color: var(--text-primary); }

.footer__legal {
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-muted);
}
.footer__legal a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer__legal a:hover { color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   .pill — píldora base. Variantes por familia de color:
   <span class="pill pill--blue">Desde 300€</span>
   -------------------------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

/* Dentro de una .card (blanca) la píldora por defecto sería invisible:
   ahí se usa la variante --muted, que invierte fondo y superficie. */
.pill--muted  { background: var(--bg-page);     color: var(--text-secondary); }

.pill--blue   { background: var(--blue-soft);   color: var(--blue-dark); }
.pill--purple { background: var(--purple-soft); color: var(--purple-dark); }
.pill--pink   { background: var(--pink-soft);   color: var(--pink-dark); }
.pill--amber  { background: var(--amber-soft);  color: var(--amber-dark); }
.pill--teal   { background: var(--teal-soft);   color: var(--teal-dark); }

/* --------------------------------------------------------------------------
   .icon-bubble — círculo pastel con el SVG duotono dentro.
   <span class="icon-bubble icon-bubble--md icon-bubble--blue">…svg…</span>
   Alturas fijas para no provocar CLS.
   -------------------------------------------------------------------------- */

.icon-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
}

.icon-bubble--sm { width: 40px; height: 40px; }
.icon-bubble--md { width: 48px; height: 48px; }
.icon-bubble--lg { width: 54px; height: 54px; }

.icon-bubble--blue   { background: var(--blue-soft); }
.icon-bubble--purple { background: var(--purple-soft); }
.icon-bubble--pink   { background: var(--pink-soft); }
.icon-bubble--amber  { background: var(--amber-soft); }
.icon-bubble--teal   { background: var(--teal-soft); }

/* Iconos pequeños dentro de píldoras y radios del formulario. */
.icon-mini { width: 18px; height: 18px; flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   .card — superficie blanca. Sin borde, sin sombra: separa el cambio de fondo.
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 24px;
}
.card--tight { padding: 16px; }

/* --------------------------------------------------------------------------
   Botones. .btn-primary siempre es el CTA principal (morado oscuro).
   -------------------------------------------------------------------------- */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}

.btn-primary {
  background: var(--purple-dark);
  color: var(--purple-soft);
  border: 0;
}
.btn-primary:hover { transform: translateY(-1px); background: #322B78; }

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { transform: translateY(-1px); }

/* --------------------------------------------------------------------------
   .badge-result — píldora teal con la métrica conseguida.
   El teal está reservado a esto, a estados de éxito y al destacado del blog.
   -------------------------------------------------------------------------- */

.badge-result {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 500;
}

/* Punto del badge de estado del hero. No usa --teal-mid porque sobre
   --teal-soft se queda en 2.98:1 y no llega al mínimo de 3:1 de gráficos. */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: #188F69;
  flex: 0 0 auto;
}


/* ==========================================================================
   6. ANIMACIONES DE ENTRADA
   main.js añade la clase .js al <html> y observa los [data-animate].
   Sin JS todo se ve, porque el estado inicial solo aplica bajo .js.
   ========================================================================== */

.js [data-animate] {
  opacity: 0;
  transform: translateY(12px);
}

.js [data-animate].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-enter) ease-out,
              transform var(--dur-enter) ease-out;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-animate] { opacity: 1; transform: none; }
  .btn-primary:hover,
  .btn-secondary:hover { transform: none; }
}


/* ==========================================================================
   7. PÁGINAS
   ========================================================================== */

/* --------------------------------------------------------------------------
   7.1 HOME — hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 72px 0 56px;
  text-align: center;
}

.hero h1 {
  max-width: 440px;
  margin: 20px auto 16px;
}

.hero .lede {
  max-width: 420px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   7.2 HOME — servicios en arco
   Las filas se desplazan a la derecha progresivamente (0/28/56/28px) para
   dibujar un arco. En móvil el desplazamiento se anula.
   -------------------------------------------------------------------------- */

.arc {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arc__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px 8px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-fast) var(--ease);
}
.arc__row:hover { transform: translateY(-1px); }

.arc__row:nth-child(1) { margin-left: 0; }
.arc__row:nth-child(2) { margin-left: 28px; }
.arc__row:nth-child(3) { margin-left: 56px; }
.arc__row:nth-child(4) { margin-left: 28px; }

.arc__name {
  font-size: 15px;
  font-weight: 500;
}
.arc__time {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   7.3 HOME — grid de trabajo reciente
   -------------------------------------------------------------------------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-fast) var(--ease);
}
.work-card:hover { transform: translateY(-2px); }

.work-card__line {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1 1 auto;
}

.work-card .badge-result { align-self: flex-start; }

/* --------------------------------------------------------------------------
   7.4 Bloque CTA final (home y servicios)
   -------------------------------------------------------------------------- */

.cta-final {
  padding: 64px 0 72px;
  text-align: center;
}
.cta-final h2 { margin-bottom: 8px; }
.cta-final p { margin-bottom: 24px; }

/* --------------------------------------------------------------------------
   7.5 SERVICIOS — grid 2×2, puntos clave y proceso
   -------------------------------------------------------------------------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Compensa el desplazamiento del nav sticky al saltar a #web, #ia… */
  scroll-margin-top: 80px;
}

.service-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.service-card__time {
  font-size: 13px;
  color: var(--text-muted);
}
.service-card__desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.service-points { display: flex; flex-direction: column; gap: 8px; }
.service-points li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.service-points .check {
  font-weight: 500;
  line-height: 1.5;
}
/* El check toma el tono medio de la familia del servicio. */
.service-card--blue   .check { color: var(--blue-mid); }
.service-card--purple .check { color: var(--purple-mid); }
.service-card--pink   .check { color: var(--pink-mid); }
.service-card--amber  .check { color: #B87510; }  /* amber-mid oscurecido: el
                                                     original no llegaba a 3:1
                                                     sobre blanco */

.service-card__price { margin-top: auto; align-self: flex-start; }

/* Proceso: 5 pasos en píldora. El detalle se ve siempre; con JS se pliega. */
.process {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.process__step {
  flex: 1 1 150px;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
}

.process__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  cursor: default;
}
.js .process__head { cursor: pointer; }

.process__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 500;
}

/* Sin JS se ve siempre; con JS, main.js le pone [hidden] y lo pliega. */
.process__desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   7.6 PROYECTOS — tarjetas apiladas
   -------------------------------------------------------------------------- */

.projects {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.project { scroll-margin-top: 80px; }

.project__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.project__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.project__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.project__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.project__label--challenge { color: var(--challenge); }
.project__label--solution { color: var(--blue-dark); }

.project__text {
  font-size: 13px;
  color: var(--text-secondary);
}

.project__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.project__tech {
  padding: 4px 10px;
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   7.7 NOTAS — filtros, destacado y listado
   -------------------------------------------------------------------------- */

/* La barra de filtros solo aparece con JS: sin él no haría nada. */
.filters { display: none; }
.js .filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}

.filter {
  padding: 7px 16px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.filter:hover { color: var(--text-primary); }
.filter[aria-pressed="true"] {
  background: var(--purple-dark);
  color: var(--purple-soft);
  font-weight: 500;
}

.filters__sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

/* Tarjeta destacada: el único bloque grande de color de la página. */
.featured {
  display: block;
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 28px;
  border-radius: var(--radius-card);
  background: var(--teal-soft);
  color: var(--teal-dark);
  text-decoration: none;
}
.featured__badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 14px;
}
.featured h2 {
  font-size: 24px;
  margin-bottom: 10px;
}
.featured__excerpt {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.85;
  margin-bottom: 14px;
}
.featured__meta {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 20px;
}
.featured__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--teal-dark);
  color: var(--teal-soft);
  font-size: 14px;
  font-weight: 500;
  transition: transform var(--dur-fast) var(--ease);
}
.featured:hover .featured__cta { transform: translateY(-1px); }

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.note {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-fast) var(--ease);
}
.note:hover { transform: translateY(-1px); }
.note[hidden] { display: none; }

.note__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.note__date {
  font-size: 12px;
  color: var(--text-muted);
}
.note__title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}
.note__excerpt {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Mensaje de "sin resultados" del filtrado. */
.notes-empty {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   7.8 POST — tipografía de lectura
   -------------------------------------------------------------------------- */

.post {
  max-width: var(--reading);
  margin: 0 auto;
  padding: 48px 0 64px;
}
.post__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.post h1 { margin-bottom: 28px; }

.post__body { font-size: 17px; line-height: 1.8; }
.post__body p { margin-bottom: 22px; }
.post__body h2 {
  font-size: 20px;
  margin: 36px 0 14px;
}
.post__body a { color: var(--blue-dark); }

/* Mini-bio con CTA suave al final del post. */
.post-bio {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.post-bio__text { font-size: 13px; color: var(--text-secondary); flex: 1 1 220px; }

/* --------------------------------------------------------------------------
   7.9 HABLAMOS — formulario
   -------------------------------------------------------------------------- */

.form {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 72px;
}

.field { margin-bottom: 24px; }

.field__legend,
.field__label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  padding: 0;
}

fieldset {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.field__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}
textarea { min-height: 130px; resize: vertical; }

input::placeholder,
textarea::placeholder { color: var(--text-muted); }

input:focus-visible,
textarea:focus-visible,
.btn-primary:focus-visible,
.option:has(input:focus-visible) {
  outline: none;
  box-shadow: 0 0 0 3px var(--purple-soft);
  border-color: var(--purple-mid);
}

/* Radios-píldora: el input real queda oculto pero sigue siendo focusable
   (no usamos display:none, que lo sacaría del orden de tabulación). */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option {
  position: relative;  /* ancla el input oculto, que va en absolute */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
/* El anillo de foco lo pinta la píldora, no el input invisible. */
.option input:focus-visible { outline: none; }
.option:hover { color: var(--text-primary); }

/* Seleccionado = fondo soft + borde 1.5px del tono medio de la familia. */
.option--blue:has(input:checked)   { background: var(--blue-soft);   border-color: var(--blue-mid);   color: var(--blue-dark); }
.option--purple:has(input:checked) { background: var(--purple-soft); border-color: var(--purple-mid); color: var(--purple-dark); }
.option--pink:has(input:checked)   { background: var(--pink-soft);   border-color: var(--pink-mid);   color: var(--pink-dark); }
.option--amber:has(input:checked)  { background: var(--amber-soft);  border-color: var(--amber-mid);  color: var(--amber-dark); }
.option--neutral:has(input:checked){ background: var(--purple-soft); border-color: var(--purple-mid); color: var(--purple-dark); }

/* Fallback para navegadores sin :has() — el estado se marca desde form.js. */
.option.is-checked { border-color: var(--purple-mid); background: var(--purple-soft); color: var(--purple-dark); }

.error-msg {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--error);
}
/* display:block gana al [hidden] del navegador, así que hay que repetirlo. */
.error-msg[hidden] { display: none; }
[aria-invalid="true"] { border-color: var(--error); }

.form__note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.form__note a { color: var(--text-secondary); }

/* Estado de éxito: sustituye al formulario. */
.form-success {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 480px;
  margin: 0 auto 72px;
  padding: 24px;
  border-radius: var(--radius-card);
  background: var(--teal-soft);
  color: var(--teal-dark);
}
.form-success[hidden] { display: none; }   /* ídem: display:flex gana al [hidden] */
.form-success p { font-size: 15px; font-weight: 500; }

/* --------------------------------------------------------------------------
   7.10 CV — página sobria, sin pastel salvo píldoras neutras
   -------------------------------------------------------------------------- */

.cv {
  max-width: var(--reading);
  margin: 0 auto;
  padding: 48px 0 72px;
}
.cv__role { font-size: 15px; color: var(--text-secondary); margin-top: 4px; }
.cv__summary { margin-top: 20px; color: var(--text-secondary); }

.cv__section { margin-top: 40px; }
.cv__section .section-label { margin-bottom: 16px; }

.cv-job { margin-bottom: 24px; }
.cv-job__role { font-size: 15px; font-weight: 500; }
.cv-job__company { font-size: 14px; color: var(--text-secondary); }
.cv-job__meta { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.cv-job__desc { font-size: 14px; color: var(--text-secondary); }

.cv-skills { margin-bottom: 18px; }
.cv-skills__area { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.cv-skills__list { display: flex; flex-wrap: wrap; gap: 8px; }

.cv__certs li { font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }

/* --------------------------------------------------------------------------
   7.11 404
   -------------------------------------------------------------------------- */

.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* 64px de nav + 176px aprox. de footer: centra el bloque en lo que queda. */
  min-height: calc(100vh - 240px);
  padding: 48px 0;
}

.notfound__bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-pill);
  background: var(--pink-soft);
  margin-bottom: 24px;
}

.notfound__code {
  font-size: 52px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.notfound__code span { color: var(--pink-mid); }

.notfound__title { font-size: 18px; font-weight: 500; margin-bottom: 10px; }

.notfound__text {
  max-width: 340px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.notfound__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Orejas de Ruper: balanceo de ±3°. Se anula con prefers-reduced-motion
   (la regla global de la sección 6 reduce la duración a 0). El origen es la
   base de cada oreja, para que giren desde la cabeza y no desde su centro. */
.ear-left  { transform-origin: 27px 30px; }
.ear-right { transform-origin: 45px 30px; }

@media (prefers-reduced-motion: no-preference) {
  .ear-left  { animation: ear-wobble 2.5s var(--ease) infinite alternate; }
  .ear-right { animation: ear-wobble 2.5s var(--ease) infinite alternate-reverse; }
}

@keyframes ear-wobble {
  from { transform: rotate(-3deg); }
  to   { transform: rotate(3deg); }
}

/* --------------------------------------------------------------------------
   7.12 Páginas legales
   -------------------------------------------------------------------------- */

.legal { max-width: var(--reading); margin: 0 auto; padding: 48px 0 72px; }
.legal h2 { font-size: 17px; margin: 32px 0 10px; }
.legal p { color: var(--text-secondary); margin-bottom: 14px; }


/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
  .work-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  h1 { font-size: 27px; }
  h2 { font-size: 21px; }

  /* Nav móvil: con JS, hamburguesa + columna desplegable.
     Sin JS (sin la clase .js) el menú se queda visible y envuelto. */
  .js .nav__toggle { display: flex; }

  .js .nav__menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 24px 20px;
    background: var(--bg-page);
  }
  .js .nav__menu.is-open { display: flex; }
  .js .nav__menu a { padding: 10px 0; font-size: 15px; }
  .js .nav__cta { align-self: flex-start; padding: 9px 18px; }

  .nav__menu {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  /* El arco se endereza: en columna estrecha el desplazamiento estorba. */
  .arc__row:nth-child(2),
  .arc__row:nth-child(3),
  .arc__row:nth-child(4) { margin-left: 0; }

  .services-grid { grid-template-columns: 1fr; }
  .project__body { grid-template-columns: 1fr; }
  .field__row { grid-template-columns: 1fr; }
  .process { flex-direction: column; }
  .post__body { font-size: 16px; }
}

@media (max-width: 400px) {
  .container { padding: 0 18px; }
  .hero { padding: 48px 0 40px; }
}
