/* ============================================================
   MW Law Firm, A.P.C. — landing page demo (rebuild)
   Modeled 1-to-1 on mendezsanchezlaw.com:
     display Playfair Display (serif, 700+), body DM Sans,
     red #D71A20 pill CTAs (radius 50px), transparent nav over a
     dark full-bleed hero, scenario-rotating H1 "Your ___ Allies.",
     What We Handle photo-cards, In Their Own Words, Let's Build
     Your Case, "What's your case worth?" popup.
   ============================================================ */

:root {
  --red: #d71a20;
  --red-deep: #b01218;
  --black: #0a0a0a;
  --near: #141414;
  --white: #ffffff;
  --grey: #f5f5f4;
  --muted: #6d6d6d;
  --mist: rgba(255, 255, 255, 0.85);
  --line: #e4e2df;

  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", -apple-system, "Segoe UI", sans-serif;

  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; }

h2 { font-size: clamp(1.9rem, 3.8vw, 2.65rem); margin-bottom: 0.8rem; text-wrap: balance; }

.section-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.4rem, 7vw, 6rem) clamp(1.1rem, 4vw, 2rem);
}
.section-lede { color: var(--muted); font-size: 1.05rem; margin-bottom: 2rem; }

.stars { color: var(--red); letter-spacing: 0.12em; margin-right: 0.4rem; }

/* ---------- Buttons: red pills, per the reference ---------- */
.btn-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--red); color: var(--white);
  font-family: var(--sans); font-weight: 700; font-size: 0.95rem;
  text-decoration: none; border: 0; cursor: pointer;
  border-radius: 50px;
  padding: 0.78rem 1.6rem; min-height: 44px;
  transition: background-color 140ms ease, transform 140ms ease;
}
.btn-pill:hover { background: var(--red-deep); }
.btn-pill:active { transform: translateY(1px); }
.btn-pill:focus-visible, .btn-outline:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--white);
  font-weight: 700; font-size: 0.95rem; text-decoration: none;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 50px;
  padding: 0.78rem 1.6rem; min-height: 44px;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.btn-outline:hover { border-color: var(--white); background: rgba(255, 255, 255, 0.08); }

.btn-lg { padding: 0.95rem 2rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------- Nav: transparent over the hero, solid on scroll ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: transparent;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}
.nav.is-solid { background: rgba(10, 10, 10, 0.95); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35); }
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 76px;
  padding: 0.6rem clamp(1.1rem, 4vw, 2rem);
  display: flex; align-items: center; gap: 1.6rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; margin-right: auto; }
.brand-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--white); color: var(--black);
  font-family: var(--serif); font-weight: 800; font-size: 0.95rem;
}
.brand-name { font-family: var(--sans); font-weight: 700; font-size: 1.02rem; color: var(--white); }
.brand-apc { font-weight: 500; font-size: 0.72rem; letter-spacing: 0.18em; color: var(--mist); }

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--mist); text-decoration: none; font-size: 0.94rem; font-weight: 500;
  transition: color 120ms ease;
}
.nav-links a:hover { color: var(--white); }

.nav-actions { display: flex; align-items: center; gap: 1.1rem; }
.nav-phone { color: var(--white); font-weight: 700; text-decoration: none; font-size: 0.98rem; }
.nav-phone:hover { color: var(--red); }

.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px;
  background: transparent; border: 0; cursor: pointer;
}
.nav-burger span { display: block; width: 24px; height: 2px; background: var(--white); margin: 0 auto; }

.nav-mobile {
  background: rgba(10, 10, 10, 0.98);
  padding: 1rem clamp(1.1rem, 4vw, 2rem) 1.4rem;
  display: grid; gap: 0.4rem;
}
.nav-mobile a {
  color: var(--white); text-decoration: none; font-weight: 600; font-size: 1.05rem;
  padding: 0.65rem 0; min-height: 44px; display: flex; align-items: center;
}
.nav-mobile .btn-pill { justify-content: center; margin-top: 0.5rem; }

