/* ---------- main header ----------
   Always visible from first paint, never hides on scroll (the owner
   explicitly dislikes a header that disappears). Default markup state
   (no JS needed) = the "over hero" look: solid dark bar, light text --
   correct the instant the page paints, since the page always opens on
   the hero. JS adds .is-scrolled once the hero has scrolled past, which
   swaps to a solid white bar with a hairline border. */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-inline: clamp(20px, 4vw, 64px);
  height: var(--header-height);
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-ui), border-color var(--dur-fast) var(--ease-ui), color var(--dur-fast) var(--ease-ui);
  color: #fff;
}

@media (max-width: 640px) {
  .topbar {
    height: var(--header-height-mobile);
  }
}

.topbar.is-scrolled {
  background: var(--role-bg);
  border-bottom-color: var(--role-line);
  color: var(--role-text);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.topbar__mark {
  height: 44px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  transition: filter var(--dur-fast) var(--ease-ui);
}

@media (max-width: 640px) {
  .topbar__mark { height: 34px; }
}

.topbar.is-scrolled .topbar__mark {
  filter: none;
}

.topbar .wordmark {
  color: inherit;
}

@media (max-width: 560px) {
  .topbar .wordmark { display: none; }
}

/* ---------- nav ---------- */

.topbar__nav {
  display: none;
  align-items: center;
  gap: 36px;
}

@media (min-width: 1180px) {
  .topbar__nav {
    display: flex;
  }
}

.topbar__link {
  position: relative;
  font-family: var(--heading);
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: inherit;
  text-decoration: none;
  padding-block: 6px;
}

.topbar__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transition: right var(--dur-fast) var(--ease-ui);
}

.topbar__link:hover::after,
.topbar__link.is-current::after {
  right: 0;
}

/* ---------- area text (desktop only -- also shown in the mobile menu) ---------- */

.topbar__area {
  display: none;
  font-family: var(--heading);
  font-size: 16px;
  letter-spacing: 0.03em;
  color: inherit;
  opacity: 0.8;
  white-space: nowrap;
}

@media (min-width: 1180px) {
  .topbar__area { display: inline; }
}

/* ---------- click-to-call: the owner's main non-form lead capture, so it
   is a real button, always visible, on every viewport ---------- */

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--heading);
  font-weight: 700;
  font-size: clamp(16px, 4vw, 19px);
  color: inherit;
  text-decoration: none;
  border: 1.5px solid currentColor;
  border-radius: var(--radius);
  padding: 8px 14px;
  transition: background var(--dur-fast) var(--ease-ui), color var(--dur-fast) var(--ease-ui), transform var(--dur-fast) var(--ease-ui);
  white-space: nowrap;
}

.topbar__call:hover {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--ink);
}

.topbar__call:active {
  transform: scale(0.97);
}

.topbar__call-icon { font-size: 0.9em; }

@media (max-width: 380px) {
  .topbar__call { padding: 7px 10px; gap: 5px; }
}

/* ---------- scroll progress line ---------- */

.topbar__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0%;
  background: var(--sage);
  transition: width 80ms linear;
}

/* ---------- header CTA button lives in buttons.css (.btn--primary) but the
   corner-bracket step is header-specific ---------- */

.topbar__cta.bracket-frame::before,
.topbar__cta.bracket-frame::after {
  width: 12px;
  height: 12px;
}

/* the mobile menu + sticky bar already carry their own prominent
   "Get a Quote" button, so the header's own CTA button is desktop-only --
   the call button above stays visible at every width instead */
.topbar__cta {
  display: none;
}

@media (min-width: 1180px) {
  .topbar__cta {
    display: inline-flex;
  }
}

/* ---------- mobile menu button (call lives in .topbar__actions at every width) ---------- */

@media (min-width: 1180px) {
  .topbar__menu-btn {
    display: none;
  }
}

