/* ==========================================================================
   Heras de la Madrid · Firma Legal y Consultoría Empresarial

   Dirección visual:
   · Estética editorial de despacho (títulos en serif de alto contraste con la
     palabra clave en dorado, paneles oscuros redondeados, botones píldora con
     icono circular, lista de materias con flecha).
   · Fundamentos de Apple (fuente del sistema para texto e interfaz, barra
     translúcida, respuesta al presionar, resortes interrumpibles, hojas que
     se arrastran, control segmentado, modo claro/oscuro y accesibilidad).
   · Colores del logotipo: azul petróleo + crema/dorado.
   ========================================================================== */

:root {
  /* Marca */
  --navy: #134053;
  --navy-light: #134f67;
  --navy-deep: #13303e;
  --navy-ink: #0e2530;
  --cream: #fde1bc;
  --gold-soft: #e8c48e;
  --gold-btn: #d6b07a;
  --gold-btn-hover: #e2bf8c;

  /* Superficies y texto — modo claro */
  --bg: #fbfbfa;
  --tint: #edf2f3;
  --tile: #ffffff;
  --text: #14232b;
  --text-2: #55626a;
  --text-3: #7d8990;
  --hair: rgb(19 48 62 / 0.12);
  --accent: #a0743a;            /* dorado legible sobre fondo claro */
  --link: var(--navy-light);
  --focus: rgb(19 79 103 / 0.5);
  --material: rgb(251 251 250 / 0.74);
  --material-solid: #fbfbfa;
  --scrim: rgb(10 20 25 / 0.45);
  --danger: #c4332b;
  --shadow-lg: 0 30px 80px -20px rgb(10 20 25 / 0.35);
  --photo-a: #e6ecef;
  --photo-b: #d3dde2;

  /* Tipografía */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Prata", "Didot", "Bodoni 72", "Playfair Display", Georgia, serif;

  --t-body: 1.0625rem;
  --t-small: 0.875rem;
  --t-caption: 0.75rem;

  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;
  --nav-h: 56px;
  --r-xl: 40px;
  --r-lg: 28px;
  --r-md: 18px;
  --frame: clamp(8px, 1.2vw, 16px);
  --section-y: clamp(4.5rem, 3rem + 6vw, 8rem);

  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1419;
    --tint: #0f1e26;
    --tile: #14252e;
    --text: #f3f1ec;
    --text-2: #a9b4ba;
    --text-3: #7f8b92;
    --hair: rgb(255 255 255 / 0.12);
    --accent: var(--gold-soft);
    --link: var(--gold-soft);
    --focus: rgb(232 196 142 / 0.55);
    --material: rgb(10 20 25 / 0.72);
    --material-solid: #0a1419;
    --scrim: rgb(0 0 0 / 0.6);
    --danger: #ff6961;
    --shadow-lg: 0 30px 80px -20px rgb(0 0 0 / 0.7);
    --photo-a: #16303b;
    --photo-b: #0f222b;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button, a, [role="tab"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
p { text-wrap: pretty; }
h1, h2, h3 { color: var(--text); text-wrap: balance; }

/* Serif de exhibición: tracking casi neutro (las serif de alto contraste no se aprietan como una sans) */
.display { font-family: var(--serif); font-weight: 400; letter-spacing: -0.005em; line-height: 1.08; }
.accent { color: var(--accent); }
h2.display { font-size: clamp(2.1rem, 1.4rem + 2.8vw, 3.6rem); }

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

.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 400;
  padding: 10px 16px; border-radius: 999px; background: var(--navy); color: #fff;
}
.skip:focus { top: 8px; }

