:root {
  --charcoal: #1d232b;
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0.35rem 0.8rem;
  font-family: "Avenir Next", "Gill Sans", "Segoe UI", sans-serif;
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.92);
  border: 1px solid #ecdcc7;
  box-shadow: 0 18px 40px rgba(15, 20, 28, 0.12);
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.02em;
  justify-self: start;
}

.brand-mark {
  width: 44px;
  height: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f2b782, #d88f6a);
  color: #3b2a1c;
  font-size: 0.9rem;
  font-weight: 700;
}

.brand-name {
  font-size: 1rem;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 600;
  padding: 0.2rem;
  border-radius: 999px;
  background: #f6ecdd;
  border: 1px solid #e7d6c2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  justify-self: center;
}

.nav-links a {
  text-decoration: none;
  color: #5a4a3c;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.nav-links a:hover {
  background: #fbe9d2;
  border-color: #ead8c4;
}

.nav-links a.active {
  background: #fff8ef;
  color: #1d232b;
  border-color: #e6d5c1;
  box-shadow: 0 6px 12px rgba(29, 35, 43, 0.12);
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  visibility: hidden;
  opacity: 0;
  justify-self: end;
}

.nav-actions.ready {
  visibility: visible;
  opacity: 1;
}

.nav-guest,
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-user {
  display: none;
}

.account-area {
  position: relative;
}

.account-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e2d2bf;
  background: #fff8ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(24, 33, 44, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.account-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #6b5a4b;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(24, 33, 44, 0.2);
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  min-width: 160px;
  background: #fff8ef;
  border: 1px solid #ecdcc7;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 20, 28, 0.16);
  padding: 0.4rem;
  display: none;
  z-index: 10;
}

.account-menu.open {
  display: block;
}

.account-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.85rem;
}

.account-menu-item:hover {
  background: #f2e5d3;
}

.nav-greeting {
  font-size: 0.85rem;
  color: #5a4c40;
}

.primary-button {
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fff8ef;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(24, 33, 44, 0.2);
}

.ghost-button {
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: #f1e3cf;
  color: #5a4c40;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.ghost-button:hover {
  background: #e6d4bc;
  color: #3f342b;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 960px) {
  .top-bar {
    display: flex;
    flex-wrap: wrap;
    border-radius: 20px;
    gap: 0.75rem;
  }

  .nav-links,
  .nav-actions {
    width: 100%;
  }

  .nav-actions {
    justify-content: flex-end;
  }
}
