* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:root,
:root[data-theme='light'] {
  --color-bg: #ffffff;
  --color-bg-elevated: #f5f5f7;
  --color-bg-inverted: #1d1d1f;
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-nav-bg: rgba(255, 255, 255, 0.72);
  --color-card-bg: #ffffff;
  --color-accent: #3a3cac;
  --color-accent-2: #00bfd8;
  --shadow-card: 0 1rem 2.5rem rgba(0, 0, 0, 0.06);
}

:root[data-theme='dark'] {
  --color-bg: #000000;
  --color-bg-elevated: #111113;
  --color-bg-inverted: #f5f5f7;
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #a1a1a6;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-nav-bg: rgba(0, 0, 0, 0.6);
  --color-card-bg: #1c1c1e;
  --color-accent: #6d70e0;
  --color-accent-2: #29d6ee;
  --shadow-card: 0 1rem 2.5rem rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --color-bg: #000000;
    --color-bg-elevated: #111113;
    --color-bg-inverted: #f5f5f7;
    --color-text-primary: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-nav-bg: rgba(0, 0, 0, 0.6);
    --color-card-bg: #1c1c1e;
    --color-accent: #6d70e0;
    --color-accent-2: #29d6ee;
    --shadow-card: 0 1rem 2.5rem rgba(0, 0, 0, 0.45);
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a {
  color: inherit;
}

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

.eyebrow {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.75rem;
  border-radius: 100px;
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-accent-2);
  font-weight: 600;
  text-decoration: none;
}

.link-arrow span {
  transition: transform 0.2s ease;
}

.link-arrow:hover span {
  transform: translateX(4px);
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav--scrolled {
  background: var(--color-nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--color-border);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text-primary);
}

.nav__brand img {
  height: 28px;
  width: auto;
}

/* El logo es blanco; en tema claro lo invertimos a oscuro para que se lea */
.nav__brand img,
.footer__logo {
  filter: invert(1);
}

:root[data-theme='dark'] .nav__brand img,
:root[data-theme='dark'] .footer__logo {
  filter: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .nav__brand img,
  :root:not([data-theme='light']) .footer__logo {
    filter: none;
  }
}

/* Logos de cliente con variante clara/oscura dedicada (en vez de filtro) */
.theme-light-only {
  display: inline;
}

.theme-dark-only {
  display: none;
}

:root[data-theme='dark'] .theme-light-only {
  display: none;
}

:root[data-theme='dark'] .theme-dark-only {
  display: inline;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-light-only {
    display: none;
  }

  :root:not([data-theme='light']) .theme-dark-only {
    display: inline;
  }
}

.nav__links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav__links a {
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.nav__links a:hover {
  color: var(--color-text-primary);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme='dark'] .theme-toggle .icon-sun {
  display: none;
}

[data-theme='dark'] .theme-toggle .icon-moon {
  display: block;
}

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav__burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 4rem;
  overflow: hidden;
}

.hero__content {
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  padding-bottom: 0.1em;
  margin: 0 0 1.5rem;
  background: linear-gradient(135deg, var(--color-text-primary) 40%, var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 60%);
  opacity: 0.15;
  filter: blur(60px);
  pointer-events: none;
}

/* Clients */
.clients {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
  text-align: center;
}

.clients__label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 2rem;
}

.clients__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: center;
  justify-items: center;
  gap: 2.5rem 1.5rem;
}

.clients__grid img {
  width: 100%;
  max-width: 160px;
  height: 72px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.7;
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

.clients__grid img:hover {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.05);
}

/* Section shared */
.section-head {
  max-width: 620px;
  margin: 0 auto 3.5rem;
  text-align: center;
  padding: 0 1.5rem;
}

.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.section-head p {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  margin: 0;
}

.services {
  padding: 7rem 1.5rem;
}

.services__grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 1.5rem;
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease;
}

.service-card:hover {
  transform: translateY(-4px);
}

.service-card h3 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}

.service-card p {
  color: var(--color-text-secondary);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 0;
}

.service-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: #fff;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
}

.service-card__icon svg {
  width: 22px;
  height: 22px;
}

/* Feature panels */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

.feature--reverse .feature__text {
  order: 2;
}

.feature--reverse .feature__visual {
  order: 1;
}

.feature--dark {
  max-width: none;
  background: var(--color-bg-inverted);
  color: var(--color-bg);
}

.feature--dark .eyebrow {
  color: var(--color-accent-2);
}

.feature--dark .feature__body {
  color: var(--color-text-secondary);
}

.feature--dark .feature__text,
.feature--dark .feature__visual {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem;
}

.feature h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.feature__body {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
  max-width: 480px;
}

.feature__visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 1.75rem;
  min-height: 280px;
  overflow: hidden;
}

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

.feature__visual::after {
  content: '';
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
}

.feature__visual--indigo::after {
  background: linear-gradient(135deg, rgba(109, 112, 224, 0.65), rgba(29, 29, 31, 0.55));
}

.feature__visual--turquoise::after {
  background: linear-gradient(135deg, rgba(41, 214, 238, 0.5), rgba(0, 191, 216, 0.35));
}

/* Testimonials */
.testimonials {
  padding: 7rem 1.5rem;
  background: var(--color-bg-elevated);
}

.testimonials__grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.testimonial-card {
  margin: 0;
  background: var(--color-card-bg);
  border-radius: 1.5rem;
  padding: 2rem;
  border: 1px solid var(--color-border);
}

.testimonial-card p {
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0 0 1.25rem;
}

.testimonial-card footer {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Contact */
.contact {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.contact__list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact__list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact__list span {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact__list a {
  text-decoration: none;
  font-weight: 500;
}

.contact__list a:hover {
  color: var(--color-accent);
}

.contact__form {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.form-row {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.form-row input,
.form-row textarea,
.form-row .form-select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-primary);
  resize: vertical;
}

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

.phone-input {
  display: flex;
  gap: 0.5rem;
}

.phone-input select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-primary);
  flex: 0 0 auto;
  max-width: 110px;
}

.phone-input select:focus,
.phone-input input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.phone-input input {
  flex: 1;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-primary);
}

.form-note {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* Footer */
.footer {
  padding: 3.5rem 1.5rem 2rem;
  border-top: 1px solid var(--color-border);
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer__logo {
  height: 24px;
  width: auto;
  margin: 0 0 0.75rem;
}

.footer__brand p:last-child {
  color: var(--color-text-secondary);
  margin: 0;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.footer__links a:hover {
  color: var(--color-text-primary);
}

.footer__copy {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
  .nav__links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-150%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .nav__links--open {
    transform: translateY(0);
    opacity: 1;
  }

  .nav__burger {
    display: flex;
  }

  .services__grid,
  .testimonials__grid {
    grid-template-columns: 1fr;
  }

  .feature,
  .feature--reverse {
    grid-template-columns: 1fr;
  }

  .feature__text,
  .feature--reverse .feature__text,
  .feature__visual,
  .feature--reverse .feature__visual {
    order: initial;
  }

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