/**
 * UPintelligence - Main Stylesheet
 * Optimized and cleaned version
 */

:root {
  /* Paleta corporativa: Blanco, Azul y Naranja */
  --blue: #0a2f6c;
  --blue-light: #1e4a9f;
  --blue-dark: #050816;
  --orange: #f58220;
  --orange-light: #ff9d4d;
  --white: #ffffff;
  --text-grey: #e8ecf9;
  --border: #2a4a8a;
  --card-bg: #0a1a3a;

  /* Acentos secundarios */
  --accent-orange-glow: rgba(245, 130, 32, 0.3);

  /* Pills uniformes */
  --pill-blue: #0b2546;
  --pill-blue-strong: #08203a;
  --pill-border: rgba(66,100,150,0.28);

  /* Variables de opacidad - Azul */
  --blue-light-10: rgba(30, 74, 159, 0.1);
  --blue-light-22: rgba(30, 74, 159, 0.22);
  --blue-light-25: rgba(30, 74, 159, 0.25);
  --blue-light-35: rgba(30, 74, 159, 0.35);
  --blue-light-50: rgba(30, 74, 159, 0.5);
  --blue-light-75: rgba(30, 74, 159, 0.75);

  /* Variables de opacidad - Naranja */
  --orange-30: rgba(245, 130, 32, 0.3);
  --orange-45: rgba(245, 130, 32, 0.45);
  --orange-60: rgba(245, 130, 32, 0.6);
  --orange-85: rgba(245, 130, 32, 0.85);

  /* Sistema de espaciado */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;

  /* Sistema de transiciones */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.3s ease;

  /* Curvas de timing personalizadas */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-circ: cubic-bezier(0.08, 0.82, 0.17, 1);
  --ease-in-out-back: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Duraciones específicas */
  --duration-scroll-fade: 0.8s;
  --duration-stagger-item: 0.6s;
  --duration-hover: 0.3s;

  /* Delays para stagger */
  --stagger-delay-base: 100ms;
  --stagger-delay-chip: 80ms;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

body {
  background: radial-gradient(circle at top left, #0f172a 0, #020617 45%, #000000 100%);
  color: var(--text-grey);
  line-height: 1.7;
  letter-spacing: 0.01em;
  position: relative;
  overflow-x: hidden;
}

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

/* === Background orbs === */
.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.65;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -1;
}

.orb-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -120px;
  background: radial-gradient(circle, rgba(30, 74, 159, 0.75), transparent 60%);
  /* El parallax JS controlará el transform */
  will-change: transform;
}

.orb-2 {
  width: 520px;
  height: 520px;
  bottom: -180px;
  left: -160px;
  background: radial-gradient(circle, rgba(245, 130, 32, 0.85), transparent 60%);
  /* El parallax JS controlará el transform */
  will-change: transform;
}

/* === Header === */
header {
  background: radial-gradient(circle at top left, rgba(30, 74, 159, 0.25), transparent 55%),
              rgba(3, 7, 18, 0.9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 14px 8%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(30, 74, 159, 0.5);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  margin-right: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.logo-mark:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245,130,32,0.25);
}

.header-logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.brand-tagline {
  font-size: 0.82rem;
  color: #cbd5f5;
}

/* === Navigation === */
nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--text-grey);
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.25s, color 0.25s, transform 0.2s, box-shadow 0.3s;
  text-decoration: none;
  position: relative;
}

.nav-links a:hover {
  background: radial-gradient(circle at center, var(--accent-orange-glow), transparent 80%);
  color: var(--orange-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 130, 32, 0.4);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
  border-radius: 999px;
}

/* === Language switch === */
.lang-switch {
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 230, 240, 0.25);
  padding: 4px 10px;
  color: #d9def1;
  cursor: pointer;
  margin-left: 8px;
}

.lang-switch span { padding: 0 4px; }

.lang-option {
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
}

.lang-option:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

.lang-option--active {
  font-weight: 700;
  color: #ffffff;
}

.lang-separator {
  padding: 0 4px;
  color: #b3bde8;
}

/* === Container === */
.container {
  width: 86%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 0 72px;
  color: #e5e9ff;
}

/* === Page tags === */
.page-tags {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  color: #b3bde8;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page-tag-pill {
  padding: 4px 12px;
  border-radius: 999px;
}

