/* ==========================================================================
   Nova Ars Technologies — Design System
   ========================================================================== */

:root {
  /* Colors */
  --color-bg: #0A0A0A;
  --color-surface: #141414;
  --color-border: #232323;
  --color-text: #F0EBE0;
  --color-text-secondary: #8a8a85;
  --color-accent-blue: #3D3DFF;
  --color-accent-terracotta: #D96A3C;

  /* Typography */
  --font-heading: 'Nunito', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-body: 'Nunito', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Layout */
  --max-width: 1900px;
  --container-padding: clamp(20px, 3.5vw, 40px);
  --header-height: 80px;

  /* Motion */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.4s ease;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  overflow-x: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }

p {
  color: var(--color-text-secondary);
}

.eyebrow {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent-terracotta);
}

.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;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.section-header {
  margin-bottom: var(--space-lg);
}

/* ==========================================================================
   Header / Navbar
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background-color: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  overflow: visible;
}

.logo-mark-core {
  fill: var(--color-bg);
}

.logo-mark-rays line {
  stroke: var(--color-accent-blue);
  stroke-width: 13;
  stroke-linecap: round;
}

.logo-wordmark {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--color-text);
}

.header-actions {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 3002;
  display: flex;
  align-items: center;
  height: var(--header-height);
  gap: var(--space-sm);
  padding-right: var(--container-padding);
  opacity: 1;
  pointer-events: auto;
  transition: opacity var(--transition-fast);
}

/* header-actions vive en su propio stacking context de nivel superior
   (necesario para ganarle a nav-menu, ver comentario en el HTML) — pero eso
   lo pone también por encima del botón de cerrar de los overlays de
   Soluciones/Proyectos, que comparte la misma esquina. Se apaga mientras
   cualquiera de esos overlays está abierto, igual que ya queda inerte el
   resto del fondo. */
body:has(.project-modal.is-open) .header-actions,
body:has(.service-expand-overlay.is-open) .header-actions {
  opacity: 0;
  pointer-events: none;
}

/* Selector de idioma (ES/EN/DE) — <select> nativo por accesibilidad
   (teclado, lector de pantalla, selector móvil), estilizado para el navbar
   oscuro con una flecha custom en vez del ícono nativo del navegador. */

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.4rem 1.8rem 0.4rem 0.9rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%238a8a85' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 10px;
  transition: border-color var(--transition-fast);
}

.lang-select:hover,
.lang-select:focus-visible {
  border-color: var(--color-accent-blue);
  outline: none;
}

.lang-select option {
  background-color: var(--color-surface);
  color: var(--color-text);
}

/* Ícono hamburguesa — se transforma en X mientras el menú está abierto */

