/* Paragon Ultimate Tester: the Mission-control look (U1 to U4, U13).
   Navy is the user's code, silver is checked and fine, crimson is something found.
   Gold and silver are for lines and marks only, never for text. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Variable.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --crimson: #8c1230;
  --navy: #1b2340;
  --gold: #d4a63a;
  --silver: #aeb6c2;
  --page: #f6f6f4;
  --ink: #14182a;
  --muted: #4a5168;
  --line: #c9ced8;
  --panel: #ffffff;
  --grid: rgba(27, 35, 64, 0.07);
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "SFMono-Regular", monospace;
  --track: 0.2em;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--page); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Focus: a navy ring on every control, since gold on off-white is too faint (U13). */
:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px; top: -48px;
  padding: 8px 14px;
  background: var(--panel);
  color: var(--navy);
  border: 1px solid var(--navy);
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Top bar */

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 14px 32px;
  background: var(--panel);
  border-top: 5px solid var(--crimson);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-hero { display: block; width: 48px; height: 48px; }

.wordmark { display: flex; flex-direction: column; margin: 0; line-height: 1.15; }
.wordmark-main {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--navy);
}
.wordmark-sub {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav { display: flex; gap: 8px; }
.nav-item {
  font: 600 12px/1 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--navy);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 12px 8px;
  cursor: pointer;
}
.nav-item:hover { border-bottom-color: var(--line); }
.nav-item[aria-current="page"] { border-bottom-color: var(--gold); }

/* Notices (H8) */

.notice {
  margin: 16px 32px 0;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  font-size: 14px;
}
.notice:empty { display: none; }

/* Layout */

main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 40px;
}

/* The skip link moves focus to main; the whole area needs no ring of its own. */
main:focus { outline: none; }

.view { display: flex; flex-direction: column; gap: 24px; }

/* Without JavaScript there is no helper to talk to, so the page shows its reading
   views, About and How it works. The nav buttons need JavaScript, so they step aside. */
@media (scripting: none) {
  .nav, #view-run, #view-reports { display: none; }
  #view-about[hidden], #view-how[hidden] { display: flex !important; }
}

.console {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .console { grid-template-columns: minmax(0, 1fr); }
  .topbar, main { padding-left: 16px; padding-right: 16px; }
}

/* Panels with navy header strips and a gold underline (U4) */

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
}

.strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 16px;
  background: var(--navy);
  color: #ffffff;
  border-bottom: 2px solid var(--gold);
}

.strip-title {
  margin: 0;
  font: 600 12px/1.2 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
}

.strip-meta {
  white-space: nowrap;
  font: 500 12px/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.strip-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel-body { padding: 18px 16px 20px; }

.field-label {
  display: block;
  margin-bottom: 6px;
  font: 600 11px/1.2 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--muted);
}

/* Method select (U6) */

.select {
  width: 100%;
  padding: 9px 10px;
  font: 500 15px/1.3 var(--sans);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--navy);
  border-radius: 0;
}

.version-row { margin-top: 14px; }