/* ---------- Botones píldora (respuesta al presionar) ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 50px; padding: 0 24px;
  border: 0; border-radius: 999px;
  font-size: 0.95rem; font-weight: 500; letter-spacing: -0.005em;
  white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: transform 100ms ease-out, background-color 200ms var(--ease), color 200ms var(--ease);
}
.pill:hover { text-decoration: none; }
.pill:active { transform: scale(0.97); }
.pill-icon { padding: 0 8px 0 24px; }
.pill-dot {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
}
.pill-dot svg { width: 18px; height: 18px; transition: transform 300ms var(--ease); }
.pill:hover .pill-dot svg { transform: translateX(2px); }

.pill-gold { background: var(--gold-btn); color: var(--navy-deep); }
.pill-gold:hover { background: var(--gold-btn-hover); }
.pill-gold .pill-dot { background: var(--navy-deep); color: var(--cream); }

.pill-light { background: #fff; color: var(--navy-deep); }
.pill-light:hover { background: #f4efe7; }
.pill-light .pill-dot { background: var(--gold-btn); color: var(--navy-deep); }
.pill-light .pill-dot svg { width: 16px; height: 16px; }

.pill-dark { background: var(--navy); color: #fff; }
.pill-dark:hover { background: var(--navy-deep); }
@media (prefers-color-scheme: dark) {
  .pill-dark { background: var(--cream); color: var(--navy-deep); }
  .pill-dark:hover { background: #ffeccf; }
}
.pill-sm { min-height: 34px; padding: 0 16px; font-size: var(--t-small); }

.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  background: rgb(255 255 255 / 0.1);
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.01em;
  color: rgb(253 225 188 / 0.9);
}
.chip svg { width: 30px; height: 8px; color: var(--gold-soft); }

/* ---------- Barra global: material translúcido ---------- */
.globalnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.globalnav::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px;
  background: var(--hair); opacity: 0; transition: opacity 300ms var(--ease);
}
.globalnav.is-scrolled::after { opacity: 1; }
.globalnav-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: block; flex: none; }
.brand img { height: 36px; width: auto; }
.globalnav-menu { margin-left: auto; }
.globalnav-menu ul { display: flex; gap: 28px; }
.globalnav-menu a { font-size: 0.8125rem; color: var(--text); opacity: 0.78; transition: opacity 200ms var(--ease); }
.globalnav-menu a:hover { opacity: 1; text-decoration: none; }
.globalnav-menu a[aria-current="true"] { opacity: 1; color: var(--accent); }
.nav-toggle { display: none; }

/* Selector de idioma */
.lang-switch {
  flex: none; display: inline-grid; place-items: center;
  min-width: 36px; height: 30px; padding: 0 9px;
  border-radius: 999px; box-shadow: inset 0 0 0 1px var(--hair);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; color: var(--text);
  transition: background-color 200ms var(--ease), transform 100ms ease-out;
}
.lang-switch:hover { background: var(--tint); text-decoration: none; }
.lang-switch:active { transform: scale(0.95); }

@media (max-width: 1040px) {
  .lang-switch { margin-left: auto; }
  .globalnav-cta { margin-left: 0; }
  .nav-toggle {
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px; margin-right: -12px;
    background: none; border: 0; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 1.5px; border-radius: 1px; background: var(--text); transition: transform 320ms var(--ease); }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

  .globalnav-menu {
    position: fixed; inset: var(--nav-h) 0 0 0;
    background: var(--material-solid); padding: 24px 40px;
    visibility: hidden; opacity: 0;
    transition: opacity 240ms var(--ease), visibility 0s 240ms;
  }
  .globalnav.is-open .globalnav-menu { visibility: visible; opacity: 1; transition: opacity 240ms var(--ease); }
  .globalnav-menu ul { flex-direction: column; gap: 2px; }
  .globalnav-menu li { opacity: 0; transform: translateY(-8px); transition: opacity 300ms var(--ease), transform 300ms var(--ease); }
  .globalnav.is-open .globalnav-menu li { opacity: 1; transform: none; transition-delay: calc(var(--i) * 30ms + 60ms); }
  .globalnav-menu a { display: block; padding: 8px 0; font-family: var(--serif); font-size: 2rem; opacity: 1; letter-spacing: 0; }
  .globalnav.is-open .globalnav-cta { visibility: hidden; }
}
@media (max-width: 480px) {
  .globalnav-inner { gap: 12px; }
  .brand img { height: 32px; }
  .globalnav-cta { display: none; }
}