.nav-toggle {
  position: relative;
  z-index: 3001;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
  transition: transform 300ms ease, opacity 200ms ease;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Backdrop + panel del menú principal */

.nav-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2999;
  background-color: rgba(10, 10, 10, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.nav-menu-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.nav-menu {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 3000;
  width: min(420px, 90vw);
  height: 100vh;
  background-color: var(--color-bg);
  border-left: 1px solid var(--color-border);
  padding: calc(var(--header-height) + var(--space-lg)) var(--space-lg) var(--space-lg);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 350ms ease;
}

.nav-menu.is-open {
  transform: translateX(0);
}

.nav-menu ul {
  display: flex;
  flex-direction: column;
}

.nav-menu a {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  font-weight: 500;
  color: var(--color-text);
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  transition: color var(--transition-fast);
}

.nav-menu li:last-child a {
  border-bottom: none;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  color: var(--color-accent-blue);
}

@media (prefers-reduced-motion: reduce) {
  .nav-menu,
  .nav-menu-backdrop,
  .nav-toggle-bar {
    transition: none;
  }
}

/* Secciones ocultas por el router de hash (Proyectos Antiguos / Fundador
   como "páginas" independientes fuera del scroll del home) */

.route-hidden {
  display: none !important;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding-block: var(--header-height) var(--space-xl);
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(61, 61, 255, 0.16) 0%, rgba(217, 106, 60, 0.08) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-isologo {
  position: relative;
  z-index: 1;
  width: min(65vw, 65vh, 760px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-rays {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.hero-circle {
  fill: var(--color-bg);
}

.hero-rays .ray {
  stroke: var(--color-accent-blue);
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(61, 61, 255, 0.6));
  transform-box: view-box;
  transform-origin: 200px 125px;
  transform: scaleY(1);
  animation-name: nova-ray-pulse;
  animation-duration: var(--duration, 1s);
  animation-delay: var(--delay, 0s);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.hero-rotator {
  position: relative;
  z-index: 2;
  max-width: min(90vw, 640px);
  padding-inline: var(--space-sm);
}

.hero-rotator-text {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3.4vw, 2.1rem);
  font-weight: 600;
  color: var(--color-text);
  opacity: 1;
  transition: opacity 0.4s ease;
}

.hero-rotator-text.is-hidden {
  opacity: 0;
}

.hero-cta {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .hero-rays .ray {
    animation: none;
    transform: scaleY(1.2);
  }

  .hero-rotator-text {
    transition: none;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn-primary {
  background-color: var(--color-accent-blue);
  color: var(--color-text);
}

.btn-primary:hover {
  background-color: #5555ff;
}

.btn-secondary {
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  border-color: var(--color-accent-terracotta);
  color: var(--color-accent-terracotta);
}

/* ==========================================================================
   Sobre Nova Ars
   ========================================================================== */

.section-sobre .eyebrow {
  display: block;
  margin-bottom: var(--space-lg);
}

.sobre-media {
  position: relative;
  width: 100%;
  min-height: clamp(480px, 75vh, 820px);
}

.sobre-gif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 500ms ease;
}

.sobre-gif.is-active {
  opacity: 1;
}

.sobre-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.35) 0%, rgba(10, 10, 10, 0.72) 100%);
  pointer-events: none;
}

.sobre-text {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 var(--space-md) var(--space-lg);
  text-align: center;
}

.sobre-text-typed {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  max-width: 760px;
}

.sobre-text-typed p {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--color-text);
}

.sobre-text-typed p.is-typing-cursor::after {
  content: '|';
  display: inline-block;
  margin-left: 2px;
  color: var(--color-accent-blue);
  animation: nova-cursor-blink 0.9s step-end infinite;
}

@keyframes nova-cursor-blink {
  50% { opacity: 0; }
}

/* Flechas de navegación manual: discretas por defecto, más visibles en
   hover/foco — no deben competir visualmente con el gif. */

.sobre-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(10, 10, 10, 0.35);
  color: var(--color-text);
  font-size: 1.4rem;
  line-height: 1;
  opacity: 0.45;
  transition: opacity var(--transition-fast), background-color var(--transition-fast);
}

.sobre-arrow:hover,
.sobre-arrow:focus-visible {
  opacity: 0.9;
  background-color: rgba(10, 10, 10, 0.55);
}

.sobre-arrow:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 2px;
}

.sobre-arrow--prev {
  left: var(--space-sm);
}

.sobre-arrow--next {
  right: var(--space-sm);
}

@media (prefers-reduced-motion: reduce) {
  .sobre-gif {
    transition: none;
  }

  .sobre-text-typed p.is-typing-cursor::after {
    animation: none;
  }
}

/* Proyectos grid (used by Proyectos Nuevos / Antiguos) */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.project-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.project-card:hover,
.project-card:focus-visible {
  border-color: var(--color-accent-blue);
  transform: translateY(-4px);
}

.project-card:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 2px;
}

.project-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Portadas con fondo negro propio: se centran completas, sin recortar, en
   vez de rellenar y cortar el contenedor. */
.project-card-media--contain {
  background-color: var(--color-bg);
}

.project-card-media--contain img {
  object-fit: contain;
}

.project-card-media img.img-error {
  display: none;
}

.project-card-media-label {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-sm);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  border: 1px dashed var(--color-border);
  margin: 6px;
  border-radius: 8px;
}

.project-card-media.is-empty .project-card-media-label {
  display: flex;
}

.project-card-body {
  padding: var(--space-md);
}

.project-card-tag {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-terracotta);
  margin-bottom: var(--space-xs);
}

.project-card-body h3 {
  margin-bottom: var(--space-xs);
}

