/*
 * base.css — Estilos base del sitio
 * Kinik Labs · Sitio corporativo
 *
 * Carga:  1. tokens.css  →  2. reset.css  →  3. base.css
 */

/* ─────────────────────────────────────────────
   Carga de fuentes (Google Fonts)
   ───────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

/* ─────────────────────────────────────────────
   Contenedor de página
   ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (max-width: 640px) {
  .container {
    padding-inline: var(--space-4);
  }
}

/* ─────────────────────────────────────────────
   Responsive: escalar el orbit en pantallas pequeñas
   ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .tech-orbit {
    width: 320px;
    height: 320px;
  }
  .tech-orbit__ring--inner {
    width: 160px;
    height: 160px;
  }
  .tech-orbit__ring--outer {
    width: 280px;
    height: 280px;
  }
  .tech-orbit__item--inner {
    --radius: 80px;
  }
  .tech-orbit__item--outer {
    --radius: 140px;
  }
  .tech-orbit__core {
    width: 72px;
    height: 72px;
  }
  .tech-orbit__core-icon {
    font-size: 1.25rem;
  }
  .tech-orbit__pill-name {
    display: none;
  }
}

/* ─────────────────────────────────────────────
   Portafolio — Tarjetas estáticas SEO (RF-022)
   ───────────────────────────────────────────── */

.portfolio-static-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.portfolio-static-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.portfolio-static-card__header {
  display: flex;
  gap: var(--space-2);
}

.portfolio-static-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.portfolio-static-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.portfolio-static-card__reto,
.portfolio-static-card__solucion {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.portfolio-static-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: auto;
}

/* Tags */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: var(--border-thin) solid var(--border-color);
  color: var(--text-secondary);
  letter-spacing: var(--tracking-wide);
}

@media (max-width: 768px) {
  .portfolio-static-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────
   Portafolio — Modal de detalle (RF-021)
   ───────────────────────────────────────────── */

.portfolio-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-default);
}

.portfolio-modal-overlay[hidden] {
  display: none;
}

.portfolio-modal-overlay.is-visible {
  opacity: 1;
}

.portfolio-modal {
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.portfolio-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.portfolio-modal__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.portfolio-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: var(--border-thin) solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background-color var(--duration-fast) var(--ease-default),
    border-color var(--duration-fast) var(--ease-default),
    transform var(--duration-fast) var(--ease-spring);
}

.portfolio-modal__close:hover {
  background: var(--bg-muted);
  border-color: var(--border-color-strong);
  transform: scale(1.05);
}

.portfolio-modal__close:focus-visible {
  outline: 2px solid var(--border-color-focus);
  outline-offset: 3px;
}

.portfolio-modal__badge {
  margin-bottom: var(--space-2);
}

.portfolio-modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.portfolio-modal__section h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.portfolio-modal__section p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.portfolio-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.portfolio-modal__cta {
  align-self: flex-start;
  margin-top: var(--space-2);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .portfolio-modal-overlay {
    transition: none;
  }
}

/* ─────────────────────────────────────────────
   Formulario adaptativo (RF-027, RF-028, RNF-013, RNF-014)
   ───────────────────────────────────────────── */

.form__conditional-block {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height var(--duration-slow) var(--ease-default),
    opacity var(--duration-normal) var(--ease-default);
}

.form__conditional-block.is-visible {
  max-height: 1200px;
  opacity: 1;
}

.form__conditional-block__header {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: var(--border-thin) solid var(--border-color);
}

/* Reduced motion: sin transición */
@media (prefers-reduced-motion: reduce) {
  .form__conditional-block {
    transition: none;
  }
  .form__conditional-block.is-visible {
    max-height: none;
    opacity: 1;
  }
}

/* ─────────────────────────────────────────────
   Chat IA widget (RF-025)
   ───────────────────────────────────────────── */

.chat-widget {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-chat);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
}

.chat-widget__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-brand-gradient);
  color: var(--color-neutral-0);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition:
    transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast) var(--ease-default);
}

.chat-widget__trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 30px rgba(9, 133, 199, 0.35);
}

.chat-widget__trigger:focus-visible {
  outline: 2px solid var(--border-color-focus);
  outline-offset: 3px;
}

.chat-widget__panel {
  width: 360px;
  max-height: 480px;
  background: var(--bg-surface);
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.chat-widget__panel.is-open {
  display: flex;
}

.chat-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: var(--color-brand-gradient);
  color: var(--color-neutral-0);
}

