:root{
  --max-width: 120rem;
  --container-padding: 2.4rem;
  --brand-900: #0f1720;
  --brand-700: #1f2937;
  --accent: #25d366;
  --muted: #767676;
  --bg: #ffffff;
  --card-bg: linear-gradient(135deg,#ffffff,#e5eef8);
  --radius: 0.9rem;
  --shadow-sm: 0 6px 18px rgba(15,23,37,0.08);
  --shadow-md: 0 12px 36px rgba(15,23,37,0.12);
  --transition: 200ms cubic-bezier(.2,.8,.2,1);
  --max-content-width: 1200px;
  --text-color: #222;
  --muted-color: #6b7280;
  --focus-ring: 0 0 0 4px rgba(37,211,102,0.12);
  --sticky-top: 4rem;
}

/* Reset & sensible defaults */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: 62.5%; /* 1rem = 10px */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text-color);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.45;
  font-size: 1.6rem; /* 16px */
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

/* Utility container */
.container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Splash / Preloader */
#splash {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 1s ease;
  pointer-events: none;
}

#splash.fade-out { opacity: 0; }
#splash.hidden { display: none; }

#splash img {
  max-width: 60%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Header / Hero */
.site-header {
  min-height: 100vh;
  display: grid;
  align-items: center;
  position: relative;
  color: #fff;
  background-image: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)), url('../Images/Background/working.jpg');
  background-size: cover;
  background-position: center;
  padding: 4.8rem 0;
}

