/* ==========================================================================
   Fides Abogados — demo QuickPixel
   Sobria y de autoridad: azul tinta, piedra cálida y bronce.
   Una sola familia tipográfica (Manrope) para títulos y texto.
   ========================================================================== */
:root {
  --ink: #141821;
  --ink-2: #1d2330;
  --ink-3: #283043;
  --stone: #efe9df;
  --stone-2: #e4dccf;
  --paper: #f8f5f0;
  --bronze: #b08d57;
  --bronze-2: #977443;
  --text: #1b2130;
  --muted: #5d6474;
  --muted-d: #a3a9b6;
  --sans: "Manrope", system-ui, sans-serif;
  --gutter: clamp(1.1rem, .5rem + 3vw, 3rem);
  --ease: cubic-bezier(.22, 1, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--text); font-family: var(--sans); font-size: 1.02rem; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1260px; margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.demo { padding: .5rem var(--gutter); background: #0b0e14; color: var(--muted-d); font-size: .78rem; text-align: center; }
.demo a { color: #fff; font-weight: 700; text-decoration: none; margin-left: .3rem; }

/* ---------- Botones (rectos, sobrios) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 1.7rem; border: 1.5px solid transparent; border-radius: 2px; font: 700 .9rem/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .3s, color .3s, border-color .3s; }
.btn--bronze { background: var(--bronze); color: #fff; }
.btn--bronze:hover { background: var(--bronze-2); }
.btn--line { border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn--line:hover { background: #fff; color: var(--ink); }
.btn--sm { min-height: 44px; padding: 0 1.1rem; font-size: .78rem; }
.btn--block { width: 100%; }
.link { display: inline-block; margin-top: 1.4rem; font-weight: 700; color: var(--bronze-2); text-decoration: none; border-bottom: 1.5px solid currentColor; padding-bottom: 2px; }

/* ---------- Nav: transparente sobre la foto, sólido al bajar ---------- */
.nav { position: sticky; top: 0; z-index: 50; margin-bottom: -84px; color: #fff; transition: background .35s, color .35s; }
.nav.is-scrolled { background: var(--ink); }
.nav__inner { display: flex; align-items: center; gap: 1.6rem; height: 84px; }
.nav__logo { display: block; color: inherit; }
.nav__logo svg { width: 176px; height: auto; display: block; }
.nav__links { display: none; gap: 1.9rem; margin-left: auto; }
.nav__links a { text-decoration: none; font-weight: 600; font-size: .92rem; opacity: .9; transition: opacity .2s, color .2s; }
.nav__links a:hover { opacity: 1; color: var(--bronze); }
.nav__toggle { margin-left: auto; display: grid; gap: 6px; place-content: center; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; }
.nav__toggle span { width: 24px; height: 2px; background: currentColor; transition: transform .3s var(--ease); }
.nav.is-open .nav__toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
.nav__cta { display: none; }
@media (max-width: 999px) {
  .nav.is-open { background: var(--ink); }
  .nav.is-open .nav__links { display: grid; position: absolute; top: 100%; left: 0; right: 0; padding: .4rem var(--gutter) 1.4rem; background: var(--ink); }
  .nav.is-open .nav__links a { padding: .9rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--ink-3); }
}

/* ---------- Hero: foto a ancho completo con texto encima ---------- */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; color: #fff; isolation: isolate; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 2.4s var(--ease); }
.is-loaded .hero__bg { transform: none; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(20, 24, 33, .92) 0%, rgba(20, 24, 33, .72) 45%, rgba(20, 24, 33, .35) 100%), linear-gradient(0deg, rgba(20, 24, 33, .85) 0%, rgba(20, 24, 33, 0) 40%); }
.hero__content { align-self: center; padding-top: 120px; padding-bottom: 3rem; }
.hero__pre { display: inline-flex; align-items: center; gap: .8rem; font-weight: 600; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--bronze); }
.hero__pre::before { content: ""; width: 40px; height: 1.5px; background: var(--bronze); }
.hero__title { max-width: 15ch; margin-top: 1.4rem; font-size: clamp(2.5rem, 1.2rem + 4.6vw, 5rem); line-height: 1.04; font-weight: 800; letter-spacing: -.03em; }
.hero__lead { max-width: 36rem; margin-top: 1.5rem; font-size: clamp(1.05rem, 1rem + .3vw, 1.22rem); color: #d6dae3; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }
.hero__stats { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid rgba(255, 255, 255, .16); background: rgba(20, 24, 33, .55); }
.hero__stats div { padding: 1.3rem var(--gutter); border-right: 1px solid rgba(255, 255, 255, .12); border-bottom: 1px solid rgba(255, 255, 255, .12); }
.hero__stats dt { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; color: #fff; }
.hero__stats dd { margin: 0; font-size: .88rem; color: var(--muted-d); }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(4.5rem, 3rem + 5vw, 8rem); }
.section--stone { background: var(--stone); }
.head { max-width: 720px; margin-bottom: clamp(2.2rem, 1.8rem + 2vw, 3.4rem); }
.title { font-size: clamp(2rem, 1.2rem + 3vw, 3.3rem); line-height: 1.08; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.title::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 1.2rem; background: var(--bronze); }
.title--light { color: #fff; }
.lead { margin-top: 1.2rem; font-size: 1.1rem; color: var(--muted); }

/* ---------- Áreas: selector ---------- */
.areas { display: grid; gap: 1.5rem; }
.areas__tabs { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .3rem; }
.areas__tabs::-webkit-scrollbar { display: none; }
.areas__tab { flex: none; padding: .9rem 1.1rem; border: 0; border-bottom: 2px solid var(--stone-2); background: none; font: 700 .98rem/1.2 var(--sans); color: var(--muted); text-align: left; cursor: pointer; transition: color .25s, border-color .25s, background .25s; }
.areas__tab:hover { color: var(--ink); }
.areas__tab.is-on { color: var(--ink); border-color: var(--bronze); }
.panel { display: grid; background: #fff; animation: panel-in .6s var(--ease); }
.panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.panel img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.panel__body { padding: clamp(1.6rem, 1.2rem + 2vw, 2.6rem); }
.panel h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.panel p { margin-top: .8rem; color: var(--muted); font-size: 1.05rem; }
.panel ul { display: grid; gap: .55rem; margin-top: 1.2rem; padding: 0; list-style: none; }
.panel li { display: flex; gap: .7rem; font-weight: 600; }
.panel li::before { content: ""; flex: none; width: 14px; height: 1.5px; margin-top: .8em; background: var(--bronze); }

/* ---------- Valores ---------- */
.values { padding-block: clamp(4.5rem, 3rem + 5vw, 7.5rem); background: var(--ink); color: #d6dae3; }
.values__grid { display: grid; gap: 2.4rem; }
.value { padding-top: 1.4rem; border-top: 1px solid var(--ink-3); }
.value h3 { font-size: 1.4rem; font-weight: 800; color: #fff; }
.value h3::before { content: ""; display: block; width: 10px; height: 10px; margin-bottom: 1rem; background: var(--bronze); }
.value p { margin-top: .5rem; color: var(--muted-d); }

/* ---------- Proceso ---------- */
.process { display: grid; gap: 3rem; align-items: center; }
.process__photo img { width: 100%; aspect-ratio: 9 / 10; object-fit: cover; }
.timeline { position: relative; display: grid; gap: 1.8rem; margin-top: 2.4rem; padding: 0 0 0 2rem; list-style: none; counter-reset: t; }
.timeline::before { content: ""; position: absolute; left: 6px; top: .4rem; bottom: .4rem; width: 1.5px; background: var(--stone-2); }
.timeline li { position: relative; counter-increment: t; }
.timeline li::before { content: ""; position: absolute; left: calc(-2rem + 1px); top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--bronze); }
.timeline h3 { font-size: 1.2rem; font-weight: 800; color: var(--ink); }
.timeline h3::before { content: "0" counter(t) "  "; color: var(--bronze); white-space: pre; }
.timeline p { margin-top: .3rem; color: var(--muted); }

/* ---------- El estudio ---------- */
.studio { display: grid; gap: 3rem; align-items: center; }
.studio__img { width: 100%; aspect-ratio: 9 / 11; object-fit: cover; }
.quote { margin-top: 2.2rem; padding-left: 1.6rem; border-left: 3px solid var(--bronze); }
.quote p { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); font-weight: 700; line-height: 1.4; color: var(--ink); letter-spacing: -.01em; }
.quote cite { display: block; margin-top: .8rem; font-style: normal; font-weight: 600; color: var(--bronze-2); }

/* ---------- Equipo: blanco y negro → color ---------- */
.team { display: grid; gap: 1.4rem; grid-template-columns: repeat(2, 1fr); }
.lawyer img { width: 100%; aspect-ratio: 6 / 7.6; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .6s var(--ease), transform .8s var(--ease); }
.lawyer:hover img { filter: none; }
.lawyer h3 { margin-top: 1rem; font-size: 1.08rem; font-weight: 800; color: var(--ink); }
.lawyer p { font-size: .9rem; color: var(--muted); }

/* ---------- Testimonios (uno a la vez) ---------- */
.testi { background: var(--paper); text-align: center; }
.testi__inner { max-width: 900px; }
.testi__track { display: grid; }
/* Cambio secuencial: el que sale se va rápido y recién después entra el nuevo (nunca se superponen) */
.testi__item { grid-area: 1 / 1; opacity: 0; transform: translateY(-10px); transition: opacity .3s ease, transform .3s ease; pointer-events: none; }
.testi__item.is-on { opacity: 1; transform: none; pointer-events: auto; transition: opacity .6s var(--ease) .32s, transform .6s var(--ease) .32s; }
.testi__item blockquote { font-size: clamp(1.4rem, 1rem + 1.8vw, 2.3rem); font-weight: 700; line-height: 1.32; letter-spacing: -.02em; color: var(--ink); }
.testi__item blockquote::before { content: "“"; display: block; margin-bottom: .2rem; font-size: 4rem; line-height: .6; color: var(--bronze); }
.testi__item figcaption { margin-top: 1.4rem; font-weight: 700; color: var(--bronze-2); }
.testi__dots { display: flex; justify-content: center; gap: .6rem; margin-top: 2.4rem; }
.testi__dots button { width: 34px; height: 4px; border: 0; padding: 0; background: var(--stone-2); cursor: pointer; transition: background .3s; }
.testi__dots button.is-on { background: var(--bronze); }

/* ---------- Preguntas: grilla abierta ---------- */
.qa { display: grid; gap: 2rem 3rem; }
.qa h3 { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.qa p { margin-top: .5rem; color: var(--muted); }

/* ---------- Contacto ---------- */
.contact { padding-block: clamp(4.5rem, 3rem + 5vw, 8rem); background: var(--ink); color: #d6dae3; }
.contact__grid { display: grid; gap: 3rem; }
.contact__lead { margin-top: 1.2rem; font-size: 1.1rem; color: var(--muted-d); }
.contact dl { display: grid; gap: 1.2rem; margin-top: 2.2rem; }
.contact dt { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--bronze); }
.contact dd { margin: .2rem 0 0; color: #fff; font-weight: 600; }
/* Mapa en tonos oscuros, acorde a la sección */
.contact__map { margin-top: 2.2rem; aspect-ratio: 16 / 11; overflow: hidden; border-top: 3px solid var(--bronze); background: var(--ink-2); }
.contact__map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1) invert(.92) contrast(.9) brightness(.95); }
.form { display: grid; gap: 1.1rem; padding: clamp(1.5rem, 1rem + 2vw, 2.6rem); background: var(--ink-2); border-top: 3px solid var(--bronze); }
.form__row { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .45rem; }
.field > span, .pref legend { font-size: .85rem; font-weight: 700; color: #fff; }
.field small { font-weight: 500; color: var(--muted-d); }
.field input, .field select, .field textarea { width: 100%; padding: .9rem 1rem; border: 1px solid var(--ink-3); border-radius: 2px; background: var(--ink); color: #fff; font: 500 1rem/1.4 var(--sans); transition: border-color .2s; }
.field select { color-scheme: dark; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--bronze); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: #e2725b; }
.pref { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; border: 0; padding: 0; }
.pref legend { margin-bottom: .6rem; width: 100%; }
.pref label { display: flex; gap: .45rem; align-items: center; color: #d6dae3; cursor: pointer; }
.pref input { accent-color: var(--bronze); width: 18px; height: 18px; }
.form__status { min-height: 1.3em; font-weight: 700; }
.form__status.is-ok { color: #8fd3a8; }
.form__status.is-error { color: #f0907b; }

/* ---------- Footer ---------- */
.footer { padding-block: 2.6rem; background: var(--stone); color: var(--muted); font-size: .9rem; }
.footer__inner { display: grid; gap: 1.6rem; align-items: center; }
.footer__logo { color: var(--ink); }
.footer__logo svg { width: 170px; display: block; }
.footer nav { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; }
.footer nav a { text-decoration: none; font-weight: 700; color: var(--ink); }
.footer__demo { font-size: .8rem; }

/* ---------- WhatsApp ---------- */
.wa { position: fixed; right: var(--gutter); bottom: var(--gutter); z-index: 60; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, .3); transition: transform .3s var(--ease); }
.wa:hover { transform: scale(1.08); }
.wa svg { width: 29px; height: 29px; fill: currentColor; }

/* ---------- Aparición ---------- */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--rd, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .form__row { grid-template-columns: 1fr 1fr; }
  .qa { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .hero__stats { grid-template-columns: repeat(4, 1fr); }
  .hero__stats div { border-bottom: 0; }
  .areas { grid-template-columns: 280px 1fr; gap: 3rem; }
  .areas__tabs { flex-direction: column; overflow: visible; gap: 0; }
  .areas__tab { padding: 1.15rem 0 1.15rem 1.2rem; border-bottom: 1px solid var(--stone-2); border-left: 3px solid transparent; }
  .areas__tab.is-on { border-left-color: var(--bronze); border-bottom-color: var(--stone-2); background: #fff; }
  .panel { grid-template-columns: 1fr 1fr; }
  .panel img { aspect-ratio: auto; height: 100%; min-height: 420px; }
  .values__grid { grid-template-columns: 1.1fr 1fr 1fr 1fr; align-items: start; gap: 3rem; }
  .process { grid-template-columns: .9fr 1.1fr; gap: 5rem; }
  .studio { grid-template-columns: 1.1fr .9fr; gap: 5rem; }
  .team { grid-template-columns: repeat(4, 1fr); }
  .contact__grid { grid-template-columns: .8fr 1.2fr; gap: 5rem; align-items: start; }
  .footer__inner { grid-template-columns: auto 1fr; }
  .footer nav { justify-content: flex-end; }
  .footer__demo { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .nav__links { display: flex; }
  .nav__cta { display: inline-flex; }
  .nav__toggle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .hero__bg { transform: none; }
  html { scroll-behavior: auto; }
}
