/* The validation page: the results of the NIS benchmark report. It uses ../styles.css for the base. */

:root {
  /* the marks of the charts: checked with the dataviz palette validator on --bg-2 (dark) */
  --ok: #14a6c8;
  --out: #c98a12;
  --far: #e8508f;
  --bar: #8f6ff0;
  --surface: #0a0f1c;
  --grid: rgba(148, 173, 222, 0.12);
  --band: rgba(148, 173, 222, 0.08);
}

.nav nav a[aria-current] { color: var(--text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- hero ---- */
.v-hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(120px, 16vw, 180px) clamp(20px, 4vw, 40px) clamp(40px, 6vw, 70px);
}
.v-hero h1 { font-size: clamp(2.5rem, 6.4vw, 4.8rem); }
.verdict {
  display: flex; gap: 16px; align-items: flex-start; max-width: 46em;
  margin: 2em 0 0; padding: 20px 22px; border-radius: var(--radius);
  background: rgba(20, 166, 200, 0.08); border: 1px solid rgba(20, 166, 200, 0.35);
}
.verdict p { margin: 0; color: #c9d6f2; }
.verdict strong { color: var(--text); display: block; margin-bottom: 4px; font-size: 1.08rem; }
.verdict-icon {
  flex: none; width: 34px; height: 34px; padding: 6px; border-radius: 50%;
  background: var(--ok); fill: none; stroke: #041018; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}
.btn-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pdf-meta { margin-top: 14px; font-family: var(--mono); font-size: 0.78rem; color: rgba(147, 161, 194, 0.8); }

/* ---- sections ---- */
.v-section { max-width: var(--max); margin: 0 auto; padding: clamp(56px, 8vw, 100px) clamp(20px, 4vw, 40px); }
.v-intro { max-width: 46em; font-size: 1.05rem; }
.v-note { max-width: 52em; margin-top: 28px; font-size: 0.95rem; }
h3 { margin: 0 0 6px; font-size: 1.15rem; letter-spacing: -0.01em; }

/* ---- code check ---- */
.check-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 36px 0 28px; }
.check-card {
  padding: 24px 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.check-n { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.check-n small { font-size: 1.05rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.check-k { font-weight: 650; line-height: 1.3; }
.check-v { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
@media (max-width: 980px) { .check-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .check-grid { grid-template-columns: 1fr; } }

/* ---- figures and charts ---- */
.v-figure, .explorer {
  margin: 0; padding: 22px clamp(14px, 2.4vw, 26px) 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.v-figure figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.fig-title { font-weight: 650; }
.fig-sub { color: var(--muted); font-size: 0.88rem; }
.chart { position: relative; width: 100%; min-height: 200px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-main { min-height: 360px; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text, .chart .tick { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.chart .axis-title { fill: var(--muted); font-family: var(--font); font-size: 12px; }
.chart .one { stroke: rgba(232, 238, 252, 0.55); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .band { fill: var(--band); }
.chart .band-label { fill: rgba(147, 161, 194, 0.85); font-family: var(--mono); font-size: 10.5px; }
.chart .cursor { stroke: rgba(232, 238, 252, 0.35); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .dim { opacity: 0.12; }
.chart .found { stroke: var(--text); stroke-width: 2; }
.chart .hl { stroke: var(--text) !important; stroke-width: 2 !important; }
.chart .direct { fill: var(--text); font-family: var(--mono); font-size: 11px; }
.chart .edge { fill: var(--muted); font-family: var(--mono); font-size: 10px; }

/* the marks: shape and colour, so that the state is never colour alone */
.m-ok { fill: var(--ok); stroke: var(--surface); stroke-width: 1.5; }
.m-out { fill: var(--surface); stroke: var(--out); stroke-width: 2.2; }
.m-far { fill: var(--far); stroke: var(--surface); stroke-width: 1.2; }
.m-sel { stroke: var(--text); stroke-width: 2; }

/* ---- benchmarks ---- */
.suite-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 36px; }
.suite-card {
  position: relative; padding: 24px 22px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; cursor: pointer;
  transition: transform 0.3s, border-color 0.3s;
}
.suite-card:hover, .suite-card:focus-visible { transform: translateY(-4px); border-color: rgba(94, 231, 255, 0.4); outline: none; }
.suite-card p { margin: 0; }
.suite-agree { color: var(--text) !important; }
.suite-agree b { font-weight: 650; }
.suite-v { font-size: 0.88rem; line-height: 1.5; flex: 1; }
.ring {
  --p: 0; position: relative; width: 84px; height: 84px; border-radius: 50%; margin-bottom: 10px;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), rgba(148, 173, 222, 0.14) 0);
  display: grid; place-items: center; transition: --p 1.4s;
}
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg-2); }
.ring-n { position: relative; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.tests { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tests li {
  font-family: var(--mono); font-size: 0.7rem; padding: 3px 8px; border-radius: 999px;
  color: rgba(147, 161, 194, 0.55); border: 1px dashed rgba(148, 173, 222, 0.18);
}
.tests li.on { color: var(--text); border: 1px solid rgba(20, 166, 200, 0.55); background: rgba(20, 166, 200, 0.12); }
@media (max-width: 980px) { .suite-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .suite-grid { grid-template-columns: 1fr; } }

/* ---- explorer ---- */
.explorer { margin-top: 32px; }
.controls { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.controls-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.seg button {
  font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--muted);
  padding: 8px 14px; border-radius: 10px; border: 0; background: transparent; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"] { color: #041018; background: linear-gradient(100deg, var(--cyan), var(--blue)); }
.seg button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.select, .search { display: flex; flex-direction: column; gap: 4px; }
.select span { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.select select, .search input {
  font: inherit; font-size: 0.92rem; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-height: 40px;
}
.select select { padding-right: 30px; max-width: 100%; }
.search { flex: 1; min-width: 200px; }
.search input { width: 100%; }
.select select:focus, .search input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }

.summary { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 4px 0 12px; font-size: 0.92rem; color: var(--muted); }
.summary b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.summary .big b { font-size: 1.1rem; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 6px; font-size: 0.85rem; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg svg { width: 13px; height: 13px; overflow: visible; }
.lg-band i { width: 22px; height: 12px; border-radius: 3px; background: rgba(148, 173, 222, 0.16); }
.chart-note { margin: 6px 0 0; font-size: 0.85rem; }
.chart-note:empty { display: none; }

.table-view { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.table-view summary { cursor: pointer; color: var(--cyan); font-weight: 600; font-size: 0.92rem; width: fit-content; }
.table-wrap { overflow: auto; max-height: 460px; margin-top: 12px; border-radius: 12px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
thead th {
  position: sticky; top: 0; z-index: 1; background: var(--bg-2);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600; color: var(--muted); letter-spacing: 0.04em;
}
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
td.state { text-align: left; color: var(--muted); }
td.state svg { width: 11px; height: 11px; vertical-align: -1px; margin-right: 6px; overflow: visible; }
td.sel { color: var(--text); font-weight: 650; }

/* ---- causes ---- */
.cause-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 36px 0 20px; }
.cause-card { margin: 0; padding: 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.cause-card figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.cause-card figcaption span { color: var(--muted); font-size: 0.88rem; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 9.5em 1fr 2.5em; align-items: center; gap: 12px; font-size: 0.9rem; }
.bar-k { color: var(--text); }
.bar-track { display: block; height: 14px; border-radius: 4px; background: rgba(148, 173, 222, 0.08); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 0 4px 4px 0; background: var(--bar); transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }
.bar-n { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.bar-row.code .bar-k { color: var(--ok); font-weight: 650; }
.bar-row.code .bar-n { color: var(--ok); }
.bar-row.code .bar-track { border: 1px dashed rgba(20, 166, 200, 0.5); background: transparent; }
@media (max-width: 800px) { .cause-grid { grid-template-columns: 1fr; } }

.finding-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.finding { padding: 24px 22px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line); }
.finding ul { margin: 10px 0 0; padding-left: 1.1em; display: grid; gap: 8px; color: var(--muted); font-size: 0.92rem; }
.finding li::marker { color: var(--cyan); }
.finding b { color: var(--text); font-weight: 650; }
@media (max-width: 900px) { .finding-grid { grid-template-columns: 1fr; } }

/* ---- overview table ---- */
.overview-wrap { max-height: none; margin-top: 28px; background: var(--card); }
.overview td.bench-name { font-weight: 650; color: var(--text); vertical-align: top; padding-top: 12px; }
.overview td.run { text-align: left; color: var(--muted); }
.overview tr.ref td.run { color: var(--text); font-weight: 600; }
.overview tr.first td { border-top: 1px solid rgba(148, 173, 222, 0.3); }
.overview .meter { display: inline-block; width: 64px; height: 6px; margin-left: 10px; border-radius: 3px; background: rgba(148, 173, 222, 0.14); vertical-align: middle; overflow: hidden; }
.overview .meter i { display: block; height: 100%; background: var(--ok); border-radius: 0 3px 3px 0; }

/* ---- report band ---- */
.report-band {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center;
  padding: clamp(28px, 4vw, 48px); border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(140deg, rgba(77, 141, 255, 0.14), rgba(94, 231, 255, 0.05) 50%, rgba(167, 139, 250, 0.1));
  border: 1px solid rgba(94, 231, 255, 0.25);
}
.report-text h2 { margin-bottom: 0.4em; }
.method { margin: 0; display: grid; gap: 14px; }
.method div { padding-left: 14px; border-left: 2px solid rgba(94, 231, 255, 0.35); }
.method dt { font-weight: 650; }
.method dd { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 860px) { .report-band { grid-template-columns: 1fr; } }

/* ---- tooltip ---- */
.v-tip { position: fixed; white-space: normal; max-width: 300px; line-height: 1.5; font-family: var(--font); font-size: 0.84rem; }
.v-tip .t-name { font-weight: 650; font-size: 0.92rem; margin-bottom: 4px; }
.v-tip .t-state { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--muted); }
.v-tip .t-state svg { width: 11px; height: 11px; overflow: visible; }
.v-tip table { font-size: 0.8rem; }
.v-tip td { padding: 1px 0; border: 0; }
.v-tip td:first-child { color: var(--muted); padding-right: 14px; }
.v-tip tr.sel td { color: var(--text); font-weight: 650; }
.v-tip .t-cause { margin-top: 6px; color: var(--text); }
.v-tip .t-cause span { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .bar-fill, .ring { transition: none !important; }
}
@media (forced-colors: active) {
  .m-ok, .m-far, .bar-fill, .ring { forced-color-adjust: none; }
}