/* === Hero section === */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 44px;
  align-items: center;
  margin-top: 24px;
  padding: 40px 32px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 0% 0%, rgba(34, 211, 238, 0.25), transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(249, 115, 22, 0.25), transparent 55%),
    linear-gradient(135deg, #020617, #020617 40%, #0b1120 100%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(226, 230, 240, 0.18);
  position: relative;
  overflow: hidden;
}

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

.hero-kicker {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #facc9c;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.hero-kicker span { display: inline-flex; align-items: center; gap: 6px; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #f58220;
}

.hero-title {
  font-size: clamp(2.4rem, 2.3vw + 1.6rem, 3rem);
  line-height: 1.1;
  font-weight: 750;
  color: #ffffff;
  margin-bottom: 18px;
  letter-spacing: -0.03em;
}

.hero-gradient {
  background: linear-gradient(120deg, #ffffff, #facc9c, #e2e8f0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: #e0e7ff;
  margin-bottom: 22px;
  max-width: 620px;
  line-height: 1.7;
}

/* === Chips === */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  border-radius: 999px;
  border: 1px solid rgba(30, 74, 159, 0.4);
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-grey);
  background: radial-gradient(circle at top left, rgba(30, 74, 159, 0.35), transparent 70%),
              rgba(10, 26, 58, 0.75);
  box-shadow: 0 8px 18px rgba(10, 26, 58, 0.85);
}

/* === Hero badges === */
.hero-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  color: #cbd5f5;
  margin-bottom: 22px;
}

.hero-badges div { display: flex; align-items: center; gap: 6px; }

/* === Buttons === */
.hero-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.cta-btn {
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: var(--white);
  padding: 13px 30px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.98rem;
  box-shadow: 0 18px 40px var(--accent-orange-glow);
  border: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.cta-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 22px 55px rgba(245, 130, 32, 0.6);
  filter: brightness(1.15);
}

.cta-btn:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.ghost-btn {
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid rgba(30, 74, 159, 0.6);
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-grey);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 26, 58, 0.5);
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.ghost-btn span { font-size: 1rem; }

.ghost-btn:hover {
  background: rgba(30, 74, 159, 0.25);
  border-color: var(--blue-light);
  transform: translateY(-1px);
}

.ghost-btn:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 4px;
}

/* === Hero right === */
.hero-right { position: relative; height: 100%; }

