/* ==========================================================================
   Morrison & Barnes — layout
   Header, navigation, footer, mobile action bar.
   ========================================================================== */

/* ---------- Header ----------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: transform 0.45s var(--ease), background-color 0.45s var(--ease),
              box-shadow 0.45s var(--ease);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  /* z-index -1 keeps this scrim BEHIND the header content. Being positioned
     with no z-index, it painted over the utility strip and knocked the text
     back to roughly 25% white however many times the colour was set. */
  z-index: -1;
  background: linear-gradient(to bottom, rgba(5, 12, 34, 0.92), rgba(5, 12, 34, 0));
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}
.site-header.is-stuck {
  background: rgba(5, 12, 34, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}
.site-header.is-stuck::before { opacity: 0; }
.site-header.is-hidden { transform: translateY(-100%); }

/* Utility strip */
.header-utility {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* Pure white: this strip sits over the video, and the old grey-500 was
     unreadable against the bright frames. */
  color: var(--white);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.header-utility__inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  height: 40px;
  /* The strip is a fixed 40px; wrapping overflowed it into the nav below. */
  white-space: nowrap;
  overflow: hidden;
}
.header-utility__spacer { flex: 1; }
.header-utility__note { color: var(--white); }
.header-utility__link { color: var(--white); transition: color 0.25s var(--ease); }
.header-utility__link:hover { color: var(--blue-400); }
.site-header.is-stuck .header-utility { display: none; }

/* Main bar — an explicit 3-column grid, so the logo, nav and CTA can never
   collide the way they do on the current staging build. */
.header-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  height: var(--header-h);
  transition: height 0.4s var(--ease);
}
.site-header.is-stuck .header-bar { height: 68px; }

/* min-width keeps the auto track from collapsing when the nav gets greedy.
   z-index keeps it above the mobile drawer, which is a sibling inside the
   header's stacking context — without this you cannot see the close button. */
.header-logo { min-width: max-content; position: relative; z-index: 90; }
.header-logo img {
  width: clamp(150px, 12vw, 210px);
  height: auto;
  transition: width 0.4s var(--ease);
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 1.1vw, 1.15rem);
}
.nav-list > li { position: relative; }
.nav-list > li > a,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.6rem 0.25rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-300);
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.nav-list > li > a::after,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: 0.25rem; right: 0.25rem; bottom: 0.35rem;
  height: 1px;
  background: var(--blue-400);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav-list > li > a:hover,
.nav-toggle:hover,
.nav-list > li > a[aria-current="page"] { color: var(--white); }
.nav-list > li > a:hover::after,
.nav-toggle:hover::after,
.nav-list > li:hover .nav-toggle::after { transform: scaleX(1); transform-origin: left; }

.nav-caret {
  width: 0.4em; height: 0.4em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.3s var(--ease);
}
.has-menu:hover .nav-caret,
.nav-toggle[aria-expanded="true"] .nav-caret { transform: translateY(1px) rotate(225deg); }

/* Dropdowns */
.submenu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  translate: -50% 0;
  min-width: 230px;
  padding: 0.75rem;
  background: rgba(11, 26, 72, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              visibility 0.3s var(--ease);
}
.has-menu:hover > .submenu,
.has-menu:focus-within > .submenu,
.nav-toggle[aria-expanded="true"] + .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* Hover bridge so the pointer can cross the gap without closing the menu.
   Excludes .has-mega: that item is position:static, so an ::after here would
   be laid out against .header-bar and sit across the whole width of the bar,
   swallowing clicks. The mega panel opens flush instead, so it needs no gap. */
.has-menu:not(.has-mega)::after {
  content: "";
  position: absolute;
  top: 100%; left: 0;
  width: 100%; height: 0.75rem;
}

.submenu-list a,
.mega-col a {
  display: block;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  color: var(--grey-300);
  border-radius: 2px;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
              padding-left 0.25s var(--ease);
}
.submenu-list a:hover,
.mega-col a:hover {
  background: rgba(42, 39, 233, 0.22);
  color: var(--white);
  padding-left: 1.15rem;
}

/* Mega menu.
   Anchored to .header-bar, not to its own <li>. Anchoring it to the list item
   pushed a ~1080px panel off the left of the screen, because the item sits in
   the middle of the nav. Making .has-mega static hands the containing block to
   .header-bar, so the panel lines up with the page shell and can never
   overflow the viewport. */
.header-bar { position: relative; }
/* Needs to out-specify `.nav-list > li { position: relative }` above. */
.nav-list > li.has-mega { position: static; }

