/* ============================================================
   COLLAPSAR — monochrome space index
   Palette: near-black space, off-white light, bright photon ring
   ============================================================ */

:root {
  --bg:        #060606;
  --bg-deep:   #030303;
  --surface:   rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.05);
  --line:      rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text:      #e8e6e0;
  --text-2:    #9a9a95;
  --text-3:    #5d5d59;
  --hot:       #f6f4ee;   /* photon-ring bright */
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---- background canvas ---- */
#space {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
  pointer-events: none;
}

/* faint top + bottom vignette so text always reads */
.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 38%, transparent 40%, rgba(3,3,3,0.45) 100%),
    linear-gradient(to bottom, rgba(3,3,3,0.55) 0%, transparent 18%, transparent 70%, rgba(3,3,3,0.85) 100%);
}

.page {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================================
   TELEMETRY TOP BAR
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.topbar .brand-min {
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 9px;
}
.topbar .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 8px 1px rgba(246,244,238,0.7);
  animation: pulse 3.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
.topbar .readout { display: flex; gap: 26px; }
.topbar .readout span b { color: var(--text-2); font-weight: 500; }
@media (max-width: 720px) { .topbar .readout { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  height: 100vh;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 40px;
  text-align: center;
}

.hero-top { padding-top: 8vh; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 26px;
}

.wordmark {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(44px, 11vw, 132px);
  letter-spacing: 0.16em;
  margin: 0;
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--hot);
  text-shadow: 0 0 38px rgba(246,244,238,0.18);
}
.wordmark .glyph {
  display: inline-block;
  color: var(--text);
}

.tagline {
  max-width: 540px;
  margin: 26px auto 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
}

.hero-bottom {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.scroll-cue {
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, transparent, var(--text-3));
  position: relative;
  overflow: hidden;
}
.scroll-cue::after {
  content: "";
  position: absolute;
  top: -50%; left: 0;
  width: 1px; height: 50%;
  background: linear-gradient(to bottom, transparent, var(--hot));
  animation: fall 2.4s ease-in-out infinite;
}
@keyframes fall { 0% { top: -50%; } 60%,100% { top: 100%; } }

/* ============================================================
   CONSOLE (search / filter / sort)
   ============================================================ */
.console {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -32px;
  padding: 16px 32px;
  background: linear-gradient(to bottom, rgba(6,6,6,0.92), rgba(6,6,6,0.7));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.console-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.console-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.filter-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-right: 2px;
  flex-shrink: 0;
}
.filter-divider {
  width: 1px;
  align-self: stretch;
  background: var(--line-soft);
  margin: 2px 4px;
}

.search {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
}
.search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 11px 14px 11px 38px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--text-3); text-transform: uppercase; letter-spacing: 0.18em; font-size: 11px; }
.search input:focus {
  border-color: rgba(246,244,238,0.4);
  box-shadow: 0 0 0 1px rgba(246,244,238,0.18), 0 0 22px rgba(246,244,238,0.07);
}
.search .ic {
  position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px;
  border: 1.4px solid var(--text-3);
  border-radius: 50%;
}
.search .ic::after {
  content: ""; position: absolute; right: -4px; bottom: -4px;
  width: 6px; height: 1.4px; background: var(--text-3);
  transform: rotate(45deg);
}
.search .key-hint {
  position: absolute;
  right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 6px 4px;
  pointer-events: none;
  transition: opacity .2s;
}
.search input:focus + .key-hint { opacity: 0; }

.filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.chip:hover { border-color: rgba(246,244,238,0.35); color: var(--text); }
.chip.active {
  background: var(--hot);
  color: #0a0a0a;
  border-color: var(--hot);
  box-shadow: 0 0 18px rgba(246,244,238,0.22);
}

.sort {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.sort select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 10px;
  cursor: pointer;
  outline: none;
}

/* ============================================================
   GRID
   ============================================================ */
.collection {
  padding: 54px 0 120px;
}
.collection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 16px;
}
.collection-head h2 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0;
}
.count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .3s, box-shadow .35s, background .3s;
  will-change: transform;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(246,244,238,0.22);
  background: var(--surface-2);
  box-shadow: 0 18px 50px -20px rgba(0,0,0,0.9), 0 0 30px -8px rgba(246,244,238,0.08);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #060608;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}
.thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.badge {
  position: absolute;
  top: 12px; left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(8,8,8,0.7);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  padding: 5px 9px;
  border-radius: 2px;
}

.card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.card-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.3;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}
.card-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0;
  flex: 1;
  text-wrap: pretty;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.card-meta .arrow {
  opacity: 0;
  transform: translateX(-4px);
  transition: all .3s;
  color: var(--hot);
}
.card:hover .card-meta .arrow { opacity: 1; transform: translateX(0); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---- team sections (each team = a system in orbit) ---- */
.team-section { margin-bottom: 46px; }
.team-section:last-child { margin-bottom: 0; }
.team-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 20px;
}
.team-head .idx {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-3);
}
.team-head h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
}
.team-head .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--line), var(--line-soft) 60%, transparent);
}
.team-head .ct {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

/* secondary (type) chips read a touch quieter than team chips */
.chip.chip-sm {
  font-size: 10px;
  padding: 6px 11px;
  color: var(--text-3);
}
.chip.chip-sm:hover { color: var(--text); }
.chip.chip-sm.active {
  background: transparent;
  color: var(--hot);
  border-color: rgba(246,244,238,0.5);
  box-shadow: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  border-top: 1px solid var(--line-soft);
  padding: 34px 0 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  flex-wrap: wrap;
}
.foot a:hover { color: var(--text); }

@media (max-width: 720px) {
  .page { padding: 0 20px; }
  .console { margin: 0 -20px; padding: 14px 20px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .dot, .scroll-cue::after { animation: none; }
}

/* ---- intro reveal (entering orbit) ---- */
@keyframes settle {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
.eyebrow, .wordmark, .tagline, .hero-bottom {
  animation: settle 1.1s cubic-bezier(.2,.7,.2,1) both;
}
.eyebrow     { animation-delay: 0.05s; }
.wordmark    { animation-delay: 0.18s; }
.tagline     { animation-delay: 0.42s; }
.hero-bottom { animation-delay: 0.7s; }

@media (prefers-reduced-motion: reduce) {
  .eyebrow, .wordmark, .tagline, .hero-bottom { animation: none; }
}
