/* Sarmiento Sepúlveda — sitio web
   Tokens tomados del sistema gráfico en Figma (Sistema gráfico · Web). */

:root {
  --negro: #16151b;
  --hueso: #e7e4df;
  --grafito: #5e5d5b;
  --gris-hero: #979797;

  --oswald: "Oswald", "Arial Narrow", sans-serif;
  --garamond: "EB Garamond", Georgia, serif;
  --montserrat: "Montserrat", Arial, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --margen: 100px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--negro);
  color: var(--hueso);
  font-family: var(--garamond);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }

/* La regla: 1 px, nunca más gruesa, nunca en diagonal */
.regla { display: block; height: 1px; background: currentColor; font-style: normal; }

.contenedor { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--margen); }
.solo-movil { display: none; }

:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 40px var(--margen);
  color: var(--hueso);
  transition: background-color 200ms ease, padding 200ms ease, backdrop-filter 200ms ease;
}
.nav.velo {
  background: rgba(22, 21, 27, 0.72);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  padding-top: 24px; padding-bottom: 24px;
}
.logo {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--montserrat); font-size: 17px; letter-spacing: 2.6px; white-space: nowrap;
}
.logo .regla { width: 44px; }
.menu { display: flex; gap: 44px; font-family: var(--oswald); font-weight: 300; font-size: 12px; letter-spacing: 1.8px; }
.menu a { position: relative; padding: 6px 0; transition: opacity 160ms ease; }
.menu a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform 160ms ease;
}
.menu a.activo::after { transform: scaleX(1); }
.menu-boton { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 161px 0 120px; }
.hero-fondo {
  position: absolute; inset: 0;
  background: linear-gradient(rgba(22,21,27,.88), rgba(22,21,27,.88)), url("../img/hero.jpg") center / cover no-repeat;
  filter: grayscale(1);
}
.hero-contenido { position: relative; display: flex; flex-direction: column; gap: 40px; }
.hero-bajada { font-family: var(--oswald); font-weight: 300; font-size: 12px; letter-spacing: 2.6px; color: var(--gris-hero); white-space: pre; }
.hero-titulo {
  font-family: var(--oswald); font-weight: 300; font-size: 88px; line-height: 1.03; letter-spacing: -0.02em;
  max-width: 1000px;
}
.hero-texto { font-size: 22px; line-height: 1.55; max-width: 620px; }

.cta, .whatsapp {
  display: flex; align-items: center; gap: 24px;
  font-family: var(--oswald); font-weight: 300; font-size: 13px; letter-spacing: 2.2px; white-space: nowrap;
  transition: transform 120ms var(--ease-out);
}
.cta .regla { flex: 1; transform-origin: left; transition: transform 160ms ease; }
.cta:hover .regla { transform: scaleX(0.97); }
.cta:active, .whatsapp:active { transform: scale(0.97); }

/* ---------- Secciones ---------- */
.seccion { padding: 130px 0; }
.claro { background: var(--hueso); color: var(--negro); }
.oscuro { background: var(--negro); color: var(--hueso); }
.rotulo { font-family: var(--oswald); font-size: 12px; letter-spacing: 2.6px; white-space: pre; }
.claro .rotulo { color: var(--grafito); }

/* 01 · La firma */
#la-firma { padding-bottom: 120px; }
#la-firma .rotulo { margin-bottom: 72px; }
.firma-columnas { display: flex; gap: 100px; align-items: flex-start; }
.firma-titulo {
  flex: 0 1 620px;
  font-family: var(--oswald); font-weight: 300; font-size: 46px; line-height: 1.04; letter-spacing: -0.015em;
}
.firma-mision { flex: 0 1 520px; display: flex; flex-direction: column; gap: 26px; font-size: 19px; line-height: 1.6; }

.valores { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 60px; row-gap: 56px; margin-top: 72px; }
.valor { display: flex; flex-direction: column; gap: 18px; }
.valor::before { content: ""; height: 1px; background: var(--negro); }
.valor h3 { font-family: var(--oswald); font-weight: 400; font-size: 13px; letter-spacing: 1.6px; }
.valor p { font-size: 16px; line-height: 1.58; color: var(--grafito); }

