/* ============================================================
   Bufete Pérez Gutiérrez — Ponce, Puerto Rico
   Navy · Gold · Ivory. Editorial, not a SaaS template.
   ============================================================ */

:root {
  --navy-950: #070d16;
  --navy-900: #0b1524;
  --navy-800: #122033;
  --navy-700: #1b2d46;
  --gold: #c4a35a;
  --gold-soft: #d4b872;
  --gold-deep: #9a7d38;
  --ivory: #f6f1e7;
  --cream: #ece4d4;
  --paper: #faf8f3;
  --ink: #161410;
  --ink-soft: #3c382f;
  --muted: #6a6458;
  --line: rgba(196, 163, 90, 0.28);
  --line-soft: #e4dccb;
  --header-h: 84px;
  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Outfit", system-ui, -apple-system, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-brand: "Cinzel", "Cormorant Garamond", serif;
  --shadow: 0 18px 50px rgba(11, 21, 36, 0.12);
}

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

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

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

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

address {
  font-style: normal;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  background: var(--gold);
  color: var(--navy-900);
  padding: 0.6rem 1rem;
}

.skip-link:focus {
  top: 1rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn-lg {
  min-height: 54px;
  padding-inline: 1.6rem;
}

.btn-block {
  width: 100%;
}

.btn-gold {
  background: var(--gold);
  color: var(--navy-900);
}

.btn-gold:hover {
  background: var(--gold-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--ivory);
  border-color: rgba(246, 241, 231, 0.45);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-navy {
  background: var(--navy-900);
  color: var(--ivory);
}

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

/* ---- Header ---- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--header-h);
  color: var(--ivory);
  background: linear-gradient(180deg, rgba(7, 13, 22, 0.72), transparent);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(11, 21, 36, 0.96);
  box-shadow: 0 1px 0 rgba(196, 163, 90, 0.22);
  backdrop-filter: blur(12px);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-mark {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-brand);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-firm {
  font-family: var(--font-brand);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ivory);
  white-space: nowrap;
}

.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: rgba(246, 241, 231, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 1.6rem;
}

.nav a {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 241, 231, 0.78);
}

.nav a:hover,
.nav a.is-active {
  color: var(--gold);
}

.header-cta {
  flex: none;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(246, 241, 231, 0.25);
  background: transparent;
  position: relative;
}

.menu-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.5px;
  background: var(--ivory);
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 20px; }
.menu-toggle span:nth-child(3) { top: 26px; }

.menu-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + 3rem) 0 7.5rem;
  color: var(--ivory);
  overflow: hidden;
}

.hero-bg,
.hero-veil {
  position: absolute;
  inset: 0;
}

.hero-bg {
  background:
    url("../assets/images/hero.jpg") center / cover no-repeat;
  transform: scale(1.04);
}

.hero-veil {
  background:
    linear-gradient(90deg, rgba(7, 13, 22, 0.88) 0%, rgba(7, 13, 22, 0.72) 48%, rgba(7, 13, 22, 0.38) 100%),
    linear-gradient(180deg, rgba(7, 13, 22, 0.25) 0%, rgba(7, 13, 22, 0.55) 100%);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 360px);
  gap: 3.5rem;
  align-items: end;
}

.eyebrow,
.section-kicker {
  font-family: var(--font-brand);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.hero h1,
.section h2 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ivory);
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.15rem);
  max-width: 16ch;
}

.hero-lead {
  margin-top: 1.25rem;
  font-size: 1.15rem;
  max-width: 46ch;
  color: rgba(246, 241, 231, 0.88);
}

.hero-support {
  margin-top: 1rem;
  max-width: 54ch;
  color: rgba(246, 241, 231, 0.68);
  font-weight: 300;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

/* ---- Portrait slots (drop-in retrato.jpg) ---- */
.portrait {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(27, 45, 70, 0.45), rgba(11, 21, 36, 0.55)),
    url("../assets/images/biblioteca.jpg") center / cover no-repeat;
  border: 1px solid rgba(196, 163, 90, 0.45);
}

.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.portrait.has-photo img {
  opacity: 1;
}

.portrait.has-photo .portrait-fallback {
  opacity: 0;
  pointer-events: none;
}

.portrait-fallback {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  height: 100%;
  padding: 1.5rem 1rem 1.75rem;
  color: var(--ivory);
}

.portrait-initials {
  margin-top: auto;
  font-family: var(--font-brand);
  font-size: 2.4rem;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.portrait-name,
.portrait-role {
  display: block;
}

.portrait-name {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.portrait-role {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: rgba(246, 241, 231, 0.65);
}

.portrait-hero {
  min-height: 460px;
  aspect-ratio: 4 / 5;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.portrait-about {
  min-height: 340px;
  aspect-ratio: 4 / 5;
}

/* ---- Stats ---- */
.stats {
  position: relative;
  z-index: 2;
  margin-top: -3.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--navy-900);
  border: 1px solid rgba(196, 163, 90, 0.28);
  color: var(--ivory);
}

.stat {
  padding: 1.5rem 1.35rem;
  border-right: 1px solid rgba(196, 163, 90, 0.16);
}

.stat:last-child {
  border-right: 0;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.15;
}

.stat span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: rgba(246, 241, 231, 0.7);
}

/* ---- Sections ---- */
.section {
  padding: 6.5rem 0 5.5rem;
}

.section h2 {
  color: var(--navy-900);
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  max-width: 18ch;
}

.section-sub {
  margin-top: 0.85rem;
  max-width: 48ch;
  font-size: 1.12rem;
  color: var(--muted);
}

.section-intro {
  margin-bottom: 2.75rem;
}

.section-intro.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 320px);
  gap: 3rem;
  align-items: end;
}

