/* ==========================================================================
   BNA Portal — Layout chrome
   Announcement, header, navigation, footer, floating UI
   ========================================================================== */

/* --------------------------------------------------------------------------
   Scroll progress
   -------------------------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 3px;
  background: transparent;
  pointer-events: none;
}

.scroll-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--lime-500), var(--leaf-500), var(--terra-500));
  box-shadow: 0 0 14px rgba(255, 101, 74, 0.7);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* --------------------------------------------------------------------------
   Announcement
   -------------------------------------------------------------------------- */

.announce {
  position: relative;
  z-index: 60;
  padding: 8px 0;
  background: var(--ink-950);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11.5px;
}

.announce__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.announce__left,
.announce__right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.announce__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--lime-500);
  color: var(--ink-950);
  font-weight: 700;
  white-space: nowrap;
}

.announce__badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-950);
  animation: pulseDot 2.4s ease-in-out infinite;
}

.announce__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announce__text strong {
  color: var(--white);
  font-weight: 600;
}

.announce__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.announce__link:hover {
  color: var(--lime-400);
}

.announce__link .icon {
  width: 14px;
  height: 14px;
  color: var(--lime-400);
}

.announce__divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.16);
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-pill);
  color: rgba(255, 255, 255, 0.72);
  font-size: 10.5px;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.sound-toggle:hover {
  border-color: rgba(255, 101, 74, 0.5);
  color: var(--white);
}

.sound-toggle[aria-pressed="false"] {
  opacity: 0.6;
}

.sound-toggle .icon {
  width: 13px;
  height: 13px;
  color: var(--lime-400);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  border-bottom: 1px solid transparent;
  background: rgba(252, 250, 244, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(252, 250, 244, 0.95);
  box-shadow: 0 18px 40px -36px rgba(23, 15, 38, 0.5);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  transition: height 0.3s var(--ease-out);
}

.site-header.is-scrolled .header__inner {
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  flex: 0 0 auto;
}

.brand__logo {
  width: 148px;
  height: auto;
  opacity: 1;
  filter: drop-shadow(0 7px 14px rgba(23, 15, 38, 0.12));
  animation: brandLogoIn 0.85s 0.12s var(--ease-out);
  transition: transform 0.35s var(--ease-spring);
}

@keyframes brandLogoIn {
  0% {
    opacity: 0;
    transform: translateX(-9px) scale(0.97);
    filter: blur(3px) drop-shadow(0 7px 14px rgba(23, 15, 38, 0.12));
  }
  60% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 8px 16px rgba(23, 15, 38, 0.16));
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0) drop-shadow(0 7px 14px rgba(23, 15, 38, 0.12));
  }
}

.brand:hover .brand__logo {
  transform: translateY(-1px) scale(1.015);
}

.brand__text {
  display: none;
}

.brand__name {
  display: block;
  color: var(--forest-900);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.2;
}

.brand__sub {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-family: var(--font-latin);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--lime-500);
  transform: translateX(-50%);
  transition: width 0.25s var(--ease-out);
}

.main-nav a:hover {
  color: var(--forest-900);
  background: rgba(47, 35, 75, 0.045);
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  width: 18px;
}

.main-nav a.is-active {
  color: var(--forest-900);
}

.main-nav a.nav-highlight {
  color: var(--forest-900);
  background: var(--lime-100);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.header__apply {
  display: inline-flex;
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--forest-900);
  background: var(--paper);
}

.menu-toggle .icon {
  width: 21px;
  height: 21px;
}

.menu-toggle[aria-expanded="true"] .icon--menu {
  display: none;
}

.menu-toggle .icon--close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon--close {
  display: block;
}

/* Mobile drawer */
.mobile-drawer {
  display: none;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: rgba(252, 250, 244, 0.98);
  backdrop-filter: blur(18px);
}

.mobile-drawer__inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  padding: 18px 0 26px;
  overscroll-behavior: contain;
}

.mobile-drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.mobile-drawer a:hover {
  background: var(--bone);
}

.mobile-drawer a .icon {
  width: 16px;
  height: 16px;
  color: var(--muted-2);
}

.mobile-drawer .btn {
  margin-top: 12px;
  justify-content: center;
}

.mobile-drawer__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bone);
  color: var(--muted);
  font-size: 12px;
}

.mobile-drawer__meta .icon {
  width: 16px;
  height: 16px;
  color: var(--leaf-500);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  position: relative;
  overflow: hidden;
  padding-top: clamp(4rem, 7vw, 6rem);
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 101, 74, 0.12), transparent 34%),
    linear-gradient(160deg, var(--forest-900), var(--ink-950) 62%);
  color: rgba(255, 255, 255, 0.58);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--lime-500), transparent);
  background-size: 200% 100%;
  animation: progressStripe 9s linear infinite;
}

.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) repeat(3, minmax(0, 0.8fr));
  gap: clamp(2rem, 5vw, 4.5rem);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.footer__logo-chip {
  display: inline-flex;
  align-items: center;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--paper);
}

