/*
 * Google Fonts locales
 *
 * Fuente: Inter
 * Variantes: 400 (Regular), 500 (Medium), 600 (SemiBold)
 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('../assets/fonts/Inter-Regular.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  src: url('../assets/fonts/Inter-Medium.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('../assets/fonts/Inter-SemiBold.woff2') format('woff2');
  font-display: swap;
}

/*
 * Google Fonts locales
 *
 * Fuente: Montserrat
 * Variantes: 600 (SemiBold), 700 (Bold)
 */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  src: url('../assets/fonts/Montserrat-SemiBold.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  src: url('../assets/fonts/Montserrat-Bold.woff2') format('woff2');
  font-display: swap;
}

/*
 * Variables
 */
:root {
  --bg: #0d0d0d;
  --bg-darker: #080808;
  --text: #f5f5f5;
  --text-muted: #d4d4d4;
  --brand: #f97316;
  --link: #f97316;
  --link-hover: #fb923c;
  --border-color: #3f3f46;
  --border-dark: #27272a;
  --form-bg: #18181b;

  --step--2: clamp(0.64rem, 0.63rem + 0.04vw, 0.67rem);
  --step--1: clamp(0.8rem, 0.78rem + 0.08vw, 0.85rem);
  --step-0: clamp(1rem, 0.96rem + 0.17vw, 1.1rem);
  --step-1: clamp(1.25rem, 1.19rem + 0.26vw, 1.41rem);
  --step-2: clamp(1.56rem, 1.48rem + 0.39vw, 1.79rem);
  --step-3: clamp(1.95rem, 1.83rem + 0.58vw, 2.29rem);
  --step-4: clamp(2.44rem, 2.27rem + 0.77vw, 2.87rem);
  --step-5: clamp(3.05rem, 2.82rem + 1.13vw, 3.82rem);
}

/*
 * Reset
 */
html { font-size: 100%; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeSpeed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
h5 { font-size: var(--step-0); }

p { margin-top: 0; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
ol, ul, li { margin: 0; padding: 0; }

/*
 * General
 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 4rem 0; }
section:first-of-type { padding-top: 0; }

/*
 * Header & Navigation
 */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--bg); }
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.brand { display: flex; align-items: center; }

/* Solución para el logo "chafado" */
.brand img {
  height: auto;
}

/* Menú de navegación principal */
.nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s ease-in-out;
}
.nav a:hover {
  color: var(--text);
}

/* Iconos */
.header-social-links a svg, .lang-switcher button svg {
  width: 20px;
  height: 20px;
}

/* Estilos para el menú de navegación en móvil */
.nav {
  display: none;
}
.lang-switcher, .header-social-links {
  display: none;
}

.nav-open .nav,
.nav-open .lang-switcher,
.nav-open .header-social-links {
  display: flex; /* Muestra los elementos cuando el menú está abierto */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.nav-open .nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  z-index: 50;
  animation: fadeIn .3s ease-in-out;
}

.nav-open .nav ul {
  flex-direction: column;
  gap: 24px;
}

.nav-toggle {
  background: none;
  border: 0;
  cursor: pointer;
  width: 42px;
  height: 42px;
  position: relative;
  border-radius: 8px;
  z-index: 60;
}

.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text);
  margin: 6px auto;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Estilos del selector de idioma */
.lang-switcher button {
  background: none;
  border: none;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease-in-out;
  padding: 0;
}
.lang-switcher button:hover { opacity: 0.8; }
.lang-switcher button.active { opacity: 1; }

/* Animación de apertura para el menú */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Ordenación y visibilidad en escritorio */
@media (min-width: 900px) {
  .nav {
    display: block;
    order: 3;
    margin-left: auto;
  }
  .lang-switcher {
    display: flex;
    order: 1;
  }
  .header-social-links {
    display: flex;
    order: 2;
  }
  .nav-toggle {
    display: none;
  }
}

/*
 * Hero Section
 */
.hero-section {
  background-color: var(--bg-darker);
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: 100px 0;
  text-align: center;
}

.hero-content h1 {
  font-size: var(--step-5);
  font-weight: 700;
  margin-bottom: 0.5em;
  line-height: 1.1;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-content p {
  max-width: 600px;
  margin: 0 auto 24px;
  font-size: var(--step-0);
  opacity: 0.8;
}

.cta-button {
  display: inline-block;
  background-color: var(--brand);
  color: var(--text);
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.2s ease-in-out;
}
.cta-button:hover { background-color: var(--link-hover); }

.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
}

/*
 * Features Section
 */
.features-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  text-align: center;
}
.feature-card {
  padding: 24px;
  background-color: var(--bg-darker);
  border-radius: 8px;
}
.feature-card h3 {
  color: var(--brand);
  font-size: var(--step-1);
}
@media (min-width: 600px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/*
 * Contact Section
 */
.contact-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-info p { margin: 0; }
.contact-info a { text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }

.contact-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-muted);
}
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--form-bg);
  color: var(--text);
  margin-bottom: 16px;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--brand);
}

.contact-form textarea { resize: vertical; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.helper { opacity: .8; font-size: 0.95rem; }

.contact-list { list-style: none; padding: 0; margin: 12px 0 0; }
.contact-list li { margin-bottom: 6px; }

/*
 * Footer
 */
.site-footer { border-top: 1px solid rgba(229,231,235,0.1); padding: 24px 0 12px; }
.foot-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.foot-about { opacity: .9; }
.foot-nav, .foot-legal { display: flex; gap: 12px; flex-wrap: wrap; }
.copy { opacity: .7; font-size: var(--step--1); margin-top: 10px; }
@media (min-width: 800px) {
  .foot-grid { grid-template-columns: 1.2fr 1fr 1fr; }
}

.skip-link {
  position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 16px; top: 16px; z-index: 1000; width: auto; height: auto;
  padding: 8px 16px; background-color: var(--brand); color: var(--text); border-radius: 4px;
}