.hero-visual-card {
  position: relative;
  border-radius: 20px;
  padding: 20px 18px 16px;
  background: radial-gradient(circle at top left, rgba(245, 130, 32, 0.22), transparent 55%),
              rgba(5, 11, 26, 0.95);
  border: 1px solid rgba(226, 230, 240, 0.22);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.hero-card-title {
  font-size: 0.84rem;
  font-weight: 500;
  color: #f9fafb;
}

.hero-card-sub {
  font-size: 0.8rem;
  color: #c8cff5;
  margin-bottom: 10px;
}

.formula {
  font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  color: #e5e9ff;
  opacity: 0.93;
  margin-bottom: 14px;
  line-height: 1.6;
}

.formula span { color: #fde68a; }

.hero-diagram {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
  align-items: flex-start;
}

.hero-left-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-metric-card {
  border-radius: 14px;
  padding: 11px 13px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(226, 230, 240, 0.2);
}

.hero-metric-label {
  font-size: 0.74rem;
  color: #b3bde8;
  margin-bottom: 4px;
}

.hero-metric-value {
  font-size: 0.98rem;
  font-weight: 600;
  color: #e5e9ff;
}

.hero-metric-sub {
  font-size: 0.74rem;
  color: #cdd7ff;
  margin-top: 4px;
  line-height: 1.6;
}

.hero-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hero-pill {
  font-size: 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 2px 8px;
  color: #e5e9ff;
  background: rgba(15, 23, 42, 0.9);
}

.hero-right-col {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(226, 230, 240, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-list-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: #e5e9ff;
}

.hero-list {
  font-size: 0.74rem;
  color: #cbd5f5;
  list-style: none;
  padding-left: 0;
}

.hero-list li {
  margin-bottom: 5px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.5;
}

.hero-list li span {
  font-size: 0.9rem;
  color: #fbbf24;
  margin-top: 1px;
}

/* === Trust bar === */
.trust-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.72rem;
  color: #cbd5f5;
  flex-wrap: wrap;
}

.trust-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.trust-badge {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
}

.trust-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot-green {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

/* === Sections === */
section { margin-top: 56px; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(1.75rem, 1.1vw + 1.4rem, 2.1rem);
  font-weight: 700;
  background: linear-gradient(120deg, #e5e7eb, #a5b4fc, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 0.98rem;
  color: #cbd5f5;
  max-width: 480px;
  line-height: 1.7;
}

.section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #cbd5f5;
  margin-bottom: 6px;
}

/* === Domains grid === */
.domains-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.domain-card {
  border-radius: 20px;
  padding: 18px 18px 20px;
  background:
    radial-gradient(circle at 0 0, rgba(30, 74, 159, 0.3), transparent 60%),
    radial-gradient(circle at 120% 0, rgba(245, 130, 32, 0.15), transparent 60%),
    var(--card-bg);
  border: 1px solid rgba(30, 74, 159, 0.45);
  box-shadow: 0 20px 50px rgba(5, 8, 22, 0.9);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
}

.domain-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.domain-chip {
  font-size: 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 74, 159, 0.5);
  padding: 3px 9px;
  color: var(--white);
  background: rgba(10, 26, 58, 0.8);
}

.domain-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.domain-text {
  font-size: 0.88rem;
  color: #d1d5f0;
  margin-bottom: 6px;
  line-height: 1.65;
}

.domain-list {
  margin-top: 4px;
  padding-left: 18px;
  font-size: 0.86rem;
  color: #cbd5f5;
  line-height: 1.6;
}

.domain-list li { margin-bottom: 4px; }

/* === Projects grid === */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  border-radius: 20px;
  padding: 18px 18px 20px;
  background:
    radial-gradient(circle at 0 0, rgba(30, 74, 159, 0.25), transparent 55%),
    var(--card-bg);
  border: 1px solid rgba(30, 74, 159, 0.4);
  box-shadow: 0 16px 40px rgba(5, 8, 22, 0.85);
}

.project-pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  background: var(--accent-orange-glow);
  border: 1px solid rgba(245, 130, 32, 0.3);
  color: var(--text-grey);
  margin-bottom: 8px;
}

.project-title {
  font-weight: 600;
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 5px;
}

.project-client {
  font-size: 0.8rem;
  color: #cbd5f5;
  margin-bottom: 8px;
}

.project-text {
  font-size: 0.88rem;
  color: #d1d5f0;
  margin-bottom: 8px;
  line-height: 1.65;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: #cbd5f5;
  margin-top: 4px;
  line-height: 1.5;
}

.project-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* === Team layout === */
.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 22px;
}

.team-summary {
  font-size: 0.95rem;
  color: #d1d5f0;
  line-height: 1.7;
}

.team-summary p + p { margin-top: 10px; }

.team-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: #cbd5f5;
}

.team-tag-pill {
  border-radius: 999px;
  border: 1px solid rgba(226, 230, 240, 0.3);
  padding: 3px 11px;
  background: rgba(5, 11, 26, 0.6);
}

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

.team-card {
  border-radius: 18px;
  padding: 15px 14px 17px;
  background:
    radial-gradient(circle at 0 0, rgba(30, 74, 159, 0.3), transparent 60%),
    radial-gradient(circle at 120% 0, rgba(245, 130, 32, 0.15), transparent 60%),
    var(--card-bg);
  border: 1px solid rgba(30, 74, 159, 0.45);
  box-shadow: 0 16px 40px rgba(5, 8, 22, 0.9);
}

.team-role {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--white);
  background: rgba(10, 26, 58, 0.8);
  border: 1px solid rgba(30, 74, 159, 0.5);
  border-radius: 999px;
  padding: 3px 9px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.team-name {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.team-bio {
  font-size: 0.85rem;
  color: #d1d5f0;
  margin-bottom: 8px;
  line-height: 1.65;
}

.team-meta {
  font-size: 0.78rem;
  color: #cbd5f5;
  line-height: 1.6;
}

/* === Contact === */
.contact-grid { margin-top: 8px; }

.contact-card {
  margin-top: 24px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 255, 0.45);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.22), transparent 55%),
    rgba(8, 12, 30, 0.96);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
  align-items: center;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.95);
}

