/* ============================================================
   Holdings — the signal-map + filterable holdings ledger.
   The portfolio centerpiece. Loaded after styles.css; it reuses
   the shared Suede IP-Terminal token system (no new palette).
   ============================================================ */

.holdings-shell {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--space-gutter);
}

.holdings-head {
  display: grid;
  gap: 18px;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem);
}

.holdings-head h2 {
  max-width: 22ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-h1);
  line-height: 1.05;
}

.holdings-head p {
  max-width: 66ch;
  color: var(--text-muted);
  font-size: var(--text-base);
  line-height: 1.7;
}

/* ── Signal-map: flagship core → category traces (circuit aesthetic) ── */

.signal-map {
  display: grid;
  grid-template-columns: minmax(180px, 250px) 1fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  margin-bottom: clamp(1.75rem, 1.25rem + 2vw, 3rem);
  padding: clamp(20px, 3vw, 34px);
  border: var(--border-width) solid var(--hairline-cyan);
  border-radius: var(--radius);
  background:
    radial-gradient(130% 120% at 0% 50%, var(--glow-cyan), transparent 58%),
    var(--ink-control);
  overflow: hidden;
}

.smap-core {
  position: relative;
  display: grid;
  gap: 8px;
  padding: clamp(18px, 2vw, 24px);
  border: var(--border-width) solid var(--rights-red);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--rights-red) 24%, transparent), transparent 68%),
    var(--ink-deep);
}

.smap-core-tag {
  color: #f3aab0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.smap-core-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
  color: var(--text-primary);
}

.smap-core-sub {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.smap-rails {
  position: relative;
  display: grid;
  gap: clamp(8px, 1.4vw, 13px);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* the vertical bus the traces branch from */
.smap-rails::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9%;
  bottom: 9%;
  width: 2px;
  background: var(--hairline-cyan);
}

.smap-rail {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 230px);
  align-items: center;
  gap: 10px;
}

.smap-rail-trace {
  height: 2px;
  background-color: var(--hairline-cyan);
  background-image: linear-gradient(90deg, transparent, var(--registry-cyan), transparent);
  background-repeat: no-repeat;
  background-size: 42% 100%;
  background-position: -45% 0;
  animation: railPulse 3.4s linear infinite;
}

.smap-rail:nth-child(2) .smap-rail-trace { animation-delay: 0.55s; }
.smap-rail:nth-child(3) .smap-rail-trace { animation-delay: 1.1s; }
.smap-rail:nth-child(4) .smap-rail-trace { animation-delay: 1.65s; }
.smap-rail:nth-child(5) .smap-rail-trace { animation-delay: 2.2s; }
.smap-rail:nth-child(6) .smap-rail-trace { animation-delay: 2.75s; }

@keyframes railPulse {
  to { background-position: 145% 0; }
}

.smap-node {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 9px 13px;
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--ink-deep);
}

.smap-node-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.smap-node-meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums lining-nums;
}

/* ── Console toolbar: live count + status filters ── */

.registry-console {
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius);
  background: var(--ink-control);
  overflow: hidden;
}

.registry-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px clamp(16px, 3vw, 26px);
  border-bottom: var(--border-width) solid var(--hairline-cyan);
  background: color-mix(in srgb, var(--registry-cyan) 6%, transparent);
}

.registry-count {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums lining-nums;
}

.registry-count b {
  color: var(--registry-cyan);
  font-weight: 600;
}

.registry-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reg-chip {
  min-height: 40px;
  padding: 0 14px;
  border: var(--border-width) solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.reg-chip:hover {
  color: var(--text-primary);
  border-color: var(--hairline-cyan);
}

.reg-chip.is-active {
  color: var(--ink-deep);
  background: var(--registry-cyan);
  border-color: var(--registry-cyan);
}

.reg-chip:focus-visible {
  outline: 2px solid var(--registry-cyan);
  outline-offset: 2px;
}

/* ── Ledger rows ── */

.registry {
  margin: 0;
  padding: 0;
  list-style: none;
}

.registry-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(12px, 2.4vw, 26px);
  padding: clamp(15px, 2.2vw, 22px) clamp(16px, 3vw, 26px);
  border-bottom: var(--border-width) solid var(--hairline);
  transition:
    background var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.registry-row:last-child {
  border-bottom: 0;
}

.registry-row[hidden] {
  display: none;
}

.registry-row:hover {
  background: color-mix(in srgb, var(--registry-cyan) 6%, transparent);
  box-shadow: inset 3px 0 0 var(--registry-cyan);
}

.registry-row.is-flagship {
  background: linear-gradient(90deg, var(--glow-red), transparent 62%);
  box-shadow: inset 3px 0 0 var(--rights-red);
}

.registry-row.is-flagship:hover {
  box-shadow: inset 3px 0 0 var(--rights-red-bright);
}

.registry-id {
  align-self: start;
  padding-top: 3px;
  color: var(--registry-cyan);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
}

.is-flagship .registry-id {
  color: var(--rights-red-bright);
}

.registry-main {
  min-width: 0;
}

.registry-main h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-h3);
  line-height: 1.12;
  color: var(--text-primary);
}

.registry-cat {
  padding: 3px 9px;
  border: var(--border-width) solid var(--hairline);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.registry-main p {
  max-width: 72ch;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

/* ── Status chips (semantic, by lifecycle) ── */

.status--flagship,
.status--live,
.status--beta,
.status--building {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 108px;
  padding: 7px 12px;
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status--flagship::before,
.status--live::before,
.status--beta::before,
.status--building::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.status--flagship {
  color: #f3aab0;
  border-color: color-mix(in srgb, var(--rights-red) 52%, transparent);
  background: color-mix(in srgb, var(--rights-red) 18%, transparent);
}

.status--live {
  color: var(--verified-emerald);
  border-color: color-mix(in srgb, var(--verified-emerald) 42%, transparent);
  background: color-mix(in srgb, var(--verified-emerald) 12%, transparent);
}

.status--beta {
  color: var(--registry-cyan);
  border-color: var(--hairline-cyan);
  background: color-mix(in srgb, var(--registry-cyan) 10%, transparent);
}

.status--building {
  color: var(--text-muted);
}

/* ── Outbound link / pending marker ── */

.registry-link {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition:
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.registry-link svg {
  width: 16px;
  height: 16px;
}

.registry-link:hover,
.registry-link:focus-visible {
  color: var(--text-primary);
  border-color: var(--registry-cyan);
  background: color-mix(in srgb, var(--registry-cyan) 14%, transparent);
}

.registry-link:focus-visible {
  outline: 2px solid var(--registry-cyan);
  outline-offset: 2px;
}

.registry-soon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
}

.registry-empty {
  padding: 30px clamp(16px, 3vw, 26px);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.registry-empty[hidden] {
  display: none;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .signal-map {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .smap-rails::before {
    display: none;
  }

  .smap-rails {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .smap-rail {
    grid-template-columns: 1fr;
  }

  .smap-rail-trace {
    display: none;
  }

  .smap-node {
    min-height: 56px;
    align-content: center;
  }
}

@media (max-width: 600px) {
  .registry-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .registry-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    row-gap: 12px;
  }

  .registry-id {
    padding-top: 2px;
  }

  .status--flagship,
  .status--live,
  .status--beta,
  .status--building {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
  }

  .registry-link,
  .registry-soon {
    grid-row: 1 / span 2;
    grid-column: 3;
    align-self: start;
  }

  .smap-rails {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .smap-rail-trace {
    animation: none;
    background-image: none;
  }
}
