:root {
  --wine: #591d26;
  --wine-dark: #341016;
  --ink: #1f2328;
  --muted: #667085;
  --line: #e8e2df;
  --paper: #fffaf7;
  --white: #ffffff;
  --gold: #b99262;
  --shadow: 0 24px 70px rgba(31, 35, 40, 0.14);
  --header-bg: rgba(255, 255, 255, 0.82);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  background-image:
    url("assets/blueprint.svg"),
    radial-gradient(circle at 20% 80%, rgba(185, 146, 98, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(89, 29, 38, 0.02) 0%, transparent 50%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: left top, left 10% bottom 20%, right top;
  background-size: min(900px, 80vw) auto, 600px 600px, 500px 500px;
  background-attachment: fixed, scroll, scroll;
  font-family: Inter, Arial, sans-serif;
  line-height: 1.6;
}

/* El plano se desvanece hacia el contenido para no competir con la lectura */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 14%, rgba(255, 255, 255, 0.66) 48%, rgba(255, 255, 255, 0.9) 72%),
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 60%);
}

/* El contenido queda por encima del velo */
main,
footer {
  position: relative;
  z-index: 1;
}

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

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

::selection {
  color: var(--white);
  background: var(--wine);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* Oculto visualmente pero disponible para lectores de pantalla y SEO */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------
   Header / navegación
------------------------------------------------------------------ */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 5vw, 64px);
  background: var(--header-bg);
  border-bottom: 1px solid rgba(89, 29, 38, 0.08);
  backdrop-filter: blur(18px);
  transition: box-shadow 180ms ease, min-height 180ms ease, background 180ms ease;
}

.site-header.scrolled {
  min-height: 62px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 32px rgba(20, 20, 20, 0.07);
}

.brand img {
  width: min(240px, 42vw);
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 30px);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.site-nav a {
  color: #282828;
}

.site-nav a:not(.portal-link) {
  position: relative;
  padding: 10px 0;
}

.site-nav a:not(.portal-link)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 2px;
  background: var(--wine);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.site-nav a.active:not(.portal-link)::after,
.site-nav a:not(.portal-link):hover::after {
  transform: scaleX(1);
}

.portal-link {
  padding: 11px 15px;
  color: var(--wine) !important;
  border: 1px solid rgba(89, 29, 38, 0.25);
  border-radius: 6px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.portal-link:hover,
.button:hover {
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: var(--wine);
  border: 0;
  border-radius: 6px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--white);
}

/* ------------------------------------------------------------------
   Hero
------------------------------------------------------------------ */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #1f1f1f;
  padding-top: 72px;
}

.hero picture,
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero img {
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(29, 18, 18, 0.72), rgba(29, 18, 18, 0.22) 52%, rgba(29, 18, 18, 0.08));
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 36%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent);
  pointer-events: none;
}

.hero-panel {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 36px));
  margin: 0 0 clamp(140px, 20vh, 220px) clamp(18px, 7vw, 90px);
  padding-bottom: clamp(20px, 4vh, 40px);
  color: var(--white);
  animation: riseIn 700ms ease both;
}

