@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("/assets/fonts/jost-latin.woff2") format("woff2");
}

:root {
  --blanco: #ffffff;
  --niebla: #eef2ee;   /* el mar de nubes de Tacoronte */
  --rojo: #cd2026;     /* rojo del logo */
  --rojo-oscuro: #a5171c;
  --picon: #2b2826;    /* grava volcánica */
  --gris: #5f5a56;
  --linea: #d6dcd5;

  --fuente: "Jost", system-ui, sans-serif;
  --texto-s: 0.9375rem;
  --texto: 1.0625rem;
  --texto-l: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
  --h2: clamp(2rem, 1.45rem + 2.4vw, 3.375rem);

  --ancho: 1320px;
  --margen: clamp(1.25rem, 4vw, 3rem);
  --seccion: clamp(4rem, 2.75rem + 5.5vw, 8rem);
  --alto-cabecera: 4.75rem;
  --radio: clamp(20px, 1rem + 1vw, 28px);
  --hoja: clamp(56px, 3rem + 5vw, 150px); /* esquinas opuestas grandes: forma de hoja */
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--alto-cabecera) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: var(--texto);
  font-weight: 400;
  line-height: 1.6;
  color: var(--picon);
  background: var(--blanco);
  -webkit-font-smoothing: antialiased;
}

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

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
ul {
  margin: 0;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--rojo);
  outline-offset: 3px;
  border-radius: 4px;
}

.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.saltar {
  position: absolute;
  left: var(--margen);
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--picon);
  color: var(--blanco);
  border-radius: 999px;
}

.saltar:focus {
  top: 0.75rem;
}

.contenedor {
  width: 100%;
  max-width: calc(var(--ancho) + 2 * var(--margen));
  margin-inline: auto;
  padding-inline: var(--margen);
}

/* Tipografía compartida */

.titulo-seccion {
  font-size: var(--h2);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.parrafo-grande {
  max-width: 34em;
  font-size: var(--texto-l);
  line-height: 1.55;
  color: var(--gris);
}

.titulo-seccion + .parrafo-grande {
  margin-top: 1.25rem;
}

.enlace {
  color: var(--picon);
  text-decoration: underline;
  text-decoration-color: var(--rojo);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  transition: color 0.2s;
}

.enlace:hover {
  color: var(--rojo-oscuro);
}

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--rojo);
  color: var(--blanco);
  font: inherit;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.boton:hover {
  background: var(--rojo-oscuro);
}

.boton:focus-visible {
  outline-color: var(--picon);
  border-radius: 999px;
}

.boton--pequeno {
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  font-size: var(--texto-s);
}

/* Cabecera */

.cabecera {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--niebla);
  border-bottom: 1px solid var(--linea);
}

.cabecera__interior {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  min-height: var(--alto-cabecera);
  padding-block: 0.625rem;
}

.cabecera__logo {
  display: block;
  flex: none;
}

.cabecera__logo img {
  width: auto;
  height: 44px;
}

.cabecera__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
}

.cabecera__lista {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
}

.cabecera__enlace {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: var(--texto-s);
  text-decoration: none;
  transition: color 0.2s;
}

.cabecera__enlace:hover {
  color: var(--rojo-oscuro);
}

.cabecera__menu {
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  border: 1px solid var(--linea);
  border-radius: 999px;
  background: var(--blanco);
  color: var(--picon);
  font: inherit;
  font-size: var(--texto-s);
  font-weight: 500;
  cursor: pointer;
}

.cabecera__menu:focus-visible {
  border-radius: 999px;
}

.cabecera__icono {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}

.cabecera__icono--cerrar,
.cabecera__menu[aria-expanded="true"] .cabecera__icono--abrir {
  display: none;
}

.cabecera__menu[aria-expanded="true"] .cabecera__icono--cerrar {
  display: block;
}

/* En móvil, con JavaScript, la navegación se pliega tras el botón Menú.
   Sin JavaScript sigue visible en una segunda fila. */
@media (max-width: 759px) {
  .js .cabecera__menu {
    display: inline-flex;
  }

  .js .cabecera__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 0.5rem var(--margen) 1.5rem;
    background: var(--niebla);
    border-bottom: 1px solid var(--linea);
    box-shadow: 0 18px 30px -18px rgb(43 40 38 / 0.35);
  }

  .js .cabecera--abierta .cabecera__nav {
    display: flex;
  }

  .js .cabecera__lista {
    flex-direction: column;
  }

  .js .cabecera__enlace {
    display: flex;
    min-height: 3.25rem;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--linea);
  }

  .js .cabecera__nav .boton {
    min-height: 3.25rem;
    font-size: var(--texto);
  }
}

@media (max-height: 500px) {
  html {
    scroll-padding-top: 1rem;
  }

  .cabecera {
    position: relative;
  }
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  padding-top: clamp(2rem, 1.25rem + 3vw, 3.5rem);
}

.hero__texto {
  container-type: inline-size;
}

