/* Base layout */

:root {
  --bg: #020617;
  --bg-elevated: #050914;
  --border-subtle: #1f2830;
  --accent: #22c55e;
  --accent-soft: #bbf7d0;
  --accent-pill: #4ade80;
  --text-main: #e5f0ff;
  --text-muted: #9ca3af;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #000 100%);
  color: var(--text-main);
  font-family: var(--font-main);
}

body {
  min-height: 100vh;
}

/* Top nav */

.ag-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    to bottom,
    rgba(2, 6, 23, 0.95),
    rgba(2, 6, 23, 0.88)
  );
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
  padding: 0.7rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.ag-nav-title {
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-soft);
  white-space: nowrap;
}

.ag-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}

.ag-nav-links a {
  font-size: 0.78rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  color: var(--text-main);
  text-decoration: none;
  background: rgba(15, 23, 42, 0.9);
  text-transform: capitalize;
}

.ag-nav-links a.ag-nav-current {
  background: radial-gradient(circle at top left, #22c55e, #14b8a6);
  color: #021015;
  border-color: transparent;
}

/* Main container */

.ag-main {
  max-width: 1024px;
  margin: 1.6rem auto 3rem;
  padding: 0 1rem 2.5rem;
}

/* Hero */

.ag-hero {
  margin-bottom: 1.6rem;
}

.ag-hero-pill {
  display: inline-block;
  padding: 0.22rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 210, 197, 0.7);
  background: rgba(6, 12, 20, 0.9);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.ag-hero-title {
  margin: 0.6rem 0 0.2rem;
  font-size: 1.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ag-hero-sub {
  margin: 0.1rem 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.ag-hero-actions {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Buttons */

.ag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    background 0.1s ease, border-color 0.1s ease;
}

.ag-btn-primary {
  background: radial-gradient(circle at top left, #22c55e, #14b8a6);
  color: #00100b;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35);
}

.ag-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px rgba(34, 197, 94, 0.45);
}

.ag-btn-ghost {
  background: rgba(15, 23, 42, 0.9);
  color: var(--accent-soft);
  border-color: rgba(148, 210, 197, 0.5);
}

.ag-btn-ghost:hover {
  border-color: var(--accent-soft);
}

/* Grid & cards */

.ag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
  margin-top: 1.2rem;
}

.ag-card {
  background: var(--bg-elevated);
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 0 0 1px rgba(8, 16, 24, 0.5);
}

.ag-card-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 0.35rem;
}

.ag-card-footnote {
  margin-top: 0.6rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Triad list / metrics */

.ag-triad-list {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.ag-triad-list li {
  margin-bottom: 0.22rem;
}

.ag-metrics {
  list-style: none;
  padding: 0;
  margin: 0.1rem 0;
  font-size: 0.88rem;
}

.ag-metrics li {
  margin-bottom: 0.25rem;
}

/* Cycle / book index */

.ag-cycle-list {
  font-size: 0.88rem;
}

.ag-cycle-block {
  margin-bottom: 0.6rem;
}

.ag-cycle-block h3 {
  margin: 0 0 0.1rem;
  font-size: 0.9rem;
}

.ag-section {
  margin-top: 1.8rem;
}

.ag-section-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.3rem;
}

.ag-book-index {
  margin-top: 0.6rem;
}

.ag-book-row {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
}

.ag-book-title {
  font-size: 0.9rem;
}

.ag-book-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ag-book-more {
  margin-top: 0.6rem;
}

/* Logs and muted text */

.ag-log-snippet {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(31, 41, 55, 0.9);
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.ag-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Status bar & footer note */

.ag-footer-note {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ag-status-bar {
  margin-top: 1.2rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(3, 7, 18, 0.96);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ag-status-ok {
  border-color: rgba(34, 197, 94, 0.7);
  color: var(--accent-soft);
}

.ag-status-warn {
  border-color: #fbbf24;
  color: #facc15;
}

.ag-status-err {
  border-color: #fb7185;
  color: #fecdd3;
}

/* Links */

a {
  color: #a5f3fc;
}

a:hover {
  text-decoration: underline;
}

/* Mobile tweaks */

@media (max-width: 640px) {
  .ag-nav {
    justify-content: flex-start;
  }

  .ag-nav-title {
    width: 100%;
  }

  .ag-main {
    padding-bottom: 2.2rem;
  }

  .ag-hero-title {
    font-size: 1.6rem;
  }
}