.checks { margin: 14px 0 16px; min-height: 3em; }

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0 0 20px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.facts dt {
  font: 600 11px/1.9 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd { margin: 0; overflow-wrap: anywhere; }

#method-needs { white-space: pre-wrap; }
.needs-ok::before { content: "\2713  "; }
.needs-missing { color: var(--crimson); }
.needs-missing::before { content: "\25B2  "; }

/* Buttons */

.button {
  font: 600 12px/1 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
  padding: 11px 16px;
  border: 1px solid var(--navy);
  border-radius: 0;
  background: var(--panel);
  color: var(--navy);
  cursor: pointer;
  transition: background-color 0.4s ease, color 0.4s ease;
}
.button:hover { background: #eef0f4; }
.button:disabled { cursor: not-allowed; color: var(--muted); border-color: var(--line); background: var(--page); }

.button-primary { background: var(--navy); color: #ffffff; }
.button-primary:hover { background: #2a3560; }
.button-primary.is-stop { background: var(--panel); color: var(--crimson); border-color: var(--crimson); }
.button-wide { display: block; width: 100%; padding: 14px 16px; }

.button-strip { padding: 7px 12px; font-size: 11px; border-color: #ffffff; background: var(--navy); color: #ffffff; }
.button-strip:hover { background: #2a3560; }
.button-strip:disabled { background: var(--navy); color: #b7bdcb; border-color: #4b5577; }
.button-strip:focus-visible { outline-color: #ffffff; }

/* Run window: a faint plotting grid with gold corner ticks (U4, U7) */

.window {
  position: relative;
  background-color: #fbfbfa;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: -1px -1px;
  border: 1px solid var(--line);
}

.window-svg { display: block; width: 100%; height: auto; aspect-ratio: 640 / 280; }

/* Run animations (A1 to A4, U2): navy is the code, silver is checked and fine,
   crimson is something found and always comes with a shape. Calm and slow. */

.anim-fade-in { animation: anim-fade 1.4s ease-out both; }
.anim-still, .anim-still * { animation: none !important; transition: none !important; }

.anim-ring { fill: none; stroke: var(--navy); stroke-opacity: 0.18; stroke-width: 1.5; }
.anim-breathe { animation: anim-breathe 7s ease-in-out infinite; }
.anim-caption { font: 500 16px var(--sans); letter-spacing: 0.04em; fill: var(--navy); }

.anim-scope { fill: none; stroke: var(--navy); stroke-opacity: 0.16; stroke-width: 1; }
/* Unchecked code is a deeper navy than the silver it turns, so progress shows. */
.anim-row { fill: var(--navy); fill-opacity: 0.55; transition: fill 1.6s ease, fill-opacity 1.6s ease; }
.anim-row.is-checked { fill: var(--silver); fill-opacity: 0.95; }
.anim-sweep {
  transform-box: view-box;
  transform-origin: 320px 140px;
  animation: anim-turn 6s linear infinite;
  transition: opacity 1.6s ease;
}
.anim-sweep.is-resting { opacity: 0; animation-play-state: paused; }
.anim-sweep-trail { fill: var(--navy); fill-opacity: 0.07; }
.anim-sweep-line { stroke: var(--navy); stroke-opacity: 0.4; stroke-width: 1.5; }

.anim-box { fill: var(--panel); stroke: var(--navy); stroke-opacity: 0.55; stroke-width: 1.25; }
.anim-wire {
  fill: none;
  stroke: var(--navy);
  stroke-opacity: 0.7;
  stroke-width: 2;
  stroke-linejoin: round;
  transition: stroke 1.6s ease, stroke-opacity 1.6s ease;
}
.anim-wire.is-checked { stroke: var(--silver); stroke-opacity: 1; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: anim-draw 2.8s ease-out forwards; }
.anim-pulse {
  fill: none;
  stroke: var(--navy);
  stroke-opacity: 0.55;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 0.05 0.95;
  opacity: 0;
  animation: anim-flow 7s linear infinite both;
}
.is-resting > .anim-pulse { animation: none; opacity: 0; }

.anim-halo { fill: #fbfbfa; fill-opacity: 0.92; }
.anim-found-fill { fill: var(--crimson); }
.anim-found-line { fill: none; stroke: var(--crimson); stroke-width: 2; stroke-linecap: round; }

/* Mutation testing, coverage and test independence move about 40% slower
   than the first animations above, and fade softly (A1). */
.anim-mutation-sweep { animation: anim-pass 8.4s ease-in-out infinite alternate; transition: opacity 2.2s ease; }
.anim-mutation-sweep.is-resting { animation-play-state: paused; opacity: 0.5; }
.anim-log { font: 500 12px var(--mono); fill: var(--ink); }
.anim-log.is-found { fill: var(--crimson); }
.anim-log-sign { font-weight: 700; }
/* A row the tests never reach stays hollow, even when progress passes it. */
.anim-row.anim-hollow,
.anim-row.anim-hollow.is-checked { fill: none; fill-opacity: 0; stroke: var(--crimson); stroke-width: 1.5; }
.anim-card { transition: transform 2.2s ease-in-out, opacity 2.2s ease-in-out; }
.anim-flag { pointer-events: none; }

/* Property-based testing, round trips, action sequences and logic checking
   share the same slower pace and soft fades (A1). */
.anim-dot { fill: var(--navy); fill-opacity: 0.6; transition: fill 2.2s ease, fill-opacity 2.2s ease; }
.anim-dot.is-checked { fill: var(--silver); fill-opacity: 0.95; }
.anim-stream-dot { opacity: 0; animation: anim-stream 14.4s linear infinite; }
.anim-stream-1 { animation-delay: 2.4s; }
.anim-stream-2 { animation-delay: 4.8s; }
.anim-stream-3 { animation-delay: 7.2s; }
.anim-stream-4 { animation-delay: 9.6s; }
.anim-stream-5 { animation-delay: 12s; }
.is-resting .anim-stream-dot { animation-play-state: paused; opacity: 0; transition: opacity 2.2s ease; }
.anim-shrink { transition: r 1.2s ease-in-out; }
.anim-copy { fill: none; stroke: var(--navy); stroke-opacity: 0; stroke-width: 1.5; transition: stroke 2.2s ease, stroke-opacity 2.2s ease; }
.anim-copy.is-shown { stroke-opacity: 0.55; }
.anim-copy.is-found { stroke: var(--crimson); stroke-opacity: 1; stroke-width: 2; }
.anim-piece { fill: var(--navy); fill-opacity: 0.55; transition: transform 2.2s ease-in-out; }
.anim-chip { fill: var(--navy); fill-opacity: 0; transition: fill 2.2s ease, fill-opacity 2.2s ease; }
.anim-chip.is-shown { fill-opacity: 0.55; }
.anim-chip.is-found { fill: var(--crimson); fill-opacity: 0.9; }
.anim-timeline { transition: x2 2.2s ease-in-out; }
.anim-route { fill: none; stroke: var(--silver); stroke-width: 2; stroke-linecap: round; }
.anim-route.is-found { stroke: var(--crimson); }
.anim-link { fill: none; stroke: var(--navy); stroke-opacity: 0.55; stroke-width: 1.5; transition: transform 2.2s ease-in-out, stroke-opacity 2.2s ease; }
.anim-link-cut .anim-link { stroke-opacity: 0.35; }
.anim-link-cut .anim-link:first-child { transform: translate(-3px, 0); }
.anim-link-cut .anim-link:last-child { transform: translate(3px, 0); }
.anim-ring-found { fill: none; stroke: var(--silver); stroke-width: 2.5; }
.anim-gap { fill: none; stroke: var(--crimson); stroke-width: 2.5; stroke-linecap: round; }
.anim-trace { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.anim-trace-saved { stroke: var(--silver); }
.anim-trace-today { stroke: var(--navy); stroke-opacity: 0.7; }
.anim-gap-fill { fill: var(--crimson); fill-opacity: 0.22; }
.anim-hatch-line { stroke: var(--crimson); stroke-width: 1.5; stroke-opacity: 0.8; }
.anim-mark { font: 700 16px var(--mono); fill: var(--silver); }
.anim-mark-found { fill: var(--crimson); }
@keyframes anim-stream {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { transform: translateX(592px); opacity: 0; }
}

@keyframes anim-pass { from { transform: translateX(0); } to { transform: translateX(250px); } }

@keyframes anim-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes anim-breathe { 0%, 100% { stroke-opacity: 0.12; } 50% { stroke-opacity: 0.3; } }
@keyframes anim-turn { to { transform: rotate(360deg); } }
@keyframes anim-draw { to { stroke-dashoffset: 0; } }
@keyframes anim-flow {
  0% { stroke-dashoffset: 1; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

.tick { position: absolute; width: 14px; height: 14px; border: 0 solid var(--gold); }
.tick-tl { top: 6px; left: 6px; border-top-width: 2px; border-left-width: 2px; }
.tick-tr { top: 6px; right: 6px; border-top-width: 2px; border-right-width: 2px; }
.tick-bl { bottom: 6px; left: 6px; border-bottom-width: 2px; border-left-width: 2px; }
.tick-br { bottom: 6px; right: 6px; border-bottom-width: 2px; border-right-width: 2px; }

.estimate { padding: 12px 2px 16px; border-bottom: 1px solid var(--line); }
.estimate-line { margin: 0; font: 400 15px/1.5 var(--mono); white-space: pre-line; }

/* Readouts */

.readouts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.readout { padding: 12px 14px; border-right: 1px solid var(--line); }
.readout:last-child { border-right: 0; }
.readout dt {
  font: 600 11px/1.2 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--muted);
}
.readout dd { margin: 6px 0 0; font-size: 20px; font-weight: 500; color: var(--navy); }

@media (max-width: 560px) {
  .readouts { grid-template-columns: repeat(2, 1fr); }
  .readout:nth-child(2) { border-right: 0; }
}

/* Report (U8) */

.report-body { min-height: 120px; }
.report-body:focus { outline: none; }
.quiet { margin: 0; color: var(--muted); }

.report-summary { font-size: 19px; margin: 0 0 6px; }
.report-meta { margin: 0 0 18px; font: 400 13px/1.5 var(--mono); color: var(--muted); }
.report-stopped { margin: 0 0 16px; padding: 8px 14px; border-left: 4px solid var(--crimson); background: var(--page); }

.report-section {
  margin: 26px 0 12px;
  padding-bottom: 6px;
  font: 600 12px/1.2 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 1px solid var(--gold);
}

.report-table {
  margin: 8px 0 4px;
  border-collapse: collapse;
  font-size: 14px;
  border-top: 1px solid var(--navy);
  border-bottom: 1px solid var(--navy);
}
.report-table caption { padding: 0 0 6px; text-align: left; font-weight: 600; color: var(--ink); }
.report-table th, .report-table td { padding: 4px 18px 4px 0; text-align: left; border-bottom: 1px solid var(--line); }
.report-table th { font-weight: 600; border-bottom-color: var(--navy); }
.report-table .num { text-align: right; font-family: var(--mono); }

.report-code h4 { margin: 14px 0 6px; font-size: 15px; font-weight: 600; color: var(--navy); }
.report-code pre {
  margin: 0 0 14px;
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre;
  font: 400 13px/1.5 var(--mono);
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--navy);
}

.finding {
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--crimson);
}
.finding-title { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--crimson); }
.finding-title::before { content: "\25C6  "; }
.finding-where { margin: 0 0 8px; font: 400 13px/1.4 var(--mono); }
.finding p { margin: 0 0 8px; }
.finding-code { font: 400 12px/1.4 var(--mono); color: var(--muted); }

.excerpt {
  margin: 8px 0;
  padding: 8px 0;
  overflow-x: auto;
  font: 400 13px/1.5 var(--mono);
  background: var(--page);
  border: 1px solid var(--line);
}
.excerpt-line { display: block; padding: 0 12px; white-space: pre; }
.excerpt-line.is-hit { background: #f3e3e7; }
.excerpt-number { display: inline-block; min-width: 3em; color: var(--muted); }

.not-checked { margin: 0; padding-left: 20px; }
.not-checked li { margin-bottom: 4px; }

.error-box { padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--crimson); }
.log-tail {
  margin: 10px 0 0;
  padding: 10px 12px;
  overflow-x: auto;
  font: 400 12px/1.5 var(--mono);
  white-space: pre-wrap;
  background: var(--page);
  border: 1px solid var(--line);
}

/* Reports page (U12) */

.reports-list { display: flex; flex-direction: column; gap: 22px; }
.report-group-title {
  margin: 0 0 8px;
  font: 600 12px/1.2 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 6px;
}
.report-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.report-row-main { display: flex; flex-direction: column; gap: 2px; }
.report-row-name { font-weight: 600; }
.report-row-meta { font: 400 13px/1.4 var(--mono); color: var(--muted); }
.report-row-actions { display: flex; gap: 8px; }
.report-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--navy); }
.report-rows { margin: 0; padding: 0; list-style: none; }

@media (max-width: 560px) {
  .report-row { grid-template-columns: auto minmax(0, 1fr); }
  .report-row-actions { grid-column: 2; }
}

/* Footer (U16) */

.footer {
  padding: 18px 32px;
  border-top: 1px solid var(--gold);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.footer a { color: var(--navy); }

/* Reduced motion: movement becomes quiet step-by-step changes (A3). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* About and How it works: long-form reading text (U10, U11, U13) */

.prose { max-width: 46rem; font-size: 16px; line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose pre, .prose table { margin: 0 0 1em; }
.prose h2 {
  margin: 1.8em 0 0.5em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gold);
  font-size: 20px;
  line-height: 1.3;
  color: var(--navy);
}
.prose h3 { margin: 0 0 0.4em; font-size: 17px; line-height: 1.35; color: var(--navy); }
.prose ul { padding-left: 1.4em; }
.prose li { margin-bottom: 0.5em; }
.prose a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--crimson); }
.prose-hero { display: block; width: 240px; height: 240px; margin: 0 0 1.2em; }
.prose-credit { margin-top: 2em; font-weight: 600; }
.prose .method-number { font-family: var(--mono); font-weight: 500; color: var(--crimson); margin-right: 0.5em; }
.prose .method-block { margin: 0 0 1.4em; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--navy); background: var(--panel); }
.prose .method-block p { margin-bottom: 0.4em; }
.prose code, .prose pre { font-family: var(--mono); font-size: 14px; }
.prose pre { overflow-x: auto; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel); line-height: 1.5; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--navy); color: #ffffff; font-weight: 600; }
