/* ==========================================================================
   Carlos Medina Pitre & Abogados
   Sistema visual: azul marino de marca (#102841), dorado sobrio como acento,
   fondo gris azulado muy claro. Tipografía: Newsreader (títulos) + Public Sans (texto).
   ========================================================================== */

/* ---------- Fuentes (autoalojadas: no dependen de Google Fonts) ---------- */
@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/newsreader-latin-opsz-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/newsreader-latin-wght-italic.woff2') format('woff2');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('assets/fonts/public-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Variables ---------- */
:root {
  --navy-950: #06111f;
  --navy-900: #081626;
  --navy-800: #102841;   /* color del logo */
  --navy-700: #1a4068;

  --gold:      #c9a96a;  /* sobre fondos oscuros */
  --gold-soft: #dcc493;
  --gold-deep: #86672c;  /* texto sobre fondos claros (contraste AA) */

  --ivory: #ece6d6;
  --mist:  #f3f5f8;
  --white: #ffffff;
  --ink:   #101a28;
  --muted: #4d5867;
  --line:  #d6dce4;

  --font-display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --max: 1180px;
  --header-h: 84px;
  --radius: 14px;
  --shadow-soft: 0 20px 45px rgba(8, 22, 38, .10);
  --shadow-deep: 0 30px 70px rgba(6, 17, 31, .30);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 450;
  color: var(--navy-800);
  letter-spacing: -0.012em;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: 32px;
}

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}
.hero :focus-visible, .contact :focus-visible, .site-footer :focus-visible {
  outline-color: var(--gold-soft);
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  background: var(--navy-800);
  color: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius);
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.btn-sm { padding: 11px 20px; font-size: 0.86rem; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--navy-900);
  box-shadow: 0 14px 30px rgba(201, 169, 106, .28);
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 18px 36px rgba(201, 169, 106, .38);
  transform: translateY(-1px);
}

.btn-navy { background: var(--navy-800); color: var(--white); }
.btn-navy:hover { background: var(--navy-700); }

.btn-line { background: transparent; color: var(--ivory); border-color: rgba(236, 230, 214, .45); }
.btn-line:hover { border-color: var(--gold); color: var(--gold-soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(8, 22, 38, .08); }

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: block; flex-shrink: 0; }
.brand-logo { height: 46px; width: auto; }

.site-nav ul { display: flex; align-items: center; gap: 34px; }
.site-nav a:not(.btn) {
  position: relative;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  padding: 6px 0;
}
.site-nav a:not(.btn)::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.site-nav a:not(.btn):hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy-800);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  height: 90vh;
  min-height: 620px;
  max-height: 860px;
  background: var(--navy-900);
  color: var(--ivory);
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  line-height: 0;
  background: var(--navy-900);
}
.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center 32%;
  filter: grayscale(.1) saturate(1.05) brightness(.7) contrast(1.12);
  animation: photoZoom 24s ease-in-out infinite alternate;
}
@keyframes photoZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(195deg, rgba(6, 17, 31, .04) 0%, rgba(6, 17, 31, .1) 40%, rgba(6, 17, 31, .55) 82%, rgba(6, 17, 31, .68) 100%);
}

.hero-overlay {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding-bottom: 9%;
  animation: rise 1s cubic-bezier(.2, .7, .2, 1) both;
}

.hero-overlay::before {
  content: 'CM';
  position: absolute;
  left: 4%;
  bottom: 8%;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(6rem, 15vw, 13rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: rgba(236, 230, 214, 0.09);
  pointer-events: none;
  z-index: 1;
}

@media (max-width: 780px) {
  .hero-overlay::before { display: none; }
}

.hero-statement {
  margin-left: auto;
  max-width: 30em;
  color: var(--white);
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 450;
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  line-height: 1.35;
  text-align: right;
  text-wrap: balance;
  letter-spacing: -0.01em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, .4);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Quiénes somos ---------- */
.about {
  position: relative;
  padding: 140px 0;
  background: var(--white);
  overflow: hidden;
  isolation: isolate;
}

/* Monograma tenue de marca, en eco con el de la portada */
.about-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(9rem, 26vw, 20rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--navy-800);
  opacity: 0.02;
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
}

.about-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.about-copy {
  max-width: 46em;
  text-align: center;
}

.about-rule {
  display: block;
  width: 64px;
  height: 2px;
  margin: 0 auto 28px;
  background: linear-gradient(90deg, transparent, var(--gold-deep) 50%, transparent);
}

.about-copy h2 {
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  line-height: 1.1;
  margin-bottom: 34px;
}

.about-lead {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 400;
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--muted);
  margin: 0 auto 24px;
  max-width: 38em;
  letter-spacing: normal;
}

.about-copy > p:not(.about-lead) {
  font-family: var(--font-body);
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.75;
  margin: 0 auto;
  max-width: 38em;
}

/* Aparición suave al entrar en pantalla */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}


