/* TRIMCode — whole-family evidence and reasoning surface. */

.trimcode-masthead {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 22%, rgba(244, 164, 91, .38), transparent 25%),
    radial-gradient(circle at 70% 88%, rgba(79, 181, 174, .24), transparent 34%),
    linear-gradient(134deg, #10283d, #174b61 58%, #187d78);
}

.trimcode-masthead::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -120px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(255,255,255,.028), 0 0 0 96px rgba(255,255,255,.018);
  pointer-events: none;
}

.trimcode-lab { display: grid; gap: 16px; }

.trim-status-row,
.trim-domain-row,
.trim-choice-row,
.trim-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trim-status,
.trim-domain,
.trim-filter-row button,
.trim-choice-row button {
  padding: 8px 11px;
  border: 1px solid #cbd6dc;
  border-radius: 999px;
  background: #fff;
  color: #486474;
  font-size: .76rem;
  font-weight: 760;
}

.trim-status.observed { border-color: #62b9ae; background: #edf8f5; color: #205d56; }
.trim-status.inferred { border-color: #8fb0d9; background: #f0f5fb; color: #315d90; }
.trim-status.proposed { border-color: #e2ad6d; background: #fff7eb; color: #815a28; }

.trim-card,
.trim-media-card,
.trim-result-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.trim-card h4,
.trim-media-card h4,
.trim-result-card h4 { margin: 5px 0 9px; color: var(--navy); font-size: 1.06rem; }
.trim-card p,
.trim-media-card p,
.trim-result-card p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.58; }

.trim-domain {
  min-width: 74px;
  border-radius: 9px;
  text-align: center;
}
.trim-domain.core { border-color: #d8964f; background: #fff4e7; color: #7f4a17; }
.trim-domain.variable { border-color: #62b9ae; background: #edf8f5; color: #205d56; }

.trim-filter-row button,
.trim-choice-row button { cursor: pointer; }
.trim-filter-row button.active,
.trim-choice-row button.active { border-color: #1763d6; background: #1763d6; color: #fff; }

.trim-atlas-layout {
  display: grid;
  grid-template-columns: minmax(200px, .7fr) minmax(300px, 1.3fr);
  gap: 12px;
}

.trim-atlas-list {
  max-height: 390px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 5px;
}

.trim-atlas-list button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid #d5dfe4;
  border-radius: 8px;
  background: #fff;
  color: #405c6d;
  text-align: left;
}
.trim-atlas-list button.active { border-color: #1763d6; background: #eef4fd; color: #123c75; font-weight: 800; }

.trim-media-card img {
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  border-radius: 9px;
  background: #07131e;
}

.trim-media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trim-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.trim-metric { padding: 14px; border-top: 3px solid #d8964f; background: #f8fafb; }
.trim-metric strong { display: block; color: var(--navy); font-family: Georgia, serif; font-size: 1.35rem; }
.trim-metric span { display: block; margin-top: 6px; color: #607583; font-size: .72rem; line-height: 1.35; }

.trim-citation { margin-top: 10px !important; font-size: .74rem !important; }
.trim-citation a { color: #1763d6; }

@media (max-width: 800px) {
  .trim-atlas-layout,
  .trim-media-grid { grid-template-columns: 1fr; }
  .trim-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .trim-metric-grid { grid-template-columns: 1fr; }
}

.trimcode-videos { width: min(var(--hrs-max, 1320px), calc(100% - 88px)); margin: 0 auto; padding: 32px 0 8px; }
.trimcode-video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 12px; }
.trimcode-video-card { border-radius: 14px; overflow: hidden; border: 1px solid rgba(16,36,58,.14); background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.trimcode-video-card:hover { border-color: rgba(16,36,58,.28); box-shadow: 0 16px 38px rgba(16,40,61,.09); }
.trimcode-video-card video { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #071820; }
.trimcode-video-card p { margin: 0; padding: 12px 14px 14px; font: 700 .85rem/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #10243a; }
@media(max-width: 620px) { .trimcode-video-grid { grid-template-columns: 1fr; } }
@media(max-width: 1080px) { .trimcode-videos { width: min(var(--hrs-max, 1320px), calc(100% - 52px)); } }
@media(max-width: 820px) { .trimcode-videos { width: calc(100% - 36px); } }
.video-lab-credit { display: inline-block; margin-top: 4px; color: #587087; font-weight: 700; font-size: .78rem; }

.trimcode-masthead .bioai-hero-text { min-width: 0; }

.trimcode-research-brief {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 650px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid rgba(255,255,255,.16);
}
.trimcode-masthead .trimcode-research-brief p {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 14px;
  max-width: 100% !important;
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: .82rem;
  line-height: 1.48;
  white-space: normal !important;
}
.trimcode-research-brief span {
  min-width: 0;
  overflow-wrap: break-word;
}
.trimcode-research-brief strong {
  color: #8ee5dd;
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}
@media (max-width: 620px) {
  .trimcode-research-brief { margin-top: 18px; padding-top: 14px; }
  .trimcode-masthead .trimcode-research-brief p { grid-template-columns: 1fr; gap: 3px; }
}
