/* The download page. The colours are the app's own (lib/theme.ts): dark first, light where the device asks for it. */

:root {
  color-scheme: dark light;
  --background: #0a0d14;
  --surface: #121722;
  --surface-alt: #1b2231;
  --border: #262f40;
  --text: #f3f5f9;
  --text-muted: #a8b2c5;
  --text-faint: #8591a6;
  --primary: #8e97ff;
  --primary-hover: #a3aaff;
  --primary-soft: #1f2552;
  --on-primary: #0a0d14;
  --success: #4ade80;
  --success-soft: #13301f;
  --danger: #f87171;
  --danger-soft: #3d181a;
  --glow: rgba(142, 151, 255, 0.16);

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;
  --radius: 14px;
  --radius-large: 20px;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --background: #f5f6f8;
    --surface: #ffffff;
    --surface-alt: #eceef2;
    --border: #dfe3ea;
    --text: #0f172a;
    --text-muted: #526074;
    --text-faint: #66728a;
    --primary: #4338ca;
    --primary-hover: #3730a3;
    --primary-soft: #eaebfd;
    --on-primary: #ffffff;
    --success: #15803d;
    --success-soft: #e4f5ea;
    --danger: #c62828;
    --danger-soft: #fce8e8;
    --glow: rgba(67, 56, 202, 0.1);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--background);
  background-image: radial-gradient(60rem 28rem at 50% -8rem, var(--glow), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.top,
main,
footer {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: max(1.25rem, env(safe-area-inset-left)) max(1.25rem, env(safe-area-inset-right));
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 750;
  text-wrap: balance;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 650;
}

h3 {
  font-size: 1.0625rem;
  line-height: 1.35;
  font-weight: 650;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.skip:focus {
  top: 1rem;
}

/* The top: the mark and the name. */

.top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: max(var(--space-4), env(safe-area-inset-top));
}

.mark {
  display: block;
}

.wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* The hero: what it is, and the one thing to do here. */

main {
  display: grid;
  gap: var(--space-6);
  padding-block: var(--space-6) var(--space-7);
}

.hero {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
  padding-top: var(--space-4);
}

.lead {
  max-width: 34rem;
  font-size: clamp(1.125rem, 3.4vw, 1.3125rem);
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3.5rem;
  margin-top: var(--space-1);
  padding: 0 1.75rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1.125rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 180ms ease-out,
    transform 120ms ease-out;
}

.button:hover {
  background: var(--primary-hover);
}

.button:active {
  transform: scale(0.98);
}

/* A dot between the facts. Each fact carries its dot to its left, and the line's edge cuts off the
   dot of whichever fact starts a line, so a wrapped line never begins or ends with one. */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  overflow: hidden;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.facts span {
  position: relative;
}

.facts span::before {
  content: '·';
  position: absolute;
  left: -0.9rem;
  color: var(--text-faint);
}

.facts strong {
  color: var(--text);
  font-weight: 600;
}

.notice {
  max-width: 34rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* [hidden] loses to a class's display otherwise. */
[hidden] {
  display: none !important;
}

/* What you get. */

.quiet {
  margin-bottom: var(--space-4);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.benefits {
  display: grid;
  gap: var(--space-4);
  padding: 0;
  list-style: none;
}

.benefits li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: var(--space-3);
  align-items: start;
}

.benefits svg {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.625rem;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.benefits p {
  margin-top: 0.125rem;
  color: var(--text-muted);
}

/* The cards: how to install, what you need, the checksum. */

.card {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
}

.card > h2 {
  margin-bottom: var(--space-3);
}

.steps {
  display: grid;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  min-height: 2rem;
  padding-left: 3rem;
  color: var(--text-muted);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.steps strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.aside {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.plain {
  display: grid;
  gap: var(--space-2);
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.plain li::marker {
  color: var(--text-faint);
}

.verify summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 2.75rem;
  margin: calc(var(--space-2) * -1) 0;
  font-size: 1.0625rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.verify summary::-webkit-details-marker {
  display: none;
}

.verify summary::after {
  content: '';
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  margin-right: 0.25rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 180ms ease-out;
}

.verify[open] summary::after {
  transform: rotate(-135deg);
}

.verify p {
  margin-top: var(--space-3);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
}

.verify p code {
  padding: 0.125rem 0.375rem;
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--text);
  white-space: nowrap;
}

.checksum {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.checksum code {
  align-self: stretch;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  user-select: all;
}

.checksum button {
  min-width: 5.25rem;
  min-height: 2.75rem;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 180ms ease-out;
}

.checksum button:hover {
  border-color: var(--primary);
}

/* Keeps its line whether it says something or not, so nothing jumps when it does. */
.verify p.status {
  min-height: 1.5rem;
  margin-top: var(--space-1);
  color: var(--success);
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  padding-block: var(--space-4) max(var(--space-5), env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-faint);
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
}

footer a {
  display: inline-block;
  padding-block: 0.75rem;
  margin-block: -0.75rem;
}

/* The guide (verify.html): an article, with the check itself in a card. */

.top .home {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  color: var(--text);
  text-decoration: none;
}

.top .toplink {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-left: auto;
  padding-inline: var(--space-2);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.article article {
  display: grid;
  gap: var(--space-6);
}

.article section,
.intro {
  display: grid;
  gap: var(--space-3);
}

.article h1 {
  font-size: clamp(1.875rem, 6.4vw, 2.75rem);
  line-height: 1.12;
}

.article h2 {
  font-size: 1.4375rem;
}

.article h3 {
  margin-top: var(--space-2);
}

.article section > p,
.article section > ul,
.article dd {
  color: var(--text-muted);
}

.article p strong,
.article li strong {
  color: var(--text);
  font-weight: 600;
}

.kicker {
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.byline {
  font-size: 0.9375rem;
  color: var(--text-faint);
}

.byline strong {
  color: var(--text-muted);
  font-weight: 600;
}

.article .steps {
  margin-block: var(--space-1);
}

.article :not(.checksum) > code {
  padding: 0.125rem 0.375rem;
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--text);
  white-space: nowrap;
}

.article .checksum {
  margin-top: 0;
}

.article .status {
  min-height: 1.5rem;
  margin-top: calc(var(--space-2) * -1);
  font-size: 0.9375rem;
  color: var(--success);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.checker {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
}

.checker .button {
  margin-top: 0;
}

/* The file input itself is out of sight; its label is the button, and shows where the keyboard is. */
.checker input:focus-visible + .button {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.private {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.working {
  display: grid;
  gap: var(--space-1);
  width: 100%;
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 0.5rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-alt);
  color: var(--primary);
}

progress::-webkit-progress-bar {
  background: var(--surface-alt);
}

progress::-webkit-progress-value {
  background: var(--primary);
}

progress::-moz-progress-bar {
  background: var(--primary);
}

.result {
  display: grid;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.result-title {
  font-size: 1.1875rem;
  font-weight: 700;
}

.result.good {
  border-color: var(--success);
  background: var(--success-soft);
}

.result.good .result-title {
  color: var(--success);
}

.result.bad {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.result.bad .result-title {
  color: var(--danger);
}

.result-detail {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* As specific as the rule for words of code in the article's text, and after it: this one is 64 characters and has to wrap. */
.article .result-detail code {
  display: block;
  margin-top: 0.25rem;
  padding: 0;
  background: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

.systems {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.systems div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.systems dt {
  font-weight: 650;
}

.systems dd {
  margin: 0;
}

.article section.card {
  gap: var(--space-2);
}

.article section.card > h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.back {
  display: flex;
}

.button.secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.button.secondary:hover {
  background: var(--surface-alt);
  border-color: var(--primary);
}

@media (max-width: 30rem) {
  .button {
    width: 100%;
  }

  .card {
    padding: var(--space-3);
    border-radius: var(--radius);
  }

  .checksum button {
    align-self: stretch;
  }

  .systems div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (min-width: 48rem) {
  main {
    gap: var(--space-7);
    padding-top: var(--space-7);
  }

  main > .card + .card,
  main > .card + details.card {
    margin-top: calc(var(--space-5) * -1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .button:active {
    transform: none;
  }
}
