/**
 * Echoes home — constellation dark shell
 * Baseline tokens: www.vayati.com + weave.vayati.ai
 * Echo accent: emerald (Weave pyramid Echoes node)
 */
:root {
  --bg: #050310;
  --bg-elevated: #0a051e;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --text: #e8e0d5;
  --text-soft: #c4bddc;
  --muted: #8a82a8;
  --muted-dim: #6a6385;
  --cyan: #00ffff;
  --violet: #9d6bff;
  --emerald: #34d399;
  --emerald-dim: rgba(52, 211, 153, 0.15);
  --gold: #e8c56a;
  --border: rgba(157, 107, 255, 0.28);
  --border-soft: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --max: 68rem;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .echo-card,
  .kind-tab,
  .btn {
    transition: none !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #c8e8ff;
  text-decoration: none;
}
a:hover,
a:focus-visible {
  color: #9ef;
  outline: none;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.85rem;
  background: #16122a;
  color: var(--text);
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.skip-link:focus {
  left: 0.75rem;
}

/* —— Top bar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(5, 3, 16, 0.88);
  border-bottom: 1px solid var(--border-soft);
}
.topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #c8e8ff;
}
.brand:hover {
  color: #9ef;
}
.brand__mark {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.65);
  display: inline-block;
  position: relative;
  top: -1px;
}
.brand__name {
  font-size: 0.95rem;
}
.brand__sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
  font-size: 0.82rem;
}
.topnav a {
  color: var(--text-soft);
}
.topnav a:hover {
  color: var(--cyan);
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: var(--emerald-dim);
  color: var(--emerald);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.live-pill::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}
.live-pill[data-state="degraded"] {
  border-color: rgba(232, 197, 106, 0.4);
  background: rgba(232, 197, 106, 0.12);
  color: var(--gold);
}
.live-pill[data-state="degraded"]::before {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}
.live-pill[data-state="down"] {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}
.live-pill[data-state="down"]::before {
  background: #f87171;
}

/* —— Hero —— */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.hero__glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background:
    radial-gradient(ellipse 50% 60% at 20% 40%, rgba(52, 211, 153, 0.12), transparent 70%),
    radial-gradient(ellipse 45% 55% at 80% 30%, rgba(157, 107, 255, 0.14), transparent 70%),
    radial-gradient(ellipse 40% 50% at 50% 80%, rgba(0, 255, 255, 0.06), transparent 70%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
}
.hero__kicker {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald);
}
.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 650;
  line-height: 1.2;
  color: #f4f0ff;
  max-width: 22ch;
}
.hero__lead {
  margin: 0 0 1.35rem;
  max-width: 42rem;
  color: var(--text-soft);
  font-size: 1.02rem;
}
.hero__hierarchy {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0 0 1.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(157, 107, 255, 0.25);
  background: rgba(157, 107, 255, 0.08);
  font-size: 0.8rem;
  color: var(--text-soft);
}
.hero__hierarchy strong {
  color: var(--violet);
  font-weight: 650;
}
.hero__hierarchy .apex {
  color: #efe6ff;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn--primary {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(0, 255, 255, 0.12));
  border-color: rgba(52, 211, 153, 0.45);
  color: #e8fbfc;
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.32), rgba(0, 255, 255, 0.18));
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.2);
  color: #fff;
  outline: none;
}
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-soft);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: rgba(0, 255, 255, 0.35);
  color: var(--cyan);
  outline: none;
}

