/* ssh.rocks — one stylesheet, no framework, no webfont.
   Both themes are defined: the page follows the reader's system setting. */

:root {
  color-scheme: light dark;

  --bg: #fbfaf8;
  --panel: #ffffff;
  --border: #e3e0da;
  --text: #1b1a18;
  --muted: #6c6862;
  --accent: #0a6c62;

  --excellent: #0d7a5f;
  --good: #1f6feb;
  --unknown: #6c6862;
  --weak: #a35d00;
  --broken: #b3261e;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121311;
    --panel: #1a1c19;
    --border: #2c2f2b;
    --text: #e8e6e1;
    --muted: #9b968e;
    --accent: #4fd1c0;

    --excellent: #46c99b;
    --good: #6fa8ff;
    --unknown: #9b968e;
    --weak: #e0a049;
    --broken: #ff7b72;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.25rem clamp(1rem, 5vw, 3rem);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--accent); }

nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
nav a:hover { color: var(--accent); }

main {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 5vw, 3rem) 4rem;
}

h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 0.75rem; }
h2 { font-size: 1.3rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }

.lede { font-size: 1.1rem; color: var(--muted); max-width: 46rem; }
.sub { color: var(--muted); font-size: 0.95rem; }

code, pre, .fp { font-family: var(--mono); }
code { font-size: 0.9em; }

.hero { padding: 1rem 0 2rem; }

.cmd {
  margin: 1.5rem 0 0.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}
.cmd code { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 600; }

/* 19rem rather than 16rem so four cards settle into 2x2 on a desktop instead
   of 3 + 1 orphan, and still collapse to one column on a phone. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
}
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.note {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1.5rem 1.5rem;
  margin-top: 2.5rem;
}

main a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
main a:hover { text-decoration-thickness: 2px; }

ul.plain { padding-left: 1.2rem; }
ul.plain li { margin: 0.5rem 0; }

form { margin: 1.5rem 0; }
label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 0.4rem; }

input[type="text"] {
  width: 100%;
  max-width: 32rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.6rem 0.75rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Jump links on the reference page. */
.jump { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin: 1.5rem 0; }
.jump a { font-size: 0.9rem; }

/* Algorithm lists on the scan page: dense, scannable, one per line. */
.algolist { list-style: none; padding: 0; margin: 0.5rem 0 1.5rem; }
.algolist li { display: flex; gap: 0.6rem; align-items: baseline; padding: 0.15rem 0; }

.finding { margin: 1rem 0; padding-left: 0.9rem; border-left: 3px solid currentColor; }
.finding p { color: var(--text); margin: 0.35rem 0; }
.finding pre { margin-top: 0.5rem; }

/* Command table on the landing page. */
.cmds td { border-bottom: 1px solid var(--border); }
.cmds td:first-child { white-space: nowrap; }

h4 { margin: 1.25rem 0 0.25rem; font-size: 0.95rem; }

textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.75rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  margin-top: 0.75rem;
  padding: 0.6rem 1.4rem;
  font: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }

.alert {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--broken);
  border-left: 3px solid var(--broken);
  border-radius: 6px;
  background: var(--panel);
  color: var(--broken);
}

.result {
  margin-top: 2rem;
  padding: 0.5rem 1.5rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}

dl { display: grid; grid-template-columns: minmax(9rem, auto) 1fr; gap: 0.5rem 1.5rem; margin: 1rem 0; }
dt { color: var(--muted); font-size: 0.9rem; }
dd { margin: 0; overflow-wrap: anywhere; }

.hint { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }
.dim { color: var(--muted); }

.verdict { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }

.pill {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.v-excellent, .v-excellent .pill { color: var(--excellent); }
.v-good, .v-good .pill { color: var(--good); }
.v-unknown, .v-unknown .pill { color: var(--unknown); }
.v-weak, .v-weak .pill { color: var(--weak); }
.v-broken, .v-broken .pill { color: var(--broken); }

.verdict { color: var(--text); }

/* Tables scroll inside their own box rather than making the page scroll. */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; display: block; overflow-x: auto; }
thead th { text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
th, td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
td.num { color: var(--muted); font-family: var(--mono); }

/* A rating class on a <tr> would otherwise tint every cell in the row, which
   makes fingerprints and algorithm names render in link-blue and read as
   clickable. The pill carries the colour; the cells stay body text.
   A direct declaration on td beats the inherited one from tr regardless of
   the class's higher specificity. */
tbody td { color: var(--text); }

.fps td { font-size: 0.95rem; }
.fp { overflow-wrap: anywhere; }

pre.code {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem clamp(1rem, 5vw, 3rem);
  color: var(--muted);
  font-size: 0.9rem;
}
footer p { margin: 0; }

/* Stat bars. Widths are classes because the CSP forbids inline styles. */
.bars { width: 100%; }
.bars td { border-bottom: 0; padding: 0.25rem 0.5rem 0.25rem 0; vertical-align: middle; }
.barlabel { width: 1%; white-space: nowrap; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
.barcell { width: 100%; }
.barpct { width: 1%; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar {
  display: block;
  height: 0.7rem;
  border-radius: 3px;
  background: var(--accent);
  min-width: 2px;
}
.w0 { width: 0%; }
.w5 { width: 5%; }
.w10 { width: 10%; }
.w15 { width: 15%; }
.w20 { width: 20%; }
.w25 { width: 25%; }
.w30 { width: 30%; }
.w35 { width: 35%; }
.w40 { width: 40%; }
.w45 { width: 45%; }
.w50 { width: 50%; }
.w55 { width: 55%; }
.w60 { width: 60%; }
.w65 { width: 65%; }
.w70 { width: 70%; }
.w75 { width: 75%; }
.w80 { width: 80%; }
.w85 { width: 85%; }
.w90 { width: 90%; }
.w95 { width: 95%; }
.w100 { width: 100%; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 2rem 0; }
.timeline li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding: 1rem 0 1rem 0;
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  margin-left: 0.5rem;
}
.timeline .year { font-family: var(--mono); font-weight: 700; color: var(--muted); }
.timeline h3 { margin: 0 0 0.35rem; }
.timeline p { margin: 0; color: var(--muted); }
.kindtag {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid currentColor; border-radius: 999px; padding: 0.05rem 0.5rem;
  vertical-align: middle; font-weight: 600;
}
.ev-arrival { border-left-color: var(--excellent); }
.ev-arrival .kindtag { color: var(--excellent); }
.ev-attack { border-left-color: var(--broken); }
.ev-attack .kindtag { color: var(--broken); }
.ev-retirement { border-left-color: var(--weak); }
.ev-retirement .kindtag { color: var(--weak); }

/* Prose blocks that keep their line breaks without looking like code. */
pre.prose {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
}
