/* ==========================================================================
   WeltEnergie - Hoja de estilos principal
   Cambios habituales:
   - Colores: variables CSS en :root.
   - Imagen principal: selector .hero-bg.
   - Espaciados globales: paddings de cada sección.
   ========================================================================== */

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

/* Paleta oficial (Manual de Identidad Corporativa): negro, blanco y dorado #D3AF35.
   Tipografías oficiales: Lexend (títulos) y Bahnschrift (textos). Bahnschrift sólo
   existe en Windows; en el resto de sistemas se usa Barlow, de proporciones similares. */
:root {
  --gold: #d3af35;
  --gold-light: #e2c45c;
  --black: #000000;
  --white: #ffffff;
  --dark: #000000;          /* alias histórico */
  --font-display: "Lexend", "Barlow", Arial, sans-serif;
  --font-body: "Bahnschrift", "Barlow", Arial, sans-serif;
  --page-x: clamp(22px, 6vw, 92px);
  --section-y: clamp(72px, 9vw, 110px);

  /* Tema oscuro (por defecto) */
  --bg: #000000;
  --surface: #0c0c0c;
  --surface-2: #161616;
  --fg: #ffffff;
  --text: var(--fg);
  --muted: #a6a6a6;
  --line-gold: rgba(211, 175, 53, 0.25);
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-input: rgba(255, 255, 255, 0.12);
  --header-bg: rgba(0, 0, 0, 0.92);
  --shine: rgba(255, 255, 255, 0.05);
  --num-ghost: rgba(211, 175, 53, 0.12);
}

/* Tema claro: se activa desde el panel (SEO y redes › Fondo de la web). */
:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f5f5f5;
  --surface-2: #ebebeb;
  --fg: #000000;
  --muted: #555555;
  --line-gold: rgba(211, 175, 53, 0.5);
  --line-soft: rgba(0, 0, 0, 0.08);
  --line-input: rgba(0, 0, 0, 0.16);
  --header-bg: rgba(255, 255, 255, 0.92);
  --shine: rgba(0, 0, 0, 0.03);
  --num-ghost: rgba(211, 175, 53, 0.22);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  min-width: 320px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  overflow-x: hidden;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ===== Navegación ===== */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-gold);
  backdrop-filter: blur(12px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  padding: 0 var(--page-x);
}

.logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

/* El imagotipo oficial va apilado (emblema sobre el nombre) y en un solo color:
   blanco sobre fondo oscuro, negro sobre fondo claro (index.php elige el archivo). */
.logo img,
.footer-logo img {
  flex: 0 0 auto;
  width: auto;
  object-fit: contain;
}

.logo img {
  height: 60px;
}

.footer-logo img {
  height: 84px;
}

.nav-links {
  display: flex;
  gap: clamp(20px, 3vw, 36px);
  list-style: none;
}

.nav-links a {
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--gold);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

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

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

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

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

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg,
.hero-particles,
.hero-grid,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-bg {
  background: url("../../assets2/hero-pipelines.jpg") center / cover no-repeat;
}