.topbar__icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.topbar__menu-btn {
  flex-direction: column;
  gap: 4px;
}

.topbar__menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform var(--dur-fast) var(--ease-ui), opacity var(--dur-fast) var(--ease-ui);
}

.mobile-menu.is-open ~ .topbar .topbar__menu-btn span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu.is-open ~ .topbar .topbar__menu-btn span:nth-child(2) {
  opacity: 0;
}

.mobile-menu.is-open ~ .topbar .topbar__menu-btn span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- full-screen mobile menu ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--charcoal);
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform var(--dur-base) var(--ease-ui);
}

.mobile-menu.is-open {
  transform: translateY(0);
}

.mobile-menu__grid {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(88px, 14vh, 140px) clamp(24px, 6vw, 64px) clamp(32px, 6vh, 64px);
}

@media (min-width: 768px) {
  .mobile-menu__grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: stretch;
    padding: 0;
  }
}

.mobile-menu__col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
}

@media (min-width: 768px) {
  .mobile-menu__col {
    padding: clamp(64px, 10vw, 120px) clamp(32px, 5vw, 72px);
  }
}

/* ---------- nav links: full-width bordered rows, fill-sweep hover/focus
   matching the Call button's treatment, staggered entrance ---------- */

.mobile-menu__nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-menu__nav li {
  opacity: 0;
  transform: translateY(16px);
}

.mobile-menu.is-open .mobile-menu__nav li {
  animation: mobileMenuLinkIn var(--dur-base) var(--ease-reveal) forwards;
}

.mobile-menu.is-open .mobile-menu__nav li:nth-child(1) { animation-delay: 60ms; }
.mobile-menu.is-open .mobile-menu__nav li:nth-child(2) { animation-delay: 120ms; }
.mobile-menu.is-open .mobile-menu__nav li:nth-child(3) { animation-delay: 180ms; }
.mobile-menu.is-open .mobile-menu__nav li:nth-child(4) { animation-delay: 240ms; }

@keyframes mobileMenuLinkIn {
  to { opacity: 1; transform: translateY(0); }
}

.mobile-menu__nav a {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  font-family: var(--heading);
  font-weight: 700;
  font-size: clamp(20px, 4vw, 26px);
  color: #fff;
  text-decoration: none;
  border: 1.5px solid var(--sage);
  border-radius: var(--radius);
  padding: 18px 24px;
  transition: color var(--dur-fast) var(--ease-ui);
}

.mobile-menu__nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sage);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-ui);
  z-index: -1;
}

.mobile-menu__nav a:hover,
.mobile-menu__nav a:focus-visible {
  color: var(--ink);
}

.mobile-menu__nav a:hover::before,
.mobile-menu__nav a:focus-visible::before {
  transform: scaleX(1);
}

.mobile-menu__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 320px;
}

/* ---------- right-column photo panel (>=768px): crossfades to the
   hovered/focused link's photo; hidden below 768px ---------- */

.mobile-menu__photo {
  display: none;
  position: relative;
  overflow: hidden;
  background: var(--ink);
}

@media (min-width: 768px) {
  .mobile-menu__photo { display: block; }
}

.mobile-menu__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-ui);
}

.mobile-menu__photo img.is-visible { opacity: 1; }

.mobile-menu__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 18, 15, 0.55), rgba(20, 18, 15, 0.1));
}

/* ---------- sticky mobile bottom bar ---------- */

.mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  gap: 1px;
  background: var(--role-line);
  transform: translateY(100%);
  transition: transform var(--dur-base) var(--ease-ui);
}

@media (min-width: 1180px) {
  .mobile-bar {
    display: none;
  }
}

.mobile-bar.is-visible {
  transform: translateY(0);
}

.mobile-bar a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-block: 16px;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.mobile-bar__call {
  background: var(--role-bg);
  color: var(--role-text);
}

.mobile-bar__quote {
  background: var(--charcoal);
  color: #fff;
}