/* ---------- Fotografías (con respaldo elegante mientras no haya foto) ---------- */
.photo {
  position: relative; overflow: hidden; margin: 0;
  background: linear-gradient(160deg, var(--photo-a), var(--photo-b));
  isolation: isolate;
}
.photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../assets/img/monograma-azul.png") center / 42% no-repeat;
  opacity: 0.12;
}
@media (prefers-color-scheme: dark) { .photo::before { background-image: url("../assets/img/monograma-crema.png"); opacity: 0.1; } }
.photo[data-photo-label]::after {
  content: attr(data-photo-label);
  position: absolute; left: 16px; bottom: 16px; z-index: -1;
  padding: 6px 12px; border-radius: 999px;
  background: rgb(255 255 255 / 0.7); color: #3b4a52;
  font-size: var(--t-caption); letter-spacing: 0;
}
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-caption {
  position: absolute; right: 16px; bottom: 16px; z-index: 1;
  padding: 7px 14px; border-radius: 999px;
  background: rgb(251 251 250 / 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  color: var(--navy-deep); font-size: var(--t-caption); font-weight: 600; letter-spacing: 0.01em;
}
@media (prefers-reduced-transparency: reduce) { .photo-caption { background: #fbfbfa; backdrop-filter: none; -webkit-backdrop-filter: none; } }
/* Encuadres: mantener los rostros dentro del recorte en cualquier tamaño */
.team-photo img { object-position: 55% 28%; }
.profile-photo img { object-position: 50% 15%; }

/* ---------- Portada ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.12fr 1fr;
  min-height: min(calc(100svh - var(--nav-h) - var(--frame)), 800px);
  margin: 0 var(--frame);
  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;
}
.hero-panel {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  margin-right: calc(-1 * var(--r-xl));        /* se monta sobre la foto para mostrar la curva */
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
  background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy-deep) 70%, var(--navy-ink) 100%);
  color: #f5f1ea;
  overflow: hidden;
}
.hero-waves { position: absolute; inset: auto 0 0 0; width: 100%; height: 50%; z-index: -1; }
.hero-waves path { fill: none; stroke: var(--cream); stroke-opacity: 0.12; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.hero-copy { padding: clamp(40px, 6vw, 88px); padding-right: calc(clamp(40px, 6vw, 88px) + var(--r-xl)); max-width: 720px; }
.hero h1 {
  margin-top: 26px;
  font-size: clamp(2.8rem, 1.5rem + 4.6vw, 5.4rem); line-height: 1.02;
  color: #f7f3ec;
}
.hero h1 .accent { color: var(--gold-soft); }
.hero-lede { margin-top: 22px; max-width: 34rem; font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem); line-height: 1.55; color: rgb(245 241 234 / 0.8); }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
/* Panel de marca a la derecha de la portada (sin fotografías de personas) */
.hero-brand {
  position: relative;
  display: grid; place-items: center;
  padding: clamp(32px, 5vw, 64px); padding-left: calc(var(--r-xl) + clamp(32px, 5vw, 64px));
  background: linear-gradient(160deg, var(--photo-a), var(--photo-b));
}
.hero-brand-mark { width: min(62%, 340px); height: auto; opacity: 0.9; }
@media (prefers-color-scheme: dark) { .hero-brand-mark { content: url("../assets/img/monograma-crema.png"); opacity: 0.85; } }
.hero-brand-cities {
  position: absolute; inset: auto 24px 28px calc(var(--r-xl) + 24px);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px;
  font-size: var(--t-caption); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2);
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-panel { margin-right: 0; margin-bottom: calc(-1 * var(--r-xl)); border-radius: 0 0 var(--r-xl) var(--r-xl); }
  .hero-copy { padding: 48px 24px 56px; }
  .hero-brand { min-height: 340px; padding: calc(var(--r-xl) + 32px) 24px 72px; }
  .hero-brand-mark { width: min(56%, 260px); }
  .hero-brand-cities { inset: auto 16px 24px 16px; }
}
@media (max-width: 440px) {
  .hero-actions .pill { width: 100%; justify-content: space-between; }
}

/* ---------- Cifras ---------- */
.facts { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem); }
.facts-row { display: grid; grid-template-columns: repeat(3, 1fr); }
.fact { padding: 8px clamp(16px, 3vw, 40px); border-left: 1px solid var(--hair); }
.fact:first-child { border-left: 0; padding-left: 0; }
.fact-num { font-variant-numeric: tabular-nums lining-nums; font-size: clamp(2.6rem, 2rem + 2.4vw, 4rem); line-height: 1; color: var(--text); }
.fact-label { margin-top: 8px; color: var(--text-2); font-size: var(--t-small); }
@media (max-width: 560px) {
  .facts-row { grid-template-columns: 1fr; }
  .fact { border-left: 0; border-top: 1px solid var(--hair); padding: 18px 0; display: flex; align-items: baseline; gap: 16px; }
  .fact:first-child { border-top: 0; }
  .fact-label { margin-top: 0; }
}