/* 02 · Servicios */
#servicios .rotulo { margin-bottom: 64px; }
.servicios { border-bottom: 1px solid var(--hueso); }
.servicio { position: relative; padding: 32px 0; }
.servicio::before {
  content: ""; position: absolute; left: 0; right: 0; top: 32px; height: 1px; background: var(--hueso);
}
.servicio-encabezado {
  display: flex; gap: 40px; align-items: flex-start; width: 100%;
  padding-top: 27px;
  font-family: var(--oswald); font-weight: 300;
  transition: transform 120ms var(--ease-out);
}
.servicio-encabezado:active { transform: scale(0.97); transform-origin: left center; }
.servicio-numero, .servicio-titulo { transition: transform 160ms ease; }
.servicio-numero { flex: 0 0 48px; font-size: 16px; line-height: 1.6; }
.servicio-titulo { flex: 1; font-size: 34px; line-height: 1.08; letter-spacing: -0.005em; }
.servicio-cuerpo {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows 220ms var(--ease-out), opacity 220ms var(--ease-out);
}
.servicio-cuerpo > div { overflow: hidden; }
.servicio-cuerpo p { max-width: 760px; margin: 26px 0 0 88px; font-size: 18px; line-height: 1.62; }
.servicio.abierto .servicio-cuerpo { grid-template-rows: 1fr; opacity: 1; }

@media (hover: hover) {
  .servicio:hover .servicio-numero, .servicio:hover .servicio-titulo { transform: translateX(4px); }
  .menu a:hover { opacity: .7; }
}

/* 03 · Equipo */
#equipo .rotulo { margin-bottom: 72px; }
.perfil { display: flex; gap: 80px; align-items: flex-start; }
.perfil-retrato { flex: 0 0 420px; width: 420px; height: 540px; object-fit: cover; }
.perfil-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; padding-top: 10px; }
.perfil-rol { font-family: var(--oswald); font-weight: 300; font-size: 30px; line-height: 1.1; letter-spacing: -0.005em; }
.perfil-nombre { font-size: 23px; color: var(--grafito); }
.perfil-credenciales { font-family: var(--oswald); font-size: 11.5px; letter-spacing: 1.8px; line-height: 1.9; color: var(--grafito); }
.perfil-texto > p:not([class]) { font-size: 18px; line-height: 1.62; }

/* 04 · Contacto */
.contacto { padding-bottom: 60px; }
.contacto .contenedor { display: flex; flex-direction: column; gap: 80px; }
.contacto-titulo { font-family: var(--oswald); font-weight: 300; font-size: 64px; line-height: 1; letter-spacing: -0.02em; }
.datos { display: flex; gap: 90px; flex-wrap: wrap; }
.datos > div { display: flex; flex-direction: column; gap: 10px; }
.datos dt { font-family: var(--oswald); font-size: 11px; letter-spacing: 2.2px; }
.datos dd { font-size: 22px; }
.datos a { background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat; transition: background-size 160ms ease; }
.datos a:hover { background-size: 100% 1px; }
.whatsapp { display: none; }
.monograma { display: flex; align-items: center; gap: 22px; }
.monograma .regla { flex: 1; }
.monograma .regla.corta { flex: 0 0 130px; }
.monograma span { font-family: var(--montserrat); font-size: 22px; letter-spacing: 3.3px; }

/* ---------- Tablet ---------- */
@media (max-width: 1200px) {
  :root { --margen: 56px; }
  .hero-titulo { font-size: 68px; }
  .firma-columnas { gap: 56px; }
  .perfil { gap: 48px; }
  .perfil-retrato { flex-basis: 340px; width: 340px; height: 437px; }
}

