/* PQHello: set like an RFC. One monospace voice on white paper; colour only
   where it carries meaning (blue = action, green = post-quantum, amber = classical,
   red = broken). The handshake ladder is the one loud element. */

:root {
  --paper: #ffffff;
  --ink: #000000;
  --graphite: #595959;
  --wire: #1f3fd1;
  --pq: #00703c;
  --classical: #8f4e00;
  --broken: #b00020;
  --rule: #d6d6d6;
  --well: #f3f4f8;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--mono);
}

.page { max-width: 80ch; margin: 0 auto; padding: 56px 20px 0; }
.foot { padding: 40px 20px 48px; }
.foot p { margin: 0; font-size: 13px; color: var(--graphite); }

h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.lede { margin: 8px 0 32px; max-width: 58ch; }
h2 { margin: 0; font-size: 19px; line-height: 1.3; }
h3 { margin: 32px 0 10px; font-size: 15px; }
p { margin: 0 0 12px; }
a { color: var(--wire); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--wire); outline-offset: 2px; }

/* Input row */
form { display: flex; gap: 8px; }
input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 16px;
  padding: 11px 12px;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink); border-radius: 3px;
}
input::placeholder { color: #8a8a8a; }
button { font: inherit; }
.scan {
  padding: 11px 20px;
  font-weight: 700; color: #fff;
  background: var(--wire); border: 1px solid var(--wire); border-radius: 3px;
  cursor: pointer;
}
.scan:hover { background: #1834ad; }
.scan[disabled] { opacity: .65; cursor: progress; }
.try { margin: 10px 0 0; font-size: 13px; color: var(--graphite); }
.try button {
  padding: 0; border: 0; background: none;
  font-size: 13px; color: var(--wire); text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}

#status { min-height: 1.55em; margin: 28px 0 0; color: var(--graphite); }
.banner { margin: 0 0 20px; padding: 8px 12px; font-size: 13px; border: 1px dashed var(--classical); }
#status.error { color: var(--broken); }

/* Result */
.result { margin: 4px 0 8px; }
.result h2 { font-size: 22px; word-break: break-all; }
.verdict { display: flex; gap: 16px; align-items: baseline; margin: 10px 0 4px; }
.letter { font-size: 44px; line-height: 1; font-weight: 700; }
.headline { margin: 0; }
.when { font-size: 13px; color: var(--graphite); margin: 6px 0 0; }
.card { margin: 12px 0 0; padding: 18px 20px 14px; background: var(--well); border-left: 3px solid var(--graphite); }
.card.c-a { border-left-color: var(--pq); }
.card.c-c { border-left-color: var(--classical); }
.card.c-d { border-left-color: var(--broken); }
.card .verdict { margin: 0 0 16px; }
.verdict-text { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 700; }
.meaning { margin: 4px 0 0; }
.card dl { grid-template-columns: 15ch 1fr; }
.card .when { margin: 14px 0 0; }

.g-a { color: var(--pq); }
.g-b, .g-c { color: var(--classical); }
.g-d, .g-f { color: var(--broken); }
.g-u { color: var(--graphite); }

/* The handshake, drawn the way RFC 8446 draws it */
.ladder {
  margin: 28px 0 8px;
  font-size: 13px; line-height: 1.5;
  white-space: pre; overflow-x: auto;
}
.ladder span { display: block; }
.ladder .pq { color: var(--pq); font-weight: 700; }
.ladder .classical { color: var(--classical); font-weight: 700; }
.ladder .broken { color: var(--broken); font-weight: 700; }
.ladder-note { font-size: 13px; color: var(--graphite); margin: 0 0 8px; }

dl { display: grid; grid-template-columns: 26ch 1fr; gap: 4px 16px; margin: 0; }
dt { color: var(--graphite); }
dd { margin: 0; overflow-wrap: anywhere; }
.note { font-size: 13px; color: var(--graphite); margin: 8px 0 0; max-width: 70ch; }

ul.issues { list-style: none; margin: 0; padding: 0; }
ul.issues li { margin: 0 0 8px; padding-left: 9ch; text-indent: -9ch; }
.sev { display: inline-block; width: 9ch; text-indent: 0; }
.sev-critical, .sev-high { color: var(--broken); }
.sev-medium, .sev-low { color: var(--classical); }
.sev-info { color: var(--graphite); }

.fix { margin: 0 0 24px; }
.fix h4 { margin: 0 0 6px; font-size: 15px; }
.fix ol { margin: 0 0 10px; padding-left: 3ch; }
.fix li { margin: 0 0 6px; }
.snippet { margin: 10px 0; }
.snippet-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--graphite); }
.copy {
  padding: 2px 8px; font-size: 13px;
  color: var(--wire); background: none;
  border: 1px solid var(--wire); border-radius: 3px; cursor: pointer;
}
pre.code {
  margin: 4px 0 0; padding: 12px 14px;
  font-size: 13px; line-height: 1.5;
  background: var(--well); border-left: 3px solid var(--wire);
  overflow-x: auto;
}
.source { font-size: 13px; }

details { margin: 10px 0; }
summary { cursor: pointer; color: var(--wire); }
.probes { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.probes th, .probes td { text-align: left; padding: 4px 12px 4px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.probes th { color: var(--graphite); font-weight: 400; }
.table-wrap { overflow-x: auto; }
pre.raw { font-size: 12px; max-height: 420px; overflow: auto; background: var(--well); padding: 12px; }

.about { margin: 56px 0 0; padding-top: 24px; border-top: 1px solid var(--rule); color: var(--ink); }
.about h2 { font-size: 15px; margin-bottom: 10px; }
.about p { max-width: 72ch; color: var(--graphite); }

@media (max-width: 600px) {
  .page { padding-top: 32px; }
  h1 { font-size: 24px; }
  .letter { font-size: 34px; }
  .ladder { font-size: 11px; }
  dl, .card dl { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 14px 14px 12px; }
  dd { margin-bottom: 8px; }
}