/* ---------- Hero: dark full-bleed, scenario rotator ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex; align-items: center;
  color: var(--white);
  overflow: hidden;
  background: var(--black);
}
.hero-media {
  position: absolute; inset: 0;
  background:
    radial-gradient(1100px 600px at 78% 30%, var(--glow, rgba(215, 26, 32, 0.28)) 0%, transparent 60%),
    linear-gradient(105deg, rgba(0, 0, 0, 0.94) 0%, rgba(10, 10, 10, 0.82) 45%, rgba(15, 15, 18, 0.65) 100%),
    #101014;
  transition: --glow 600ms ease;
}
.hero[data-scenario="auto"] .hero-media { --glow: rgba(215, 26, 32, 0.30); }
.hero[data-scenario="wrongful"] .hero-media { --glow: rgba(120, 130, 200, 0.28); }
.hero[data-scenario="slip"] .hero-media { --glow: rgba(200, 160, 60, 0.26); }
.hero[data-scenario="injury"] .hero-media { --glow: rgba(90, 170, 160, 0.26); }

.hero-inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: 8.5rem clamp(1.1rem, 4vw, 2rem) 4rem;
}
.hero-title {
  font-size: clamp(2.7rem, 7vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 1.3rem;
}
.hero-scenario {
  color: var(--red);
  display: inline-block;
  min-width: 6ch;
  transition: opacity 300ms ease, transform 300ms ease;
}
.hero-scenario.is-swapping { opacity: 0; transform: translateY(10px); }
.hero[data-scenario="wrongful"] .hero-scenario { color: #aab4e8; }
.hero[data-scenario="slip"] .hero-scenario { color: #d9b24a; }
.hero[data-scenario="injury"] .hero-scenario { color: #7cc4bb; }

.hero-sub { font-size: 1.12rem; color: var(--mist); max-width: 34rem; margin-bottom: 2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.6rem; }

.hero-stats {
  list-style: none;
  display: flex; flex-wrap: wrap;
  gap: 2.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 1.5rem;
  max-width: 34rem;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1.1; }
.hero-stats span { font-size: 0.85rem; color: var(--mist); }

/* ---------- What We Handle: dark photo-style cards ---------- */
.practice { background: var(--white); }
.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.practice-card {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 300px;
  border-radius: 14px;
  padding: 1.5rem 1.4rem;
  color: var(--white);
  text-decoration: none;
  overflow: hidden;
  transition: transform 160ms ease;
}
.practice-card:hover { transform: translateY(-4px); }
.card-auto     { background: linear-gradient(160deg, #2b2f3a 0%, #14161c 70%); }
.card-wrongful { background: linear-gradient(160deg, #303045 0%, #131320 70%); }
.card-slip     { background: linear-gradient(160deg, #3a332b 0%, #1c1712 70%); }
.card-injury   { background: linear-gradient(160deg, #27343a 0%, #101a1c 70%); }
.card-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
}
.practice-card h3 { position: relative; font-size: 1.45rem; margin-bottom: 0.4rem; }
.practice-card p { position: relative; font-size: 0.93rem; color: var(--mist); max-width: 26rem; }
.card-arrow {
  position: absolute; top: 1.2rem; right: 1.3rem;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.practice-card:hover .card-arrow { background: var(--red); border-color: var(--red); }

/* ---------- Creed ---------- */
.creed { background: var(--black); color: var(--white); }
.creed-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.creed-title { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.12; }
.creed-copy p { color: var(--mist); margin-bottom: 1.1rem; max-width: 32rem; }
.creed-copy .btn-pill { margin-top: 0.5rem; }

/* ---------- In Their Own Words ---------- */
.words { background: var(--grey); }
.words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}
.word-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.7rem 1.5rem;
}
.word-card p { font-family: var(--serif); font-size: 1.08rem; line-height: 1.55; margin-bottom: 1rem; }
.word-card cite { font-style: normal; font-weight: 700; font-size: 0.9rem; color: var(--red); }
.word-card cite::before { content: "\2014\00a0"; }

/* ---------- Let's Build Your Case ---------- */
.build { background: var(--black); color: var(--white); }
.build-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.build h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.build-copy > p { color: var(--mist); max-width: 26rem; margin-bottom: 1.4rem; }
.build-phone {
  display: inline-block;
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--white); text-decoration: none;
  border-bottom: 3px solid var(--red);
  margin-bottom: 1.2rem;
}
.build-phone:hover { color: var(--red); }
.build-addr { color: var(--mist); font-size: 0.95rem; }

.build-form {
  background: var(--white);
  color: var(--black);
  border-radius: 16px;
  padding: 1.8rem 1.6rem;
  display: grid; gap: 1rem;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.build-form label { font-weight: 700; font-size: 0.88rem; }
.build-form input, .build-form textarea {
  width: 100%; margin-top: 0.35rem;
  font-family: var(--sans); font-size: 1rem; color: var(--black);
  background: var(--grey);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0.72rem 0.85rem;
  min-height: 44px;
}
.build-form textarea { min-height: 96px; }
.build-form input:focus, .build-form textarea:focus { outline: 2px solid var(--black); background: var(--white); }
.form-fine { font-size: 0.8rem; color: var(--muted); text-align: center; }
.form-sent {
  font-weight: 600; background: #eef3ea; border: 1px solid #cfdcc7;
  border-radius: 10px; padding: 0.85rem 1rem; text-align: center;
}

/* ---------- Footer ---------- */
.footer { background: #060606; color: #9a9a9a; font-size: 0.9rem; }
.footer-inner { padding-top: 2.6rem; padding-bottom: 2.6rem; }
.footer a { color: #d9d9d9; text-decoration: none; }
.footer a:hover { color: var(--red); }
.footer-brand-row {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--sans); font-weight: 700; font-size: 1.05rem; color: var(--white);
  margin-bottom: 0.7rem;
}
.footer-brand-row .brand-circle { width: 34px; height: 34px; font-size: 0.8rem; }
.footer-fine { margin-top: 0.5rem; font-size: 0.8rem; }

/* ---------- Mobile call bar ---------- */
.callbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem calc(0.6rem + env(safe-area-inset-bottom));
  background: rgba(6, 6, 6, 0.97);
  border-top: 1px solid #222;
}
.callbar a {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; font-weight: 700; font-size: 0.98rem;
  border-radius: 50px; padding: 0.85rem 0.5rem; min-height: 44px;
}
.callbar-phone { background: var(--red); color: var(--white); }
.callbar-consult { background: transparent; color: var(--white); border: 1.5px solid #3a3a3a; }

/* ---------- Popup: "What's your case worth?" ---------- */
.popup-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.66);
  display: flex; align-items: center; justify-content: center;
  padding: 1.2rem;
}
.popup {
  position: relative;
  background: var(--white);
  border-radius: 18px;
  max-width: 460px; width: 100%;
  padding: 2.2rem 1.9rem 1.9rem;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
}
.popup h2 { font-size: 1.9rem; margin-bottom: 1.2rem; }
.popup-close {
  position: absolute; top: 0.7rem; right: 0.7rem;
  width: 44px; height: 44px;
  background: transparent; border: 0; cursor: pointer;
  font-size: 1.7rem; line-height: 1; color: var(--muted);
  border-radius: 50%;
}
.popup-close:hover { color: var(--black); background: var(--grey); }
.popup-steps { list-style: none; display: grid; gap: 0.75rem; margin-bottom: 1.2rem; }
.popup-steps li { display: flex; align-items: center; gap: 0.8rem; font-weight: 500; }
.popup-num {
  font-family: var(--serif); font-weight: 700; font-size: 0.95rem;
  color: var(--red);
  border: 1.5px solid var(--red);
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.popup-fine { font-size: 0.76rem; color: var(--muted); line-height: 1.5; margin-bottom: 1.2rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * {
    opacity: 0; transform: translateY(16px);
    animation: rise 640ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
  .hero-inner > *:nth-child(1) { animation-delay: 80ms; }
  .hero-inner > *:nth-child(2) { animation-delay: 180ms; }
  .hero-inner > *:nth-child(3) { animation-delay: 280ms; }
  .hero-inner > *:nth-child(4) { animation-delay: 400ms; }
  .popup { animation: pop 360ms cubic-bezier(0.2, 0.9, 0.3, 1.2); }
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 560ms ease, transform 560ms cubic-bezier(0.2, 0.7, 0.2, 1); }
  .reveal.is-in { opacity: 1; transform: none; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.92) translateY(14px); } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .creed-inner, .build-inner { grid-template-columns: 1fr; }
  .hero { min-height: 86vh; }
}
@media (max-width: 720px) {
  .nav-actions { display: none; }
  .nav-burger { display: flex; }
  .callbar { display: flex; }
  body { padding-bottom: 76px; }
  .hero-ctas .btn-pill, .hero-ctas .btn-outline { flex: 1 1 100%; }
  .hero-stats { gap: 1.6rem; }
}
