:root {
  --navy: #10243a;
  --blue: #0879b9;
  --red: #d72b29;
  --red-hover: #b82422;
  --mist: #f3f6f9;
  --white: #ffffff;
  --ink: #10243a;
  --muted: #3d5166;
  --line: #e4eaf0;
  --header-h: 5.6rem;
  --bar-h: 4.6rem;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(16, 36, 58, 0.06);
  --display: "Sora", system-ui, sans-serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  max-width: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-size: 1.0625rem;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

p {
  margin: 0;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--navy);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

section[id],
.site-header {
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.eyebrow::before {
  content: "";
  display: block;
  width: 1.75rem;
  height: 2px;
  margin-bottom: 0.8rem;
  background: var(--blue);
}

.hero .eyebrow,
.eyebrow-light {
  color: var(--red);
}

.clients .eyebrow {
  color: #d7e4ef;
}

.hero .eyebrow::before,
.eyebrow-light::before {
  background: var(--red);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px rgba(16, 36, 58, 0.05);
}

.header-inner {
  width: min(1180px, calc(100% - 1.4rem));
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand img {
  display: block;
  height: 4.4rem;
  width: auto;
  max-width: min(16rem, 54vw);
  object-fit: contain;
  object-position: left center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 0.18rem;
}

.brand-mark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.28rem;
  letter-spacing: -0.05em;
}

.brand-sub {
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.nav {
  display: none;
}

.nav-toggle {
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  padding: 0;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.28rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.15rem;
  height: 1.5px;
  background: var(--navy);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(0.4rem) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-0.4rem) rotate(-45deg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.7rem 1.15rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

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

.btn-quote {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.btn-quote:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
}

.header-cta {
  min-height: 2.4rem;
  padding-inline: 0.85rem;
  font-size: 0.92rem;
}

.btn-ghost {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}

.btn:focus-visible,
.nav a:focus-visible,
.contact-row:focus-visible,
.text-link:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.hero {
  display: flex;
  flex-direction: column;
  background: var(--white);
}

.hero-copy {
  order: -1;
  padding: 1.7rem 0 1.15rem;
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero h1 {
  max-width: 14ch;
  font-size: clamp(2.15rem, 8vw, 2.7rem);
}

.hero .lead {
  max-width: 38rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.hero-visual {
  position: relative;
  height: 13.5rem;
  overflow: hidden;
  background: var(--navy);
}

.hero-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 46%;
}

.section {
  padding: 4.5rem 0;
}

.section-mist {
  background: var(--mist);
}

.section-head {
  max-width: 38rem;
  margin-bottom: 2rem;
}

.section-head h2,
.about-copy h2,
.contact-info h2,
.clients h2 {
  font-size: clamp(2rem, 4vw, 3.15rem);
}

.section-intro,
.about-copy p,
.contact-lead {
  margin-top: 0.85rem;
  color: var(--muted);
  max-width: 38rem;
}

.service-grid {
  display: grid;
  gap: 1rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.service-photo {
  height: 11.25rem;
  overflow: hidden;
  background: #d7e0e8;
}

.service-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.encuadre-instalacion img { object-position: center 28%; }
.encuadre-mantenimiento img { object-position: center 36%; }
.encuadre-tecnico img { object-position: center 62%; }
.encuadre-control img { object-position: center 48%; }
.encuadre-equipos img { object-position: 78% 40%; }

.service-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  padding: 1.15rem 1.15rem 1.25rem;
}

.service-index {
  margin: 0;
  color: var(--blue);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.service-body h3 {
  font-size: 1.28rem;
  letter-spacing: -0.03em;
}

.service-body p {
  color: var(--muted);
}

.text-link {
  margin-top: auto;
  padding-top: 0.85rem;
  color: var(--blue);
  font-weight: 600;
}

.text-link::after {
  content: " →";
}

.about-grid {
  display: grid;
  gap: 1.8rem;
}

.about-copy p + p {
  margin-top: 0.75rem;
}

.facts {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.6rem;
}

.facts li {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.facts span {
  color: var(--muted);
  font-size: 0.92rem;
}

.facts strong {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.about-photo {
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  background: #d7e0e8;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.project-grid {
  display: grid;
  gap: 1rem;
}

.project-card {
  min-height: 13rem;
  padding: 1.4rem 1.3rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.project-type {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 600;
}

.project-card h3 {
  font-size: clamp(1.5rem, 2vw, 1.85rem);
}

.project-card p:last-child {
  color: var(--muted);
  max-width: 28rem;
}

.clients {
  background: var(--navy);
  color: var(--white);
  padding: 4.5rem 0;
}

.clients h2 {
  max-width: 16ch;
}

.client-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
  margin-top: 1.8rem;
}

.client-list li {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.contact-layout {
  display: grid;
  gap: 2rem;
}

.contact-company {
  margin-top: 1.6rem;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.contact-legal {
  color: var(--muted);
  margin-top: 0.2rem;
}

.contact-list {
  display: grid;
  margin-top: 1.2rem;
}

.contact-row {
  display: grid;
  gap: 0.1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.contact-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

.contact-row strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

a.contact-row:hover strong {
  color: var(--blue);
}

.contact-form {
  display: grid;
  gap: 0.9rem;
  padding: 1.2rem;
  background: var(--mist);
  border-radius: var(--radius);
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.92rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 0.75rem 0.8rem;
}

.field textarea {
  resize: vertical;
  min-height: 7rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--blue);
  border-color: var(--blue);
}

.form-error {
  margin: 0;
  color: var(--red);
  font-weight: 600;
}

.contact-submit {
  width: 100%;
  border: 0;
}

.site-footer {
  background: var(--navy);
  color: var(--white);
  padding: 3rem 0 2.2rem;
}

.footer-grid {
  display: grid;
  gap: 1.8rem;
}

.footer-mark {
  margin: 0;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.footer-logo {
  display: block;
  height: 4.8rem;
  width: auto;
  max-width: min(22rem, 78vw);
  object-fit: contain;
  object-position: left center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.footer-name,
.footer-label {
  margin: 0.8rem 0 0.35rem;
  font-weight: 600;
}

.footer-tag,
.site-footer a,
.site-footer p {
  color: #d5e0ea;
}

.site-footer a:hover {
  color: var(--white);
}

.footer-grid ul {
  display: grid;
  gap: 0.35rem;
}

.footer-grid .social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.social-list a {
  width: 2.45rem;
  height: 2.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #d5e0ea;
}

.social-list a:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.7);
}

.social-list svg {
  width: 1.05rem;
  height: 1.05rem;
}

.mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem calc(0.7rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.mobile-bar a {
  min-height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 600;
}

.mobile-bar-call {
  border: 1px solid var(--navy);
  color: var(--navy);
}

.mobile-bar-wa {
  background: var(--navy);
  color: var(--white);
}

.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  .service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(16, 36, 58, 0.08);
  }

  .service-card:hover img {
    transform: scale(1.035);
  }

  .project-card {
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  }

  .project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(16, 36, 58, 0.08);
  }

  .text-link {
    transition: color 0.2s var(--ease);
  }

  .text-link:hover {
    color: var(--navy);
  }
}

@media (min-width: 720px) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .contact-form {
    padding: 1.5rem;
  }
}

@media (min-width: 860px) {
  body {
    padding-bottom: 0;
  }

  .header-tools {
    display: none;
  }

  .nav {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    margin-left: auto;
  }

  .nav ul {
    display: flex;
    gap: 1.15rem;
  }

  .nav ul a {
    font-size: 0.98rem;
    font-weight: 500;
  }

  .nav ul a:hover,
  .nav a[aria-current="true"] {
    color: var(--blue);
  }

  .mobile-bar {
    display: none;
  }

  .service-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.15rem;
  }

  .service-card:nth-child(-n + 3) {
    grid-column: span 2;
  }

  .service-card:nth-child(n + 4) {
    grid-column: span 3;
  }

  .service-photo {
    height: 13.5rem;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.9fr);
    gap: 4rem;
    align-items: center;
  }

  .about-photo {
    aspect-ratio: 4 / 5;
  }

  .contact-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.05fr);
    gap: 3.5rem;
    align-items: start;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1.5fr) auto auto;
    justify-content: space-between;
    align-items: start;
  }

  .section,
  .clients {
    padding: 7rem 0;
  }
}

@media (min-width: 960px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(22rem, 0.88fr) 1.16fr;
    min-height: calc(100dvh - var(--header-h));
    background: var(--navy);
    color: var(--white);
  }

  .hero-copy {
    order: 0;
    width: auto;
    margin: 0;
    padding: 3.5rem 3.2rem 3.5rem 6vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hero .eyebrow {
    color: #d7e4ef;
  }

  .hero h1 {
    max-width: 11ch;
    font-size: clamp(3.1rem, 4.4vw, 4.55rem);
    color: var(--white);
  }

  .hero .lead {
    color: #d5e0ea;
    font-size: 1.18rem;
  }

  .hero .btn-ghost {
    border-color: rgba(255, 255, 255, 0.55);
    color: var(--white);
  }

  .hero .btn-ghost:hover {
    background: var(--white);
    color: var(--navy);
  }

  .hero-visual {
    height: auto;
    min-height: 100%;
  }
}

@media (max-width: 859px) {
  body.is-nav-open {
    overflow: hidden;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.2rem 1.2rem 6rem;
    background: var(--white);
    transform: translateX(100%);
    transition: transform 0.32s var(--ease);
    overflow: auto;
  }

  .nav.is-open {
    transform: none;
  }

  .nav ul a {
    display: block;
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--display);
    font-size: 1.45rem;
    letter-spacing: -0.03em;
  }

  .nav-cta {
    width: 100%;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .js .reveal,
  .service-card:hover,
  .service-card:hover img,
  .project-card:hover,
  .btn:hover {
    opacity: 1;
    transform: none;
  }
}