.project-card-body p {
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Project detail modal
   ========================================================================== */

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 40px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-medium), visibility var(--transition-medium);
}

.project-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(6px);
}

.project-modal-dialog {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  overflow: hidden;
  transform: translateY(16px);
  transition: transform var(--transition-medium);
}

.project-modal.is-open .project-modal-dialog {
  transform: translateY(0);
}

.project-modal-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 88px var(--space-lg) var(--space-lg);
}

.project-modal-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(10, 10, 10, 0.6);
  color: var(--color-text);
  font-size: 1.1rem;
  transition: background-color var(--transition-fast);
}

.project-modal-close:hover {
  background-color: var(--color-accent-terracotta);
}

.project-modal-header {
  margin-bottom: var(--space-lg);
}

.project-modal-header h3 {
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 800;
  margin-block: var(--space-sm) var(--space-md);
}

.project-modal-header p {
  font-size: 1.05rem;
}

.project-modal-partner {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: var(--space-sm);
}

.project-modal-partner:empty {
  display: none;
}

.project-modal-section {
  margin-bottom: var(--space-lg);
}

.project-modal-section:last-child {
  margin-bottom: 0;
}

.project-modal-section.is-empty {
  display: none;
}

.project-modal-section-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.project-modal-strategies {
  display: grid;
  gap: var(--space-sm);
}

.project-modal-strategies li {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding-block: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

.project-modal-strategies li:first-child {
  border-top: none;
}

.strategy-index {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent-terracotta);
  flex-shrink: 0;
  width: 2ch;
}

.strategy-text {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text);
}

/* "Qué incluye" — lista de features con nombre destacado + descripción */

.project-modal-features {
  display: grid;
  gap: var(--space-md);
}

.project-modal-features li {
  padding-block: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

.project-modal-features li:first-child {
  border-top: none;
}

.feature-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.feature-description {
  display: block;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

/* Sub-ítems interactivos de "Qué incluye" en Soluciones: hover muestra un
   mini ícono de rayos (mismo componente .ray / @keyframes nova-ray-pulse que
   el Hero y los círculos grandes de Soluciones, a escala reducida), clic
   expande un acordeón clásico (uno abierto a la vez) con línea de acento +
   descripción. */

.feature-toggle {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding-left: 10px;
  text-align: left;
  cursor: pointer;
}

.feature-toggle:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 4px;
}

.feature-toggle .feature-name {
  margin-bottom: 0;
}

.feature-hover-marker {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.feature-toggle:hover .feature-hover-marker,
.feature-toggle:focus-visible .feature-hover-marker {
  opacity: 1;
}

.feature-hover-rays {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

.feature-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 400ms ease;
}

.feature-item.is-open .feature-panel {
  grid-template-rows: 1fr;
}

.feature-panel-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  gap: var(--space-sm);
}

.feature-accordion-line {
  width: 2px;
  flex-shrink: 0;
  background-color: var(--color-accent-terracotta);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 350ms ease;
}

.feature-item.is-open .feature-accordion-line {
  transform: scaleY(1);
}

.feature-panel .feature-description {
  flex: 1;
  padding-top: 0.1rem;
  padding-bottom: var(--space-sm);
  opacity: 0;
  transition: opacity 300ms ease;
}

.feature-item.is-open .feature-panel .feature-description {
  opacity: 1;
  transition-delay: 250ms;
}

@media (prefers-reduced-motion: reduce) {
  .feature-hover-marker,
  .feature-panel,
  .feature-accordion-line,
  .feature-panel .feature-description {
    transition: none;
  }
}

/* "Ideal para" — nota final discreta */

.project-modal-ideal-for {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--color-accent-terracotta);
}

.project-modal-ideal-for:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}

.project-modal-ideal-for strong {
  font-style: normal;
  font-weight: 600;
}

.project-modal-media {
  position: relative;
  width: 100%;
  min-height: 160px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.project-modal-media img,
.project-modal-media video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

.project-modal-media img.img-error,
.project-modal-media video.img-error {
  display: none;
}

.project-modal-media-label {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  border: 1px dashed var(--color-border);
  margin: 6px;
  border-radius: 10px;
}

.project-modal-media.is-empty .project-modal-media-label {
  display: flex;
}

/* Grupos de imágenes configurables por proyecto (galería, 2 columnas, individual) */

.project-modal-media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  align-items: start;
}