/* ---------- Secciones ---------- */
.section { padding-block: var(--section-y); }
.section-tight { padding-top: 0; }
.section-tint { background: var(--tint); }
.section-head { margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.section-head h2 { max-width: 20ch; }
.section-head p { margin-top: 14px; color: var(--text-2); font-size: 1.1rem; }
.section-head-center { text-align: center; }
.section-head-center h2 { margin-inline: auto; }

/* ---------- La firma ---------- */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: 20px; }
.about-year {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 460px; padding: clamp(28px, 4vw, 48px);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, var(--navy-light), var(--navy-deep) 70%, var(--navy-ink));
  color: rgb(245 241 234 / 0.82);
}
.about-waves { position: absolute; inset: 0 0 auto 0; width: 100%; height: 55%; z-index: -1; transform: scaleY(-1); }
.about-waves path { fill: none; stroke: var(--cream); stroke-opacity: 0.12; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.about-year-label { font-size: var(--t-small); font-weight: 600; color: var(--gold-soft); letter-spacing: 0.02em; }
.about-year-num { font-size: clamp(5rem, 3rem + 7vw, 8.5rem); line-height: 0.95; color: #f7f3ec; font-variant-numeric: lining-nums; }
.about-year-text { margin-top: 18px; max-width: 30ch; }
.about-card {
  background: var(--tint); border-radius: var(--r-lg);
  padding: clamp(28px, 4.5vw, 64px);
  display: flex; flex-direction: column; justify-content: center;
}
.about-card > p { margin-top: 22px; color: var(--text-2); font-size: 1.08rem; line-height: 1.6; max-width: 58ch; }
.about-points { margin-top: 28px; border-top: 1px solid var(--hair); }
.about-points li { padding: 14px 0; border-bottom: 1px solid var(--hair); color: var(--text-2); }
.about-points strong { color: var(--text); font-weight: 600; }
.about-cta { margin-top: 28px; align-self: flex-start; }
@media (max-width: 880px) {
  .about { grid-template-columns: 1fr; }
  .about-year { min-height: 300px; }
}

/* ---------- Materias ---------- */
.matters { border-top: 1px solid var(--hair); }
.matter-row {
  width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; align-items: center; gap: 24px;
  padding: 26px 4px;
  background: none; border: 0; border-bottom: 1px solid var(--hair);
  text-align: left; cursor: pointer; color: var(--text);
  transition: transform 100ms ease-out;
}
.matter-row:active { transform: scale(0.992); }
.matter-name { font-size: clamp(1.7rem, 1.35rem + 1.3vw, 2.4rem); line-height: 1.1; transition: color 250ms var(--ease); }
.matter-desc { color: var(--text-2); max-width: 46ch; }
.matter-go {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--hair); color: var(--text);
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease), color 300ms var(--ease);
}
.matter-go svg { width: 22px; height: 22px; transition: transform 400ms var(--ease); }
@media (hover: hover) {
  .matter-row:hover .matter-go { background: var(--gold-btn); border-color: var(--gold-btn); color: var(--navy-deep); }
  .matter-row:hover .matter-go svg { transform: rotate(45deg); }
  .matter-row:hover .matter-name { color: var(--accent); }
}
@media (max-width: 720px) {
  .matter-row { grid-template-columns: 1fr auto; gap: 6px 16px; padding: 22px 0; }
  .matter-name { grid-column: 1; }
  .matter-desc { grid-column: 1; grid-row: 2; font-size: 0.95rem; }
  .matter-go { grid-column: 2; grid-row: 1 / span 2; width: 44px; height: 44px; }
}