.submenu--mega {
  top: 100%;
  left: 0;
  right: 0;
  width: auto;
  min-width: 0;
  translate: none;
  padding: 2rem clamp(1.5rem, 4vw, 3.25rem);
  /* Near-solid: across this much area the 0.97 alpha used by the small
     dropdowns let the page headline read straight through the panel. */
  background: linear-gradient(rgba(9, 20, 54, 0.99), rgba(6, 14, 38, 0.99));
  border-inline: 0;
  border-radius: 0;
}
.mega {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 1.15fr;
  gap: 1.75rem;
}
.mega-title {
  margin-bottom: 0.6rem;
  padding-left: 0.85rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue-400);
}
.mega-aside {
  padding: 1.4rem;
  background: rgba(42, 39, 233, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}
.mega-aside__eyebrow {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.mega-aside__text {
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

/* Header CTA cluster */
.header-cta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: max-content;
}
.header-phone { display: grid; text-align: right; line-height: 1.15; }
.header-phone__label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-400);
}
.header-phone__number {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.header-phone:hover .header-phone__number { color: var(--blue-400); }

/* Burger */
.burger {
  display: none;
  position: relative;
  z-index: 90; /* must stay clickable above the open drawer */
  width: 46px; height: 46px;
  padding: 12px 10px;
  flex-direction: column;
  justify-content: space-between;
}
.burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Footer ----------------------------------------------------- */
.site-footer {
  background: #010409;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: clamp(3.5rem, 7vw, 6rem);
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.footer-brand img { width: clamp(200px, 18vw, 260px); }
.footer-blurb {
  margin-top: 1.25rem;
  max-width: 34ch;
  color: var(--grey-500);
  font-size: 0.9rem;
}
.footer-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--white);
  margin-bottom: 0.75rem;
}
.footer-title--gap { margin-top: 1.75rem; }
.footer-col ul { display: grid; gap: 0.5rem; }
.footer-col a { color: var(--grey-400); transition: color 0.25s var(--ease); }
.footer-col a:hover { color: var(--blue-400); }

.footer-col--cta { text-align: right; }
.footer-kicker {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--white);
  line-height: 1.2;
}
.footer-recovery {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  margin-bottom: 1.25rem;
}
.footer-phone {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  transition: color 0.25s var(--ease);
}
.footer-phone:hover { color: var(--blue-400); }

.footer-legal {
  padding-block: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 0.75rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--grey-500);
}

/* ---------- Agency credit ---------------------------------------------- */
.footer-credit {
  padding-bottom: 1.75rem;
  font-size: 0.74rem;
  color: var(--grey-500);
}
.footer-credit a {
  color: var(--grey-400);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  padding-bottom: 1px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.footer-credit a:hover {
  color: #fff;
  border-bottom-color: currentColor;
}

/* ---------- Mobile sticky action bar ----------------------------------- */
.mobile-bar {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 90;
  grid-template-columns: 1fr 1fr;
  background: var(--navy-900);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 58px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
}
.mobile-bar svg { width: 1.1em; height: 1.1em; fill: currentColor; }
.mobile-bar__call { background: var(--blue-500); }

/* ==========================================================================
   Responsive
   ========================================================================== */
/* The "Free Case Review" button is the first thing to go — the phone number
   outperforms it for this client anyway, so the phone is what survives. */
@media (max-width: 1560px) {
  .header-cta__btn { display: none; }
}

/* Address is the first thing to drop — the offer and the 24/7 line earn their
   space more than a street address does up here. */
@media (max-width: 960px) {
  .header-utility__inner > .header-utility__link:first-of-type { display: none; }
}

@media (max-width: 1150px) {
  :root { --header-h: 72px; }

  .burger { display: flex; order: 3; }
  .header-bar { grid-template-columns: 1fr auto auto; }
  /* order 2 vs the burger's 3: without this the burger inherits order 0 and
     lands between the logo and the phone number, i.e. mid-bar. */
  .header-cta { order: 2; }
  .header-phone__number { font-size: 1.1rem; }

  .header-nav {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    align-content: start;
    padding: calc(var(--header-h) + 2.5rem) var(--gutter) 3rem;
    background: var(--navy-950);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1.5rem);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
                visibility 0.4s var(--ease);
  }
  .header-nav.is-open { opacity: 1; visibility: visible; transform: none; }

  /* With the drawer open the bar needs its own solid ground to sit on. */
  body.is-locked .site-header { background: var(--navy-950); }
  body.is-locked .site-header::before { opacity: 0; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-list > li { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
  .nav-list > li > a,
  .nav-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 1.15rem 0;
    font-size: 1rem;
  }
  .nav-list > li > a::after, .nav-toggle::after { display: none; }
  .has-menu::after { display: none; }

  /* Accordion instead of hover dropdowns on touch. */
  .submenu, .submenu--mega {
    position: static;
    width: auto;
    translate: none;
    transform: none;
    min-width: 0;
    padding: 0 0 1rem;
    background: none;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    display: none;
  }
  .nav-toggle[aria-expanded="true"] + .submenu { display: block; }
  .has-menu:hover > .submenu { display: none; }
  .nav-toggle[aria-expanded="true"] + .submenu { display: block; }

  .mega { grid-template-columns: 1fr; gap: 1.25rem; }
  .mega-aside { display: none; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col--cta { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 720px) {
  .header-utility { display: none; }
  .header-phone { display: none; }
  .mobile-bar { display: grid; }
  body { padding-bottom: 58px; }

  .footer-grid { grid-template-columns: 1fr; }
}

/* ---- Footer: firm links + service-area strip ---- */
.footer-title a { color: inherit; transition: color 0.25s var(--ease); }
.footer-title a:hover { color: var(--blue-400); }
.footer-firmlinks { display: grid; gap: 0.5rem; margin-top: 1.5rem; }
.footer-firmlinks a { color: var(--grey-400); transition: color 0.25s var(--ease); }
.footer-firmlinks a:hover { color: var(--blue-400); }
.footer-areas {
  padding-block: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  line-height: 2;
  color: var(--grey-500);
}
.footer-areas span {
  margin-right: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
}
.footer-areas a {
  margin-right: 0.9rem;
  color: var(--grey-400);
  transition: color 0.25s var(--ease);
}
.footer-areas a:hover { color: var(--blue-400); }