/* Header nav layout */
.header-nav {
  position: absolute;
  top: 2.0rem;
  left: var(--container-padding);
  right: var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

/* Brand */
.brand { flex: 0 0 auto; }
.brand-link img { display: block; height: auto; }

/* Main nav centered */
.main-nav { display: flex; justify-content: flex-end; align-items: center; }
.main-nav .nav-list {
  display: flex;
  gap: 2.4rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Accessible menu button */
.btn-menu {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  padding: .6rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  color: #fff;
}
.btn-menu:focus { outline: none; box-shadow: var(--focus-ring); border-radius: .6rem; }

/* Base: hide menu button on desktop */
.btn-menu { display: none; }

/* Nav links */
.nav-link {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 4.0rem;
  transition: color var(--transition);
}
.nav-link:hover,
.nav-link:focus { color: rgba(227,229,230,0.8); outline: none; }

/* Header content */
.header-container {
  text-align: center;
  margin-top: 28rem; /* reduced default to avoid overflow on smaller screens */
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

.header-h1-1 {
  font-size: 3.6rem;
  line-height: 1.08;
  margin-bottom: 1.2rem;
  font-weight: 700;
  color: #fff;
}
.header-sub {
  font-size: 4rem;
  font-weight: 700;
  color: #00BFFF;
  margin-bottom: 2.4rem;
}
.btn-header {
  display: inline-block;
  background: rgba(37,211,102,0.95);
  color: #062018;
  padding: 1.4rem 2.8rem;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.8rem;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.btn-header:hover,
.btn-header:focus { transform: translateY(-3px); box-shadow: var(--shadow-md); outline: none; box-shadow: var(--shadow-md), var(--focus-ring); }

/* Services grid (original fallback) */
.services-container {
  padding: 9.6rem 0;
  background: #f8fafc;
}
.header-servicios {
  text-align: center;
  font-size: 3.6rem;
  font-weight: 700;
  color: #00BFFF;
  margin-bottom: 4.8rem;
  border-bottom: 1px solid rgba(68,68,68,0.08);
  padding-bottom: 3.2rem;
}

/* Original grid (kept for fallback) */
.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3.2rem;
  align-items: start;
}

/* Card */
.service-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 6px 18px rgba(15,23,37,0.04);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.service-card:hover,
.service-card:focus-within { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.services-img {
  width: 100%;
  height: 18rem;
  object-fit: cover;
  display: block;
  background-color: #e6eef8;
}

/* Consolidated description rules */
.services .descripcion,
.service-card .descripcion,
.descripcion {
  text-align: justify;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  text-align-last: left;
  line-height: 1.6;
  padding: 0 1.6rem 2.4rem 1.6rem;
  font-size: 2.4rem;
  color: var(--muted-color);
  margin-top: auto;
}

/* Titles */
.titulo {
  font-size: 2.0rem;
  font-weight: 700;
  padding: 1.6rem;
  color: var(--brand-700);
  text-align: center;
}

/* Contact / Form */
.contact-us {
  padding: 6.4rem 0;
}
.register {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 2.4rem;
  align-items: stretch;
  max-width: 110rem;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 1.1rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Contact text box */
.contact-text-box {
  padding: 3.2rem;
}
.heading-contact {
  font-size: 2.8rem;
  margin-bottom: 1.6rem;
  color: var(--brand-700);
  text-align: center;
}

/* Form layout (single declaration) */
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  align-items: start;
}
.contact-form .full-width {
  grid-column: 1 / -1;
}

.contact-form label {
  display: block;
  font-size: 1.4rem;
  margin-bottom: .6rem;
  color: var(--brand-700);
  text-align: center;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  display: block;
  width: 100%;
  padding: 1.0rem 1.2rem;
  font-size: 1.6rem;
  border-radius: .8rem;
  border: 1px solid rgba(15,23,37,0.06);
  background: rgba(181,202,222,0.12);
  outline: none;
  transition: box-shadow var(--transition), border-color var(--transition);
  box-sizing: border-box;
  text-align: center;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus { box-shadow: var(--focus-ring); border-color: rgba(37,211,102,0.2); }

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #9aa4b2;
  text-align: center;
}

/* Ensure select and inputs align visually */
.contact-form select { appearance: none; -webkit-appearance: none; -moz-appearance: none; }

/* Button */
.btn-container1 { grid-column: 1 / -1; display: flex; justify-content: center; }
.btn-register {
  background: var(--accent);
  color: #062018;
  border: none;
  padding: 1.0rem 2.4rem;
  border-radius: .8rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 1.6rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-register:hover,
.btn-register:focus { transform: translateY(-3px); box-shadow: var(--shadow-md); outline: none; }

/* Right column: image */
.contact-img {
  background-size: cover;
  background-position: center;
  min-height: 36rem;
}

/* Floating CTA (WhatsApp) */
.float {
  position: fixed;
  width: 6.0rem;
  height: 6.0rem;
  bottom: 4.0rem;
  right: 4.0rem;
  background-color: var(--accent);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  font-size: 3.0rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.float svg { width: 5.6rem; height: 5.6rem; display: block; }
.float:focus { box-shadow: var(--focus-ring); outline: none; }

/* Footer */
.footer-line { border-bottom: 1px solid rgba(68,68,68,0.08); margin-top: 4.0rem; }
.footer {
  padding: 3.2rem 0 6.4rem 0;
  background: #fff;
}
.footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2.4rem;
}
.copyright { font-size: 1.6rem; color: var(--muted-color); }

/* Social icons */
.social-list {
  display: flex;
  gap: 1.6rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.social-list li img {
  display: block;
  width: 3.2rem;
  height: 3.2rem;
  object-fit: contain;
  vertical-align: middle;
}
.social-list li.youtube img { width: 4.4rem; height: 4.4rem; }

/* Legal links styling */
.legal ul {
  display: flex;
  gap: 2.4rem;
  list-style: none;
  margin: 1.6rem 0 0 0;
  padding: 0;
  align-items: center;
}
.legal ul li a {
  color: var(--muted-color);
  text-decoration: none;
  font-size: 1.4rem;
  padding: .4rem .6rem;
  border-radius: .4rem;
  transition: background .15s, color .15s;
}
.legal ul li a:hover,
.legal ul li a:focus {
  background: rgba(37,211,102,0.08);
  color: var(--brand-700);
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Accessibility helpers */
.sr-only {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .header-h1-1 { font-size: 2.8rem; }
  .header-sub { font-size: 1.6rem; }
  .register { grid-template-columns: 1fr; }
  .contact-img { min-height: 28rem; }
  .header-container { margin-top: 20rem; }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .btn-menu { display: inline-flex; }
  .header-container { padding: 0 1.6rem; margin-top: 12rem; }
  .services { grid-template-columns: 1fr; gap: 1.6rem; }
  .header-h1-1 { font-size: 2.2rem; }
  .btn-header { padding: 1.0rem 1.8rem; font-size: 1.6rem; }
  .contact-form { grid-template-columns: 1fr; }
  .contact-form input, .contact-form select { font-size: 1.4rem; }
  .float { bottom: 6.4rem; right: 1.6rem; }
}

/* Mobile nav open state (toggled by .nav-open on root) */
.nav-open .main-nav {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(0);
  z-index: 998;
}
.nav-open .nav-list {
  flex-direction: column;
  gap: 3.2rem;
}
.nav-open .nav-link { color: var(--brand-900); font-size: 2.0rem; }

/* Focus-visible for keyboard users */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: .6rem; }

/* Small tweaks for very small screens */
@media (max-width: 360px) {
  .header-h1-1 { font-size: 1.9rem; }
  .header-sub { font-size: 1.4rem; }
  .btn-header { padding: .8rem 1.2rem; font-size: 1.4rem; }
  .services-img { height: 12rem; }
}

/* Scrollytelling specific styles (non-invasive, only for services-section) */
.scrolly-layout {
  display: grid;
  grid-template-columns: 48% 52%;
  gap: 2.4rem;
  align-items: start;
  margin-top: 3.2rem;
  margin-bottom: 3.2rem;
}

/* Sticky panel */
.sticky-panel {
  position: sticky;
  top: calc(var(--sticky-top) + 1rem);
  background: #fff;
  border-radius: .9rem;
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 20; /* defensive z-index */
}
.sticky-media {
  width: 100%;
  height: 260px;
  overflow: hidden;
  border-radius: 6px;
  background:#e6eef8;
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
}
.sticky-media img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition: opacity 180ms ease;
  opacity: 1;
}

/* Steps column */
.steps-column {
  display:flex;
  flex-direction:column;
  gap: 1.6rem;
  padding-left: 0;
}

/* Make service-card compatible with scrolly layout (non-destructive) */
.scrolly-layout .service-card {
  min-height: 22rem;
  padding: 0;
  overflow: visible;
}
.scrolly-layout .service-card .services-img {
    display: none;
    width: 0;
    height: 0;
    visibility: hidden;
}
.scrolly-layout .service-card .titulo { padding: 1.2rem; font-size: 2.8rem; text-align: center; }
.scrolly-layout .service-card .descripcion { padding: 0 1.6rem 1.6rem 1.6rem; }

/* Active visual on step */
.scrolly-layout .service-card.active {
  outline: 3px solid rgba(37,211,102,0.12);
  box-shadow: var(--shadow-md);
  transform: translateY(-6px);
}

/* Ensure sticky behaves well on small screens */
@media (max-width: 900px) {
  .scrolly-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: relative; top: auto; }
  .sticky-media { height: 200px; }
}

.services-container.services-section {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
}

.services-container .service-card,
.scrolly-layout .service-card,
.services .service-card {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

.scrolly-layout .service-card {
  padding: 1.6rem !important;
}

.scrolly-layout .service-card .titulo,
.scrolly-layout .service-card .descripcion {
  color: #ffffff; 
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.sticky-panel {
  background: transparent !important;
  box-shadow: none !important;
}

.scrolly-layout .service-card .services-img { display: none; }
