:root {
  --bg: #fcfcfc;
  --fg: #635f87;
  --accent-1: #7f86a9;
  --accent-2: #9baecb;
  --accent-3: #b7d6ed;

  --header-height: 64px;
  --hero-edge: 56px;
  --section-pad: 48px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --shadow: 0 20px 50px rgba(99, 95, 135, 0.08);
  --border: 1px solid rgba(127, 134, 169, 0.25);

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  --font-serif: "Playfair Display", ui-serif, Georgia, "Times New Roman", Times, serif;

  --container: 1120px;
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.55;
  position: relative;
}

body::before {
  content: "";
  position: absolute;
  inset: -120px;
  z-index: -1;
  background:
    radial-gradient(600px 260px at 20% 10%, rgba(183, 214, 237, 0.7), transparent 60%),
    radial-gradient(520px 240px at 80% 30%, rgba(155, 174, 203, 0.48), transparent 60%),
    radial-gradient(700px 320px at 50% 100%, rgba(127, 134, 169, 0.26), transparent 30%);
  filter: blur(1.6px);
}

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

a {
  color: inherit;
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

.hero--home .container {
  width: min(1280px, calc(100% - 40px));
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
}

.skip-link:focus {
  left: 16px;
  outline: 2px solid var(--accent-3);
  outline-offset: 4px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(252, 252, 252, 0.78);
  border-bottom: 1px solid rgba(127, 134, 169, 0.16);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand__mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(252, 252, 252, 0.6);
}

.brand__banner {
  height: 32px;
  width: auto;
  object-fit: contain;
  opacity: 0.92;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}

.nav__link {
  text-decoration: none;
  font-size: 14px;
  opacity: 0.9;
  padding: 8px 10px;
  border-radius: 999px;
}

.nav__link:hover {
  background: rgba(183, 214, 237, 0.25);
}

.hero {
  position: relative;
  padding-block: var(--hero-edge);
  min-height: clamp(440px, calc(80vh - var(--header-height)), 640px);
  min-height: clamp(440px, calc(80svh - var(--header-height)), 640px);
}

/* Home hero: keep vertical flow intact; only adjust horizontal layout via container rules. */

.hero--home::before {
  content: "";
  position: absolute;
  z-index: 0;
  background:
    radial-gradient(900px 420px at 8% 85%, rgba(183, 214, 237, 0.6), transparent 60%),
    radial-gradient(700px 380px at 88% 20%, rgba(155, 174, 203, 0.46), transparent 60%),
    radial-gradient(780px 420px at 50% 100%, rgba(127, 134, 169, 0.32), transparent 65%);
  filter: blur(6px);
  opacity: 1;
  transform: translate3d(0, 0, 0);
  animation: hero-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

.hero--home .hero__inner {
  position: relative;
  z-index: 1;
}

.hero--home .scroll-cue {
  z-index: 1;
}

@keyframes hero-drift {
  0% {
    transform: translate3d(-12px, -10px, 0) scale(1);
  }
  100% {
    transform: translate3d(14px, 12px, 0) scale(1.03);
  }
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(127, 134, 169, 0.25),
    transparent
  );
  pointer-events: none;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(127, 134, 169, 0.22);
  background: rgba(252, 252, 252, 0.65);
  box-shadow: 0 14px 40px rgba(99, 95, 135, 0.08);
  opacity: 0.85;
  z-index: 1;
}

.hero--home {
  display: flex;
  flex-direction: column;
  /* On load, make the home hero fill the viewport height (minus header)
     so its content stays visually centered. */
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
}

/*
  Center the hero inner container vertically within the hero height
  without affecting its internal layout.
*/
.hero--home .hero__inner {
  margin-block: auto;
}

.scroll-cue:hover {
  opacity: 1;
}

.scroll-cue:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 3px;
}

.scroll-cue__text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scroll-cue__icon {
  width: 16px;
  height: 16px;
  stroke: var(--fg);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: scroll-cue-float 1600ms ease-in-out infinite;
}

@keyframes scroll-cue-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

section[id] {
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}

/* Home hero: keep two columns but center content with inner padding. */
.hero--home .hero__inner {
  justify-content: center;
  column-gap: 40px;
  padding-inline: 32px;
}

