.home-view.atlas-home-ready > :not(#atlasHome) {
  display: none !important;
}

.atlas-home {
  width: 100%;
  min-height: 100%;
  color: var(--nx-text);
  background: var(--nx-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.atlas-masthead {
  min-height: 280px;
  padding: clamp(36px, 6vw, 76px) clamp(24px, 6vw, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 48px;
  color: #f8fafc;
  background:
    linear-gradient(90deg, rgba(5, 15, 32, .98) 0%, rgba(7, 24, 50, .93) 58%, rgba(9, 39, 78, .86) 100%),
    url('../assets/hero/og-card.jpg') center / cover;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  overflow: hidden;
}

.atlas-masthead-copy {
  max-width: 780px;
  animation: atlas-enter .55s cubic-bezier(.22, 1, .36, 1) both;
}

.atlas-eyebrow {
  margin-bottom: 12px;
  color: var(--nx-blue, #3b82f6);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.atlas-masthead h1 {
  max-width: 720px;
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 720;
  letter-spacing: -.045em;
  line-height: .98;
}

.atlas-masthead p {
  max-width: 640px;
  margin: 22px 0 0;
  color: rgba(226, 232, 240, .78);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
}

.atlas-masthead-actions {
  min-width: 240px;
  display: grid;
  gap: 18px;
  justify-items: end;
  animation: atlas-enter .55s .08s cubic-bezier(.22, 1, .36, 1) both;
}

.atlas-primary-action {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: var(--nx-blue, #3b82f6);
  color: #fff;
  font: 700 13px/1 Inter, sans-serif;
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease;
}

.atlas-primary-action:hover,
.atlas-primary-action:focus-visible {
  background: var(--nx-blue-hover, #2563eb);
  transform: translateY(-2px);
  outline: 3px solid rgba(96, 165, 250, .3);
  outline-offset: 2px;
}

.atlas-masthead-meta {
  display: flex;
  gap: 18px;
  color: rgba(226, 232, 240, .58);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.atlas-masthead-meta span { display: grid; gap: 3px; text-align: right; }
.atlas-masthead-meta strong { color: #fff; font-size: 14px; letter-spacing: 0; text-transform: none; }

.atlas-stage-rail {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(10, minmax(76px, 1fr));
  background: var(--nx-card);
  border-bottom: 1px solid var(--nx-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.atlas-stage {
  min-height: 66px;
  padding: 11px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 0;
  border-right: 1px solid var(--nx-border);
  background: transparent;
  color: var(--nx-text-muted);
  text-align: left;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease;
}

.atlas-stage:last-child { border-right: 0; }
.atlas-stage span { font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.atlas-stage strong { color: inherit; font-size: 12px; }
.atlas-stage:hover { color: var(--nx-text); background: var(--nx-card-hover); }
.atlas-stage.active { color: var(--nx-blue); background: color-mix(in srgb, var(--nx-blue) 8%, var(--nx-card)); box-shadow: inset 0 -2px 0 var(--nx-blue); }
.atlas-stage:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--nx-blue); outline-offset: -2px; }

.atlas-workspace {
  max-width: 1540px;
  margin: 0 auto;
  padding: clamp(34px, 5vw, 72px) clamp(22px, 5vw, 72px) 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  gap: clamp(36px, 6vw, 88px);
}

.atlas-directory { min-width: 0; scroll-margin-top: 84px; }
.atlas-directory-head {
  margin-bottom: 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.atlas-directory h2,
.atlas-context h2 {
  margin: 0;
  color: var(--nx-text);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 680;
  letter-spacing: -.025em;
}

.atlas-search {
  width: min(320px, 42vw);
  min-height: 42px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--nx-border-strong, var(--nx-border));
  color: var(--nx-text-muted);
}

.atlas-search:focus-within { border-color: var(--nx-blue); color: var(--nx-blue); }
.atlas-search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.atlas-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--nx-text); font: 500 13px/1 Inter, sans-serif; }

.atlas-groups { border-top: 1px solid var(--nx-border); }
.atlas-group {
  border-bottom: 1px solid var(--nx-border);
  animation: atlas-enter .42s calc(var(--atlas-index) * 35ms) cubic-bezier(.22, 1, .36, 1) both;
}

.atlas-group-toggle {
  width: 100%;
  min-height: 78px;
  padding: 14px 4px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 16px;
  border: 0;
  background: transparent;
  color: var(--nx-text);
  text-align: left;
  cursor: pointer;
}

.atlas-group-toggle:hover .atlas-group-title strong { color: var(--nx-blue); }
.atlas-group-toggle:focus-visible { outline: 2px solid var(--nx-blue); outline-offset: -2px; }
.atlas-group-number { color: var(--nx-blue); font: 800 11px/1 Inter, sans-serif; letter-spacing: .12em; }
.atlas-group-title { display: grid; gap: 4px; }
.atlas-group-title strong { font-size: 17px; transition: color .18s ease; }
.atlas-group-title small { color: var(--nx-text-muted); font-size: 12px; font-weight: 450; }
.atlas-group-count { min-width: 28px; color: var(--nx-text-muted); font: 700 11px/1 Inter, sans-serif; text-align: right; }
.atlas-group-toggle > svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .22s ease; }
.atlas-group.collapsed .atlas-group-toggle > svg { transform: rotate(-90deg); }
.atlas-group.collapsed .atlas-module-list { display: none; }

.atlas-module-list { padding: 0 0 14px 64px; }
.atlas-module {
  width: 100%;
  min-height: 62px;
  padding: 10px 4px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 14px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--nx-border) 65%, transparent);
  background: transparent;
  color: var(--nx-text);
  text-align: left;
  cursor: pointer;
  transition: background-color .18s ease, padding-left .18s ease;
}

.atlas-module:hover { padding-left: 10px; background: color-mix(in srgb, var(--nx-blue) 4%, transparent); }
.atlas-module:focus-visible { outline: 2px solid var(--nx-blue); outline-offset: -2px; }
.atlas-module[hidden] { display: none; }
.atlas-module-icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--nx-blue); }
.atlas-module-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.atlas-module-copy { min-width: 0; display: grid; gap: 3px; }
.atlas-module-copy strong { overflow: hidden; color: var(--nx-text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.atlas-module-copy small { overflow: hidden; color: var(--nx-text-muted); font-size: 11px; font-weight: 450; text-overflow: ellipsis; white-space: nowrap; }
.atlas-module-stage { color: var(--nx-text-dim); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.atlas-module-arrow { color: var(--nx-text-muted); font-size: 18px; transition: color .18s ease, transform .18s ease; }
.atlas-module:hover .atlas-module-arrow { color: var(--nx-blue); transform: translateX(4px); }

.atlas-context {
  align-self: start;
  position: sticky;
  top: 102px;
  padding-left: 28px;
  border-left: 1px solid var(--nx-border);
}

.atlas-context-list { margin: 28px 0 34px; padding: 0; list-style: none; counter-reset: context; }
.atlas-context-list li { position: relative; padding: 0 0 22px 34px; display: grid; gap: 4px; counter-increment: context; }
.atlas-context-list li:not(:last-child)::before { content: ''; position: absolute; left: 9px; top: 19px; bottom: 0; width: 1px; background: var(--nx-border); }
.atlas-context-list li::after { content: counter(context); position: absolute; left: 0; top: 0; width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid var(--nx-border-strong, var(--nx-border)); border-radius: 50%; color: var(--nx-blue); background: var(--nx-bg); font: 800 8px/1 Inter, sans-serif; }
.atlas-context-list strong { color: var(--nx-text); font-size: 12px; }
.atlas-context-list span { color: var(--nx-text-muted); font-size: 11px; line-height: 1.45; }

.atlas-system { padding-top: 20px; display: flex; gap: 11px; border-top: 1px solid var(--nx-border); }
.atlas-system > span:last-child { display: grid; gap: 3px; }
.atlas-system strong { color: var(--nx-text); font-size: 11px; }
.atlas-system small { color: var(--nx-text-muted); font-size: 10px; }
.atlas-status-dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: var(--nx-warning); box-shadow: 0 0 0 4px color-mix(in srgb, var(--nx-warning) 12%, transparent); }
.atlas-system.online .atlas-status-dot { background: var(--nx-success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--nx-success) 12%, transparent); }
.atlas-system.offline .atlas-status-dot { background: var(--nx-error); }

@keyframes atlas-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1050px) {
  .atlas-masthead { grid-template-columns: 1fr; align-items: start; gap: 30px; }
  .atlas-masthead-actions { justify-items: start; }
  .atlas-masthead-meta span { text-align: left; }
  .atlas-stage-rail { display: flex; overflow-x: auto; }
  .atlas-stage { min-width: 104px; flex: 1 0 104px; }
  .atlas-workspace { grid-template-columns: 1fr; }
  .atlas-context { position: static; padding: 32px 0 0; border-top: 1px solid var(--nx-border); border-left: 0; }
  .atlas-context-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
  .atlas-context-list li { padding-right: 10px; }
}

@media (max-width: 720px) {
  .atlas-masthead { min-height: 0; padding: 36px 22px; }
  .atlas-masthead h1 { font-size: 38px; }
  .atlas-masthead-meta { flex-wrap: wrap; }
  .atlas-workspace { padding: 34px 18px 72px; }
  .atlas-directory-head { align-items: stretch; flex-direction: column; }
  .atlas-search { width: 100%; }
  .atlas-group-toggle { grid-template-columns: 36px minmax(0, 1fr) auto 18px; gap: 10px; }
  .atlas-module-list { padding-left: 0; }
  .atlas-module { grid-template-columns: 30px minmax(0, 1fr) 22px; }
  .atlas-module-stage { display: none; }
  .atlas-context-list { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-masthead-copy,
  .atlas-masthead-actions,
  .atlas-group { animation: none; }
  .atlas-primary-action,
  .atlas-module,
  .atlas-module-arrow,
  .atlas-group-toggle > svg { transition: none; }
}