.contact-main-text {
  font-size: 0.94rem;
  color: #d1d5f0;
  margin-bottom: 10px;
  line-height: 1.7;
}

.contact-highlight {
  font-size: 0.9rem;
  color: #fef3c7;
  margin-bottom: 10px;
  line-height: 1.7;
}

.contact-info {
  font-size: 0.9rem;
  color: #cbd5f5;
  margin-top: 4px;
}

.contact-info p { margin-bottom: 4px; }

.contact-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: #cbd5f5;
}

.contact-badge-pill {
  border-radius: 999px;
  border: 1px solid rgba(226, 230, 240, 0.3);
  padding: 3px 11px;
  background: rgba(5, 11, 26, 0.7);
}

.contact-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.contact-cta-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.contact-cta-text {
  font-size: 0.9rem;
  color: #d1d5f0;
  line-height: 1.7;
}

/* === Footer === */
footer {
  padding: 22px 8% 26px;
  font-size: 0.8rem;
  color: #b3bde8;
  border-top: 1px solid rgba(226, 230, 240, 0.2);
  background: #020617;
  margin-top: 48px;
}

footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

footer .footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

footer .footer-links a {
  text-decoration: none;
  color: inherit;
}

footer .footer-links a:hover {
  text-decoration: underline;
}

/* === Image slots === */
.image-slot {
  border-radius: 18px;
  border: 1px solid rgba(226, 230, 240, 0.22);
  background: radial-gradient(circle at top left, rgba(148, 163, 255, 0.12), transparent 60%),
              rgba(5, 11, 26, 0.55);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.image-slot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-slot--hero { height: 220px; margin-top: 14px; }
.image-slot--wide { height: 260px; }

.image-slot--wide img {
  object-fit: contain;
  padding: 12px;
  background: transparent;
}

.image-slot--card { height: 140px; margin: 10px 0 12px; }
.image-slot--mini { height: 110px; margin: 10px 0 12px; }

/* === Image grid === */
.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.image-grid--single { grid-template-columns: 1fr; }
.image-grid--triple { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.image-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(226, 230, 240, 0.18);
  background: rgba(5, 11, 26, 0.35);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  aspect-ratio: 16 / 10;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-frame .caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  font-size: 0.72rem;
  color: #e5e9ff;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
}

.image-frame.has-caption { position: relative; }

/* === Contact Form === */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 500px;
  margin-top: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 6px;
  color: var(--text-grey);
  font-size: 0.9rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--white);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), outline var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-color: var(--orange);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #6b7280;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* === Video frame === */
.video-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(226, 230, 240, 0.22);
  background: rgba(5, 11, 26, 0.6);
  box-shadow: 0 14px 36px rgba(0,0,0,0.35);
  aspect-ratio: 16 / 9;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* === Video carousel === */
.video-carousel {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0,0,0,0.35);
}

.video-carousel video {
  display: block;
  width: 100%;
  transform: scale(1.01);
}

.video-carousel:hover {
  box-shadow: 0 18px 44px rgba(0,0,0,0.45);
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,0.35), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.video-carousel.is-paused .video-overlay { opacity: 1; }

.video-carousel:not(.is-paused) .video-overlay {
  opacity: 0;
  pointer-events: none;
}

.video-carousel:focus-within .video-overlay {
  opacity: 1;
  pointer-events: auto;
}