.section-body {
  margin-top: 1.15rem;
  max-width: 52ch;
}

.study-photo {
  border: 1px solid var(--line-soft);
  overflow: hidden;
  min-height: 320px;
}

.study-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

/* ---- Quote ---- */
.quote-banner {
  position: relative;
  margin: 0 0 3.5rem;
  min-height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.quote-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 13, 22, 0.72), rgba(7, 13, 22, 0.78)),
    url("../assets/images/ponce.jpg") center / cover no-repeat;
}

.quote-banner blockquote {
  position: relative;
  z-index: 1;
  width: min(100% - 2.5rem, 820px);
  text-align: center;
  color: var(--ivory);
}

.quote-banner p {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.25;
}

.quote-banner p::before {
  content: "« ";
  color: var(--gold);
}

.quote-banner p::after {
  content: " »";
  color: var(--gold);
}

.quote-banner cite {
  display: block;
  margin-top: 1.1rem;
  font-style: normal;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  gap: 1.15rem;
}

.cards-6 {
  grid-template-columns: repeat(3, 1fr);
}

.info-card,
.practice-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  padding: 1.6rem 1.45rem 1.5rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.info-card:hover,
.practice-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-index {
  display: block;
  font-family: var(--font-brand);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 0.85rem;
}

.info-card h3,
.practice-card h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--navy-900);
  line-height: 1.2;
  margin-bottom: 0.65rem;
}

.info-card p,
.practice-card p {
  font-size: 0.98rem;
  color: var(--muted);
}

/* ---- Practice ---- */
.practica {
  background:
    linear-gradient(180deg, #f3eee4 0%, var(--paper) 100%);
}

.cards-practice {
  grid-template-columns: repeat(6, 1fr);
}

.practice-card:nth-child(1),
.practice-card:nth-child(2),
.practice-card:nth-child(3) {
  grid-column: span 2;
}

.practice-card:nth-child(4),
.practice-card:nth-child(5) {
  grid-column: span 3;
}

.practice-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 1rem;
  color: var(--gold-deep);
}

.practice-icon svg {
  width: 100%;
  height: 100%;
}

/* ---- Contact ---- */
.contacto {
  background:
    linear-gradient(180deg, rgba(11, 21, 36, 0.92), rgba(11, 21, 36, 0.94)),
    url("../assets/images/balanza.jpg") center / cover no-repeat;
  color: var(--ivory);
}

.contacto h2,
.contacto .section-sub {
  color: var(--ivory);
}

.contacto .section-sub {
  color: rgba(246, 241, 231, 0.72);
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 1.25rem;
  align-items: start;
}

.contact-card,
.contact-form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(196, 163, 90, 0.28);
  padding: 1.8rem 1.6rem;
}

.contact-label {
  font-family: var(--font-brand);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.contact-card h3 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 500;
  margin: 0.4rem 0 1.3rem;
}

