:root {
  --bg: #09131a;
  --bg-elevated: rgba(10, 23, 31, 0.86);
  --bg-panel: rgba(13, 27, 35, 0.76);
  --line: rgba(146, 185, 193, 0.18);
  --line-strong: rgba(255, 179, 118, 0.34);
  --text: #edf8f7;
  --muted: #91a8ad;
  --warm: #ffb16a;
  --warm-soft: #ffd3a1;
  --cool: #67d4d8;
  --danger: #ff7b7b;
  --success: #79db9d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --font-display: "Avenir Next", "Segoe UI Variable Display", "Helvetica Neue",
    sans-serif;
  --font-body: "Avenir Next", "Segoe UI Variable Text", "Helvetica Neue",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(103, 212, 216, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 177, 106, 0.18), transparent 28%),
    linear-gradient(180deg, #071018 0%, #09131a 42%, #060d12 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
}

body {
  overflow-x: hidden;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 40px 28px 56px;
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}

.ambient-a {
  top: 80px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: rgba(255, 177, 106, 0.2);
}

.ambient-b {
  left: -100px;
  bottom: 80px;
  width: 320px;
  height: 320px;
  background: rgba(103, 212, 216, 0.12);
}

.masthead,
.panel,
.project-card,
.recent-card,
.agent-card,
.step-card {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.masthead {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin: 0 auto 28px;
  padding: 24px 28px;
  max-width: 1440px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 177, 106, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(9, 19, 26, 0.96), rgba(9, 19, 26, 0.82));
  box-shadow: var(--shadow);
}

.eyebrow,
.panel-kicker,
.meta-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cool);
  font-size: 0.73rem;
}

h1,
h2,
h3,
.metric-value,
.agent-rank {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.96;
}

h1 {
  margin-top: 10px;
  font-size: clamp(3rem, 6vw, 5.8rem);
  letter-spacing: -0.05em;
}

.intro {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.55;
}

.masthead-meta {
  display: grid;
  gap: 14px;
  min-width: 260px;
}

.meta-block {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 16, 22, 0.54);
}

.meta-block strong {
  display: block;
  margin-top: 8px;
  color: var(--warm-soft);
  font-size: 0.98rem;
}

.snapshot-relative {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.meta-actions {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
}

.action-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 177, 106, 0.1);
  color: var(--warm-soft);
  font-size: 0.88rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 180ms ease;
}

.action-btn:hover {
  background: rgba(255, 177, 106, 0.2);
  transform: translateY(-1px);
}

.action-btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.action-btn-ghost:hover {
  background: rgba(103, 212, 216, 0.08);
  color: var(--text);
}

/* ── Fleet status bar ────────────────────────────────────────── */

.fleet-bar {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: -8px auto 24px;
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg-panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.fleet-bar .panel-kicker {
  margin-bottom: 14px;
}

.fleet-nodes {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.fleet-node {
  flex: 1;
  min-width: 200px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(7, 16, 22, 0.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 200ms ease;
}

.fleet-node:hover {
  border-color: rgba(103, 212, 216, 0.3);
}

.fleet-current {
  border-color: var(--line-strong);
  background: rgba(255, 177, 106, 0.06);
}

.fleet-retired {
  opacity: 0.5;
}

.fleet-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-bottom: 4px;
}

.fleet-indicator.online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(121, 219, 157, 0.5);
}

.fleet-indicator.retired {
  background: var(--muted);
}

.fleet-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fleet-info strong {
  font-size: 1rem;
  color: var(--text);
}

.fleet-ip {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

.fleet-spec {
  font-size: 0.82rem;
  color: var(--cool);
}

.fleet-role {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Search overlay ──────────────────────────────────────────── */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.search-modal {
  width: 100%;
  max-width: 620px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: rgba(9, 19, 26, 0.96);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: translateY(-10px);
  transition: transform 200ms ease;
}

.search-overlay.active .search-modal {
  transform: translateY(0);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.search-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.search-input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.1rem;
}

.search-input-wrapper input::placeholder {
  color: rgba(145, 168, 173, 0.5);
}

.search-kbd {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.72rem;
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.search-hint {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-result {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 120ms ease;
}

.search-result:hover {
  background: rgba(255, 177, 106, 0.08);
}

.search-result-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-result-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.search-result-detail {
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ── Highlight pulse for search-to-scroll ────────────────────── */

@keyframes pulse-highlight {
  0% { box-shadow: 0 0 0 0 rgba(255, 177, 106, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255, 177, 106, 0.15); }
  100% { box-shadow: 0 0 0 0 rgba(255, 177, 106, 0); }
}

.highlight-pulse {
  animation: pulse-highlight 800ms ease-out 2;
  border-color: var(--line-strong) !important;
}

/* ── Dashboard ───────────────────────────────────────────────── */

.dashboard {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  background: var(--bg-panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
  background:
    linear-gradient(135deg, rgba(255, 177, 106, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(11, 24, 31, 0.9), rgba(8, 18, 24, 0.92));
}

.hero-copy h2 {
  margin-top: 12px;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  letter-spacing: -0.04em;
}

.hero-summary {
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1rem;
  margin: 16px 0 0;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.badge,
.filter-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  font-size: 0.86rem;
}

.badge {
  color: var(--warm-soft);
  background: rgba(255, 177, 106, 0.1);
}

.hero-stats,
.recent-grid,
.project-grid,
.agent-list,
.next-steps {
  display: grid;
  gap: 16px;
}

.hero-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.metric-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(7, 16, 22, 0.5);
}

.metric-value {
  margin-top: 10px;
  font-size: clamp(2rem, 3.4vw, 3rem);
  letter-spacing: -0.05em;
}

.metric-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-top: 10px;
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  letter-spacing: -0.03em;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  background: rgba(8, 18, 24, 0.65);
  color: var(--muted);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease,
    background 180ms ease;
}

.filter-chip.active,
.filter-chip:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 177, 106, 0.12);
}

.recent-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recent-card,
.project-card,
.agent-card,
.step-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  padding: 20px;
  transform: translateY(16px);
  opacity: 0;
  animation: rise-in 650ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.recent-card::before,
.project-card::before,
.step-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cool), var(--warm), transparent);
  opacity: 0.7;
}

.recent-card {
  min-height: 260px;
}

.card-topline,
.card-meta,
.project-meta,
.step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.card-label,
.meta-pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(103, 212, 216, 0.08);
  border: 1px solid rgba(103, 212, 216, 0.16);
  color: var(--cool);
  font-size: 0.78rem;
}