/* ---------- Banda contable ---------- */
.band {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 0 var(--frame);
  border-radius: var(--r-xl);
  padding-block: clamp(4.5rem, 3rem + 5vw, 7.5rem);
  background: linear-gradient(150deg, var(--navy-light), var(--navy-deep) 65%, var(--navy-ink));
  color: rgb(245 241 234 / 0.82);
}
.band-waves { position: absolute; inset: auto 0 0 0; width: 100%; height: 60%; z-index: -1; }
.band-waves path { fill: none; stroke: var(--cream); stroke-opacity: 0.1; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.band-head { max-width: 760px; }
.band h2 { color: #f7f3ec; margin-top: 22px; }
.band h2 .accent { color: var(--gold-soft); }
.band-head > p { margin-top: 20px; font-size: 1.12rem; line-height: 1.6; max-width: 58ch; }
.band-cols { margin-top: clamp(3rem, 2rem + 3vw, 4.5rem); display: grid; grid-template-columns: repeat(3, 1fr); }
.band-cols li { padding: 4px clamp(16px, 3vw, 36px); border-left: 1px solid rgb(255 255 255 / 0.16); }
.band-cols li:first-child { border-left: 0; padding-left: 0; }
.band-cols h3 { font-size: 1.6rem; line-height: 1.15; color: #f7f3ec; }
.band-cols p { margin-top: 10px; font-size: 0.98rem; }
@media (max-width: 760px) {
  .band-cols { grid-template-columns: 1fr; gap: 0; }
  .band-cols li { border-left: 0; border-top: 1px solid rgb(255 255 255 / 0.16); padding: 22px 0; }
  .band-cols li:first-child { border-top: 0; }
}

/* ---------- Pasos ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); }
.steps li { border-top: 1px solid var(--hair); padding-top: 24px; }
.step-num {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--hair);
  font-size: var(--t-caption); font-weight: 600; letter-spacing: 0.02em; color: var(--accent);
  margin-bottom: 28px;
}
.steps h3 { font-size: 1.65rem; margin-bottom: 10px; }
.steps p { color: var(--text-2); font-size: 0.98rem; }
@media (max-width: 880px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 36px; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } .step-num { margin-bottom: 18px; } }

/* ---------- Oficinas: control segmentado ---------- */
.segmented-wrap {
  display: flex; justify-content: center;
  margin-bottom: 24px; overflow-x: auto; scrollbar-width: none;
  margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter);
}
.segmented-wrap::-webkit-scrollbar { display: none; }
@media (max-width: 720px) { .segmented-wrap { justify-content: flex-start; } }
.segmented {
  position: relative; display: inline-flex; flex: none; padding: 4px;
  border-radius: 999px; background: var(--tile);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.segmented-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0;
  border-radius: 999px; background: var(--navy);
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.12);
  will-change: transform, width;
}
@media (prefers-color-scheme: dark) { .segmented-thumb { background: var(--gold-btn); } }
.segmented button {
  position: relative; z-index: 1;
  min-height: 40px; padding: 0 20px;
  border: 0; background: none; border-radius: 999px;
  font-size: var(--t-small); font-weight: 500;
  color: var(--text-2); white-space: nowrap; cursor: pointer;
  transition: color 200ms var(--ease);
}
.segmented button[aria-selected="true"] { color: #fff; }
@media (prefers-color-scheme: dark) { .segmented button[aria-selected="true"] { color: var(--navy-deep); } }
.segmented button:active { opacity: 0.7; }

.office-tile {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center;
  background: var(--tile); border-radius: var(--r-lg);
  padding: clamp(28px, 4vw, 56px);
}
.office-panel { transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.office-panel.is-swapping { opacity: 0; transform: translateY(6px); }
.office-name { font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem); margin-top: 6px; }
.office-note { margin-top: 14px; font-size: 1.15rem; line-height: 1.45; color: var(--text-2); max-width: 30ch; }
.office-meta { margin-top: 28px; border-top: 1px solid var(--hair); }
.office-meta div { display: grid; grid-template-columns: 7rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.office-meta dt { font-size: var(--t-small); color: var(--text-3); }
.office-meta dd { font-size: var(--t-small); }

.office-map svg { width: 100%; height: auto; overflow: visible; }
.map-coast { fill: none; stroke: var(--text-3); stroke-width: 1.2; stroke-opacity: 0.6; }
.map-sea path { fill: none; stroke: var(--navy-light); stroke-width: 1; stroke-opacity: 0.3; }
.map-sea-label { font-family: var(--serif); font-size: 15px; letter-spacing: 0.06em; fill: var(--text-3); }
.map-route { fill: none; stroke: var(--accent); stroke-opacity: 0.7; stroke-width: 1.5; stroke-dasharray: 2 6; stroke-linecap: round; }
.map-pin { cursor: pointer; }
.map-leader { fill: none; stroke: var(--text-3); stroke-opacity: 0.55; stroke-width: 1; }
.map-pin.is-active .map-leader { stroke: var(--accent); stroke-opacity: 0.9; }
.map-pin circle { fill: var(--tile); stroke: var(--navy-light); stroke-width: 2; transition: fill 200ms var(--ease), r 300ms var(--ease); }
.map-pin text { font-size: 13px; font-weight: 500; fill: var(--text-2); transition: fill 200ms var(--ease); }
.map-pin.is-active circle { fill: var(--accent); stroke: var(--accent); r: 9; }
.map-pin.is-active text { fill: var(--text); font-weight: 600; }
@media (prefers-color-scheme: dark) { .map-pin circle { stroke: var(--gold-soft); } .map-sea path { stroke: var(--gold-soft); } }
@media (max-width: 880px) { .office-tile { grid-template-columns: 1fr; } .office-map { max-width: 420px; } }

/* ---------- Preguntas frecuentes ---------- */
.faq-wrap { max-width: 860px; }
.faq { border-top: 1px solid var(--hair); }
.faq-item { border-bottom: 1px solid var(--hair); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 0; background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem); line-height: 1.25; color: var(--text);
}
.faq-icon { flex: none; color: var(--accent); }
.faq-icon svg { width: 26px; height: 26px; transition: transform 400ms var(--ease); }
.faq-q[aria-expanded="true"] .faq-icon svg { transform: rotate(45deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 420ms var(--ease); }
.faq-a > div { overflow: hidden; }
.faq-a p { padding-bottom: 24px; color: var(--text-2); max-width: 62ch; line-height: 1.6; }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }

/* ---------- Contacto ---------- */
.contact { display: grid; grid-template-columns: 5fr 7fr; gap: 20px; }
.contact-info {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 28px;
  border-radius: var(--r-lg); padding: clamp(28px, 4vw, 48px);
  background: linear-gradient(150deg, var(--navy-light), var(--navy-deep) 70%, var(--navy-ink));
  color: rgb(245 241 234 / 0.8);
}
.contact-info .chip { align-self: flex-start; }
.contact-waves { position: absolute; inset: auto 0 0 0; width: 100%; height: 50%; z-index: -1; }
.contact-waves path { fill: none; stroke: var(--cream); stroke-opacity: 0.12; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.contact-direct { border-top: 1px solid rgb(255 255 255 / 0.16); }
.contact-direct div { display: grid; grid-template-columns: 6rem 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgb(255 255 255 / 0.16); }
.contact-direct dt { color: rgb(245 241 234 / 0.55); font-size: var(--t-small); padding-top: 2px; }
.contact-direct dd, .contact-direct a { color: #f7f3ec; }
.contact-offices { margin-top: auto; font-size: var(--t-small); color: rgb(253 225 188 / 0.8); }
.contact-card {
  display: grid; gap: 14px; align-content: start;
  background: var(--tint); border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 52px);
}
.contact-lede { color: var(--text-2); margin-bottom: 10px; max-width: 52ch; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { position: relative; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 58px;
  padding: 25px 20px 9px;
  border: 1px solid transparent; border-radius: 16px;
  background: var(--tile);
  font-size: var(--t-body); color: var(--text);
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.45; }
.field label {
  position: absolute; left: 21px; top: 18px;
  font-size: var(--t-body); color: var(--text-3);
  pointer-events: none; transform-origin: left top;
  transition: transform 200ms var(--ease), color 200ms var(--ease);
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label,
.field-select label { transform: translateY(-10px) scale(0.72); }
.field-select select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%237d8990' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 18px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy-light); box-shadow: 0 0 0 4px var(--focus); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field [aria-invalid="true"] + label { color: var(--danger); }
.field-msg { margin-top: 6px; padding-left: 6px; font-size: var(--t-caption); letter-spacing: 0; color: var(--danger); }
.check { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: var(--t-small); color: var(--text-2); margin-top: 4px; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--navy-light); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }
.form-status { font-size: var(--t-small); color: var(--text-2); }
@media (max-width: 880px) { .contact { grid-template-columns: 1fr; }  }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } .form-foot .pill { width: 100%; justify-content: space-between; } }

/* ---------- Pie ---------- */
.footer {
  margin: clamp(3rem, 6vw, 5rem) var(--frame) 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: linear-gradient(160deg, var(--navy-deep), var(--navy-ink));
  color: rgb(245 241 234 / 0.72);
  padding-block: clamp(3.5rem, 6vw, 6rem) 28px;
  font-size: var(--t-small);
}
.footer-big { font-size: clamp(3.2rem, 1rem + 9vw, 9rem); line-height: 0.98; color: #f7f3ec; letter-spacing: -0.015em; }
.footer-big .accent { color: var(--gold-soft); }
.footer-mid {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px;
  margin-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: 28px; border-bottom: 1px solid rgb(255 255 255 / 0.16);
}
.footer-mid img { width: min(260px, 100%); height: auto; }
.footer-contact { display: grid; gap: 6px; }
.footer-contact div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 12px; }
.footer-contact dt { color: rgb(245 241 234 / 0.5); }
.footer a { color: rgb(245 241 234 / 0.85); }
.footer a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; padding-top: 22px; }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-bottom p { color: rgb(245 241 234 / 0.5); }

/* ---------- Hoja de detalle ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; }
.sheet-root[hidden] { display: none; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; }
.sheet {
  position: relative;
  width: min(100% - 48px, 820px); max-height: min(86vh, 760px);
  display: flex; flex-direction: column;
  background: var(--tile); color: var(--text);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden; outline: none;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}
.sheet-head { flex: none; height: 28px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-head:active { cursor: grabbing; }
.sheet.is-dragging { user-select: none; -webkit-user-select: none; }
.sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--hair); }
.sheet-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: var(--tint); color: var(--text-2); cursor: pointer;
  transition: transform 100ms ease-out;
}
.sheet-close:active { transform: scale(0.92); }
.sheet-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 20px clamp(24px, 6vw, 72px) 8px; }
.sheet-eyebrow { font-size: var(--t-small); font-weight: 600; color: var(--text-3); margin-bottom: 12px; }
.sheet-title { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem); max-width: 22ch; }
.sheet-lede { margin-top: 16px; font-size: 1.15rem; line-height: 1.45; color: var(--text-2); max-width: 40ch; }
.sheet-foot { flex: none; padding: 20px clamp(24px, 6vw, 72px) 32px; }
.check-list { margin-top: 28px; border-top: 1px solid var(--hair); }
.check-list li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.check-list li::before {
  content: ""; flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%;
  background: var(--gold-btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14 7.5' fill='none' stroke='%2313303e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
@media (max-width: 640px) {
  .sheet-root { place-items: end stretch; }
  .sheet { width: 100%; max-height: calc(100svh - 24px); border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet-head { height: 32px; }
  .sheet-close { top: 14px; right: 14px; width: 32px; height: 32px; }
  .sheet-foot .pill { width: 100%; justify-content: space-between; }
}

/* ---------- WhatsApp ---------- */
.whatsapp {
  position: fixed; z-index: 90;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold-btn); color: var(--navy-deep);
  box-shadow: 0 10px 30px -8px rgb(0 0 0 / 0.35);
  transition: transform 100ms ease-out;
}
.whatsapp:active { transform: scale(0.94); }
.whatsapp[hidden] { display: none; }
.whatsapp svg { width: 26px; height: 26px; fill: currentColor; }