.hero--home .hero__copy {
  padding-left: 16px;
}

.hero--home .hero-illustration {
  justify-self: center;
  padding-right: 0;
}

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

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

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  opacity: 0.85;
}

.hero__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: clamp(34px, 3vw, 60px);
  line-height: 1.05;
}

.hero__subtitle {
  margin: 39px 0 53px;
  font-size: 15px;
  max-width: 66ch;
  opacity: 0.9;
}

.hero__banner {
  margin-top: 18px;
  width: min(520px, 100%);
  height: auto;
  opacity: 0.92;
}

/* Home hero image: slightly smaller and responsive. */
.hero--home .hero__illustration,
.hero--home .hero-illustration {
  width: min(360px, 70%);
  height: auto;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* Slightly larger hero CTAs on home. */
.hero--home .hero__actions .btn {
  padding: 20px 26px;
  font-size: 20px;
}

.hero__actions--secondary {
  margin-top: 14px;
}

.hero__meta {
  margin-top: 18px;
}

.hero__art {
  padding: 18px;
  border-radius: var(--radius-md);
  border: var(--border);
  box-shadow: var(--shadow);
  background: rgba(252, 252, 252, 0.7);
}

.hero-illustration path,
.hero-illustration circle {
  vector-effect: non-scaling-stroke;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.btn--stacked {
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
  padding-block: 20px;
  overflow: hidden;
}

.btn__label {
  position: relative;
  z-index: 1;
  transition: transform 160ms ease;
}

.btn__subtext {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.btn--stacked:hover .btn__label,
.btn--stacked:focus-visible .btn__label {
  transform: translateY(-18px);
}

.btn--stacked:hover .btn__subtext,
.btn--stacked:focus-visible .btn__subtext {
  opacity: 0.9;
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 3px;
}

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

/* Home hero: make the button grow on hover without scaling the text. */
.hero--home .hero__actions .btn {
  padding: 20px 18px;
  font-size: 15px;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    padding 160ms ease;
}

.hero--home .hero__actions .btn:hover,
.hero--home .hero__actions .btn:focus-visible {
  padding-block: 14px;
  padding-inline: 24px;
}

.btn--primary {
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 14px 36px rgba(99, 95, 135, 0.28);
}

.btn--primary:hover {
  background: rgba(99, 95, 135, 0.92);
}

.btn--ghost {
  background: rgba(155, 174, 203, 0.18);
  color: var(--fg);
  border: 1px solid rgba(127, 134, 169, 0.22);
}

.btn--ghost:hover {
  background: rgba(155, 174, 203, 0.28);
}

.btn--soft {
  background: rgba(183, 214, 237, 0.35);
  color: var(--fg);
  border: 1px solid rgba(183, 214, 237, 0.35);
}

.link {
  text-decoration: none;
  font-weight: 600;
  opacity: 0.9;
}

.link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.section {
  padding-block: var(--section-pad);
}

.section--tinted {
  background: rgba(183, 214, 237, 0.16);
  border-block: 1px solid rgba(127, 134, 169, 0.14);
}

.section__inner {
  display: grid;
  gap: 24px;
}

.section__header {
  display: grid;
  gap: 10px;
}

.section__title {
  margin: 0;
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
  font-size: 34px;
  line-height: 1.1;
}

.section__lead {
  margin: 0;
  max-width: 70ch;
  opacity: 0.9;
}

.prose {
  max-width: 78ch;
}

.prose p {
  margin: 0 0 12px;
}

/* Index only: justify body text for Vision and Who we are sections. */
#vision .prose,
#quienes .prose {
  /*
    Narrower measure reduces uneven spacing ("rivers") in justified text and matches
    typical word-processor column widths.
  */
  max-width: 100ch;
}

#vision .prose p,
#quienes .prose p {
  text-align: justify;
  /*
    "Word-like" justification (best-effort on the web):
    - Use inter-word justification where supported
    - Avoid hyphenation (no "-" at line breaks)
    - Keep the last line left-aligned (typical word processors)
  */
  text-justify: inter-word;
  text-align-last: left;
  hyphens: none;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  overflow-wrap: normal;
  text-wrap: pretty;
}

.tabs {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  border: var(--border);
  background: rgba(252, 252, 252, 0.7);
  box-shadow: 0 14px 40px rgba(99, 95, 135, 0.08);
  width: fit-content;
}

.tab {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 14px;
  background: transparent;
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
  opacity: 0.85;
  transition: background-color 160ms ease, opacity 160ms ease;
}

.tab.is-active {
  background: rgba(183, 214, 237, 0.35);
  opacity: 1;
}

.panel {
  margin-top: 24px;
}

.panel__intro {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.panel__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: -0.01em;
}

.panel__subtitle {
  margin: 0;
  max-width: 78ch;
  opacity: 0.9;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cards--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.service-card {
  border-radius: var(--radius-md);
  border: var(--border);
  background: rgba(252, 252, 252, 0.75);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 10px;
  transition: transform 180ms ease, box-shadow 180ms ease;
  min-height: 220px;
}

/* Ensure all business insurance card titles align to the same vertical level by
   reserving consistent space for the icon + title block. */
#panel-empresariales .service-card__header {
  min-height: 4%; /* adjust if titles ever wrap to more lines */
}

/* Slightly reduce top spacing for the 4th business insurance card title only. */
#panel-empresariales .cards.cards--four .service-card:nth-child(4) .service-card__header {
  margin-top: -10px;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 70px rgba(99, 95, 135, 0.12);
}