.hero-panel .eyebrow {
  display: inline-flex;
  padding: 8px 11px;
  margin-bottom: 16px;
  color: #ffe4b6;
  background: rgba(89, 29, 38, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 14ch;
  font-size: clamp(42px, 6.5vw, 72px);
}

h2 {
  font-size: clamp(30px, 4.5vw, 52px);
}

h3 {
  font-size: clamp(24px, 2.8vw, 34px);
}

.hero-panel p:not(.eyebrow) {
  max-width: 560px;
  margin: 22px 0 0;
  font-size: clamp(18px, 2vw, 23px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.button.primary {
  color: var(--white);
  background: var(--wine);
}

.button.primary:hover {
  background: #6c2630;
  box-shadow: 0 14px 34px rgba(89, 29, 38, 0.25);
}

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

.button.ghost:hover {
  color: var(--wine-dark);
  background: rgba(255, 255, 255, 0.9);
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.hero-kpis {
  position: absolute;
  right: clamp(18px, 5vw, 72px);
  bottom: clamp(120px, 20vh, 220px);
  left: clamp(18px, 5vw, 72px);
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  pointer-events: none;
}

.hero-kpis article {
  min-height: 92px;
  padding: 18px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.hero-kpis strong,
.hero-kpis span {
  display: block;
}

.hero-kpis strong {
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.1;
}

.hero-kpis span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 3;
  width: 24px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  transform: translateX(-50%);
}

.scroll-cue::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: var(--white);
  border-radius: 999px;
  transform: translateX(-50%);
  animation: cue 1400ms ease infinite;
}

/* ------------------------------------------------------------------
   Secciones comunes
------------------------------------------------------------------ */
.section {
  padding: clamp(64px, 9vw, 120px) clamp(18px, 5vw, 72px);
  scroll-margin-top: 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-heading {
  width: min(1100px, 100%);
  margin: 0 auto 34px;
  display: grid;
  gap: 12px;
}

.section-heading.narrow {
  width: min(820px, 100%);
  text-align: center;
}

.section-heading.narrow p:last-child {
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 18px;
}

.company-section {
  background: var(--paper);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------------------------------------------
   Empresa
------------------------------------------------------------------ */
.company-grid,
.services-layout,
.contact-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  gap: clamp(24px, 4vw, 54px);
}

.company-grid,
.services-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
  align-items: center;
}

.company-grid {
  align-items: stretch;
}

.slider {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: #ddd;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.slider::after,
.services-image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.22));
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 400ms ease;
}

.slide.active {
  opacity: 1;
}

.slider-controls {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.slider-controls button {
  width: 34px;
  height: 10px;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.55);
  border: 0;
  border-radius: 999px;
}

.slider-controls button.active {
  background: var(--white);
}

.slider-controls button:focus-visible {
  outline-color: var(--white);
  outline-offset: 3px;
}

.content-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 44px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(89, 29, 38, 0.08);
}

.content-panel p {
  margin: 0 0 16px;
}

.values {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.values span {
  padding: 9px 12px;
  color: var(--wine);
  background: #f7ece8;
  border: 1px solid rgba(89, 29, 38, 0.12);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.process-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

/* ------------------------------------------------------------------
   Servicios
------------------------------------------------------------------ */
.service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.service-list article {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  display: flex;
  align-items: center;
  padding: 18px;
  padding-left: 54px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(31, 35, 40, 0.05);
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.service-list article::before {
  content: "";
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  background: var(--wine);
  border-radius: 6px;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.78);
}

.service-list article:hover {
  transform: translateY(-4px);
  border-color: rgba(89, 29, 38, 0.26);
  box-shadow: 0 20px 52px rgba(31, 35, 40, 0.09);
}

.services-image {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.services-image img,
.contact-image {
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.expensas {
  position: relative;
  overflow: hidden;
  width: min(1180px, 100%);
  margin: 46px auto 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  padding: clamp(28px, 5vw, 52px);
  color: var(--white);
  background: linear-gradient(135deg, var(--wine-dark), #5b1c25 58%, #232326);
  border-radius: 8px;
}

.expensas::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, black, transparent 78%);
  pointer-events: none;
}

.expensas > * {
  position: relative;
}

.expensas p {
  color: rgba(255, 255, 255, 0.82);
}

.expensas ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
}

/* ------------------------------------------------------------------
   Contacto
------------------------------------------------------------------ */
.contact-section {
  background: #f6f7f8;
}

.contact-grid {
  grid-template-columns: 0.85fr 1fr;
  align-items: start;
}

.contact-copy {
  padding-top: 12px;
}

.contact-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
}

.contact-details {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  color: var(--ink);
  font-weight: 700;
}

.contact-details a {
  color: var(--wine);
}

.contact-form {
  display: grid;
  gap: 15px;
  padding: clamp(22px, 4vw, 36px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(31, 35, 40, 0.08);
}

.contact-form .honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  font: inherit;
  background: #fbfbfb;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 3px solid rgba(185, 146, 98, 0.22);
  border-color: var(--gold);
  background: var(--white);
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--wine);
  font-size: 14px;
  font-weight: 800;
}