.project-modal-media-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  align-items: start;
}

/* Franja de logos — marquee infinito, sutil */

.project-modal-logos {
  position: relative;
  overflow: hidden;
  background-color: #F5F5F0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding-block: var(--space-md);
  min-height: 96px;
}

.project-modal-logos-track {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  width: max-content;
  animation: nova-marquee 32s linear infinite;
}

.project-modal-logos:hover .project-modal-logos-track {
  animation-play-state: paused;
}

.project-modal-logos-img {
  height: 52px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.project-modal-logos.is-empty .project-modal-logos-track {
  display: none;
}

.project-modal-logos-label {
  display: none;
  position: absolute;
  inset: 0;
  margin: 6px;
}

.project-modal-logos.is-empty .project-modal-logos-label {
  display: flex;
}

@keyframes nova-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .project-modal-logos-track {
    animation: none;
  }
}

.project-modal-tag {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-terracotta);
  margin-bottom: var(--space-sm);
}

/* ==========================================================================
   Servicios — flujo de círculos conectados, con efecto spotlight
   ========================================================================== */

.services-flow {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vw, 5rem);
}

/* Líneas SVG entre círculos consecutivos: pintadas primero (detrás en el
   documento) y con z-index 0, así el fondo opaco de cada círculo (z-index 1)
   las "corta" justo en el borde, dando la impresión de que nacen y terminan
   ahí en vez de cruzar por encima. */

.services-connectors {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.connector-line-base {
  stroke: rgba(61, 61, 255, 0.22);
  stroke-width: 1.5;
}

.connector-line-pulse {
  stroke: var(--color-accent-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 15 25;
  filter: drop-shadow(0 0 4px rgba(61, 61, 255, 0.8));
  animation: nova-connector-flow 2.5s linear infinite;
}

@keyframes nova-connector-flow {
  to {
    stroke-dashoffset: -40;
  }
}

.service-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  align-self: flex-start;
  border-radius: 16px;
  padding: var(--space-xs);
  cursor: pointer;
}

.service-node:nth-of-type(even) {
  align-self: flex-end;
}

.service-node:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 4px;
}

.service-node.is-expand-hidden {
  visibility: hidden;
}

.service-circle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(150px, 13vw, 230px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  padding: var(--space-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), opacity 0.3s ease;
}

.service-circle-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

/* Rayos radiantes tipo ecualizador — siempre activos en loop continuo
   (mismo criterio que el Hero), independientes de hover/foco. */

.service-rays {
  position: absolute;
  inset: 0;
  overflow: visible;
  z-index: 0;
  opacity: 1;
  pointer-events: none;
}

.service-rays .ray,
.founder-rays .ray,
.feature-hover-rays .ray {
  stroke: var(--color-accent-blue);
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(61, 61, 255, 0.6));
  transform-box: view-box;
  transform-origin: 100px 0px;
  transform: scaleY(1);
  animation-name: nova-ray-pulse;
  animation-duration: var(--duration, 1s);
  animation-delay: var(--delay, 0s);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

@keyframes nova-ray-pulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.5); }
}

.service-number {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-accent-terracotta);
}

.service-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-text);
}

.service-subitems {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: opacity 0.3s ease;
}

.service-subitems li {
  font-size: 0.95rem;
  font-weight: 500;
  color: #c9c8c0;
}

/* Spotlight: nodo activo se ilumina, el resto se atenúa (los rayos en sí ya
   no dependen de esto — siguen animando siempre, ver .service-rays arriba) */

.service-node.is-active .service-circle {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px rgba(61, 61, 255, 0.25), 0 0 32px rgba(61, 61, 255, 0.35);
}

.service-node.is-dimmed {
  opacity: 0.35;
}

@media (prefers-reduced-motion: reduce) {
  .service-circle,
  .service-subitems {
    transition: none;
  }

  .service-rays .ray,
  .feature-hover-rays .ray {
    animation: none;
    transform: scaleY(1.2);
  }

  .connector-line-pulse {
    animation: none;
  }
}