.hero-grid {
  background-image:
    linear-gradient(rgba(211, 175, 53, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(211, 175, 53, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: grid-drift 18s linear infinite;
}

.hero-particles {
  z-index: 1;
  opacity: 0.62;
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero-overlay {
  z-index: 1;
  background:
    linear-gradient(100deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.32) 42%, rgba(0, 0, 0, 0.05) 70%),
    linear-gradient(to top, var(--bg) 0%, transparent 22%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 120px clamp(26px, 8vw, 120px) 80px;
  animation: fade-up 0.9s ease both;
}

.hero-tag,
.section-tag {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.hero-tag {
  display: inline-block;
  padding: 5px 16px;
  margin-bottom: 28px;
  border: 1px solid var(--gold);
  border-radius: 2px;
}

.hero h1 {
  margin-bottom: 28px;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(38px, 5.6vw, 70px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.04;
  text-transform: uppercase;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero h1 em {
  display: block;
  color: var(--gold);
  font-style: normal;
}

.hero p:not(.hero-tag) {
  max-width: 560px;
  margin-bottom: 44px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 15px 34px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--gold);
  color: #000;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--gold-light);
  transform: translateY(-2px);
}

.btn-outline {
  border-color: var(--line-input);
  color: var(--fg);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.btn-primary,
.service-card,
.supply-item {
  isolation: isolate;
}

/* ===== Indicadores ===== */

.stats-bar {
  display: flex;
  justify-content: center;
  padding: 40px var(--page-x);
  background: var(--surface);
  border-top: 1px solid rgba(211, 175, 53, 0.3);
  border-bottom: 1px solid rgba(211, 175, 53, 0.3);
}

.stat {
  flex: 1;
  min-width: 150px;
  padding: 16px 32px;
  border-right: 1px solid var(--line-soft);
  text-align: center;
}

.stat:last-child {
  border-right: 0;
}

.stat-num {
  display: block;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ===== Estilos compartidos ===== */

.gold-line {
  width: 56px;
  height: 3px;
  margin: 14px 0 22px;
  background: var(--gold);
}

.section-title {
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.8vw, 46px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.08;
  text-transform: uppercase;
}

.section-sub,
.section-text {
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.section-sub {
  margin-bottom: 52px;
}

.section-text {
  margin-bottom: 36px;
}

/* ===== Empresa ===== */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(44px, 6vw, 80px);
  align-items: center;
  padding: var(--section-y) clamp(26px, 8vw, 120px);
  background: var(--surface);
}

.about-img {
  position: relative;
  min-height: 420px;
  max-width: 520px;
  margin-inline: auto;
}

.about-img::before {
  content: "";
  position: absolute;
  inset: -16px 16px 16px -16px;
  border: 2px solid var(--gold);
  pointer-events: none;
}

.about-img img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(0.72) brightness(0.84);
}

.about-img::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  height: 40%;
  background: linear-gradient(to top, var(--surface), transparent);
}

.about-badge {
  position: absolute;
  bottom: 32px;
  left: 32px;
  z-index: 3;
  padding: 12px 20px;
  background: var(--gold);
  color: #000;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pillar {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.pillar-icon,
.contact-detail-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(211, 175, 53, 0.1);
  border: 1px solid rgba(211, 175, 53, 0.25);
}

.pillar-icon svg,
.contact-detail-icon svg,
.svc-icon,
.supply-icon {
  fill: none;
  stroke: var(--gold);
  color: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.pillar-icon svg,
.svc-icon,
.supply-icon {
  stroke-width: 1.9;
}

.pillar-icon svg {
  width: 26px;
  height: 26px;
}

.pillar h3 {
  margin-bottom: 4px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pillar p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== Galería (carrusel) ===== */

.gallery {
  padding: 80px 0 0;
  background: var(--bg);
}

.gallery-title {
  margin-bottom: 44px;
  padding: 0 var(--page-x);
  text-align: center;
}

.gallery-title .gold-line {
  margin-inline: auto;
}

.carousel {
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

.carousel-track {
  position: relative;
  height: clamp(340px, 62vw, 720px);
}

.carousel-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.carousel-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 7s linear;
}

.carousel-slide.is-active img {
  transform: scale(1);
}

.carousel-caption {
  position: absolute;
  left: var(--page-x);
  bottom: 28px;
  z-index: 2;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 600;
}

.carousel-nav {
  position: absolute;
  right: var(--page-x);
  bottom: 28px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel-dots {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.carousel-dots button,
.carousel-arrow {
  display: grid;
  place-items: center;
  height: 40px;
  padding: 0 10px;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.carousel-arrow {
  width: 40px;
  padding: 0;
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel-dots button:hover,
.carousel-arrow:hover,
.carousel-dots button:focus-visible,
.carousel-arrow:focus-visible {
  color: var(--gold);
  border-color: var(--gold);
}

.carousel-dots button.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

@media (max-width: 640px) {
  .carousel-track {
    height: 72vw;
    min-height: 260px;
  }

  .carousel-caption {
    left: 16px;
    bottom: 68px;
    font-size: 15px;
  }

  .carousel-nav {
    right: 16px;
    left: 16px;
    bottom: 16px;
    justify-content: space-between;
  }
}

/* ===== Servicios ===== */

.services {
  padding: var(--section-y) var(--page-x);
  background: var(--bg);
}

.services-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 56px;
}

.services-intro .section-sub {
  margin-bottom: 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1px;
  background: rgba(211, 175, 53, 0.12);
  border: 1px solid rgba(211, 175, 53, 0.12);
}

.service-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  padding: 38px 34px;
  background: var(--surface);
  transition: background 0.25s ease;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 0%, var(--shine) 45%, transparent 60%);
  transform: translateX(-130%);
  transition: transform 0.6s ease;
}

.service-card:hover {
  background: var(--surface-2);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover::after {
  transform: translateX(130%);
}

.service-num {
  display: block;
  margin-bottom: 12px;
  color: var(--num-ghost);
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}

.svc-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
}

.service-card h3 {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.25;
  text-transform: uppercase;
}

.service-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.service-card-cta {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--surface-2);
}

.service-card-cta:hover {
  background: var(--surface-2);
}

.service-cta-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ===== Suministros ===== */

.supplies {
  padding: var(--section-y) var(--page-x);
  background: var(--surface);
}

.supplies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}

.supply-item {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  padding: 24px 22px;
  background: var(--surface-2);
  border: 1px solid rgba(211, 175, 53, 0.13);
  transition: border-color 0.2s ease;
}

.supply-item:hover {
  border-color: var(--gold);
}

.supply-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.supply-item span:last-child {
  font-size: 15px;
  font-weight: 600;
}

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

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(44px, 6vw, 80px);
  align-items: start;
  padding: var(--section-y) clamp(26px, 8vw, 120px);
  background: var(--bg);
}

.contact-title {
  font-size: clamp(32px, 4vw, 52px);
}

.contact-info > p:not(.section-tag) {
  margin-bottom: 40px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.contact-detail-icon {
  width: 48px;
  height: 48px;
}

.contact-detail-icon svg {
  width: 20px;
  height: 20px;
}

.contact-detail span {
  display: block;
  margin-bottom: 2px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.contact-detail p {
  color: var(--text);
  font-size: 15px;
}

.location-list {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.location-list p {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.contact-detail a,
.footer-contact a {
  color: inherit;
  text-decoration: none;
}

.contact-detail a:hover,
.contact-detail a:focus-visible,
.footer-contact a:hover,
.footer-contact a:focus-visible {
  color: var(--gold);
}

.form-row {
  margin-bottom: 18px;
}

.form-row label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line-input);
  border-radius: 0;
  color: var(--fg);
  outline: 0;
  transition: border-color 0.2s ease;
}

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

.form-row select {
  padding-right: 40px;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A9BB5' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.form-row textarea {
  min-height: 120px;
  resize: vertical;
}

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

.form-submit {
  width: 100%;
  clip-path: none;
  font-size: 14px;
  padding-block: 18px;
}

.form-note {
  min-height: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.form-note.success {
  color: var(--gold-light);
}

.form-note.error {
  color: #d9534f;
}

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

.footer {
  padding: 48px var(--page-x) 32px;
  background: var(--surface);
  border-top: 1px solid var(--line-gold);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-desc {
  max-width: 280px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.footer-nav h2,
.footer-contact h2 {
  margin-bottom: 16px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.footer-nav a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--gold);
}

.footer-contact p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.footer-contact p:last-child {
  margin-top: 16px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.footer-bottom p,
.footer-credit {
  color: var(--muted);
  font-size: 12px;
}

.footer-credit a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-credit a:hover,
.footer-credit a:focus-visible {
  color: var(--gold-light);
}

/* ===== Botón volver arriba ===== */

.back-to-top {
  position: fixed;
  right: clamp(18px, 3vw, 34px);
  bottom: clamp(18px, 3vw, 34px);
  z-index: 90;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: rgba(211, 175, 53, 0.92);
  border: 1px solid var(--line-soft);
  color: #000;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--gold-light);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

/* ===== Animaciones ===== */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes grid-drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 60px 60px, 60px 60px;
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ===== Página 404 ===== */

.error-page {
  min-height: 100vh;
}

.error-hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 120px var(--page-x) 72px;
}

.error-content {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  text-align: center;
  animation: fade-up 0.8s ease both;
}

.error-content .hero-tag {
  margin-bottom: 24px;
}

.error-code {
  color: rgba(211, 175, 53, 0.18);
  font-family: var(--font-display);
  font-size: clamp(110px, 22vw, 220px);
  font-weight: 700;
  line-height: 0.78;
  text-transform: uppercase;
}

.error-content h1 {
  margin: 0 auto 20px;
  font-family: var(--font-display);
  font-size: clamp(34px, 5.5vw, 64px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.95;
  text-transform: uppercase;
}

.error-content p:not(.hero-tag):not(.error-code) {
  max-width: 620px;
  margin: 0 auto 36px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.error-content .btn-group {
  justify-content: center;
}

.error-nav {
  display: flex;
}

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

@media (max-width: 900px) {
  .about,
  .contact {
    grid-template-columns: 1fr;
  }

  .about-img,
  .about-img img {
    min-height: 340px;
  }

  .services-intro,
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 84px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 12px 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line-gold);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 12px var(--page-x);
    font-size: 14px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .logo img {
    height: 48px;
  }

  .hero p:not(.hero-tag) {
    font-size: 16px;
  }

  .btn {
    width: 100%;
  }

  .stats-bar {
    flex-wrap: wrap;
  }

  .stat {
    min-width: 50%;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }


  .form-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .back-to-top {
    width: 44px;
    height: 44px;
  }

  .error-nav {
    display: none;
  }

  .error-content {
    text-align: left;
  }

  .error-content .btn-group {
    justify-content: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .hero-grid {
    animation: none;
  }
}
