:root {
  --atlas-ground: #f7f5ef;
  --atlas-paper: #fbfaf6;
  --atlas-ink: #082d52;
  --atlas-cobalt: #075cff;
  --atlas-coral: #ee6548;
  --atlas-rule: rgb(8 45 82 / 16%);
  --atlas-grain-opacity: 0.035;
}

.atlas-page {
  --atlas-surface: var(--atlas-paper);
  --atlas-blue: var(--atlas-cobalt);
  --atlas-muted: rgb(8 45 82 / 64%);
  --atlas-line: var(--atlas-rule);
  --atlas-soft-line: rgb(8 45 82 / 8%);
  --atlas-error: #a2382a;
  --atlas-font: "Overused Grotesk", "Outfit", sans-serif;
  --atlas-ease: cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--atlas-ink);
  background: var(--atlas-ground);
  font-family: var(--atlas-font);
  overflow-x: hidden;
}

.atlas-page :where(h1, h2, h3, p) {
  text-wrap: pretty;
}

.atlas-page :where(button, input, textarea, select, a) {
  font: inherit;
}

.atlas-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid var(--atlas-blue);
  border-radius: 2px;
  padding: 0 22px;
  color: #fff;
  background: var(--atlas-blue);
  font-weight: 600;
  text-decoration: none;
  transition:
    color 220ms var(--atlas-ease),
    background-color 220ms var(--atlas-ease),
    transform 220ms var(--atlas-ease);
}

.atlas-action:hover,
.atlas-action:focus-visible {
  color: var(--atlas-blue);
  background: transparent;
  transform: translateY(-2px);
}

.atlas-page :where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--atlas-blue);
  outline-offset: 3px;
}

.atlas-artifact {
  border: 1px solid var(--atlas-line);
  border-radius: 3px;
  color: var(--atlas-ink);
  background: var(--atlas-surface);
  box-shadow: 0 18px 45px rgba(11, 42, 74, 0.08);
}

.atlas-coordinate {
  color: var(--atlas-blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.atlas-route {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.atlas-route::before {
  content: "";
  position: absolute;
  top: 11px;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--atlas-line);
}

.atlas-route__node {
  position: relative;
  padding-top: 32px;
  color: var(--atlas-muted);
}

.atlas-route__node::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--atlas-paper);
}

.atlas-route__node.is-current {
  color: var(--atlas-blue);
  font-weight: 650;
}

.atlas-route__node.is-current::before {
  border-color: var(--atlas-blue);
  background: var(--atlas-blue);
}

.atlas-page .main-header {
  color: var(--atlas-ink);
  background: transparent;
}

.atlas-page .main-footer {
  color: var(--atlas-ink);
  background: var(--atlas-paper);
}

.atlas-page .utility-bar,
.atlas-page .nav-link__icon,
.atlas-page .brand-subtitle {
  display: none;
}

:is(.atlas-page, body:has(.home-canvas)) .header-shell {
  --header-item-height: 44px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

:is(.atlas-page, body:has(.home-canvas)) .header-shell::before {
  display: none;
}

:is(.atlas-page, body:has(.home-canvas)) .primary-nav {
  gap: clamp(0.75rem, 2vw, 2rem);
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

:is(.atlas-page, body:has(.home-canvas)) .main-nav {
  gap: 0;
  margin-left: auto;
  padding: 4px;
  border: 1px solid var(--atlas-rule);
  border-radius: 999px;
  background: rgb(251 250 246 / 86%);
  box-shadow: 0 12px 32px rgb(8 45 82 / 7%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

:is(.atlas-page, body:has(.home-canvas)) .main-nav a {
  border-radius: 999px;
  color: var(--atlas-ink);
  font-size: 0.82rem;
}

.atlas-page :where(
  .main-nav a,
  .btn-login,
  .btn-logout,
  .btn-register,
  .user-badge,
  .menu-button,
  .mobile-header-bar
) {
  border-radius: 2px;
}

.atlas-page .btn-register-wrapper::before {
  display: none;
}

@media (max-width: 420px) {
  .atlas-route {
    grid-template-columns: repeat(4, minmax(128px, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    padding-bottom: 12px;
  }

  .atlas-route::before {
    right: auto;
    width: 512px;
  }
}

@media (max-width: 991.98px) {
  :is(.atlas-page, body:has(.home-canvas)) .main-header {
    padding: 18px 20px 0;
  }

  :is(.atlas-page, body:has(.home-canvas)) .mobile-header-bar {
    min-height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  :is(.atlas-page, body:has(.home-canvas)) .mobile-header-bar .brand-mark {
    width: 42px;
    height: 42px;
  }

  :is(.atlas-page, body:has(.home-canvas)) .mobile-header-bar .brand-title {
    color: var(--atlas-ink);
    font-size: 0.96rem;
    font-weight: 650;
  }

  :is(.atlas-page, body:has(.home-canvas)) .mobile-header-bar .menu-button {
    width: 44px;
    height: 44px;
    border: 0;
    color: var(--atlas-ink);
    background: transparent;
    box-shadow: none;
  }

  :is(.atlas-page, body:has(.home-canvas)) .primary-nav.is-open {
    margin-top: 10px;
    border: 1px solid var(--atlas-rule);
    border-radius: 16px;
    background: rgb(251 250 246 / 96%);
  }

  :is(.atlas-page, body:has(.home-canvas)) .primary-nav.is-open .main-nav {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-page *,
  .atlas-page *::before,
  .atlas-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