/* —— Search / filters —— */
.panel {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  margin: 0 0 1rem;
}
@media (max-width: 900px) {
  .edu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .search-row {
    grid-template-columns: 1fr;
  }
  .edu-grid {
    grid-template-columns: 1fr;
  }
}
.search-input {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(10, 5, 30, 0.85);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
.search-input::placeholder {
  color: var(--muted-dim);
}
.search-input:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.kind-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.kind-tab {
  appearance: none;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.kind-tab:hover {
  color: var(--text-soft);
  border-color: rgba(157, 107, 255, 0.4);
}
.kind-tab[aria-selected="true"] {
  color: #e8fbfc;
  border-color: rgba(52, 211, 153, 0.5);
  background: var(--emerald-dim);
}
.kind-tab:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.status-line {
  min-height: 1.35rem;
  margin: 0 0 1.15rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.status-line[data-tone="error"] {
  color: #f87171;
}

/* —— Cards grid —— */
.echo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 1rem;
}
.echo-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
  color: inherit;
  min-height: 100%;
}
a.echo-card:hover,
a.echo-card:focus-visible {
  border-color: rgba(52, 211, 153, 0.45);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  color: inherit;
  outline: none;
}
.echo-card__media {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(145deg, #12101f, #0a0814);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.echo-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.echo-card__ph-badge {
  position: absolute;
  left: 0.45rem;
  bottom: 0.45rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(5, 3, 16, 0.85);
  border: 1px solid rgba(0, 255, 255, 0.4);
  color: #9ef;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.echo-card__media-fallback {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.echo-card__body {
  padding: 0.9rem 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.echo-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chip--person {
  color: #7fd4e0;
  background: rgba(127, 212, 224, 0.12);
  border: 1px solid rgba(127, 212, 224, 0.28);
}
.chip--group {
  color: #c4a8ff;
  background: rgba(157, 107, 255, 0.12);
  border: 1px solid rgba(157, 107, 255, 0.3);
}
.chip--place {
  color: #e6d090;
  background: rgba(232, 197, 106, 0.12);
  border: 1px solid rgba(232, 197, 106, 0.28);
}
.chip--verified {
  color: var(--emerald);
  background: var(--emerald-dim);
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.chip--narrator {
  color: #d4c4a8;
  background: rgba(212, 196, 168, 0.12);
  border: 1px solid rgba(212, 196, 168, 0.32);
}
.echo-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: #f4f0ff;
  line-height: 1.3;
}
.echo-card__years {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.echo-card__summary {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.echo-card__id {
  margin-top: 0.55rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted-dim);
  word-break: break-all;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.echo-card__id-short {
  letter-spacing: 0.04em;
}
.echo-card__id-full {
  color: var(--muted-dim);
  opacity: 0.85;
  font-size: 0.6rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 2rem 1.25rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

/* —— Educate —— */
.edu {
  margin: 2.25rem 0 1.5rem;
}
.edu-title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.edu-lead {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.edu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}
.edu-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: rgba(10, 5, 30, 0.55);
}
.edu-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  color: #efe6ff;
}
.edu-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.edu-card strong {
  color: var(--emerald);
}
.edu-card a {
  color: #c8e8ff;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.edu-card a:hover,
.edu-card a:focus-visible {
  color: #9ef;
}

/* —— Locks strip —— */
.locks {
  margin: 1.5rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 255, 255, 0.15);
  background: rgba(0, 255, 255, 0.04);
  font-size: 0.8rem;
  color: var(--text-soft);
}
.locks ul {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
}
.locks li {
  margin: 0.2rem 0;
  color: var(--muted);
}

/* —— Footer —— */
.footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 1rem;
  padding: 1.5rem 1.25rem 2.5rem;
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  font-size: 0.82rem;
}
.footer__links a {
  color: var(--text-soft);
}
.footer__links a:hover {
  color: var(--cyan);
}
.footer__meta {
  font-size: 0.72rem;
  color: var(--muted-dim);
  font-family: var(--mono);
}
.footer__note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 40rem;
}

/* Skeleton */
.skeleton-grid .echo-card {
  pointer-events: none;
}
.skeleton-media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(90deg, #12101f 25%, #1a1530 50%, #12101f 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
.skeleton-line {
  height: 0.7rem;
  border-radius: 4px;
  margin: 0.45rem 1rem;
  background: rgba(255, 255, 255, 0.06);
}
.skeleton-line--title {
  width: 60%;
  height: 1rem;
  margin-top: 0.85rem;
}
.skeleton-line--body {
  width: 88%;
}
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-media {
    animation: none;
  }
}
