/* ===== HEADER / NAV ===== */
header {
  background: rgba(8,8,18,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(130,155,215,0.18);
  position: sticky;
  top: 0;
  z-index: 200;
  height: auto;
  /* needed so the mobile dropdown positions from the header bottom */
  overflow: visible;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
}

.site-name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== HAMBURGER BUTTON ===== */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: 1px solid rgba(130,155,215,0.25);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.nav-toggle:hover { border-color: var(--muted); }

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
  transform-origin: center;
}

/* Animate to X when open */
header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===== MOBILE NAV DROPDOWN ===== */
.tabs {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background: rgba(8,8,18,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(130,155,215,0.18);
  padding: .5rem 0;
}

header.nav-open .tabs { display: flex; }

.tab-btn {
  display: flex;
  align-items: center;
  height: auto;
  padding: .85rem 1.5rem;
  font-family: "DM Sans", sans-serif;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  position: relative;
  transition: color var(--transition), background var(--transition);
  border-bottom: none;
  border-left: 2px solid transparent;
}

.tab-btn:hover { color: var(--ink); background: rgba(130,155,215,0.06); }
.tab-btn.active { color: var(--red); border-left-color: var(--red); }

/* ===== DESKTOP NAV ===== */
@media (min-width: 640px) {
  header { height: var(--header-h); }
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0 2rem;
    gap: 2rem;
    min-height: unset;
    height: 100%;
  }
  .nav-toggle { display: none; }
  .tabs {
    display: flex !important;
    position: static;
    flex-direction: row;
    align-items: center;
    height: 100%;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn {
    height: 100%;
    padding: 0 1.1rem;
    font-size: .875rem;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .tab-btn:hover { background: transparent; }
  .tab-btn.active { color: var(--red); border-left-color: transparent; border-bottom-color: var(--red); }
}
