.header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding-bottom: 0.9rem;
}

.header-rail {
  background:
    radial-gradient(circle at top right, rgba(45, 135, 177, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(13, 30, 48, 0.98), rgba(10, 24, 39, 0.95));
  color: rgba(248, 242, 234, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-rail-inner {
  min-height: 2.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-rail-copy {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: rgba(248, 242, 234, 0.74);
}

.header-rail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-rail-links a {
  font-size: 0.8rem;
  color: rgba(248, 242, 234, 0.95);
}

.nav-shell {
  position: relative;
  margin-top: 0.8rem;
  padding: 1rem 1.15rem 1.1rem;
  border: 1px solid rgba(18, 30, 49, 0.08);
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(45, 135, 177, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 249, 241, 0.94));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 26px 58px rgba(18, 30, 49, 0.12);
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
}

.brand-mark {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.82), transparent 36%),
    linear-gradient(135deg, var(--accent) 0%, var(--primary-2) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 16px 28px rgba(18, 30, 49, 0.16);
}

.brand-mark-core {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: rgba(16, 36, 59, 0.78);
  font-size: 0.95rem;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.brand-name {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.06rem;
  color: var(--text);
  font-weight: 700;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-wrap {
  margin-left: auto;
  min-width: 0;
  flex: 1 1 auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  width: 100%;
  padding: 0.34rem;
  border-radius: 22px;
  background: rgba(16, 36, 59, 0.045);
  border: 1px solid rgba(16, 36, 59, 0.05);
}

.nav-mega-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  flex: 1 1 0;
  gap: 0.55rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.86rem 1rem;
  border-radius: 16px;
  font: inherit;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.nav-mega-trigger:hover,
.nav-mega-trigger:focus-visible {
  background: rgba(16, 36, 59, 0.08);
  outline: none;
}

.nav-mega-trigger.active {
  background: linear-gradient(135deg, rgba(16, 36, 59, 0.96), rgba(39, 80, 102, 0.92));
  color: #fff8f0;
  box-shadow: 0 14px 28px rgba(18, 30, 49, 0.14);
}

.nav-mega-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1;
  transition: transform 0.18s ease, color 0.18s ease;
}

.nav-mega-trigger.active .nav-mega-caret {
  transform: rotate(180deg);
  color: rgba(255, 248, 240, 0.82);
}

.nav-panel-host {
  margin-top: 1rem;
}

.nav-hub-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.4fr);
  gap: 1.1rem;
  padding: 1.1rem;
  border-radius: 32px;
  border: 1px solid rgba(18, 30, 49, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 253, 0.99), rgba(252, 247, 240, 0.98));
  box-shadow: 0 24px 56px rgba(18, 30, 49, 0.13);
}

.nav-hub-meta {
  display: grid;
  gap: 0.95rem;
  align-content: start;
  padding: 1.25rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(83, 169, 206, 0.18), transparent 34%),
    linear-gradient(160deg, rgba(13, 30, 48, 0.98), rgba(39, 80, 102, 0.94));
  color: #fdf7ef;
}

.nav-hub-kicker {
  margin: 0;
  color: rgba(255, 243, 230, 0.78);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 800;
}

.nav-hub-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1.45rem, 1.1rem + 0.9vw, 1.95rem);
  line-height: 1.06;
  color: #fff9f2;
}

.nav-hub-copy {
  margin: 0;
  color: rgba(255, 246, 235, 0.84);
  font-size: 0.9rem;
  line-height: 1.58;
}

.nav-hub-chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-hub-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  color: rgba(255, 247, 238, 0.88);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.nav-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.2rem;
}

.nav-hub-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.76rem 0.96rem;
  border-radius: 999px;
  color: #fffaf3;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.86rem;
  font-weight: 700;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.nav-hub-action:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.nav-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.82rem;
}

.nav-hub-card {
  display: grid;
  gap: 0.38rem;
  align-content: start;
  min-height: 142px;
  padding: 1rem 1rem 1.02rem;
  border-radius: 22px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 252, 247, 0.96));
  border: 1px solid rgba(18, 30, 49, 0.08);
  box-shadow: 0 12px 24px rgba(18, 30, 49, 0.06);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.nav-hub-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(45, 135, 177, 0.28);
  box-shadow: 0 16px 30px rgba(18, 30, 49, 0.09);
}

.nav-hub-card em {
  display: block;
  margin: 0;
  font-style: normal;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.72rem;
  font-weight: 800;
}

.nav-hub-card strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.3;
}

.nav-hub-card span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.9rem;
  border-radius: 999px;
  padding: 0.78rem 1.08rem;
  border: 1px solid var(--border);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 54%, var(--primary-2) 100%);
  color: #fffaf3;
  font-weight: 800;
  border: 0;
  box-shadow: 0 16px 24px rgba(201, 112, 51, 0.18);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.45);
  color: var(--text);
}

@media (max-width: 1180px) {
  .nav-bar {
    flex-wrap: wrap;
  }

  .nav-wrap {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .nav-mega-trigger {
    flex: 1 1 calc(50% - 0.4rem);
  }
}

@media (max-width: 960px) {
  .header {
    position: relative;
    padding-bottom: 0.7rem;
  }

  .header-rail-inner {
    min-height: auto;
    padding: 0.65rem 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-rail-links {
    width: 100%;
    gap: 0.5rem 0.85rem;
  }

  .nav-shell {
    padding: 1rem;
    border-radius: 28px;
  }

  .nav-bar {
    align-items: flex-start;
  }

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

  .nav-mega-trigger {
    min-width: 0;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    justify-content: space-between;
  }

  .nav-hub-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .header-rail-copy,
  .brand-sub {
    display: none;
  }

  .header-rail-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem 0.65rem;
  }

  .header-rail-links a {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .nav,
  .nav-mega-trigger {
    width: 100%;
  }

  .nav-hub-grid {
    grid-template-columns: 1fr;
  }

  .nav-shell {
    border-radius: 24px;
  }
}