/* ---------- Página de texto legal ---------- */
.legal-page { padding-block: clamp(3rem, 8vw, 6rem); max-width: 760px; }
.legal-page h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); line-height: 1.08; margin-bottom: 12px; }
.legal-page h2 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; margin: 40px 0 10px; }
.legal-page ul { list-style: disc; padding-left: 1.2rem; }
.legal-page li + li { margin-top: 6px; }
.legal-page p { color: var(--text-2); }
.legal-page p + p { margin-top: 10px; }
.pending { background: rgb(214 176 122 / 0.35); padding: 0 0.25em; border-radius: 4px; color: var(--text); }

/* ---------- Aparición al hacer scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity 900ms var(--ease), transform 900ms var(--ease); transition-delay: var(--d, 0ms); }

/* ---------- Accesibilidad: movimiento, transparencia y contraste ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; }
  .js .reveal.is-in { transition: opacity 300ms linear; }
  .globalnav-menu li { transform: none !important; }
  .pill:active, .matter-row:active { transform: none; }
  .faq-a, .cv-panel { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .globalnav { background: var(--material-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: light) {
  :root { --hair: rgb(0 0 0 / 0.4); --text-2: #2f3a40; --text-3: #2f3a40; --accent: #7a5424; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --hair: rgb(255 255 255 / 0.4); --text-2: #dfe5e8; --text-3: #dfe5e8; }
}
@media (prefers-contrast: more) {
  .globalnav { background: var(--material-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Página de equipo ---------- */