.chat-widget__header h3 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
}

.chat-widget__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--color-neutral-0);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-default);
}

.chat-widget__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chat-widget__close:focus-visible {
  outline: 2px solid var(--color-neutral-0);
  outline-offset: 2px;
}

.chat-widget__messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 200px;
  max-height: 320px;
}

.chat-widget__message {
  max-width: 85%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.chat-widget__message--bot {
  align-self: flex-start;
  background: var(--bg-subtle);
  border: var(--border-thin) solid var(--border-color);
  color: var(--text-primary);
}

.chat-widget__message--user {
  align-self: flex-end;
  background: var(--color-brand-gradient);
  color: var(--color-neutral-0);
}

.chat-widget__input-area {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: var(--border-thin) solid var(--border-color);
}

.chat-widget__input {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--input-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.chat-widget__input:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px rgba(9, 133, 199, 0.15);
}

.chat-widget__send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-brand-gradient);
  color: var(--color-neutral-0);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.chat-widget__send:hover {
  transform: scale(1.08);
}

.chat-widget__send:focus-visible {
  outline: 2px solid var(--border-color-focus);
  outline-offset: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .chat-widget__trigger,
  .chat-widget__send {
    transition: none;
  }
}

/* Chat Inline (index.html) — Req 1 */
.chat-inline {
  max-width: 600px;
  margin-inline: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  background: var(--bg-surface);
}

.chat-inline .chat-widget__messages {
  max-height: 320px;
}

/* TechGlobe Fallback — Req 2, 3, 4 */
.tech-globe-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  padding: var(--space-8);
}

@media (max-width: 480px) {
  .chat-widget__panel {
    width: calc(100vw - var(--space-12));
    right: 0;
  }
}
h2 {
  font-size: var(--text-4xl);
}
h3 {
  font-size: var(--text-3xl);
}
h4 {
  font-size: var(--text-2xl);
}
h5 {
  font-size: var(--text-xl);
}
h6 {
  font-size: var(--text-lg);
}

p {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

/* Texto destacado en párrafos */
strong,
b {
  font-weight: var(--font-weight-semibold);
}
em,
i {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--text-code);
  background: var(--bg-subtle);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
}

/* ─────────────────────────────────────────────
   Degradado de firma — clase utilitaria
   ───────────────────────────────────────────── */
.text-gradient {
  background: var(--color-brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-brand {
  background: var(--color-brand-gradient);
}

/* Línea de aliento: borde/underline con el degradado de marca */
.breath-line {
  position: relative;
  display: inline-block;
}

.breath-line::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-brand-gradient);
  border-radius: var(--radius-full);
}

/* ─────────────────────────────────────────────
   Navegación
   ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  border-bottom: var(--border-thin) solid var(--nav-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: var(--z-nav);
  transition:
    background-color var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.nav__logo {
  height: 32px;
  width: auto;
  display: flex;
  align-items: center;
}

.nav__logo img,
.nav__logo svg {
  height: 32px;
  width: auto;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}

.nav__link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--nav-text);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: color var(--duration-fast) var(--ease-default);
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--nav-text-active);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* ─────────────────────────────────────────────
   Toggle de tema (modo claro / oscuro)
   ───────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: var(--border-thin) solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-default),
    border-color var(--duration-fast) var(--ease-default),
    transform var(--duration-fast) var(--ease-spring);
  font-size: 1.1rem;
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--bg-muted);
  border-color: var(--border-color-strong);
  transform: scale(1.08);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--border-color-focus);
  outline-offset: 3px;
}

/* Icono SVG del toggle */
.theme-toggle__icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* ─────────────────────────────────────────────
   Botones
   ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  cursor: pointer;
  border: var(--border-medium) solid transparent;
  transition:
    background-color var(--duration-fast) var(--ease-default),
    color var(--duration-fast) var(--ease-default),
    border-color var(--duration-fast) var(--ease-default),
    transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast) var(--ease-default);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--border-color-focus);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--color-brand-gradient);
  color: var(--color-neutral-0);
  box-shadow: var(--shadow-brand);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 30px rgba(9, 133, 199, 0.35);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color-strong);
}

.btn--secondary:hover {
  border-color: var(--interactive-secondary);
  color: var(--interactive-secondary);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-4);
}

.btn--ghost:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

/* ─────────────────────────────────────────────
   Layout principal
   ───────────────────────────────────────────── */