.hero__titulo {
  font-size: clamp(1.75rem, 1rem + 5vw, 5rem); /* respaldo sin unidades de contenedor */
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

/* La línea más larga, "instalaciones a punto.", mide 8,04em:
   a 11,6cqi ocupa el 93 % de su columna y el título nunca pasa de dos líneas. */
@supports (font-size: 1cqi) {
  .hero__titulo {
    font-size: clamp(1.75rem, min(11.6cqi, 15svh), 5rem);
  }
}

.hero__entrada {
  max-width: 30em;
  margin-top: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-size: var(--texto-l);
  line-height: 1.55;
  color: var(--gris);
}

.hero__acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
}

.hero__acciones .enlace {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.hero__foto {
  display: block;
  overflow: hidden;
  border-radius: var(--hoja) var(--radio);
}

.hero__foto img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 60%;
  filter: saturate(0.78);
}

@media (min-width: 600px) {
  .hero__foto img {
    aspect-ratio: 16 / 10;
  }
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(3rem, 5vw, 5rem);
  }

  /* La foto llena el alto de la pantalla sin empujar el hero por debajo del pliegue */
  .hero__foto img {
    aspect-ratio: auto;
    height: clamp(400px, calc(100svh - var(--alto-cabecera) - 8rem), 700px);
  }
}

/* Secciones */

.seccion {
  padding-block: var(--seccion);
}

.seccion--niebla {
  background: var(--niebla);
}

/* Servicios */

.servicios {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

.servicios__foto {
  display: block;
  margin-top: 2.25rem;
  overflow: hidden;
  border-radius: var(--radio) var(--hoja);
}

.servicios__foto img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 50% 45%;
}

.servicio {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1.25rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--linea);
}

.servicio:first-child {
  padding-top: 0;
  border-top: 0;
}

.servicio__icono {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--niebla);
  color: var(--rojo);
}

.servicio__icono svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.servicio__nombre {
  padding-top: 0.5rem;
  font-size: var(--h3);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.servicio p {
  max-width: 36em;
  margin-top: 0.5rem;
  color: var(--gris);
}

@media (min-width: 900px) {
  .servicios {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(3rem, 7vw, 7rem);
  }

  .servicios__intro {
    position: sticky;
    top: calc(var(--alto-cabecera) + 2rem);
  }

  .servicios__foto img {
    aspect-ratio: 4 / 3;
  }
}

/* Quiénes somos */

.nosotros {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

.datos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.5rem;
}

.datos dt {
  font-size: var(--texto-s);
  color: var(--gris);
}

.datos dd {
  margin-top: 0.125rem;
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.valores {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--linea);
}

.valores__titulo {
  font-size: var(--h3);
  font-weight: 400;
}

.valor__nombre {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 500;
}

/* Los dos puntos de la ï del logo */
.valor__nombre::before {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--rojo);
}

.valor p {
  margin-top: 0.625rem;
  color: var(--gris);
}

@media (min-width: 900px) {
  .nosotros {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: 3rem clamp(3rem, 7vw, 7rem);
    align-items: end;
  }

  .datos {
    gap: 1.75rem 2rem;
  }

  .valores {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem clamp(2rem, 4vw, 4rem);
    margin-top: 1.5rem;
    padding-top: 3.5rem;
  }

  .valores__titulo {
    grid-column: 1 / -1;
  }
}

/* Contacto */

.contacto {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

.contacto__boton {
  margin-top: 2rem;
}

.contacto__dato {
  padding-block: 1.5rem;
  border-top: 1px solid var(--linea);
}

.contacto__dato:first-child {
  padding-top: 0;
  border-top: 0;
}

.contacto__dato dt {
  font-size: var(--texto-s);
  color: var(--gris);
}

.contacto__dato dd {
  margin-top: 0.25rem;
  font-size: var(--h3);
  line-height: 1.35;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.contacto__dato .contacto__mapa {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: var(--texto);
}

@media (min-width: 900px) {
  .contacto {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(3rem, 7vw, 7rem);
  }

  .contacto__dato {
    padding-block: 1.75rem;
  }
}

/* Pie */

.pie {
  padding-block: 3rem;
  background: var(--picon);
  color: #d9d4d0;
  font-size: var(--texto-s);
}

.pie__interior {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
}

.pie__logo {
  width: auto;
  height: 60px;
}

.pie__legal {
  font-style: normal;
  line-height: 1.7;
}

.pie__enlaces {
  display: grid;
}

.pie__enlaces li {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
}

.pie a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--blanco);
  text-decoration: none;
}

.pie a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.pie :focus-visible {
  outline-color: var(--blanco);
}

@media (min-width: 900px) {
  .pie__interior {
    grid-template-columns: auto 1fr auto;
    gap: 2rem clamp(2rem, 6vw, 6rem);
    align-items: center;
  }

  .pie__logo {
    height: 64px;
  }

  .pie__enlaces {
    justify-items: end;
  }

  .pie__enlaces li {
    min-height: 2rem;
  }

  .pie a {
    min-height: 2rem;
  }
}

/* Pantallas grandes: contenedor más ancho y todo un punto mayor */
@media (min-width: 1800px) {
  :root {
    --ancho: 1480px;
  }

  html {
    font-size: 106.25%;
  }
}

@media (min-width: 2400px) {
  :root {
    --ancho: 1680px;
  }

  html {
    font-size: 118.75%;
  }
}

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

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