/* ===========================================================
   Montemar Legal — redesign
   Deep navy + slate-blue (logo palette), serif display + neutral sans
   =========================================================== */

:root {
  /* palette (overridable by Tweaks) */
  --navy:      #15273f;
  --navy-2:    #1d3551;
  --brand:     #2f6ea5;
  --brand-deep:#24587f;
  --steel:     #9fb6c9;

  /* neutrals */
  --paper:  #ffffff;
  --bg:     #f6f4ef;
  --bg-2:   #efece4;
  --ink:    #18222f;
  --muted:  #5d6776;
  --line:   rgba(24, 34, 47, 0.12);
  --line-soft: rgba(24, 34, 47, 0.07);

  /* type */
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --header-h: 80px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ---- shared type helpers ---- */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--brand);
  opacity: 0.7;
}
.eyebrow.center { justify-content: center; }
.display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}
.section { padding-block: clamp(64px, 9vw, 130px); }
.section-head { max-width: 760px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-title { font-size: clamp(34px, 5vw, 56px); }
.lead { color: var(--muted); font-size: clamp(17px, 2vw, 20px); line-height: 1.6; margin-top: 22px; }

/* ===========================================================
   Header
   =========================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  display: flex;
  align-items: center;
  transition: background .35s ease, box-shadow .35s ease, height .35s ease;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img { height: 30px; width: auto; transition: filter .35s ease; }
/* on transparent (over hero) the logo sits on dark → knock it to white */
.site-header:not(.solid) .brand img {
  filter: brightness(0) invert(1);
}
.nav { display: flex; align-items: center; gap: 36px; }
.nav a {
  font-size: 13.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--nav-fg, #fff);
  position: relative;
  padding-block: 8px;
  transition: color .25s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--brand);
  transition: width .3s ease;
}
.nav a:hover::after { width: 100%; }
.site-header.solid { background: var(--paper); box-shadow: 0 1px 0 var(--line), 0 8px 30px rgba(20,39,63,.06); height: 68px; --nav-fg: var(--ink); }
.site-header.solid .nav a:hover { color: var(--brand); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--lang-bd, rgba(255,255,255,.45));
  border-radius: 999px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.lang-toggle button {
  appearance: none;
  background: none;
  border: 0;
  color: var(--lang-fg, #fff);
  padding: 6px 11px;
  cursor: pointer;
  font: inherit;
  transition: background .2s, color .2s;
}
.lang-toggle button.active { background: var(--brand); color: #fff; }
.site-header.solid .lang-toggle { --lang-bd: var(--line); --lang-fg: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 13px 24px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .25s, color .25s, border-color .25s, transform .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.header-cta { padding: 10px 20px; }
.site-header:not(.solid) .header-cta { background: rgba(255,255,255,.12); color:#fff; border-color: rgba(255,255,255,.45); }
.site-header:not(.solid) .header-cta:hover { background: #fff; color: var(--navy); }

.menu-btn { display: none; }

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}
.hero image-slot { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero .scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(11,21,35,.55) 0%, rgba(11,21,35,.18) 32%, rgba(11,21,35,.35) 62%, rgba(8,16,28,.86) 100%),
    linear-gradient(90deg, rgba(11,21,35,.62) 0%, rgba(11,21,35,.15) 70%);
}
.hero.solid-mode image-slot { display: none; }
.hero.solid-mode .scrim { background: radial-gradient(120% 130% at 12% 0%, var(--navy-2) 0%, var(--navy) 55%, #0c1726 100%); }
.hero .wrap { position: relative; z-index: 2; width: 100%; padding-bottom: clamp(56px, 8vw, 104px); padding-top: 140px; }
.hero-inner { max-width: 760px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1.0;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--steel); }
.hero .eyebrow { color: #fff; }
.hero .eyebrow::before { background: var(--steel); opacity: 1; }
.hero-lead {
  margin-top: 26px;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  color: rgba(255,255,255,.82);
  max-width: 560px;
}
.hero-cta { margin-top: 38px; display: flex; gap: 14px; flex-wrap: wrap; }

/* coastline divider (echo of logo) */
.coast {
  display: block;
  width: 130px;
  height: 14px;
  margin-top: 4px;
  color: var(--brand);
}
.coast.on-dark { color: var(--steel); }

/* ===========================================================
   Stats band
   =========================================================== */
.stats {
  background: var(--navy);
  color: #fff;
}
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat {
  padding: clamp(34px, 4vw, 56px) 28px;
  text-align: center;
  border-left: 1px solid rgba(255,255,255,.12);
}
.stat:first-child { border-left: 0; }
.stat .num {
  font-family: var(--font-display);
  font-size: clamp(46px, 5.5vw, 74px);
  line-height: 1;
  font-weight: 500;
  color: #fff;
}
.stat .num .suffix { color: var(--steel); }
.stat .label {
  margin-top: 14px;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
  line-height: 1.5;
}

/* ===========================================================
   Intro / narrative
   =========================================================== */
.intro { background: var(--bg); }
.intro .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.intro .body p + p { margin-top: 18px; }
.intro .body p { color: var(--muted); }
.intro .body .first { color: var(--ink); font-size: 19px; line-height: 1.6; }
.pillars { display: grid; gap: 0; border-top: 1px solid var(--line); }
.pillar { padding: 26px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 40px 1fr; gap: 20px; align-items: start; }
.pillar .idx { font-family: var(--font-display); font-size: 26px; color: var(--brand); line-height: 1; }
.pillar h3 { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.pillar p { margin-top: 8px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }

/* ===========================================================
   Áreas de práctica
   =========================================================== */
.areas { background: var(--paper); }
.areas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 56px;
}
.area-card {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 3px;
  background: var(--navy);
  color: #fff;
  isolation: isolate;
}
.area-card image-slot { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.area-card .veil {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(13,24,40,.15) 0%, rgba(13,24,40,.35) 45%, rgba(10,19,32,.9) 100%);
  transition: background .4s ease;
}
.area-card:hover .veil { background: linear-gradient(180deg, rgba(47,110,165,.25) 0%, rgba(13,24,40,.5) 45%, rgba(10,19,32,.94) 100%); }
.area-card .card-body { position: absolute; z-index: 2; inset: auto 0 0 0; padding: 24px; }
.area-card .num { font-size: 12px; letter-spacing: .14em; color: var(--steel); font-weight: 600; }
.area-card h3 { font-family: var(--font-display); font-size: 25px; font-weight: 600; margin-top: 6px; line-height: 1.1; }
.area-card .desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,255,255,.8);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .45s ease, opacity .35s ease, margin-top .45s ease;
}
.area-card:hover .desc { max-height: 160px; opacity: 1; }

/* ===========================================================
   Sectors
   =========================================================== */
.sectors { background: var(--bg); }
.sectors .grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.sector-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.sector {
  background: var(--paper);
  padding: 26px 24px;
  transition: background .25s;
}
.sector:hover { background: var(--bg-2); }
.sector .s-ico { width: 26px; height: 26px; color: var(--brand); margin-bottom: 14px; }
.sector h4 { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.sector p { font-size: 13.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

/* ===========================================================
   Equipo
   =========================================================== */
.team { background: var(--navy); color: #fff; }
.team .eyebrow { color: var(--steel); }
.team .eyebrow::before { background: var(--steel); }
.team .section-title { color: #fff; }
.team .lead { color: rgba(255,255,255,.7); }
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.member {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 4px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 200px 1fr;
}
.member image-slot { width: 200px; height: 100%; min-height: 280px; filter: grayscale(1); }
.member .m-body { padding: 30px 30px 30px 28px; }
.member .m-name { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.05; }
.member .m-role { color: var(--steel); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; margin-top: 8px; font-weight: 600; }
.member .m-sep { height: 1px; background: rgba(255,255,255,.12); margin: 20px 0; }
.member .m-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--steel); margin-bottom: 8px; }
.member ul { list-style: none; margin: 0 0 16px; padding: 0; }
.member li { font-size: 13.5px; color: rgba(255,255,255,.78); line-height: 1.45; padding-left: 16px; position: relative; margin-top: 6px; }
.member li::before { content: ""; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; background: var(--brand); border-radius: 50%; }
.member .m-mail { font-size: 13.5px; color: var(--steel); margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; }
.member .m-mail:hover { color: #fff; }

/* ===========================================================
   Contacto / oficinas
   =========================================================== */
.contact { background: var(--bg); }
.contact .grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px); align-items: start; }
.office image-slot { width: 100%; aspect-ratio: 4/3; border-radius: 4px; }
.office-info { margin-top: 30px; display: grid; gap: 20px; }
.office-row { display: grid; grid-template-columns: 26px 1fr; gap: 14px; align-items: start; }
.office-row .ico { width: 20px; height: 20px; color: var(--brand); margin-top: 3px; }
.office-row .r-label { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.office-row .r-val { font-size: 16px; color: var(--ink); margin-top: 2px; }
.office-row a.r-val:hover { color: var(--brand); }

.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: clamp(28px, 4vw, 44px); }
.form-card h3 { font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.field input, .field textarea {
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(47,110,165,.12); }
.field textarea { resize: vertical; min-height: 120px; }
.form-foot { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.consent { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.consent input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-note { font-size: 13.5px; color: var(--brand); display: none; }
.form-note.show { display: block; }

/* ===========================================================
   Footer
   =========================================================== */
.site-footer { background: #0d1828; color: rgba(255,255,255,.7); padding-block: clamp(56px, 7vw, 84px) 30px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.1); }
.site-footer .f-logo { height: 34px; filter: brightness(0) invert(1); opacity: .95; margin-bottom: 20px; }
.site-footer .f-about { font-size: 14.5px; line-height: 1.6; max-width: 360px; }
.f-col h5 { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--steel); margin-bottom: 18px; }
.f-col a, .f-col p { display: block; font-size: 14.5px; color: rgba(255,255,255,.7); margin-bottom: 10px; transition: color .2s; }
.f-col a:hover { color: #fff; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 26px; gap: 20px; flex-wrap: wrap; }
.footer-bottom p { font-size: 12.5px; color: rgba(255,255,255,.45); }
.social { display: flex; gap: 12px; }
.social a { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; display: grid; place-items: center; transition: background .25s, border-color .25s; }
.social a:hover { background: var(--brand); border-color: var(--brand); }
.social svg { width: 16px; height: 16px; color: #fff; }

/* reveal-on-scroll — only hidden once JS marks the document; fail-safe visible otherwise */
.has-js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.6,.2,1), transform .7s cubic-bezier(.2,.6,.2,1); }
.has-js .reveal.in { opacity: 1; transform: none; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 1040px) {
  .areas-grid { grid-template-columns: repeat(2, 1fr); }
  .area-card .desc { max-height: 160px; opacity: 1; margin-top: 10px; } /* always show on touch */
}
@media (max-width: 900px) {
  .nav, .header-cta { display: none; }
  .menu-btn { display: inline-flex; }
  .intro .grid, .sectors .grid, .team-grid, .contact .grid { grid-template-columns: 1fr; }
  .stats .wrap { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.12); }
  .stat:nth-child(odd) { border-left: 0; }
  .member { grid-template-columns: 1fr; }
  .member image-slot { width: 100%; height: 240px; min-height: 0; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sector-list { grid-template-columns: 1fr; }
  .stats .wrap { grid-template-columns: 1fr; }
  .stat { border-left: 0 !important; border-bottom: 1px solid rgba(255,255,255,.12); }
  .hero { min-height: 88vh; }
}

/* mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer.open { display: block; }
.drawer .backdrop { position: absolute; inset: 0; background: rgba(8,16,28,.6); backdrop-filter: blur(2px); }
.drawer .panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(82vw, 340px); background: var(--paper); padding: 28px; display: flex; flex-direction: column; gap: 8px; transform: translateX(100%); transition: transform .35s ease; }
.drawer.open .panel { transform: none; }
.drawer .panel a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.drawer .panel .btn { margin-top: 16px; justify-content: center; }
.drawer .x { align-self: flex-end; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--ink); line-height: 1; padding: 4px 8px; }