.pill-light-outline { min-height: 42px; padding: 0 18px; font-size: var(--t-small); color: var(--text); box-shadow: inset 0 0 0 1px var(--hair); background: transparent; }
.pill-light-outline:hover { background: var(--tint); }
.team-intro-wrap { padding-top: clamp(2.5rem, 2rem + 3vw, 5rem); }
.team-intro { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.team-intro h1 { font-size: clamp(3rem, 1.8rem + 4.6vw, 5.6rem); line-height: 1; }
.team-lede { margin-top: 22px; font-size: 1.15rem; line-height: 1.55; color: var(--text-2); max-width: 44ch; }
.team-jump { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.team-photo { border-radius: var(--r-lg); aspect-ratio: 4 / 5; }
.team-photo .photo-caption { right: 20px; bottom: 20px; }

.profiles { display: grid; gap: 20px; }
.profile {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px);
  background: var(--tile); border-radius: var(--r-lg); padding: clamp(16px, 2vw, 24px);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.profile-flip .profile-photo { order: 2; }
.profile-photo { border-radius: calc(var(--r-lg) - 8px); min-height: 480px; }
.profile-body { padding: clamp(12px, 3vw, 32px) clamp(8px, 2vw, 24px); align-self: center; }
.profile h2 { font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem); }
.profile-lede { margin-top: 14px; font-size: 1.1rem; line-height: 1.55; color: var(--text-2); max-width: 52ch; }
.profile-fullname { margin-top: 6px; font-size: var(--t-small); color: var(--text-3); letter-spacing: 0.01em; }
.profile-highlights { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.profile-highlights li {
  padding: 7px 14px; border-radius: 999px;
  background: var(--tint); color: var(--text); font-size: var(--t-small);
}
.cv-more {
  width: 100%; margin-top: 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0; border: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  background: none; cursor: pointer; text-align: left;
  font-size: 1rem; font-weight: 600; color: var(--text);
}
.cv-more:active { opacity: 0.7; }
.cv-more[aria-expanded="true"] .faq-icon svg { transform: rotate(45deg); }
.cv-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 480ms var(--ease); }
.cv-panel > div { overflow: hidden; }
.cv-panel.is-open { grid-template-rows: 1fr; }
.cv-block { padding-top: 26px; }
.cv-block h3 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; margin-bottom: 12px; }
.timeline { border-left: 1px solid var(--hair); margin-left: 4px; }
.timeline li { position: relative; display: grid; grid-template-columns: 7.5rem 1fr; gap: 14px; padding: 10px 0 10px 20px; }
.timeline li::before {
  content: ""; position: absolute; left: -4.5px; top: 17px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold-btn);
}
.tl-years { font-size: var(--t-small); color: var(--text-3); font-variant-numeric: tabular-nums; padding-top: 2px; }
.tl-role { font-weight: 600; color: var(--text); line-height: 1.35; }
.tl-org { font-size: var(--t-small); color: var(--text-2); line-height: 1.45; margin-top: 2px; }
.cv-list li { position: relative; padding: 7px 0 7px 18px; font-size: var(--t-small); color: var(--text-2); line-height: 1.5; }
.cv-list li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-btn); }

.team-cta {
  text-align: center; border-radius: var(--r-xl);
  padding: clamp(40px, 6vw, 80px) clamp(24px, 5vw, 64px);
  background: var(--tint);
}
.team-cta p { margin: 16px auto 28px; max-width: 48ch; color: var(--text-2); font-size: 1.1rem; }

@media (max-width: 880px) {
  .team-intro { grid-template-columns: 1fr; }
  .profile { grid-template-columns: 1fr; }
  .profile-flip .profile-photo { order: 0; }
  .profile-photo { min-height: min(110vw, 520px); }
}
@media (max-width: 560px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}