.form-status[data-state="success"] {
  color: #1c7c3c;
}

.form-status[data-state="error"] {
  color: #a83232;
}

.contact-image {
  grid-column: 1 / -1;
  max-height: 380px;
  object-fit: cover;
}

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------ */
.site-footer {
  display: grid;
  gap: 8px;
  padding: 26px clamp(18px, 5vw, 72px);
  color: var(--white);
  background: var(--wine);
  text-align: center;
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  text-decoration: underline;
}

/* ------------------------------------------------------------------
   Barra de progreso de lectura
------------------------------------------------------------------ */
.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--wine));
  transform-origin: left;
}

/* ------------------------------------------------------------------
   Animaciones
------------------------------------------------------------------ */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cue {
  0%, 100% { opacity: 0.35; transform: translate(-50%, 0); }
  50% { opacity: 1; transform: translate(-50%, 9px); }
}

/* ------------------------------------------------------------------
   Media queries
------------------------------------------------------------------ */
@media (max-width: 1024px) {
  .site-nav a:not(.portal-link) {
    font-size: 13px;
  }
}

@media (max-width: 980px) {
  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 18px;
    left: 18px;
    display: none;
    padding: 18px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: grid;
    gap: 8px;
  }

  .site-nav a:not(.portal-link) {
    padding: 12px 0;
    font-size: 13px;
  }

  .portal-link {
    width: 100%;
    text-align: center;
  }

  .company-grid,
  .services-layout,
  .contact-grid,
  .expensas {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    margin-bottom: 280px;
  }

  .hero-kpis {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero-kpis article {
    min-height: auto;
    padding: 16px;
  }

  .scroll-cue {
    display: none;
  }

  .process-strip {
    grid-template-columns: 1fr;
  }

  .slider {
    min-height: 420px;
    order: -1;
  }

  .content-panel {
    padding: clamp(20px, 4vw, 36px);
  }

  .services-image {
    max-width: 500px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 90svh;
  }

  .hero-panel {
    margin-bottom: clamp(160px, 22vh, 240px);
  }

  .hero-kpis {
    bottom: clamp(100px, 16vh, 180px);
  }

  .section-heading.narrow {
    text-align: left;
  }

  .section-heading.narrow p:last-child {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 66px;
    padding: 10px clamp(16px, 4vw, 24px);
  }

  .brand img {
    width: min(220px, 60vw);
    height: auto;
    max-height: 44px;
  }

  .hero {
    min-height: 86vh;
    padding-top: 66px;
  }

  .hero-panel {
    margin: 0 0 clamp(32px, 6vh, 64px) 16px;
    width: calc(100% - 32px);
  }

  .hero-panel .eyebrow {
    font-size: 11px;
    padding: 5px 9px;
    margin-bottom: 10px;
  }

  .hero-panel p:not(.eyebrow) {
    font-size: clamp(16px, 2vw, 20px);
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-kpis {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: clamp(20px, 5vh, 40px) 18px 0;
    padding: 0;
  }

  .hero-kpis article {
    min-height: auto;
    padding: 14px;
  }

  /* En pantallas chicas el plano queda fijo con el scroll para evitar el
     bug de background-attachment:fixed en iOS */
  body {
    background-size: 640px auto, 600px 600px, 500px 500px;
    background-position: left -80px top 0, left 10% bottom 20%, right top;
  }

  .service-list {
    grid-template-columns: 1fr;
  }

  .slider {
    min-height: 300px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-image {
    display: none;
  }

  .expensas {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .expensas ul {
    padding-left: 0;
    list-style: none;
  }

  .expensas li {
    padding-left: 20px;
    text-align: left;
  }

  .section {
    padding: clamp(48px, 8vw, 80px) clamp(16px, 4vw, 24px);
  }
}

/* ------------------------------------------------------------------
   Preferencia de movimiento reducido
------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