/* ---------- Áreas de práctica ---------- */
.areas {
  padding: 120px 0;
  background: var(--mist);
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 64px;
}
.section-heading h2 {
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  line-height: 1.1;
}
.section-heading p {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 30em;
  justify-self: end;
}

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

.area {
  display: flex;
  flex-direction: column;
  margin: -18px;
  padding: 18px;
  border-radius: calc(var(--radius) + 6px);
  transition: box-shadow .35s ease, transform .35s ease, background-color .35s ease;
}
.area:hover {
  background: var(--white);
  box-shadow: var(--shadow-soft);
  transform: translateY(-6px);
}

.area figure {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 26px;
  background: var(--navy-800);
  box-shadow: 0 16px 34px rgba(16, 40, 65, .16);
}
.area figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(8, 22, 38, .55) 0%, rgba(8, 22, 38, .22) 55%, rgba(8, 22, 38, .4) 100%);
  mix-blend-mode: multiply;
  transition: opacity .5s ease;
}
.area:hover figure::after { opacity: .3; }
.area img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.05);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.area:hover img { transform: scale(1.06); }

.area h3 {
  font-size: 1.6rem;
  line-height: 1.2;
  margin-bottom: 10px;
}
.area p {
  color: var(--muted);
  max-width: 24em;
  flex: 1;
}
.area-link {
  align-self: flex-start;
  margin-top: 20px;
  padding-bottom: 3px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold-deep);
  border-bottom: 1px solid currentColor;
  transition: color .2s ease;
}
.area-link:hover { color: var(--navy-800); }

/* ---------- Contacto ---------- */
.contact {
  padding: 116px 0 124px;
  background:
    radial-gradient(700px 420px at 12% 20%, rgba(201, 169, 106, .10), transparent 70%),
    linear-gradient(160deg, var(--navy-800), var(--navy-900));
  color: var(--ivory);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 96px;
  align-items: center;
}

.contact-intro h2 {
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 4vw, 3.3rem);
  line-height: 1.08;
  margin-bottom: 22px;
}
.contact-list { border-top: 1px solid rgba(236, 230, 214, .2); }

.contact-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(236, 230, 214, .2);
}

.contact-icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  color: var(--gold);
  border: 1px solid rgba(201, 169, 106, .5);
  border-radius: 50%;
}
.contact-icon svg { width: 24px; height: 24px; }

.contact-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--gold-soft);
  margin-bottom: 2px;
}
.contact-value {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--white);
  overflow-wrap: anywhere;
  transition: color .2s ease;
}
.contact-value:hover { color: var(--gold-soft); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  padding: 56px 0 48px;
  color: rgba(236, 230, 214, .7);
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px 48px;
}
.footer-logo { height: 42px; width: auto; }
.footer-tagline {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 500;
  font-size: 1rem;
  color: var(--gold-soft);
}
.footer-legal { font-size: 0.86rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .site-nav ul { gap: 24px; }
  .contact-grid { gap: 56px; }
  .areas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero { height: 82vh; min-height: 540px; max-height: 720px; }
  .hero-overlay { padding-bottom: 11%; }
  .about, .areas { padding: 84px 0; }
  .about-copy { max-width: 34em; }
  .section-heading { grid-template-columns: 1fr; gap: 16px; margin-bottom: 44px; }
  .section-heading p { justify-self: start; }
  .contact { padding: 84px 0 92px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; justify-items: start; }
}

@media (max-width: 900px) {
  :root { --header-h: 72px; }
  .brand-logo { height: 38px; }

  .nav-toggle { display: flex; }
  .site-nav ul {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 32px 22px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(8, 22, 38, .1);
  }
  .site-nav ul.open { display: flex; }
  .site-nav li { border-bottom: 1px solid var(--line); }
  .site-nav a:not(.btn) { display: block; padding: 15px 0; font-size: 1rem; }
  .site-nav a:not(.btn)::after { display: none; }
  .site-nav .nav-cta { border-bottom: none; padding-top: 18px; }
  .site-nav .nav-cta .btn { width: 100%; padding: 14px 20px; }
}

@media (max-width: 760px) {
  .wrap { padding-inline: 20px; }
  .site-nav ul { padding-inline: 20px; }
}

@media (max-width: 640px) {
  .about-copy { padding-inline: 4px; }
  .areas-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero { height: 76vh; min-height: 480px; max-height: 640px; }
  .hero-overlay { padding-bottom: 13%; }
  .hero-statement {
    max-width: 100%;
    font-size: clamp(0.92rem, 5.1vw, 1.4rem);
    line-height: 1.3;
  }
  .contact-row { grid-template-columns: 44px minmax(0, 1fr); gap: 16px; }
  .contact-icon { width: 44px; height: 44px; }
  .contact-row .btn { grid-column: 2; justify-self: start; }
  .contact-value { font-size: 1.2rem; }
}

/* ---------- Preferencias de movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
