:root {
  --paper: #ffffff;
  --ink: #000000;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --fill: #f2f2f7;
  --link: #0a66d6;
  /* The app's grade bands: under 5, under 7, under 9, from 9. */
  --fail: #e5484d;
  --pass: #e0a100;
  --good: #30a46c;
  --great: #8e4ec6;

  --rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000000;
    --ink: #ffffff;
    --muted: #98989f;
    --line: #2c2c2e;
    --fill: #1c1c1e;
    --link: #4da3ff;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.55 var(--text);
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
  border-radius: 6px;
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font: 700 1.125rem var(--rounded);
}
.brand img { width: 2rem; height: 2rem; border-radius: 0.5rem; border: 1px solid var(--line); }

h1, h2 { font-family: var(--rounded); line-height: 1.08; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 9vw, 4.25rem); font-weight: 800; margin: 3.5rem 0 1rem; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 3rem 0 0.5rem; }
h3 { font: 600 1.0625rem var(--text); margin: 1.75rem 0 0.25rem; }
p { margin: 0 0 1rem; }

.lede { font-size: 1.25rem; color: var(--muted); max-width: 32rem; }

/* The calculator: the app's question, answered as you move the slider. */
.try {
  margin: 2.5rem 0 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.subject { display: flex; flex-direction: column; gap: 0.15rem; }
.subject strong { font: 700 1.25rem var(--rounded); }
.subject span { color: var(--muted); }

.slider { margin: 1.25rem 0 0.5rem; }
.slider label { display: flex; justify-content: space-between; align-items: baseline; }
.slider output { font: 700 1.125rem var(--rounded); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; margin: 0.75rem 0 0; accent-color: var(--ink); }

.answer { margin: 1.5rem 0 0; }
.answer .grade {
  display: block;
  font: 800 clamp(4.5rem, 22vw, 7.5rem)/0.9 var(--rounded);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.answer p { margin: 0.75rem 0 0; font-size: 1.125rem; }

.bar {
  position: relative;
  height: 0.6rem;
  margin-top: 1.25rem;
  border-radius: 1rem;
  background: linear-gradient(90deg,
    var(--fail) 0 50%, var(--pass) 50% 70%, var(--good) 70% 90%, var(--great) 90% 100%);
}
.bar i {
  position: absolute;
  top: 50%;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--ink);
  transform: translate(-50%, -50%);
  transition: left 0.2s;
}
.note { font-size: 0.9375rem; color: var(--muted); }

ul.plain { padding-left: 1.2rem; }
ul.plain li { margin-bottom: 0.4rem; }

.store {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.875rem;
  background: var(--ink);
  color: var(--paper);
  font: 600 1rem var(--text);
  text-decoration: none;
}
.store[aria-disabled="true"] { background: var(--fill); color: var(--muted); }

footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

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

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