/* ==========================================================================
   Proyectos Nuevos — landing minimalista (solo logos, sin tarjeta)
   ========================================================================== */

.section-nuevos {
  padding-block: var(--space-xl) 0;
  background-color: var(--color-bg);
}

.project-card.new-project-block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 80vh;
  padding-block: clamp(1.5rem, 4vw, 3rem);
  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  overflow: visible;
  cursor: pointer;
}

.project-card.new-project-block:last-child {
  border-bottom: none;
}

.project-card.new-project-block:hover,
.project-card.new-project-block:focus-visible {
  transform: none;
  border-bottom-color: var(--color-border);
}

.project-card.new-project-block:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: -8px;
}

.new-project-logo-stack {
  position: relative;
  width: min(85vw, 78vh, 1500px);
  aspect-ratio: 1 / 1;
}

.new-project-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen;
  transition: opacity var(--transition-medium);
}

.new-project-logo--static {
  opacity: 1;
}

.new-project-logo--gif {
  opacity: 0;
}

.project-card.new-project-block:hover .new-project-logo--static,
.project-card.new-project-block:focus-visible .new-project-logo--static {
  opacity: 0;
}

.project-card.new-project-block:hover .new-project-logo--gif,
.project-card.new-project-block:focus-visible .new-project-logo--gif {
  opacity: 1;
}

/* ==========================================================================
   Fundador
   ========================================================================== */

.founder-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  width: 100%;
  text-align: left;
}

.founder-projects {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.founder-photo-wrap {
  position: relative;
  flex-shrink: 0;
  width: clamp(120px, 18vw, 180px);
  aspect-ratio: 1 / 1;
}

.founder-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
}

/* Rayos siempre activos (sutiles) alrededor de la foto de perfil — mismo
   componente que .service-rays, con menor opacidad/glow e intensidad. */

.founder-rays {
  position: absolute;
  inset: 0;
  overflow: visible;
  z-index: 0;
  opacity: 0.65;
  pointer-events: none;
}

.founder-rays .ray {
  filter: drop-shadow(0 0 2px rgba(61, 61, 255, 0.45));
}

.founder-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.founder-photo img.img-error {
  display: none;
}

.founder-photo-label {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-sm);
  font-size: 0.7rem;
  color: var(--color-text-secondary);
}

.founder-photo.is-empty .founder-photo-label {
  display: flex;
}