.service-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.service-card__icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  stroke: var(--accent-1);
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
}

.service-card__title {
  margin: 0;
  font-size: 16px;
  color: #635f87;
}

.service-card__text {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
  color: #9baecb;
  text-align: center;
}

.service-card__points {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  overflow: hidden;
  transition: opacity 180ms ease, transform 180ms ease, max-height 240ms ease;
}

.service-card:hover .service-card__points {
  opacity: 1;
  transform: translateY(0);
  max-height: 220px;
}

@media (hover: none), (pointer: coarse) {
  .service-card__points {
    opacity: 1;
    transform: none;
    max-height: 500px;
  }

  .service-card {
    min-height: auto;
  }
}

.contact {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
}

.form {
  border-radius: var(--radius-md);
  border: var(--border);
  background: rgba(252, 252, 252, 0.8);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.9;
}

.field__input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(127, 134, 169, 0.28);
  padding: 12px 12px;
  font: inherit;
  background: rgba(252, 252, 252, 0.9);
  color: var(--fg);
}

.field__input:focus {
  outline: 2px solid rgba(127, 134, 169, 0.5);
  outline-offset: 2px;
}

.field__input--textarea {
  resize: vertical;
}

.form__hint {
  margin: 0;
  font-size: 12px;
  opacity: 0.75;
}

.contact__aside {
  display: grid;
  gap: 12px;
}

.note {
  border-radius: var(--radius-md);
  border: var(--border);
  background: rgba(252, 252, 252, 0.6);
  padding: 18px;
}

.note__title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 20px;
}

.note__text {
  margin: 0 0 10px;
  opacity: 0.9;
}

.footer {
  padding-block: 26px;
  border-top: 1px solid rgba(127, 134, 169, 0.16);
  background: rgba(252, 252, 252, 0.75);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__brand {
  margin: 0;
  height: 26px;
  width: auto;
}

.footer__legal {
  margin: 0;
  font-size: 12px;
  opacity: 0.8;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  :root {
    --hero-edge: 48px;
    --section-pad: 44px;
  }

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

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  :root {
    --hero-edge: 40px;
    --section-pad: 40px;
  }

  .nav {
    display: none;
  }

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

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

@media (prefers-reduced-motion: reduce) {
  .btn,
  .service-card,
  .service-card__points {
    transition: none;
  }

  .btn__subtext {
    transition: none;
    transform: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .scroll-cue__icon {
    animation: none;
  }

  .hero--home::before {
    animation: none;
  }
}

@media (hover: none), (pointer: coarse) {
  /* No hover on touch: keep the subtext visible without animation. */
  .btn__subtext {
    opacity: 0.9;
    transform: none;
  }
}