/* ---------- Móvil (diseño 390) ---------- */
@media (max-width: 860px) {
  :root { --margen: 24px; }
  .solo-escritorio { display: none; }

  .nav { padding: 14px var(--margen); }
  .nav.velo { padding-top: 14px; padding-bottom: 14px; }
  .logo { gap: 10px; font-size: 11px; letter-spacing: 1.6px; }
  .logo .regla { width: 22px; }
  .menu-boton {
    display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 7px;
    width: 44px; height: 44px; position: relative; z-index: 2;
  }
  .menu-boton i { display: block; width: 24px; height: 1px; background: var(--hueso); transition: transform 260ms var(--ease-out); }
  .nav.abierto .menu-boton i:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.abierto .menu-boton i:last-child { transform: translateY(-4px) rotate(-45deg); }
  .menu {
    position: fixed; inset: 0 0 auto 0; z-index: 1;
    flex-direction: column; gap: 0;
    padding: 88px var(--margen) 32px;
    background: var(--negro);
    font-size: 14px; letter-spacing: 2px;
    transform: translateY(-100%); opacity: 0; visibility: hidden;
    transition: transform 260ms var(--ease-out), opacity 260ms var(--ease-out), visibility 0s linear 260ms;
  }
  .nav.abierto .menu { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .menu a { padding: 18px 0; border-top: 1px solid rgba(231, 228, 223, .28); }
  .menu a::after { display: none; }

  .hero { padding: 128px 0 72px; }
  .hero-contenido { gap: 28px; }
  .hero-bajada { font-size: 10px; letter-spacing: 2px; line-height: 1.9; white-space: normal; }
  .hero-bajada .sep { display: block; height: 0; overflow: hidden; }
  .hero-titulo { font-size: 42px; line-height: 1; letter-spacing: -0.015em; }
  .hero-texto { font-size: 17px; line-height: 1.58; }
  .cta { gap: 14px; padding: 22px 0; font-size: 11.5px; letter-spacing: 1.8px; }

  .seccion { padding: 76px 0; }
  .rotulo { font-size: 11px; letter-spacing: 2.4px; }

  #la-firma { padding-bottom: 76px; }
  #la-firma .rotulo { margin-bottom: 36px; }
  .firma-columnas { flex-direction: column; gap: 36px; }
  .firma-titulo { flex: none; font-size: 29px; line-height: 1.08; letter-spacing: -0.005em; }
  .firma-mision { flex: none; gap: 36px; font-size: 17px; line-height: 1.62; }
  .valores { grid-template-columns: 1fr; row-gap: 34px; margin-top: 52px; }

  #servicios .rotulo { margin-bottom: 32px; }
  .servicio { padding: 22px 0; }
  .servicio::before { top: 22px; }
  .servicio-encabezado { flex-direction: column; gap: 12px; padding-top: 13px; }
  .servicio-numero { flex: none; font-size: 12px; line-height: normal; }
  .servicio-titulo { font-size: 23px; line-height: 1.12; letter-spacing: 0; }
  .servicio-cuerpo p { margin: 12px 0 0; font-size: 16px; }

  #equipo .rotulo { margin-bottom: 34px; }
  .perfil { flex-direction: column; gap: 20px; }
  .perfil-retrato { flex: none; width: 100%; height: 400px; }
  .perfil-texto { gap: 20px; padding-top: 0; }
  .perfil-rol { font-size: 24px; line-height: 1.12; letter-spacing: 0; }
  .perfil-nombre { font-size: 17.3px; }
  .perfil-credenciales { font-size: 10.5px; letter-spacing: 1.6px; line-height: 2; }
  .perfil-credenciales span { display: block; }
  .perfil-credenciales .sep { display: none; }
  .perfil-credenciales br { display: none; }
  .perfil-texto > p:not([class]) { font-size: 17px; }

  .contacto { padding-bottom: 40px; }
  .contacto .contenedor { gap: 40px; }
  .contacto-titulo { font-size: 38px; line-height: 1.02; letter-spacing: -0.005em; }
  .datos { flex-direction: column; gap: 26px; }
  .datos > div { gap: 8px; }
  .datos dt { font-size: 10px; letter-spacing: 2px; }
  .datos dd { font-size: 19px; overflow-wrap: anywhere; }
  .whatsapp {
    display: flex; justify-content: space-between;
    padding: 22px 0; border-top: 1px solid var(--hueso); border-bottom: 1px solid var(--hueso);
    font-size: 12px; letter-spacing: 2px;
  }
  .whatsapp .regla { width: 40px; }
  .monograma { gap: 14px; padding-top: 24px; }
  .monograma .regla.corta { flex-basis: 40px; }
  .monograma span { font-size: 16px; letter-spacing: 2.4px; }
}

/* Movimiento reducido: se conserva opacidad y color, se elimina el desplazamiento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .servicio-cuerpo { transition: opacity 150ms ease; }
  .servicio-encabezado:active, .cta:active, .whatsapp:active { transform: none; }
  .servicio:hover .servicio-numero, .servicio:hover .servicio-titulo { transform: none; }
  .menu { transition: opacity 260ms ease, visibility 0s linear 260ms !important; transform: none !important; }
}

/* ---------- Pantalla de carga: logo extendido sobre negro ---------- */
.carga { display: none; }
.js .carga {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--negro);
  transition: opacity 500ms var(--ease-out), visibility 0s linear 500ms;
}
.js.sin-carga .carga { display: none; }
.carga-logo { width: min(560px, 78vw); opacity: 0; animation: logo-entra 700ms var(--ease-out) 100ms forwards; }
.carga-logo svg { display: block; width: 100%; height: auto; }
.carga.fuera { opacity: 0; visibility: hidden; }
.carga.fuera .carga-logo { transform: translateY(-6px); transition: transform 500ms var(--ease-out); }
@keyframes logo-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.js body.cargando { overflow: hidden; }

/* ---------- Fade-ins ---------- */
.js .aparece {
  opacity: 0; transform: translateY(18px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--retraso, 0ms);
}
.js .aparece.visible { opacity: 1; transform: none; }
.js .nav { opacity: 0; transition: opacity 600ms var(--ease-out), background-color 200ms ease, padding 200ms ease; }
.js .nav.listo { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .carga-logo { animation: none; opacity: 1; }
  .js .aparece { transform: none; transition: opacity 400ms ease; }
}