.founder-card-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.founder-name {
  font-family: var(--font-heading);
  font-size: clamp(2.75rem, 5.5vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.founder-tagline {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  max-width: 520px;
}

/* Bio del fundador — párrafo introductorio + bloques temáticos.
   Se usa tanto en la sección principal como (reutilizada) dentro del modal. */

.founder-bio {
  margin-top: var(--space-xl);
}

.founder-bio p {
  font-size: 1.1rem;
  line-height: 1.75;
  margin-bottom: var(--space-lg);
}

.founder-bio p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Servicios — expansión "shared element" del círculo clickeado
   ========================================================================== */

.service-expand-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  visibility: hidden;
  pointer-events: none;
}

.service-expand-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.service-expand-scrim {
  position: absolute;
  inset: 0;
  background-color: rgba(10, 10, 10, 0);
  transition: background-color 450ms ease;
}

.service-expand-overlay.is-open .service-expand-scrim {
  background-color: rgba(10, 10, 10, 0.85);
}

.service-expand-close {
  position: fixed;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 3;
  opacity: 0;
  transition: opacity 200ms ease;
}

.service-expand-overlay.is-open .service-expand-close {
  opacity: 1;
}

.service-expand-clone {
  position: fixed;
  z-index: 1;
  margin: 0;
  transform: translate(0px, 0px) scale(1);
  transition: transform 450ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.service-expand-content {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.service-expand-content.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.service-expand-content-inner {
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  text-align: left;
}

@media (prefers-reduced-motion: reduce) {
  .service-expand-clone {
    transition: opacity 250ms ease;
  }

  .service-expand-scrim,
  .service-expand-close,
  .service-expand-content {
    transition: opacity 250ms ease;
  }
}

/* ==========================================================================
   Contacto
   ========================================================================== */

.contact-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.contact-email {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.15em;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.contact-email:hover,
.contact-email:focus-visible {
  color: var(--color-accent-blue);
  border-color: var(--color-accent-blue);
}

.contact-email-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.contact-copy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background-color: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.contact-copy-btn:hover,
.contact-copy-btn:focus-visible {
  color: var(--color-accent-blue);
  border-color: var(--color-accent-blue);
}

.contact-copy-icon,
.contact-copy-check {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: opacity 200ms ease, transform 200ms ease;
}

.contact-copy-check {
  opacity: 0;
  transform: scale(0.6);
  color: var(--color-accent-blue);
}

.contact-copy-btn.is-copied .contact-copy-icon {
  opacity: 0;
  transform: scale(0.6);
}

.contact-copy-btn.is-copied .contact-copy-check {
  opacity: 1;
  transform: scale(1);
}

.contact-copy-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: var(--color-surface);
  color: var(--color-text);
  font-size: 0.75rem;
  font-family: var(--font-heading);
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.contact-copy-btn.is-copied .contact-copy-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .contact-copy-icon,
  .contact-copy-check,
  .contact-copy-tooltip {
    transition: none;
  }
}

.contact-toggle {
  border: none;
}

.contact-form-wrap {
  width: 100%;
  max-width: 520px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 400ms ease, opacity 300ms ease;
}

.contact-form-wrap.is-open {
  max-height: 640px;
  opacity: 1;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-top: var(--space-sm);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-field label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent-blue);
}

.contact-submit {
  align-self: flex-start;
  border: none;
}

.contact-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-form-status {
  min-height: 1.2em;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.contact-form-status.is-success {
  color: var(--color-accent-blue);
}

.contact-form-status.is-error {
  color: var(--color-accent-terracotta);
}

/* ==========================================================================
   Dónde estamos — mapa
   ========================================================================== */

.section-subtitle {
  margin-top: var(--space-sm);
  color: var(--color-text-secondary);
  font-size: 1rem;
}

.map-container {
  position: relative;
  width: 100%;
  height: clamp(550px, 42vw, 720px);
  margin-top: var(--space-lg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.leaflet-container {
  background-color: var(--color-bg) !important;
  font-family: var(--font-body) !important;
}

/* Marcador personalizado: punto azul con anillo de pulso tipo radar */

.map-marker {
  position: relative;
  width: 20px;
  height: 20px;
}

.map-marker-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background-color: var(--color-accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(61, 61, 255, 0.8);
}

.map-marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background-color: var(--color-accent-blue);
  border-radius: 50%;
  opacity: 0.6;
  animation: nova-marker-pulse 2s ease-out infinite;
}

@keyframes nova-marker-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .map-marker-pulse {
    animation: none;
    opacity: 0.25;
  }
}

/* Popup con el estilo del sitio, en vez del blanco default de Leaflet */

.leaflet-popup.map-popup .leaflet-popup-content-wrapper {
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.leaflet-popup.map-popup .leaflet-popup-content {
  margin: 0.6rem 0.9rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
}

.leaflet-popup.map-popup .leaflet-popup-tip {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: none;
}

/* Controles de zoom y atribución con tema oscuro */

.leaflet-control-zoom a {
  background-color: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
}

.leaflet-control-zoom a:hover {
  background-color: var(--color-bg) !important;
  color: var(--color-accent-blue) !important;
}

.leaflet-bar {
  border-color: var(--color-border) !important;
}

.leaflet-control-attribution {
  background-color: rgba(10, 10, 10, 0.7) !important;
  color: var(--color-text-secondary) !important;
}

.leaflet-control-attribution a {
  color: var(--color-text-secondary) !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding-block: var(--space-lg);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .sobre-media {
    min-height: clamp(380px, 58vh, 560px);
  }

  .sobre-text {
    padding: 0 var(--space-sm) var(--space-md);
  }

  .project-modal-scroll {
    padding: 76px var(--space-sm) var(--space-md);
  }

  .project-modal-media-two-col {
    grid-template-columns: 1fr;
  }

  .services-flow {
    align-items: center;
    gap: 3rem;
  }

  .service-node,
  .service-node:nth-of-type(even) {
    align-self: center;
  }

  .founder-tagline {
    max-width: none;
  }

  .map-container {
    height: 380px;
  }
}