.footer__logo-chip img {
  width: 156px;
  height: auto;
}

.footer__desc {
  max-width: 35ch;
  font-size: 12.5px;
  line-height: 1.8;
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12px;
}

.footer__contact a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.2s ease;
}

.footer__contact a:hover {
  color: var(--lime-400);
}

.footer__contact .icon {
  width: 15px;
  height: 15px;
  color: var(--lime-500);
}

.footer__col h3 {
  margin-bottom: 18px;
  color: var(--white);
  font-family: var(--font-latin);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.58);
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.footer__links a:hover {
  color: var(--lime-400);
  transform: translateX(3px);
}

.footer__socials {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.footer__social {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.72);
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.footer__social:hover {
  border-color: var(--lime-500);
  background: var(--lime-500);
  color: var(--ink-950);
}

.footer__social .icon {
  width: 15px;
  height: 15px;
}

.footer__hotline {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.footer__hotline span {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-latin);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer__hotline a {
  color: var(--lime-400);
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.03em;
}

.footer__hotline small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

.footer__giant {
  margin: clamp(2rem, 6vw, 4.5rem) 0 0;
  color: transparent;
  font-family: var(--font-latin);
  font-size: clamp(3.2rem, 12vw, 10rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.07em;
  opacity: 0.38;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.16);
  user-select: none;
  pointer-events: none;
}

.footer__omr {
  width: 100%;
  height: 48px;
  margin-top: 18px;
  opacity: 0.62;
  object-fit: cover;
  object-position: center;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 20px 0 calc(22px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

.footer__bottom-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer__bottom a:hover {
  color: var(--lime-400);
}

/* --------------------------------------------------------------------------
   Back to top
   -------------------------------------------------------------------------- */

.to-top {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 55;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--forest-900);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.84);
  transition:
    opacity 0.3s ease,
    transform 0.4s var(--ease-spring);
}

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

.to-top:hover {
  transform: translateY(-3px);
}

.to-top__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.to-top__ring circle {
  fill: none;
  stroke-width: 2.5;
}

.to-top__ring .track {
  stroke: var(--line);
}

.to-top__ring .progress {
  stroke: var(--lime-500);
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 138.23;
}

.to-top .icon {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Mobile dock
   -------------------------------------------------------------------------- */

.mobile-dock {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 58;
  display: none;
  width: min(calc(100% - 20px), 460px);
  padding: 7px;
  border: 1px solid rgba(47, 35, 75, 0.1);
  border-radius: 22px;
  background: rgba(252, 250, 244, 0.94);
  box-shadow: 0 18px 45px -18px rgba(23, 15, 38, 0.4);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.mobile-dock__inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}

.mobile-dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.mobile-dock a .icon {
  width: 19px;
  height: 19px;
}

.mobile-dock a.is-active,
.mobile-dock a:hover {
  background: var(--lime-100);
  color: var(--forest-900);
}

.mobile-dock a.dock-cta {
  background: var(--forest-900);
  color: var(--white);
}

.mobile-dock a.dock-cta:hover {
  background: var(--forest-800);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   Responsive chrome
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .main-nav a {
    padding-inline: 8px;
    font-size: 12px;
  }

  .brand__logo {
    width: 136px;
  }
}

@media (max-width: 1080px) {
  .main-nav,
  .header__apply {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  .mobile-drawer.is-open {
    display: block;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 68px;
  }

  .announce__text {
    display: none;
  }

  .announce__divider {
    display: none;
  }

  .announce__right .sound-label {
    display: none;
  }

  .header__inner {
    gap: 12px;
  }

  .brand__logo {
    width: 128px;
  }

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

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

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .mobile-dock {
    display: block;
  }

  .to-top {
    right: 14px;
    bottom: 92px;
    width: 44px;
    height: 44px;
  }

  body {
    padding-bottom: 76px;
  }
}

@media (max-width: 520px) {
  .brand__logo {
    width: 118px;
  }

  .header__inner {
    height: 64px;
  }

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

  .footer__bottom-links {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .announce {
    font-size: 10.5px;
  }

  .announce__badge {
    padding: 3px 8px;
    font-size: 10px;
  }

  .announce__link {
    font-size: 10px;
  }
}

/* Print */
@media print {
  .announce,
  .site-header,
  .mobile-dock,
  .to-top,
  .toast,
  .modal__head,
  .modal__actions,
  .no-print {
    display: none !important;
  }

  main,
  .site-footer,
  .skip-link {
    display: none !important;
  }

  html,
  body,
  body.is-locked {
    height: auto;
    overflow: visible !important;
    padding-bottom: 0;
    background: #fff;
  }

  .modal__body {
    overflow: visible;
  }

  .modal {
    position: static;
    padding: 0;
    background: #fff;
    opacity: 1;
    visibility: visible;
  }

  .modal__dialog {
    width: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .slip {
    border: 2px dashed #94a3b8;
  }
}
