/* ==========================================================================
   SpeedX — layout.css
   Announcement bar, site header, navigation, page headers and footer.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Announcement bar
   -------------------------------------------------------------------------- */
.topbar {
  background: var(--navy-900);
  color: var(--on-dark-soft);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 42px;
}

.topbar-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-transform: uppercase;
  font-weight: 500;
}

.topbar-tag .dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(229, 171, 51, 0.16);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar-links a {
  color: var(--on-dark-soft);
  transition: color var(--dur) var(--ease);
}

.topbar-links a:hover {
  color: var(--gold-400);
}

/* --------------------------------------------------------------------------
   2. Site header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

.site-header.is-stuck {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px rgba(11, 22, 38, 0.09);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 82px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.brand img {
  width: 148px;
}

/* Primary navigation ------------------------------------------------------ */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 2.1rem;
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2.1rem;
}

.nav-list > li {
  position: relative;
}

.nav-list a {
  position: relative;
  display: inline-block;
  padding-block: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--dur) var(--ease);
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--gold-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--navy-800);
}

.nav-list a:hover::after,
.nav-list a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
}

/* Mobile toggle ----------------------------------------------------------- */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.nav-toggle span {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: var(--navy-800);
  transition: background 0.2s var(--ease);
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--navy-800);
  transition: transform 0.28s var(--ease);
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.nav-toggle[aria-expanded="true"] span {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   3. Inner page header
   -------------------------------------------------------------------------- */
.page-header {
  position: relative;
  isolation: isolate;
  padding-block: 20px;
  background: var(--navy-900);
  color: var(--on-dark);
  overflow: hidden;
}

.page-header-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.page-header-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}

.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(3, 15, 36, 0.96) 12%, rgba(6, 24, 47, 0.82) 52%, rgba(10, 37, 71, 0.62) 100%);
}

.page-header h1 {
  margin-top: 1.1rem;
  color: var(--white);
}

.page-header p {
  margin-top: 1.15rem;
  max-width: 58ch;
  color: var(--on-dark-soft);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 2.25rem;
  color: var(--on-dark-faint);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumb a {
  color: var(--on-dark-soft);
  transition: color var(--dur) var(--ease);
}

.breadcrumb a:hover {
  color: var(--gold-400);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.55rem;
  color: var(--on-dark-faint);
}

.breadcrumb ol,
.breadcrumb ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

/* --------------------------------------------------------------------------
   4. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  padding-top: 5rem;
  background: var(--navy-900);
  color: var(--on-dark-soft);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 3rem 2.5rem;
  padding-bottom: 3.5rem;
}

.footer-brand img {
  width: 168px;
  margin-bottom: 1.4rem;
  padding: 0.6rem 0.8rem;
  background: var(--white);
  border-radius: var(--radius-sm);
}

.footer-brand p {
  max-width: 34ch;
  color: var(--on-dark-soft);
  line-height: 1.75;
}

.footer-social {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.6rem;
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule-dark);
  border-radius: 50%;
  color: var(--on-dark-soft);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.footer-social a:hover {
  border-color: var(--gold-500);
  color: var(--gold-400);
  transform: translateY(-3px);
}

.footer-social svg {
  width: 17px;
  height: 17px;
}

.footer-col h3 {
  margin-bottom: 1.35rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer-col li + li {
  margin-top: 0.7rem;
}

.footer-col a {
  color: var(--on-dark-soft);
  transition: color var(--dur) var(--ease), padding-left var(--dur) var(--ease);
}

.footer-col a:hover {
  color: var(--gold-400);
  padding-left: 5px;
}

.footer-contact li {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 1.15rem;
}

.footer-contact span {
  color: var(--on-dark-faint);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-contact a,
.footer-contact strong {
  color: var(--on-dark);
  font-weight: 500;
}

.footer-contact a:hover {
  color: var(--gold-400);
}

.footer-disclaimer {
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule-dark);
  color: var(--on-dark-faint);
  font-size: 0.78rem;
  line-height: 1.7;
}

/* .footer-disclaimer p {
  max-width: 100ch;
} */

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--rule-dark);
  color: var(--on-dark-faint);
  font-size: 0.78rem;
}

.footer-bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-bottom a:hover {
  color: var(--gold-400);
}

/* --------------------------------------------------------------------------
   5. Back to top
   -------------------------------------------------------------------------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gold-500);
  color: var(--navy-900);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background var(--dur) var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  background: var(--gold-400);
}

.to-top svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   6. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .nav-list {
    gap: 1.5rem;
  }

  .primary-nav {
    gap: 1.5rem;
  }
}

@media (max-width: 980px) {
  /* The off-canvas panel is a fixed-position child of the header, so the
     header must not become its containing block. `backdrop-filter` (like
     `filter` and `transform`) does exactly that, which would trap the panel
     at the header's own height — so the blur is dropped here.
     A sticky element always forms a stacking context, so the panel can never
     escape the header's; the header therefore sits above the scrim, and the
     top bar joins it so the whole top chrome dims consistently. */
  .topbar,
  .site-header {
    position: relative;
    z-index: 96;
  }

  .site-header {
    position: sticky;
    background: var(--white);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-toggle {
    display: inline-flex;
    /* Above the open panel so the menu can always be closed. */
    position: relative;
    z-index: 3;
  }

  .primary-nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 2;
    width: min(340px, 86vw);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6rem 1.75rem 2rem;
    background: var(--white);
    border-left: 1px solid var(--line);
    box-shadow: -24px 0 60px rgba(11, 22, 38, 0.16);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .primary-nav.is-open {
    transform: none;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list > li + li {
    border-top: 1px solid var(--line-soft);
  }

  .nav-list a {
    display: block;
    padding: 0.95rem 0;
    font-size: 1rem;
  }

  .nav-list a::after {
    display: none;
  }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    margin-top: 1.75rem;
  }

  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 94;
    background: rgba(3, 15, 36, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease);
  }

  .nav-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .topbar-inner {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .masthead {
    min-height: 70px;
  }

  .brand img {
    width: 122px;
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