.card-label.warm,
.status-pill.active-now {
  color: #ffd9b4;
  background: rgba(255, 177, 106, 0.1);
  border-color: rgba(255, 177, 106, 0.24);
}

.status-pill.steady {
  color: #dceee8;
  background: rgba(121, 219, 157, 0.08);
  border-color: rgba(121, 219, 157, 0.18);
}

.status-pill.cooling,
.status-pill.needs-attention {
  color: #ffd7d7;
  background: rgba(255, 123, 123, 0.08);
  border-color: rgba(255, 123, 123, 0.2);
}

.recent-card h3,
.project-card h3,
.step-card h3 {
  margin-top: 16px;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.recent-copy,
.project-copy {
  color: var(--muted);
  line-height: 1.55;
  margin: 12px 0 18px;
}

.recent-work {
  margin: 18px 0 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.recent-work strong,
.project-card strong,
.step-card strong {
  color: var(--warm-soft);
}

.split-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
}

.agent-list {
  align-content: start;
}

.agent-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

.agent-rank {
  font-size: 2rem;
  color: rgba(255, 177, 106, 0.4);
}

.agent-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.agent-detail {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 6px;
}

.agent-count {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--warm-soft);
}

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

.step-card ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  min-height: 290px;
}

.project-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.9rem;
}

.mono {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .hero-panel,
  .split-layout,
  .recent-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .next-steps {
    grid-template-columns: 1fr;
  }

  .fleet-nodes {
    flex-wrap: wrap;
  }

  .fleet-node {
    min-width: 160px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 20px 14px 32px;
  }

  .masthead,
  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .masthead {
    align-items: start;
    flex-direction: column;
  }

  .masthead-meta,
  .hero-stats {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .agent-card {
    grid-template-columns: auto 1fr;
  }

  .agent-count {
    grid-column: 2;
  }

  .fleet-nodes {
    flex-direction: column;
  }

  .fleet-node {
    min-width: unset;
  }

  .search-modal {
    margin: 0 14px;
    border-radius: 18px;
  }
}

/* Live fleet status styles */
.fleet-offline {
  opacity: 0.45;
}

.fleet-indicator.offline-dot {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(255, 123, 123, 0.4);
}

.fleet-checked {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
  margin-left: 8px;
}

/* GitHub link */
.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(103, 212, 216, 0.2);
  background: rgba(103, 212, 216, 0.06);
  color: var(--cool);
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 180ms ease;
}

.gh-link:hover {
  background: rgba(103, 212, 216, 0.14);
  border-color: rgba(103, 212, 216, 0.4);
  transform: translateY(-1px);
}

/* Per-project GitHub links */
.card-gh-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(103, 212, 216, 0.18);
  background: rgba(103, 212, 216, 0.06);
  color: var(--cool);
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 180ms ease;
}

.card-gh-link:hover {
  background: rgba(103, 212, 216, 0.14);
  border-color: rgba(103, 212, 216, 0.35);
  transform: translateY(-1px);
}

.card-gh-link-sm {
  position: absolute;
  bottom: 16px;
  right: 16px;
  margin-top: 0;
  font-size: 0.76rem;
  padding: 4px 10px;
}
