/*
 * Top bar with project tabs, shared by the main site and the project apps (e.g. /getaway/).
 * Self-contained on purpose: no global element rules, everything is scoped under .at-bar,
 * so any app can link this file without its own styles being affected.
 * Glow colours follow --at-hue, which each page animates on :root (see style.css); without it
 * they hold steady at hue 220.
 */

.at-bar {
  --at-fg: #ededed;
  --at-muted: #8a8a8a;
  --at-line: rgba(255, 255, 255, 0.1);
  --at-line-strong: rgba(255, 255, 255, 0.28);
  --at-glow: hsl(var(--at-hue, 220) 95% 68% / 0.45);
  --at-glow-soft: hsl(var(--at-hue, 220) 95% 68% / 0.16);
  --at-tint: hsl(var(--at-hue, 220) 100% 82%);
  --at-sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --at-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --at-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
  margin: 0;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--at-line);
  background: rgba(5, 5, 5, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-sizing: border-box;
  font-family: var(--at-sans);
  line-height: 1.2;
}

.at-bar *,
.at-bar *::before,
.at-bar *::after {
  box-sizing: border-box;
}

.at-brand {
  margin: 0;
  padding: 0.04em 0.06em 0.14em 0;
  font-family: var(--at-sans);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  text-decoration: none;
  background: linear-gradient(180deg, #f2f2f2 20%, var(--at-tint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px var(--at-glow-soft));
}

.at-tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 0.25rem;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.at-tabs::-webkit-scrollbar {
  display: none;
}

.at-tab {
  position: relative;
  flex: none;
  padding: 0.6rem 0.8rem;
  color: var(--at-muted);
  font-family: var(--at-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}

/* The active tab gets the same thin glowing line used under the wordmark. */
.at-tab::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: calc(0.8rem + 0.2em);
  bottom: 0.15rem;
  height: 1px;
  background: #ffffff;
  box-shadow: 0 0 12px var(--at-glow);
  transform: scaleX(0);
  transition: transform 0.4s var(--at-ease);
}

.at-tab:hover,
.at-tab:focus-visible {
  color: var(--at-fg);
  outline: 0;
}

.at-tab:focus-visible::after {
  transform: scaleX(0.35);
}

.at-tab[aria-current="page"] {
  color: var(--at-fg);
  text-shadow: 0 0 14px var(--at-glow);
}

.at-tab[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Right-hand side: the signed-in username (links to their account page) and Log out. */
.at-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0 auto;
}

.at-account {
  max-width: 10rem;
  overflow: hidden;
  color: var(--at-muted);
  font-family: var(--at-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, text-shadow 0.2s;
}

.at-account:hover,
.at-account:focus-visible,
.at-account[aria-current="page"] {
  color: var(--at-fg);
  text-shadow: 0 0 14px var(--at-glow);
  outline: 0;
}

.at-logout {
  margin: 0 0 0 auto;
}

.at-user .at-logout {
  margin: 0;
}

.at-logout button {
  margin: 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--at-line);
  border-radius: 999px;
  background: none;
  color: var(--at-muted);
  font-family: var(--at-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.at-logout button:hover,
.at-logout button:focus-visible {
  color: var(--at-fg);
  border-color: var(--at-line-strong);
  box-shadow: 0 0 16px var(--at-glow-soft);
  outline: 0;
}

/* Phones: wordmark and Log out on the first row, tabs on their own scrollable row below. */
@media (max-width: 600px) {
  .at-tabs {
    order: 3;
    flex-basis: 100%;
    margin: 0 -0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .at-tab,
  .at-tab::after,
  .at-logout button {
    transition: none;
  }
}
