/* ==================================================
   NAVIGATION — MEGA MENU
   Design system: Inter · #f5f5f3 bg · #111111 text
   #0d4fc9 blue · rgba(0,0,0,0.06) border
================================================== */


/* ==================================================
   HEADER
================================================== */

.header {
  height: 72px;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  padding: 0 48px;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  z-index: 200;

  background: rgba(245,245,243,0.85);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);

  border-bottom: 1px solid rgba(0,0,0,0.06);

  transform: translateY(0);
  transition:
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.3s ease,
    backdrop-filter 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* Scrolled state — glass kicks in */
.header.is-scrolled {
  background: rgba(245,245,243,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: rgba(0,0,0,0.08);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 4px 24px rgba(0,0,0,0.04);
}

/* Hidden — scrolling up (away from top) */
.header.is-hidden {
  transform: translateY(-100%);
}

/* Mega panel open — no bottom border (panel attaches) */
.header.mega-open {
  border-bottom-color: transparent;
}


/* ==================================================
   LOGO
================================================== */

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.75;
}

/* RM badge — matches existing preloader mark style */
.logo__mark {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 32px;
  height: 32px;

  background: #111111;
  color: #ffffff;

  border-radius: 8px;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;

  flex-shrink: 0;
}

.logo__text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary, #0f0f0f);
}


/* ==================================================
   NAV — desktop wrapper
   Centred between logo and CTA
================================================== */

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  /* Sits in grid col-2 (auto width) — centred by the 1fr|auto|1fr grid */
}


/* ==================================================
   NAV ITEM
================================================== */

.nav-item {
  position: static;
}


/* ==================================================
   NAV TRIGGER — mega menu buttons
================================================== */

.nav-trigger {
  display: flex;
  align-items: center;
  gap: 4px;

  padding: 7px 13px;

  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 400;

  color: #333;

  background: none;
  border: none;
  border-radius: 8px;

  cursor: pointer;
  line-height: 1;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.nav-trigger:hover,
.nav-trigger[aria-expanded="true"] {
  background: rgba(0,0,0,0.05);
  color: var(--text-primary, #0f0f0f);
}


/* ==================================================
   CHEVRON
================================================== */

.nav-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.38;
  flex-shrink: 0;
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    opacity   0.2s ease;
}

.nav-trigger[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
  opacity: 0.65;
}


/* ==================================================
   NAV SIMPLE LINK
================================================== */

.nav-link {
  position: relative;
  display: flex;
  align-items: center;

  padding: 7px 13px;

  font-size: 14px;
  font-weight: 400;

  color: #333;
  text-decoration: none;
  border-radius: 8px;
  line-height: 1;

  transition:
    background 0.15s ease,
    color      0.15s ease;
}

.nav-link:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-primary, #0f0f0f);
}

