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

/* Header wrapper — FIXED at top, always visible when scrolling */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

/* ---- Navbar ---- */
.navbar {
  position: relative;
  z-index: 1000;
  height: 56px;
  padding: 0 40px;
  /* Glassmorphism — frosted glass effect */
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;

  /* THE KEY: single flex row, all children on one baseline */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---- Light theme for inner pages (not homepage) ---- */
body.light-header .navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}


body.light-header .logo {
  color: #1a1a1a;
}

body.light-header .nav-link {
  color: #1a1a1a;
  text-decoration-color: #C9A961;
}

body.light-header .nav-cta {
  color: #666 !important;
  border-color: #C9A961;
}

body.light-header .nav-cta:hover {
  background: #C9A961;
  color: #fff !important;
  border-color: #C9A961;
}

body.light-header .mobile-menu-toggle span {
  background: #1a1a1a;
}

/* ---- Logo ---- */
/* All nav elements share same height for perfect vertical alignment.
   Playfair Display has slightly different metrics than sans-serif,
   so we use a small optical correction via padding. */
.logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.15em;
  font-weight: 500;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
  /* Match height of nav-cta for consistent vertical centering */
  display: inline-flex;
  align-items: center;
  height: 30px;
  /* Optical correction: Playfair ascenders make it look 1px higher */
  padding-top: 1px;
}

.logo:hover {
  opacity: 0.6;
}

/* ---- Nav menu (right side) ---- */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  /* CRITICAL: explicit height matches navbar so align-items: center
     centers children at navbar midpoint (28px), not content top.
     height:100% doesn't work because parent flex has align-items:center
     which shrink-wraps children. Use explicit px value instead. */
  height: 56px;
}

/* ---- Nav links (text only) ---- */
.nav-link {
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
  /* Match height of nav-cta for consistent vertical centering */
  display: inline-flex;
  align-items: center;
  height: 30px;
  /* Bronze underline on hover — tight to text using text-decoration */
  text-underline-offset: 3px;
  text-decoration-color: #C9A961;
}

.nav-link:hover {
  text-decoration: underline;
  text-decoration-color: #C9A961;
  text-decoration-thickness: 1px;
}

/* ---- CTA button ---- */
.nav-cta {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: transparent;
  color: #fff !important;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.nav-cta:hover {
  opacity: 1 !important;
  background: #C9A961;
  color: #fff !important;
  border-color: #C9A961;
}

/* ---- Mobile menu toggle ---- */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Hero video bleeds under navbar ---- */
.hero-video {
  margin-top: -56px;
  padding-top: 56px;
  box-sizing: content-box;
  height: calc(100vh);
}

/* Pages without hero need top padding */
body:not(:has(.hero-video)) {
  padding-top: 56px;
}

/* ==================== TABLET ==================== */

@media (max-width: 1024px) {
  .navbar {
    padding: 0 24px;
  }

  .nav-menu {
    gap: 24px;
  }
}

/* ==================== MOBILE ==================== */

@media (max-width: 768px) {
  .navbar {
    height: 52px;
    padding: 0 20px;
  }

  .logo {
    font-size: 13px;
  }

  .mobile-menu-toggle {
    display: block;
  }

  /* Slide-in drawer */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 70px 24px 24px;
    gap: 0;
    transition: right 0.3s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-link {
    display: block;
    color: var(--text, #1a1a1a);
    padding: 16px 0;
    border-bottom: 1px solid var(--divider, #e5e5e5);
    font-size: 13px;
  }

  .nav-link:last-of-type {
    border-bottom: none;
  }

  .nav-cta {
    display: block;
    height: auto;
    padding: 14px;
    margin-top: 16px;
    text-align: center;
    width: 100%;
    font-size: 12px;
    color: var(--text, #1a1a1a) !important;
    border-color: var(--text, #1a1a1a);
    background: transparent;
  }

  .nav-cta:hover,
  .nav-cta:active {
    background: var(--text, #1a1a1a);
    color: var(--bg, #fff) !important;
  }

  body.menu-open {
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0 16px;
  }

  .logo {
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .nav-menu {
    width: 100%;
    right: -100%;
  }

  .nav-menu.active {
    right: 0;
  }
}

/* ==================== ACCESSIBILITY ==================== */

.logo:focus-visible,
.nav-link:focus-visible,
.nav-cta:focus-visible,
.mobile-menu-toggle:focus-visible {
  outline: 2px solid var(--accent, #b8860b);
  outline-offset: 2px;
}

.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent, #b8860b);
  color: var(--bg, #fff);
  padding: 8px 16px;
  text-decoration: none;
  z-index: 1002;
  font-size: 12px;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 0;
}

/* ==================== SAFE AREA ==================== */
/* Only apply safe-area padding to the mobile drawer, not desktop navbar */

@media (max-width: 768px) {
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .nav-menu {
      padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
  }
}

/* ==================== TOUCH ==================== */

@media (pointer: coarse) {
  .logo,
  .nav-link,
  .nav-cta {
    min-height: 44px;
  }
}

/* ==================== PRINT ==================== */

@media print {
  header,
  .navbar {
    position: static;
    height: auto;
    border-bottom: 1px solid var(--border, #ddd);
    background: transparent;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .nav-menu {
    display: flex;
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    box-shadow: none;
    flex-direction: row;
    gap: 24px;
  }
}

/* ==================== SPECIAL NAV BUTTONS ==================== */

/* Decision/Client Portal button — subtle gold accent */
.nav-cta.nav-cta--decision {
  position: relative;
  border-color: rgba(255, 255, 255, 0.8) !important;
  /* Thin gold outer line */
  box-shadow: 0 0 0 0.5px rgba(201, 169, 97, 0.6);
}

.nav-cta.nav-cta--decision:hover {
  border-color: #C9A961 !important;
  background: #C9A961 !important;
  color: #fff !important;
}

/* Gold glow removed per BUG-001 */

/* Light header variant for Decision button */
body.light-header .nav-cta.nav-cta--decision {
  border-color: #C9A961 !important;
  color: #1a1a1a !important;
}

body.light-header .nav-cta.nav-cta--decision:hover {
  background: #C9A961 !important;
  color: #fff !important;
}

/* Dashboard button — Bronze border always visible + fill on hover */
.nav-cta.nav-cta--dashboard {
  border-color: #C9A961 !important;
  transition: all 0.3s ease, box-shadow 0.3s ease;
}

.nav-cta.nav-cta--dashboard:hover {
  background: #C9A961 !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(201, 169, 97, 0.5), 0 0 30px rgba(201, 169, 97, 0.2);
}

/* Light header variant for Dashboard button */
body.light-header .nav-cta.nav-cta--dashboard {
  border-color: #C9A961 !important;
  color: #1a1a1a !important;
}

body.light-header .nav-cta.nav-cta--dashboard:hover {
  background: #C9A961 !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(201, 169, 97, 0.6), 0 0 30px rgba(201, 169, 97, 0.3);
}

