/* ============================================================================
   NAVIGATION: header, mobile drawer, footer
   The header and footer are the two slate bands every page shares: the
   header carries the white wordmark, the footer closes the sheet with a
   drawing title block.
   ============================================================================ */

/* --- Header --- */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--slate-800);
  border-bottom: var(--rule-width) solid var(--slate-700);
  transition: box-shadow var(--duration-base) var(--ease), background-color var(--duration-base) var(--ease);
}

/* Once the page has moved: a touch deeper, with a hairline of the accent */
.top-nav--scrolled {
  background: rgba(24, 38, 47, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  box-shadow: 0 1px 0 rgba(62, 132, 197, 0.35), 0 10px 24px -16px rgba(0, 0, 0, 0.6);
}

.top-nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  max-width: 1240px;
  height: var(--nav-height);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.top-nav__logo {
  display: flex;
  align-items: center;
  min-height: 44px;
  flex: none;
}

.top-nav__logo-wide {
  display: none;
  width: auto;
  height: 24px;
}

.top-nav__logo-slim {
  width: 36px;
  height: 36px;
}

.top-nav__links {
  display: none;
  align-items: stretch;
  gap: var(--space-1);
  margin-left: var(--space-4);
  height: 100%;
}

.top-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-3);
  color: var(--slate-200);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  font-stretch: 104%;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease);
}

.top-nav__link:hover {
  color: var(--white);
}

/* Active: a blue bar on the header's bottom edge */
.top-nav__link::after {
  content: "";
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: -1px;
  height: 3px;
  background: var(--blue-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-base) var(--ease), opacity var(--duration-base) var(--ease);
}

.top-nav__link:hover::after {
  transform: scaleX(1);
  opacity: 0.45;
}

.top-nav__link--active {
  color: var(--white);
}

.top-nav__link--active::after,
.top-nav__link--active:hover::after {
  transform: scaleX(1);
  opacity: 1;
}

.top-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
}

.top-nav__phone {
  display: none;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--blue-300);
  text-decoration: none;
  white-space: nowrap;
}

.top-nav__phone:hover {
  color: var(--white);
}

.top-nav__cta {
  display: none;
}

.top-nav__hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 11px;
  border: var(--rule-width) solid var(--rule-on-dark-strong);
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
}

.top-nav__hamburger-bar {
  display: block;
  height: 2px;
  background: var(--white);
}

.top-nav__hamburger-bar:nth-child(2) {
  width: 70%;
}

@media (min-width: 480px) {
  .top-nav__cta {
    display: inline-flex;
  }
}

@media (min-width: 640px) {
  .top-nav__logo-wide {
    display: block;
  }

  .top-nav__logo-slim {
    display: none;
  }
}

@media (min-width: 900px) {
  .top-nav__links {
    display: flex;
  }

  .top-nav__hamburger {
    display: none;
  }
}

@media (min-width: 1160px) {
  .top-nav__phone {
    display: inline-flex;
  }
}

/* --- Mobile drawer --- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(17, 27, 35, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-slow) var(--ease), visibility var(--duration-slow);
}

.drawer-overlay--open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: min(88vw, 380px);
  background: var(--slate-900);
  color: var(--on-dark);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform var(--duration-slow) var(--ease-out);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer--open {
  transform: none;
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--nav-height);
  padding: 0 var(--space-5);
  border-bottom: var(--rule-width) solid var(--rule-on-dark);
}

.drawer__logo {
  width: auto;
  height: 20px;
}

.drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: var(--rule-width) solid var(--rule-on-dark-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.drawer__links {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-5);
}

.drawer__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  border-bottom: var(--rule-width) solid var(--rule-on-dark);
  color: var(--white);
  font-size: var(--text-xl);
  font-weight: var(--font-heavy);
  font-stretch: var(--stretch-heading);
  text-decoration: none;
}

.drawer__link--sub {
  min-height: 44px;
  padding-left: var(--space-2);
  border-bottom-style: dashed;
  color: var(--slate-200);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  font-stretch: 100%;
}

.drawer__index {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--blue-300);
}

.drawer__link--active,
.drawer__link:hover {
  color: var(--blue-300);
}

.drawer__footer {
  display: grid;
  gap: var(--space-3);
  margin-top: auto;
  padding: var(--space-5);
  border-top: var(--rule-width) solid var(--rule-on-dark);
}

.drawer__email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--blue-300);
  overflow-wrap: anywhere;
}

/* --- Footer --- */

.footer {
  flex: none;
  padding: clamp(56px, 7vw, 96px) 0 var(--space-8);
  background: var(--slate-900);
  color: var(--on-dark);
  border-top: 4px solid var(--blue-500);
}

.footer__grid {
  display: grid;
  gap: var(--space-10);
  grid-template-columns: 1fr;
}

.footer__logo {
  width: auto;
  height: 28px;
}

.footer__tagline {
  margin-top: var(--space-5);
  font-size: var(--text-xl);
  font-weight: var(--font-heavy);
  font-stretch: var(--stretch-display);
  color: var(--white);
}

.footer__note {
  margin-top: var(--space-3);
  max-width: 36ch;
  font-size: var(--text-sm);
  color: var(--on-dark-muted);
}

.footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.footer__heading {
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  font-stretch: 100%;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-300);
}

.footer__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--slate-100);
  font-size: var(--text-sm);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.footer__link:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer__link--strong {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  color: var(--white);
}

.footer__cta {
  margin-top: var(--space-4);
}

@media (min-width: 640px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1.6fr 1fr 1fr 1.1fr;
  }

  .footer__brand {
    grid-column: auto;
  }
}

/* Title block: label/value cells ruled like the corner of a drawing */
.title-block {
  display: grid;
  grid-template-columns: 1fr;
  margin: clamp(48px, 6vw, 72px) 0 0;
  border: var(--rule-width) solid var(--rule-on-dark-strong);
}

.title-block__cell {
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--rule-width) solid var(--rule-on-dark-strong);
}

.title-block__cell:last-child {
  border-bottom: 0;
}

.title-block__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}

.title-block__value {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--white);
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .title-block {
    grid-template-columns: 1fr 1fr;
  }

  .title-block__cell:nth-child(odd) {
    border-right: var(--rule-width) solid var(--rule-on-dark-strong);
  }

  .title-block__cell:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (min-width: 1024px) {
  .title-block {
    grid-template-columns: 2fr 2fr 1.4fr 0.6fr;
  }

  .title-block__cell {
    border-right: var(--rule-width) solid var(--rule-on-dark-strong);
    border-bottom: 0;
  }

  .title-block__cell:last-child {
    border-right: 0;
  }
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-6);
  margin-top: var(--space-3);
}

.footer__legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
}

.footer__legal {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--on-dark-muted);
}

/* Error pages: one line, no title block */
.footer--minimal {
  padding: var(--space-6) 0;
}

.footer__minimal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer--minimal .footer__legal {
  margin: 0;
}

.footer__legal-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-xs);
  color: var(--blue-300);
}