.nav-link.active {
  color: var(--blue, #1a46c9);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 13px;
  bottom: 1px;
  width: calc(100% - 26px);
  height: 1.5px;
  background: var(--blue, #1a46c9);
}

/* Active trigger (mega menu items) */
.nav-trigger.active {
  color: var(--blue, #1a46c9);
}


/* ==================================================
   CONNECT — right-anchored CTA
   Matches existing design system pill button
================================================== */

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

.nav-connect {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 9px 22px;

  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;

  color: #ffffff;
  background: var(--blue, #1a46c9);

  border: 1.5px solid var(--blue, #1a46c9);
  border-radius: 999px;

  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;

  letter-spacing: -0.01em;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.nav-connect:hover {
  background: transparent;
  color: var(--blue, #1a46c9);
}


/* ==================================================
   HAMBURGER — mobile only, hidden on desktop
================================================== */

.nav-hamburger {
  display: none;

  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;

  width: 40px;
  height: 40px;
  padding: 8px;

  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;

  transition: background 0.15s ease;
}

.nav-hamburger:hover {
  background: rgba(0,0,0,0.05);
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #111;
  border-radius: 2px;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    opacity   0.25s ease,
    width     0.25s ease;
  transform-origin: center;
}

/* Middle line shorter for aesthetic */
.nav-hamburger span:nth-child(2) {
  width: 16px;
}

/* Open state — X */
.nav-hamburger.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
  width: 22px;
}

.nav-hamburger.is-open span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.nav-hamburger.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
  width: 22px;
}


/* ==================================================
   MEGA BACKDROP
================================================== */

.mega-backdrop {
  position: fixed;
  inset: 0;
  top: 72px;
  z-index: 190;
  background: rgba(0,0,0,0.10);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mega-backdrop.is-visible {
  opacity: 1;
  pointer-events: all;
}


/* ==================================================
   MEGA MENU
================================================== */

.mega-menu {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  z-index: 195;

  background: #f5f5f3;
  border-bottom: 1px solid rgba(0,0,0,0.08);

  box-shadow:
    0 20px 60px rgba(0,0,0,0.07),
    0 6px 16px rgba(0,0,0,0.04);

  display: none;
  opacity: 0;
  transform: translateY(-8px);
}

.mega-menu.is-open {
  display: block;
  animation: megaIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes megaIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ==================================================
   MEGA PANEL
================================================== */

.mega-panel {
  display: none;
}

.mega-panel.is-active {
  display: block;
}


/* ==================================================
   MEGA INNER GRID
================================================== */

.mega-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 48px 44px;
  display: grid;
  gap: 0;
}

.mega-inner--work  { grid-template-columns: 220px 1fr 1fr; gap: 0 48px; }
.mega-inner--notes { grid-template-columns: 220px 1fr 1fr; gap: 0 48px; }
.mega-inner--lab   { grid-template-columns: 220px 1fr;     gap: 0 48px; }


/* ==================================================
   MEGA INTRO COL
================================================== */

.mega-intro {
  padding-right: 48px;
  border-right: 1px solid rgba(0,0,0,0.06);
}

.mega-intro-kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--blue, #1a46c9);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mega-intro-kicker::before {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--blue, #1a46c9);
  flex-shrink: 0;
}

.mega-intro h3 {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 1.15;
  color: var(--text-primary, #0f0f0f);
  margin-bottom: 12px;
  max-width: 9ch;
}

.mega-intro p {
  font-size: 14px;
  line-height: 1.65;
  color: #666;
  margin-bottom: 24px;
}

.mega-intro-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue, #1a46c9);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.mega-intro-cta:hover { opacity: 0.65; }


/* ==================================================
   MEGA COLUMNS
================================================== */

.mega-col { min-width: 0; }

.mega-col + .mega-col {
  border-left: 1px solid rgba(0,0,0,0.06);
  padding-left: 48px;
}

.mega-col-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  color: #999;
  text-transform: uppercase;
  margin-bottom: 20px;
}


/* ==================================================
   MEGA LINKS
================================================== */

.mega-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mega-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.mega-link:hover { background: rgba(13,79,201,0.05); }
.mega-link:hover .mega-link-title { color: var(--blue, #1a46c9); }

.mega-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 1px;
}

.mega-link-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #0f0f0f);
  margin-bottom: 2px;
  line-height: 1.3;
  transition: color 0.15s ease;
}

.mega-link-desc {
  display: block;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
}

.mega-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 16px 12px;
}


/* ==================================================
   MEGA FEATURED CARD
================================================== */

.mega-featured {
  margin: 4px 0;
  padding: 16px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
}

.mega-featured-tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue, #1a46c9);
  margin-bottom: 8px;
}

.mega-featured h4 {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text-primary, #0f0f0f);
  line-height: 1.3;
  margin-bottom: 6px;
}

.mega-featured p {
  font-size: 12px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
}

.mega-featured-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue, #1a46c9);
  background: rgba(13,79,201,0.07);
  border: 1px solid #b6c5ee;
  padding: 4px 10px;
  border-radius: 999px;
}


/* ==================================================
   MEGA FOOTER
================================================== */

.mega-footer {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 16px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245,245,243,0.94);
}

.mega-footer-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.mega-footer-link {
  font-size: 13px;
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

.mega-footer-link:hover { color: var(--text-primary, #0f0f0f); }

.mega-footer-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
}

.avail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: avail-pulse 2.4s ease-in-out infinite;
}

@keyframes avail-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}


/* ==================================================
   MOBILE DRAWER
   Elegant full-height panel from right
================================================== */

.mobile-drawer {
  display: none;

  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 100vw);

  z-index: 210;

  background: #f9f9f7;

  overflow-y: auto;
  overscroll-behavior: contain;

  /* Sections layout */
  padding: 0;
}