.page-wrapper {
  padding-top: var(--nav-height);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ─────────────────────────────────────────────
   Secciones
   ───────────────────────────────────────────── */
.section {
  padding-block: var(--space-24);
}

.section--sm {
  padding-block: var(--space-16);
}

.section--lg {
  padding-block: var(--space-32);
}

.section__header {
  margin-bottom: var(--space-16);
}

.section__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-brand-green);
  margin-bottom: var(--space-3);
}

.section__title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.section__subtitle {
  margin-top: var(--space-4);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 56ch;
  line-height: var(--leading-normal);
}

/* ─────────────────────────────────────────────
   Cards
   ───────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-surface);
  transition:
    box-shadow var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default),
    transform var(--duration-normal) var(--ease-default);
}

.card:hover {
  box-shadow: var(--shadow-elevated);
  border-color: var(--border-color-strong);
  transform: translateY(-2px);
}

/* ─────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────── */
.footer {
  border-top: var(--border-thin) solid var(--border-color);
  background: var(--bg-surface);
  padding-block: var(--space-12);
  margin-top: auto;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.footer__copy {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────
   Typewriter (RF-003)
   ───────────────────────────────────────────── */

/* El cursor parpadeante se oculta con prefers-reduced-motion */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--color-brand-blue);
  margin-left: 2px;
  vertical-align: text-bottom;
  border-radius: 1px;
  animation: tw-blink 0.9s step-end infinite;
}

@keyframes tw-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Respetar prefers-reduced-motion — ocultar cursor si no hay animación */
@media (prefers-reduced-motion: reduce) {
  .typewriter-cursor {
    display: none;
  }
}

/* ─────────────────────────────────────────────
   Utilidades
   ───────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}

.font-mono {
  font-family: var(--font-mono);
}
.font-heading {
  font-family: var(--font-heading);
}

/* ─────────────────────────────────────────────
   Métricas de impacto — RF-005
   ───────────────────────────────────────────── */

/* Grid de métricas: 5 cols en desktop, 3 en tablet, 2 en mobile */
.metrics__grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-6);
}

@media (max-width: 1024px) {
  .metrics__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .metrics__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Cada métrica: centrado, padding, borde sutil */
.metrics__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  transition:
    border-color var(--duration-normal) var(--ease-default),
    box-shadow var(--duration-normal) var(--ease-default);
}

.metrics__item:hover {
  border-color: var(--border-color-strong);
  box-shadow: var(--shadow-sm);
}

/* Fila del número: alinea prefijo, valor y sufijo en línea */
.metrics__item {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  row-gap: 0;
  column-gap: var(--space-1);
}

/* El label siempre ocupa el 100 % del ancho para quedar debajo */
.metrics__label {
  width: 100%;
  text-align: center;
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  color: var(--text-tertiary);
}

/* Valor principal: fuente grande, mono, color de marca */
.metrics__value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-brand);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  /* Evita layout shift durante el conteo reservando un ancho mínimo */
  min-width: 2ch;
  display: inline-block;
  text-align: right;
}

/* Prefijo y sufijo: algo más pequeños, color secundario */
.metrics__suffix,
.metrics__prefix {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  line-height: 1;
}

/* ─────────────────────────────────────────────
   Hero — RF-003, RF-004
   ───────────────────────────────────────────── */

/* El padding ya lo aporta .section--lg; solo necesitamos flex */
.hero {
  display: flex;
  align-items: center;
}

/* Limita el ancho del bloque de texto para mejor legibilidad */
.hero__content {
  max-width: 700px;
}

/* Título principal del hero */
.hero__title {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

/* Tagline fijo "IA y software, a tiempo." */
.hero__tagline {
  display: block;
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  margin-top: var(--space-3);
}

/* Párrafo de apoyo */
.hero__description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 55ch;
  line-height: var(--leading-normal);
  margin-top: var(--space-6);
}

/* Contenedor de CTAs */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-10);
}

/* Responsive: apilar botones en móvil */
@media (max-width: 640px) {
  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ─────────────────────────────────────────────
   Carrusel de proyectos — RF-006, RF-009
   ───────────────────────────────────────────── */

/* Contenedor y track */
.carousel {
  position: relative;
  width: 100%;
  user-select: none;
}

.carousel__track-wrapper {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.carousel__track {
  display: flex;
  transition: transform var(--duration-slow) var(--ease-default);
  will-change: transform;
}

.carousel__slide {
  flex-shrink: 0;
  width: 100%;
}

/* Layout del slide */
.carousel__slide-inner {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-surface);
}

.carousel__image {
  height: 220px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
}

.carousel__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__image-icon {
  font-size: 4rem;
  line-height: 1;
}

.carousel__content {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Badges */
.carousel__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: var(--border-thin) solid;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  align-self: flex-start;
}

.carousel__badge--production {
  color: var(--color-brand-green);
  border-color: var(--color-brand-green);
  background: rgba(9, 199, 78, 0.08);
}

.carousel__badge--development {
  color: var(--color-brand-blue);
  border-color: var(--color-brand-blue);
  background: rgba(9, 133, 199, 0.08);
}

/* Tipografía del slide */
.carousel__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.carousel__description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* Controles de navegación */
.carousel__nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-6);
}