.contact-list {
  list-style: none;
  display: grid;
  gap: 1.05rem;
  margin-bottom: 1.6rem;
}

.contact-list span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 241, 231, 0.5);
  margin-bottom: 0.15rem;
}

.contact-list a:hover {
  color: var(--gold);
}

.thanks {
  min-height: 100svh;
  display: flex;
  align-items: flex-start;
  padding-top: calc(var(--header-h) + 5.5rem + env(safe-area-inset-top, 0px));
  padding-bottom: 7rem;
  color: var(--ivory);
  background:
    linear-gradient(180deg, rgba(7, 13, 22, 0.86), rgba(7, 13, 22, 0.92)),
    url("../assets/images/hero.jpg") center / cover no-repeat;
}

.thanks-inner {
  max-width: 720px;
  padding-top: 0.5rem;
}

.thanks h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 4.15rem);
  line-height: 1.12;
  color: var(--ivory);
}

.contact-form {
  background: var(--paper);
  color: var(--ink-soft);
}

.field {
  margin-bottom: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 0.75rem 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.contact-form .btn {
  margin-top: 0.35rem;
}

.form-note {
  margin-top: 0.85rem;
  font-size: 0.92rem;
}

.form-note.is-error {
  color: #9b2c2c;
}

.form-note.is-ok {
  color: #276749;
}

.honey {
  position: absolute;
  left: -9999px;
  height: 0;
  opacity: 0;
}

.location-panel {
  position: relative;
  display: block;
  margin-top: 1.25rem;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid rgba(196, 163, 90, 0.28);
}

.location-panel img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  filter: saturate(0.85);
}

.location-panel span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 0.15rem;
  padding: 1.2rem 1.3rem;
  background: linear-gradient(180deg, transparent, rgba(7, 13, 22, 0.88));
  color: var(--ivory);
}

.location-panel strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
}

.location-panel em {
  margin-top: 0.35rem;
  font-style: normal;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.location-panel:hover em {
  color: var(--gold-soft);
}

/* ---- Footer ---- */
.site-footer {
  background: var(--navy-950);
  color: rgba(246, 241, 231, 0.72);
  padding: 3.5rem 0 6.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid rgba(196, 163, 90, 0.16);
}

.footer-firm {
  font-family: var(--font-brand);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ivory);
}

.footer-attorney {
  margin-top: 0.35rem;
  color: var(--ivory);
}

.footer-motto {
  margin: 0.55rem 0 0.85rem;
  color: var(--gold);
  font-size: 0.88rem;
}

.footer-heading {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.site-footer a:hover {
  color: var(--gold);
}

.footer-legal {
  padding-top: 1.4rem;
  font-size: 0.86rem;
}

.disclaimer {
  margin-top: 0.45rem;
  max-width: 72ch;
  color: rgba(246, 241, 231, 0.45);
}

.mobile-call {
  display: none;
}

/* ---- Mobile ---- */
@media (max-width: 1120px) {
  .brand-sub {
    display: none;
  }

  .nav {
    gap: 1.15rem;
  }
}

@media (max-width: 980px) {
  .header-cta {
    display: none;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 0;
    margin: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    background: #0b1524;
    padding: 0.75rem 0 5rem;
    z-index: 45;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.95rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .hero-grid,
  .section-intro.two-col,
  .contact-layout,
  .footer-grid,
  .cards-6,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-bottom: 5.5rem;
  }

  .hero h1 {
    max-width: none;
  }

  .portrait-hero {
    min-height: 380px;
    max-width: 360px;
  }

  .stat {
    border-right: 0;
    border-top: 1px solid rgba(196, 163, 90, 0.16);
  }

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

  .practice-card:nth-child(1),
  .practice-card:nth-child(2),
  .practice-card:nth-child(3),
  .practice-card:nth-child(4),
  .practice-card:nth-child(5) {
    grid-column: auto;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .mobile-call {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    color: var(--navy-900);
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
  }

  body {
    padding-bottom: 54px;
  }

  body.menu-open {
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  .brand-sub {
    display: none;
  }

  .hero {
    padding-top: calc(var(--header-h) + 2rem);
  }

  .section {
    padding: 4.5rem 0 4rem;
  }

  .portrait-about {
    min-height: 280px;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

.btn:focus-visible,
.nav a:focus-visible,
.brand:focus-visible,
.menu-toggle:focus-visible,
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
