/* ===================================================
   Homepage platform bento: product graphics built in code
   (they replace the screenshot images). Motion: platform-viz.js
   Framework colours match the rest of the homepage:
   ISO #8EC5FF · NCA #2DC882 · SAMA #F2C14E · NIST #B79CFF
   =================================================== */

.bento-card__visual--code {
  height: 240px;
  padding: 6px 24px 24px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.bv {
  width: 100%;
  font-family: var(--font-body);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.bento-card:hover .bv { transform: translateY(-3px); }

/* shared panel surface + status pills */
.bv-panel, .bv-cop__doc, .bv-cop__map, .bv-sama, .bv-pdpl, .bv-cms__client, .bv-cms__alert {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.006)), #0C0C12;
}
.bv-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  white-space: nowrap;
  color: var(--pc, var(--text-tertiary));
  background: color-mix(in srgb, var(--pc, #ffffff) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--pc, #ffffff) 22%, transparent);
  transition: color 0.35s ease, background 0.35s ease, border-color 0.35s ease;
}
.bv-pill--ok    { --pc: #2DC882; }
.bv-pill--mid   { --pc: #FFB020; }
.bv-pill--bad   { --pc: #FF4D4F; }
.bv-pill--draft { --pc: #9A9AAE; }
.bv-pill sup { font-size: 9px; opacity: 0.8; vertical-align: 0; }
.bv-spin {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  animation: bv-spin 0.7s linear infinite;
}
@keyframes bv-spin { to { transform: rotate(360deg); } }

/* ---------- Copilot: policy read, controls covered ---------- */
.bv-cop { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 12px; align-items: stretch; }
.bv-cop__doc { position: relative; overflow: hidden; padding: 12px 14px; display: grid; align-content: start; gap: 8px; }
.bv-cop__bar { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; }
.bv-cop__bar svg { flex: 0 0 auto; width: 13px; height: 13px; color: var(--accent-primary); }
.bv-cop__bar span { overflow: hidden; text-overflow: ellipsis; }
.bv-cop__line {
  display: block;
  width: var(--w);
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.bv-cop__line[data-cite="1"].is-hit { background: rgba(45, 200, 130, 0.7); box-shadow: 0 0 10px rgba(45, 200, 130, 0.4); }
.bv-cop__line[data-cite="2"].is-hit { background: rgba(255, 176, 32, 0.7); box-shadow: 0 0 10px rgba(255, 176, 32, 0.35); }
.bv-cop__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 28px;
  background: linear-gradient(180deg, transparent, rgba(45, 200, 130, 0.14) 70%, rgba(45, 200, 130, 0.5) 96%, transparent);
  opacity: 0;
  pointer-events: none;
}
.bv-cop__map { padding: 12px 14px; display: grid; align-content: start; gap: 9px; }
.bv-cop__head { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 2px; }
.bv-cop__head b { color: var(--text-primary); font-weight: 600; }
.bv-cop__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
  color: var(--text-secondary);
}
.bv-cop__row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-cop__row .bv-pill { opacity: 0; transform: scale(0.8); transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.bv-cop__row.is-on .bv-pill { opacity: 1; transform: none; }
.bv-cop__row.is-on > span { color: var(--text-primary); }

/* ---------- SAMA: maturity ladder ---------- */
.bv-sama { padding: 14px 16px; display: grid; gap: 11px; }
.bv-sama__head { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--text-tertiary); }
.bv-sama__target { display: inline-flex; align-items: center; gap: 6px; }
.bv-sama__target i { width: 1px; height: 11px; background: repeating-linear-gradient(180deg, #F2C14E 0 2px, transparent 2px 4px); }
.bv-sama__row { display: grid; grid-template-columns: minmax(0, 1fr) 40% 52px; align-items: center; gap: 12px; font-size: 12px; color: var(--text-secondary); }
.bv-sama__row > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-sama__row b { font-weight: 500; color: var(--text-primary); text-align: right; font-size: 11.5px; }
.bv-sama__row.is-gap b { color: #FFB020; }
.bv-sama__track { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.bv-sama__track i { height: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); transition: background 0.3s ease, box-shadow 0.3s ease; }
.bv-sama__track i.is-on { background: #2DC882; box-shadow: 0 0 8px rgba(45, 200, 130, 0.35); }
.bv-sama__row.is-gap .bv-sama__track i.is-on { background: #FFB020; box-shadow: 0 0 8px rgba(255, 176, 32, 0.35); }
/* level 3 target marker, after the third segment */
.bv-sama__track::after {
  content: '';
  position: absolute;
  left: calc(60% - 0.5px);
  top: -5px;
  bottom: -5px;
  width: 1px;
  background: repeating-linear-gradient(180deg, #F2C14E 0 2px, transparent 2px 4px);
  opacity: 0.8;
}

/* ---------- PDPL: processing register ---------- */
.bv-pdpl { padding: 6px 14px 10px; }
.bv-pdpl__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 100px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
  color: var(--text-secondary);
}
.bv-pdpl__row > em { justify-self: start; }
.bv-pdpl__row--head { font-size: 11px; color: var(--text-tertiary); padding: 6px 0 8px; }
.bv-pdpl__row > span:first-child { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.bv-pdpl__row--head > span:first-child { color: var(--text-tertiary); }
.bv-pdpl__dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.bv-pdpl__basis { color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-pdpl__rows { overflow: hidden; }
.bv-pdpl__rows .bv-pdpl__row:last-child { border-bottom: 0; }
.bv-pdpl__row--new { overflow: hidden; transition: max-height 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), padding 0.5s ease, opacity 0.4s ease, background 0.6s ease; max-height: 44px; }
.bv-pdpl__row--new .bv-pdpl__dot { background: var(--accent-primary); box-shadow: 0 0 8px rgba(45, 200, 130, 0.6); }
.bv-pdpl__row--new.is-out { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; border-bottom-color: transparent; }
.bv-pdpl__row--new.is-fresh { background: linear-gradient(90deg, rgba(45, 200, 130, 0.08), transparent 70%); }

/* ---------- CMS: client portfolio ---------- */
.bv-cms { display: grid; gap: 10px; }
.bv-cms__clients { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bv-cms__client { padding: 12px; display: grid; gap: 7px; }
.bv-cms__name { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-cms__fws { display: flex; gap: 4px; }
.bv-cms__fws i { width: 7px; height: 7px; border-radius: 50%; background: var(--fw); }
.bv-cms__pct { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); line-height: 1.1; }
.bv-cms__bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bv-cms__bar i { display: block; height: 100%; width: var(--p); border-radius: 2px; background: linear-gradient(90deg, #1E9E66, #2DC882); transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.bv-cms.is-reset .bv-cms__bar i { width: 0; transition: none; }
.bv-cms__alert { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 10px 12px; transition: border-color 0.5s ease; }
.bv-cms__alert.is-renewed { border-color: rgba(45, 200, 130, 0.3); }
.bv-cms__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #FFB020; background: rgba(255, 176, 32, 0.1); border: 1px solid rgba(255, 176, 32, 0.25); transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease; }
.bv-cms__icon svg { width: 15px; height: 15px; }
.bv-cms__alert.is-renewed .bv-cms__icon { color: var(--accent-primary); background: rgba(45, 200, 130, 0.1); border-color: rgba(45, 200, 130, 0.28); }
.bv-cms__msg { display: grid; min-width: 0; }
.bv-cms__msg strong { font-size: 12.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-cms__msg small { font-size: 11.5px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (prefers-reduced-motion: reduce) {
  .bv-spin { animation: none; }
}

/* Narrow cards. These respond to the card's own width (container queries),
   so they apply on tablets as well as phones. */
.bento-card__visual--code { container-type: inline-size; }

@container (max-width: 470px) {
  .bv-sama__row { grid-template-columns: minmax(0, 1fr) 38% 44px; gap: 10px; }
  .bv-sama__row > span:first-child { white-space: normal; line-height: 1.25; }
  .bv-pdpl__row { grid-template-columns: minmax(0, 1fr) 108px 100px; }
}
@container (max-width: 400px) {
  .bv-cop { grid-template-columns: 0.7fr 1.3fr; gap: 8px; }
  .bv-cop__doc, .bv-cop__map { padding: 10px; }
  .bv-cop__row { padding: 7px 8px; font-size: 11.5px; }
  .bv-cop__bar span { display: none; }
  .bv-sama__row { grid-template-columns: minmax(0, 1fr) 40% 14px; gap: 8px; font-size: 11px; }
  .bv-sama__row b span { display: none; }
  .bv-pdpl__row { grid-template-columns: minmax(0, 1fr) 100px; font-size: 11.5px; }
  .bv-pdpl__basis { display: none; }
  .bv-cms__clients { gap: 6px; }
  .bv-cms__client { padding: 9px; }
  .bv-cms__name { font-size: 11px; white-space: normal; line-height: 1.25; min-height: 2.5em; }
  .bv-cms__pct { font-size: 19px; }
  .bv-cms__msg strong { white-space: normal; line-height: 1.3; }
}
@container (max-width: 280px) {
  .bv-pdpl { padding: 4px 10px 8px; }
  .bv-pdpl__row { grid-template-columns: minmax(0, 1fr) 90px; gap: 8px; }
  .bv-pdpl__row .bv-pill { padding: 2px 7px; }
  .bv-cms__msg small { white-space: normal; line-height: 1.3; }
  .bv-cms__alert { gap: 9px; padding: 9px 10px; }
}
@container (max-width: 230px) {
  .bv-cop { grid-template-columns: minmax(0, 1fr); }
  .bv-cop__head { flex-wrap: wrap; gap: 2px 8px; }
  .bv-cop__row { gap: 6px; }
  .bv-cop__doc { display: none; }
  .bv-pdpl__row { font-size: 11px; }
  .bv-pdpl__dot { display: none; }
  .bv-cms__clients { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bv-cms__client:nth-child(3) { display: none; }
  .bv-cms__alert { grid-template-columns: auto minmax(0, 1fr); }
  .bv-cms__alert > .bv-pill { grid-column: 2; justify-self: start; }
  .bv-pdpl__row > span:first-child { white-space: normal; line-height: 1.3; }
}
@media (max-width: 520px) {
  .bento-card__visual--code { padding: 6px 16px 18px; }
}
@media (max-width: 360px) {
  .bento-card__visual--code { height: auto; min-height: 220px; }
}