.carousel__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: var(--border-thin) solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-default),
    border-color var(--duration-fast) var(--ease-default),
    transform var(--duration-fast) var(--ease-spring);
}

.carousel__btn:hover {
  background: var(--bg-muted);
  border-color: var(--border-color-strong);
  transform: scale(1.05);
}

.carousel__btn:focus-visible {
  outline: 2px solid var(--border-color-focus);
  outline-offset: 3px;
}

/* Dots */
.carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  border: none;
  cursor: pointer;
  padding: 0;
  transition:
    width var(--duration-normal) var(--ease-default),
    background-color var(--duration-normal) var(--ease-default);
}

.carousel__dot--active {
  background: var(--color-brand-blue);
  width: 24px;
}

.carousel__dot:focus-visible {
  outline: 2px solid var(--border-color-focus);
  outline-offset: 3px;
}

/* Responsive desktop */
@media (min-width: 768px) {
  .carousel__slide-inner {
    flex-direction: row;
  }

  .carousel__image {
    width: 40%;
    height: auto;
    min-height: 280px;
    flex-shrink: 0;
  }

  .carousel__content {
    flex: 1;
    justify-content: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .carousel__track {
    transition: none;
  }

  .carousel__dot {
    transition: none;
  }
}

/* ─────────────────────────────────────────────
   Formulario de contacto — RF-011
   ───────────────────────────────────────────── */

.contact-form {
  max-width: var(--container-md);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form__label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-wide);
}

.form__label span {
  color: var(--color-brand-green);
}

.form__input,
.form__select,
.form__textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: var(--border-thin) solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--input-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  transition:
    border-color var(--duration-fast) var(--ease-default),
    box-shadow var(--duration-fast) var(--ease-default);
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--input-placeholder);
}

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px rgba(9, 133, 199, 0.15);
}

.form__select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d97a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

.form__textarea {
  resize: vertical;
  min-height: 120px;
}

.form__success {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  background: rgba(9, 199, 78, 0.08);
  border: var(--border-thin) solid var(--color-brand-green);
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.form__error {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  background: rgba(224, 59, 59, 0.08);
  border: var(--border-thin) solid var(--color-error);
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

/* Botón submit deshabilitado */
.contact-form .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ─────────────────────────────────────────────
   Página Servicios — RF-007
   ───────────────────────────────────────────── */

/* Grid de servicios */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

/* Tarjetas de servicio */
.service-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.service-card__icon {
  font-size: 2.5rem;
  line-height: 1;
}

.service-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.service-card__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.service-card__features li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding-left: var(--space-5);
  position: relative;
}

.service-card__features li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--color-brand-green);
  font-family: var(--font-mono);
}

/* Pasos del proceso */
.process-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}

.process-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.process-step__number {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  background: var(--color-brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.process-step__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.process-step__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* Placeholder del stack tecnológico */
.stack-placeholder {
  padding: var(--space-16);
  text-align: center;
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}

.stack-placeholder__text {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

.stack-placeholder__subtitle {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* Responsive */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
  .process-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .process-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .contact-form {
    gap: var(--space-5);
  }
}

/* ─────────────────────────────────────────────
   Página Vacantes — RF-017
   ───────────────────────────────────────────── */

.vacantes-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-20) var(--space-8);
  gap: var(--space-6);
  max-width: var(--container-md);
  margin-inline: auto;
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
}

.vacantes-empty__icon {
  color: var(--text-tertiary);
  opacity: 0.7;
}

.vacantes-empty__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.vacantes-empty__subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 48ch;
  line-height: var(--leading-normal);
}

/* ─────────────────────────────────────────────
   Stack tecnológico orbital — RF-008
   ───────────────────────────────────────────── */