.play-button {
  pointer-events: auto;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(226,230,240,0.35);
  background: rgba(5, 11, 26, 0.55);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  display: grid;
  place-items: center;
  cursor: pointer;
  transform: scale(1);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.play-button:hover {
  transform: scale(1.04);
  background: rgba(15, 23, 42, 0.72);
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid rgba(226, 230, 240, 0.95);
  margin-left: 3px;
}

.pause-icon {
  width: 16px;
  height: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.pause-icon span {
  background: rgba(226,230,240,0.95);
  border-radius: 2px;
}

.carousel-controls {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.carousel-nav {
  display: inline-flex;
  gap: 8px;
  pointer-events: auto;
}

.carousel-btn {
  border-radius: 999px;
  border: 1px solid rgba(226,230,240,0.28);
  background: rgba(5,11,26,0.55);
  color: #e5e9ff;
  font-size: 0.8rem;
  padding: 7px 10px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.carousel-btn:hover {
  transform: translateY(-1px);
  background: rgba(15,23,42,0.72);
}

.carousel-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.dot-btn {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(226,230,240,0.35);
  background: rgba(226,230,240,0.18);
  cursor: pointer;
  padding: 0;
}

.dot-btn.is-active {
  background: rgba(245, 130, 32, 0.85);
  border-color: rgba(245, 130, 32, 0.95);
}

.carousel-hint {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  opacity: 0.95;
}

.carousel-pill {
  pointer-events: auto;
  border-radius: 999px;
  border: 1px solid rgba(226,230,240,0.25);
  background: rgba(5,11,26,0.45);
  color: #e5e9ff;
  font-size: 0.72rem;
  padding: 4px 10px;
  backdrop-filter: blur(10px);
}

/* === Sticky visual === */
.sticky-visual {
  position: sticky;
  top: 92px;
  align-self: start;
}

/* === Card hover effects === */
.domain-card,
.project-card,
.team-card,
.hero-visual-card,
.contact-card,
.image-slot,
.hero-metric-card {
  transition: transform var(--duration-hover) var(--ease-out-circ),
              box-shadow var(--duration-hover) var(--ease-out-circ),
              border-color var(--duration-hover) var(--ease-out-circ),
              filter var(--duration-hover) var(--ease-out-circ);
}

.domain-card:hover,
.project-card:hover,
.team-card:hover,
.hero-visual-card:hover,
.contact-card:hover,
.image-slot:hover,
.hero-metric-card:hover,
.domain-card:focus-within,
.project-card:focus-within,
.team-card:focus-within,
.hero-visual-card:focus-within,
.contact-card:focus-within,
.image-slot:focus-within,
.hero-metric-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 26px 60px rgba(245, 130, 32, 0.34), 0 6px 18px rgba(0,0,0,0.6);
  border-color: var(--orange);
  filter: brightness(1.03);
}

.domain-card:focus-visible,
.project-card:focus-visible,
.team-card:focus-visible,
.hero-visual-card:focus-visible,
.contact-card:focus-visible,
.image-slot:focus-visible,
.hero-metric-card:focus-visible {
  outline: none;
  box-shadow: 0 32px 90px rgba(245, 130, 32, 0.45), 0 0 0 6px rgba(245,130,32,0.12);
}

/* === Pills unified style === */
.page-tag-pill,
.domain-chip,
.project-pill,
.chip,
.team-role,
.contact-badge-pill,
.hero-pill,
.trust-badge,
.team-tag-pill,
.carousel-pill {
  background: linear-gradient(135deg, var(--pill-blue-strong), var(--pill-blue));
  color: var(--white);
  border: 1px solid var(--pill-border);
  box-shadow: 0 8px 20px rgba(6,24,48,0.55);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.page-tag-pill:hover,
.domain-chip:hover,
.project-pill:hover,
.chip:hover,
.team-role:hover,
.contact-badge-pill:hover,
.hero-pill:hover,
.trust-badge:hover,
.team-tag-pill:hover,
.carousel-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(11,37,80,0.55), 0 6px 18px rgba(0,0,0,0.45);
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  border-color: rgba(90,140,210,0.55);
  color: #eaf2ff;
}

/* === Responsive === */

/* Tablet landscape (1024px-980px) */
@media (max-width: 1024px) {
  .container {
    padding: 0 5%;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-right {
    max-width: 600px;
    margin: 0 auto;
  }

  .domains-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablet portrait (768px) */
@media (max-width: 768px) {
  .section-title {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .domains-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 32px 22px;
  }

  header {
    padding: 10px 16px;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .container {
    width: 92%;
    padding-top: 40px;
  }

  .domains-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-layout {
    grid-template-columns: 1fr;
  }

  .team-cards {
    grid-template-columns: 1fr 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .contact-card {
    grid-template-columns: 1fr;
  }

  .sticky-visual {
    position: relative;
    top: auto;
  }
}

/* === Scroll Animations === */
.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-scroll-fade) var(--ease-out-expo),
              transform var(--duration-scroll-fade) var(--ease-out-expo);
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Animaciones @keyframes === */

/* Chip reveal con scale */
@keyframes chipReveal {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Orb float (movimiento flotante) */
@keyframes orbFloat {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-10px, -15px);
  }
}

/* === Stagger Animations === */

/* Stagger en domain-cards con slide lateral alternado */
.domain-card {
  opacity: 0;
  transition: opacity var(--duration-stagger-item) var(--ease-out-quart),
              transform var(--duration-stagger-item) var(--ease-out-quart);
}

.domain-card:nth-child(1) {
  transform: translateX(-40px) translateY(20px);
  transition-delay: 0ms;
}

.domain-card:nth-child(2) {
  transform: translateX(40px) translateY(20px);
  transition-delay: var(--stagger-delay-base);
}

.domain-card:nth-child(3) {
  transform: translateX(-40px) translateY(20px);
  transition-delay: calc(var(--stagger-delay-base) * 2);
}

#ambitos.is-visible .domain-card {
  opacity: 1;
  transform: translateX(0) translateY(0);
}

/* Stagger en project-cards con blur-to-focus */
.project-card {
  opacity: 0;
  filter: blur(8px);
  transition: opacity var(--duration-stagger-item) var(--ease-out-expo),
              transform var(--duration-stagger-item) var(--ease-out-expo),
              filter var(--duration-stagger-item) var(--ease-out-expo);
}

.project-card:nth-child(1) {
  transform: translateX(-40px) translateY(20px);
  transition-delay: 0ms;
}

.project-card:nth-child(2) {
  transform: translateX(40px) translateY(20px);
  transition-delay: var(--stagger-delay-base);
}

.project-card:nth-child(3) {
  transform: translateX(-40px) translateY(20px);
  transition-delay: calc(var(--stagger-delay-base) * 2);
}

#proyectos.is-visible .project-card {
  opacity: 1;
  filter: blur(0);
  transform: translateX(0) translateY(0);
}

/* Desactivar blur en móvil por performance */
@media (max-width: 768px) {
  .project-card {
    filter: none !important;
  }
}

/* Stagger en team-cards */
.team-card {
  opacity: 0;
  transition: opacity var(--duration-stagger-item) var(--ease-out-quart),
              transform var(--duration-stagger-item) var(--ease-out-quart);
}

.team-card:nth-child(1) {
  transform: translateX(-40px);
  transition-delay: 0ms;
}

.team-card:nth-child(2) {
  transform: translateX(40px);
  transition-delay: var(--stagger-delay-base);
}

#etica.is-visible .team-card {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger en chips con animation */
.chip {
  opacity: 0;
  animation: chipReveal 0.5s var(--ease-in-out-back) forwards;
  animation-play-state: paused;
}

.hero.is-visible .chip:nth-child(1) {
  animation-play-state: running;
  animation-delay: 0ms;
}

.hero.is-visible .chip:nth-child(2) {
  animation-play-state: running;
  animation-delay: var(--stagger-delay-chip);
}

.hero.is-visible .chip:nth-child(3) {
  animation-play-state: running;
  animation-delay: calc(var(--stagger-delay-chip) * 2);
}

.hero.is-visible .chip:nth-child(4) {
  animation-play-state: running;
  animation-delay: calc(var(--stagger-delay-chip) * 3);
}

/* Scale effect para hero y contact-card */
.hero.fade-in-section {
  transform: scale(0.95);
}

.hero.fade-in-section.is-visible {
  transform: scale(1);
}

.contact-card.fade-in-section {
  transform: scale(0.97);
}

.contact-card.fade-in-section.is-visible {
  transform: scale(1);
}

@media (max-width: 720px) {
  .logo-mark { width: 38px; height: 38px; }

  .domains-grid {
    grid-template-columns: 1fr;
  }

  .team-cards {
    grid-template-columns: 1fr;
  }

  .brand-name {
    font-size: 1.18rem;
  }

  .hero {
    padding: 26px 18px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: clamp(1rem, 3.5vw, 1.2rem);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

/* === Language Switching State === */
.lang-switching {
  cursor: wait;
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

/* === Progressive Enhancement: @supports === */
@supports not (backdrop-filter: blur(16px)) {
  header {
    background: rgba(3, 7, 18, 0.95);
  }
}

@supports not (background-clip: text) or not (-webkit-background-clip: text) {
  .hero-gradient {
    background: transparent;
    -webkit-text-fill-color: inherit;
    color: var(--text-grey);
  }
}

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