:root {
  --soft: #6e6e73;
  --display: Outfit, Inter, system-ui, sans-serif;
  --site-content-width: min(960px, calc(100% - 32px));
}

.top-bar {
  position: sticky;
  top: 8px;
  z-index: 200;
  display: flex;
  justify-content: center;
  width: 100%;
  align-self: stretch;
  padding: 2px 24px 0;
  isolation: isolate;
}

.top-bar::before {
  content: "";
  position: absolute;
  top: -8px;
  bottom: -10px;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background: transparent;
  transition: background-color 0.22s ease, box-shadow 0.22s ease;
}

.top-bar.is-compact::before {
  background: rgba(250, 251, 252, 0.97);
  box-shadow: 0 1px 0 rgba(52, 58, 64, 0.06);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.top-bar__pill {
  pointer-events: auto;
  width: 100%;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 16px 24px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(52, 58, 64, 0.14);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: relative;
  z-index: 1;
  overflow: hidden;
  isolation: isolate;
  --blob-x: 50%;
  --blob-y: 50%;
  transition: width 0.28s ease, max-width 0.28s ease, padding 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, border-color 0.22s ease;
}

.top-bar__pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  background-image:
    linear-gradient(165deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.12) 55%, rgba(240, 245, 255, 0.08) 100%),
    radial-gradient(circle at var(--blob-x, 50%) var(--blob-y, 50%), rgba(255, 255, 255, 0.85) 0%, rgba(170, 200, 255, 0.55) 14%, rgba(0, 102, 180, 0.32) 30%, rgba(0, 66, 136, 0.12) 48%, transparent 62%),
    radial-gradient(circle at 78% 22%, rgba(11, 195, 65, 0.2) 0%, transparent 52%),
    radial-gradient(circle at 18% 78%, rgba(100, 160, 255, 0.38) 0%, transparent 55%),
    radial-gradient(circle at 52% 58%, rgba(0, 66, 136, 0.22) 0%, transparent 58%);
  background-size: 100% 100%, 100% 100%, 175% 175%, 165% 165%, 190% 190%;
  background-position: center, center, 0% 0%, 100% 100%, 50% 50%;
  background-repeat: no-repeat;
}

.top-bar__pill:hover::before {
  opacity: 1;
  animation: mortgageHeaderMeshDrift 8s ease-in-out infinite;
}

.top-bar__brand,
.top-bar__menu-toggle,
.top-bar__links {
  position: relative;
  z-index: 1;
}

.top-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 26px;
  line-height: 1.15;
  min-width: 0;
}

.top-bar__brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar__mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.top-bar__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: flex-end;
}

.top-bar__links a {
  display: block;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--soft);
  text-decoration: none;
}

.top-bar__links a[aria-current="page"] {
  color: var(--ink);
  font-weight: 800;
  background: transparent;
}

.top-bar__links a:hover { color: var(--ink); }

.top-bar.is-compact {
  width: var(--site-content-width);
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
  align-self: center;
}

.top-bar.is-compact .top-bar__pill {
  width: 100%;
  max-width: none;
  padding: 8px 16px 8px 18px;
  background: #F8F9FA;
  border-color: rgba(52, 58, 64, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.top-bar.is-compact .top-bar__brand { font-size: 20px; gap: 0.5rem; }
.top-bar.is-compact .top-bar__mark { width: 32px; height: 32px; }
.top-bar.is-compact .top-bar__links a { padding: 6px 12px; font-size: 0.95rem; }

@keyframes mortgageHeaderMeshDrift {
  0%, 100% { background-position: center, center, 0% 20%, 100% 80%, 48% 52%; }
  50% { background-position: center, center, 100% 60%, 0% 40%, 58% 42%; }
}

@media (max-width: 720px) {
  .top-bar { padding: 2px 12px 0; top: 4px; }
  .top-bar::before { top: -4px; bottom: -8px; }
  .top-bar__pill { padding: 12px 14px 12px 16px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .top-bar__pill:hover::before { animation: none; }
}

/* State-page cleanup: keep one mortgage header and remove boxed framing. */
.top-bar::before,
.top-bar.is-compact::before {
  display: none;
}

.top-bar__pill,
.top-bar.is-compact .top-bar__pill {
  border: 0;
  box-shadow: none;
}

.page-shell .hero {
  background: transparent;
}

/* Texas page: one authoritative dark surface from hero through ticker. */
body.texas-guide {
  min-height: 100vh;
  color: #fff;
  background: #081028 !important;
}

body.texas-guide .page-shell,
body.texas-guide .program-marquee {
  background: #081028 !important;
}

/* Header has no independent fill: it inherits/blends with whatever is behind it. */
body.texas-guide .top-bar,
body.texas-guide .top-bar.is-compact {
  background: transparent !important;
}

body.texas-guide .page-shell {
  width: min(1120px, calc(100% - 40px));
}

body.texas-guide .top-bar__pill,
body.texas-guide .top-bar.is-compact .top-bar__pill {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.texas-guide .top-bar__brand,
body.texas-guide .top-bar__links a {
  color: rgba(255,255,255,.72) !important;
  transition: color .22s ease, background-color .22s ease, text-shadow .22s ease;
}

body.texas-guide .top-bar__brand {
  color: rgba(255,255,255,.9) !important;
}

body.texas-guide .top-bar__mark {
  filter: brightness(0) invert(1);
  opacity: .92;
}

body.texas-guide .top-bar__links a[aria-current="page"] {
  color: rgba(255,255,255,.94) !important;
  background: transparent !important;
}

body.texas-guide .top-bar__menu-toggle {
  color: rgba(255,255,255,.86) !important;
}

body.texas-guide .top-bar__brand:hover,
body.texas-guide .top-bar__links a:hover,
body.texas-guide .top-bar__menu-toggle:hover {
  color: #fff !important;
  background: rgba(255,255,255,.07) !important;
  text-shadow: 0 0 18px rgba(255,255,255,.22);
}

body.texas-guide .program-marquee {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  border: 0 !important;
  color: rgba(255,255,255,.78) !important;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%) !important;
  mask-image: linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%) !important;
}

body.texas-guide .program-marquee__track {
  display: flex;
  width: max-content;
  animation: program-scroll 30s linear infinite !important;
  will-change: transform;
}

body.texas-guide .program-marquee__group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 56px !important;
}

body.texas-guide .program-marquee__item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 0 1.9rem !important;
  font-family: Outfit, Inter, system-ui, sans-serif;
  font-size: .84rem !important;
  font-weight: 600 !important;
  letter-spacing: .1em !important;
  text-transform: uppercase;
}

body.texas-guide .program-marquee__item::after {
  content: "•";
  margin-left: 3.8rem !important;
  opacity: .55;
}

@media (max-width: 720px) {
  body.texas-guide {
    --tx-mobile-marquee: 50px;
    --tx-mobile-peek: 52px;
    --tx-mobile-header: 56px;
    --tx-mobile-apply: 56px;
  }

  body.texas-guide .page-shell {
    width: min(100% - 24px, 1120px);
    background: transparent !important;
  }

  body.texas-guide .top-bar {
    background: transparent !important;
  }

  body.texas-guide .program-marquee {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 9%, #000 91%, transparent 100%) !important;
    mask-image: linear-gradient(to right, transparent 0%, #000 9%, #000 91%, transparent 100%) !important;
  }

  body.texas-guide .program-marquee__group {
    min-height: 50px !important;
  }

  body.texas-guide .program-marquee__item {
    font-size: .76rem !important;
    padding-inline: 1.2rem !important;
  }

  body.texas-guide .program-marquee__item::after {
    margin-left: 2.5rem !important;
  }
}