:root {
  color-scheme: light;
  --ink: #18181a;
  --muted: #66656c;
  --line: #d9d7d1;
  --paper: #f5f3ed;
  --white: #fffefa;
  --accent: #ef5b35;
  --success: #16734b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(24, 24, 26, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

a {
  color: inherit;
}

.shell {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ink);
}

.masthead p,
.back-link {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.back-link:hover {
  color: var(--accent);
}

.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.wordmark span {
  color: var(--accent);
}

.intro,
.test-page {
  padding: clamp(64px, 12vw, 116px) 0 48px;
}

.test-page {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 800px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 8vw, 78px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.test-page h1 {
  font-size: clamp(38px, 7vw, 68px);
}

.lede {
  max-width: 680px;
  margin: 28px 0 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.6;
}

.test-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.test-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 26px 12px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 150ms ease, padding 150ms ease;
}

.test-card:hover,
.test-card:focus-visible {
  padding-right: 20px;
  padding-left: 20px;
  background: var(--white);
  outline: none;
}

.test-number,
.arrow {
  color: var(--accent);
  font-size: 14px;
}

.arrow {
  font-size: 25px;
}

.test-copy {
  display: grid;
  gap: 7px;
}

.test-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.test-copy > span {
  color: var(--muted);
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

.result-panel {
  margin-top: 50px;
  padding: 24px;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 8px 8px 0 var(--ink);
}

.result-label {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-value {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.35;
}

.result-value.is-ready {
  color: var(--success);
}

.spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.no-script {
  margin-top: 24px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: #fff0e9;
  font-family: system-ui, sans-serif;
}

.plain-shell {
  width: min(720px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(56px, 10vw, 104px) 0;
}

.plain-shell > p:only-child {
  margin: 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 16px;
}

.article h1 {
  margin-bottom: 40px;
  font-size: clamp(40px, 7vw, 68px);
}

.article p {
  margin: 0 0 24px;
  color: #333238;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.72;
}

.load-button {
  appearance: none;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.load-button:hover,
.load-button:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  outline: 3px solid var(--white);
  box-shadow: 0 0 0 5px var(--accent);
}

.load-button:disabled {
  border-color: var(--line);
  background: var(--line);
  color: var(--muted);
  cursor: wait;
}

.load-button + #test-result:not(:empty) {
  margin-top: 48px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .shell {
    width: min(100% - 28px, 920px);
    padding-top: 20px;
  }

  .masthead p {
    display: none;
  }

  .test-card {
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    padding-right: 4px;
    padding-left: 4px;
  }

  .test-copy strong {
    font-size: 20px;
  }

  .result-panel {
    padding: 20px;
    box-shadow: 5px 5px 0 var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  .test-card {
    transition: none;
  }

  .spinner {
    animation: none;
  }
}