.mobile-drawer.is-open {
  display: flex;
  flex-direction: column;
  animation: drawerSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes drawerSlideIn {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Scrim behind drawer */
.mobile-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 205;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.mobile-scrim.is-open {
  display: block;
  animation: scrimIn 0.3s ease forwards;
}

@keyframes scrimIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* DRAWER HEADER */
.mobile-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.mobile-drawer__logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-primary, #0f0f0f);
  text-decoration: none;
}

.mobile-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.06);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  color: #444;
  transition: background 0.15s ease;
}

.mobile-drawer__close:hover {
  background: rgba(0,0,0,0.1);
}

/* DRAWER BODY */
.mobile-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 20px 24px;
}

/* Section label */
.mobile-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #aaa;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding: 0 8px;
}

/* Section group */
.mobile-nav-section {
  margin-bottom: 28px;
}

/* Nav links */
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  font-size: 15px;
  font-weight: 400;
  color: #222;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.12s ease;
}

.mobile-nav-link:hover {
  background: rgba(0,0,0,0.05);
}

.mobile-nav-link-icon {
  font-size: 15px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.8;
}

.mobile-nav-link-text {
  flex: 1;
}

.mobile-nav-link-desc {
  display: block;
  font-size: 11px;
  color: #999;
  margin-top: 1px;
}

/* Separator */
.mobile-nav-divider {
  height: 1px;
  background: rgba(0,0,0,0.07);
  margin: 4px 0 24px;
}

/* DRAWER FOOTER */
.mobile-drawer__footer {
  padding: 20px 20px 28px;
  border-top: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.mobile-connect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  background: var(--blue, #1a46c9);
  border: 1.5px solid var(--blue, #1a46c9);
  border-radius: 999px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease;
  margin-bottom: 16px;
}

.mobile-connect-btn:hover {
  background: transparent;
  color: var(--blue, #1a46c9);
}

.mobile-avail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  color: #888;
}


/* ==================================================
   BODY OFFSET — fixed header
================================================== */

body {
  padding-top: 72px;
}


/* ==================================================
   TABLET — 1024px
================================================== */

@media (max-width: 1024px) {

  .header { padding: 0 32px; grid-template-columns: 1fr auto 1fr; }

  .mega-inner { padding: 32px 32px 36px; }

  .mega-footer { padding: 14px 32px; }

  .mega-inner--work,
  .mega-inner--notes {
    grid-template-columns: 190px 1fr;
  }

  .mega-col:last-child:nth-child(3) { display: none; }

  .mega-intro { padding-right: 28px; }

  .mega-col + .mega-col { padding-left: 28px; }

}


/* ==================================================
   MOBILE — 768px
================================================== */

@media (max-width: 768px) {

  .header {
    height: 64px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
  }

  .nav {
    display: none;
  }

  .nav-right {
    display: none;
  }

  /* Show hamburger */
  .nav-hamburger {
    display: flex;
  }

  /* Mega menu never on mobile */
  .mega-menu,
  .mega-backdrop {
    display: none !important;
  }

  body { padding-top: 64px; }

}


/* ==================================================
   SMALL MOBILE — 480px
================================================== */

@media (max-width: 480px) {

  .mobile-drawer {
    width: 100vw;
  }

}


/* ==================================================
   REDUCED MOTION
================================================== */

@media (prefers-reduced-motion: reduce) {

  .header,
  .mega-menu,
  .mega-menu.is-open,
  .mobile-drawer.is-open,
  .mobile-scrim.is-open,
  .mega-backdrop,
  .nav-chevron,
  .nav-hamburger span {
    animation: none !important;
    transition: none !important;
  }

  .avail-dot { animation: none; }

}