.tech-orbit {
  position: relative;
  width: 560px;
  height: 560px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Núcleo central */
.tech-orbit__center {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tech-orbit__core {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  background: var(--color-brand-gradient);
  box-shadow: var(--shadow-brand);
  gap: var(--space-1);
}

.tech-orbit__core-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.tech-orbit__core-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: var(--font-weight-bold);
  color: white;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* Anillos orbitales */
.tech-orbit__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  transform: translate(-50%, -50%);
}

.tech-orbit__ring--inner {
  width: 260px;
  height: 260px;
  animation: orbit-rotate-cw 20s linear infinite;
}

.tech-orbit__ring--outer {
  width: 460px;
  height: 460px;
  animation: orbit-rotate-ccw 30s linear infinite;
}

/* Items posicionados angularmente con --i */
.tech-orbit__item {
  position: absolute;
  top: 50%;
  left: 50%;
  /* counter-rotate para que la pastilla permanezca upright */
}

.tech-orbit__item--inner {
  --angle: calc(var(--i) * 60deg);
  --radius: 130px;
  transform: rotate(var(--angle)) translate(var(--radius))
    rotate(calc(-1 * var(--angle)));
  margin-top: -18px;
  margin-left: -18px;
  animation: counter-rotate-cw 20s linear infinite;
}

.tech-orbit__item--outer {
  --angle: calc(var(--i) * 60deg + 30deg);
  --radius: 230px;
  transform: rotate(var(--angle)) translate(var(--radius))
    rotate(calc(-1 * var(--angle)));
  margin-top: -18px;
  margin-left: -18px;
  animation: counter-rotate-ccw 30s linear infinite;
}

/* Pastillas de tecnología */
.tech-orbit__pill {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  cursor: default;
  transition:
    border-color var(--duration-fast) var(--ease-default),
    box-shadow var(--duration-fast) var(--ease-default),
    transform var(--duration-fast) var(--ease-spring);
}

.tech-orbit__pill:hover {
  border-color: var(--color-brand-blue);
  box-shadow: var(--shadow-brand);
  transform: scale(1.08);
}

.tech-orbit__pill-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.tech-orbit__pill-name {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  letter-spacing: var(--tracking-wide);
}

/* Animaciones */
@keyframes orbit-rotate-cw {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes orbit-rotate-ccw {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

@keyframes counter-rotate-cw {
  from {
    transform: rotate(calc(var(--angle, 0deg))) translate(var(--radius, 130px))
      rotate(calc(-1 * var(--angle, 0deg)));
  }
  to {
    transform: rotate(calc(var(--angle, 0deg) + 360deg))
      translate(var(--radius, 130px))
      rotate(calc(-1 * (var(--angle, 0deg) + 360deg)));
  }
}

@keyframes counter-rotate-ccw {
  from {
    transform: rotate(calc(var(--angle, 30deg))) translate(var(--radius, 230px))
      rotate(calc(-1 * var(--angle, 30deg)));
  }
  to {
    transform: rotate(calc(var(--angle, 30deg) - 360deg))
      translate(var(--radius, 230px))
      rotate(calc(-1 * (var(--angle, 30deg) - 360deg)));
  }
}

/* Pausa al hacer hover sobre el componente */
.tech-orbit:hover .tech-orbit__ring,
.tech-orbit:hover .tech-orbit__item {
  animation-play-state: paused;
}

/* Reduced motion: sin rotación */
@media (prefers-reduced-motion: reduce) {
  .tech-orbit__ring,
  .tech-orbit__item--inner,
  .tech-orbit__item--outer {
    animation: none;
  }
  .tech-orbit__item--inner {
    transform: rotate(var(--angle)) translate(var(--radius))
      rotate(calc(-1 * var(--angle)));
  }
  .tech-orbit__item--outer {
    transform: rotate(var(--angle)) translate(var(--radius))
      rotate(calc(-1 * var(--angle)));
  }
}

/* Responsive: escalar el orbit en pantallas pequeñas */
@media (max-width: 640px) {
  .tech-orbit {
    width: 320px;
    height: 320px;
  }
  .tech-orbit__ring--inner {
    width: 160px;
    height: 160px;
  }
  .tech-orbit__ring--outer {
    width: 280px;
    height: 280px;
  }
  .tech-orbit__item--inner {
    --radius: 80px;
  }
  .tech-orbit__item--outer {
    --radius: 140px;
  }
  .tech-orbit__core {
    width: 72px;
    height: 72px;
  }
  .tech-orbit__core-icon {
    font-size: 1.25rem;
  }
  .tech-orbit__pill-name {
    display: none;
  }
}
