/* site.css — deliberately simple. Readable defaults for sighted helpers,
   strong focus indicators for keyboard users, and both color schemes.
   No information on this site is conveyed by styling alone. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #444444;
  --accent: #0b57a4;
  --border: #cccccc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --text: #eceff2;
    --muted: #b8bec5;
    --accent: #7db6e8;
    --border: #45494f;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  padding: 1rem;
  max-width: 46rem;
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
}

/* Skip link: visually hidden until focused. */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  z-index: 10;
}

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

header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.site-title {
  font-weight: bold;
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

nav a {
  color: var(--accent);
}

nav a[aria-current="page"] {
  font-weight: bold;
  text-decoration: none;
}

main a {
  color: var(--accent);
}

h1 {
  font-size: 1.75rem;
  line-height: 1.3;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
}

h4 {
  font-size: 1.05rem;
  margin-top: 1.25rem;
}

ul {
  padding-left: 1.5rem;
}

li {
  margin: 0.2rem 0;
}

.toc {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
}

.toc h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem 0;
  border: none;
}

.example-lead {
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.shape-intro,
.tip {
  color: var(--muted);
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
}

legend {
  font-weight: bold;
  padding: 0 0.5rem;
}

fieldset p {
  margin: 0.5rem 0;
}

input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.5rem;
}

select {
  font: inherit;
  padding: 0.3rem 0.5rem;
  border-radius: 0.35rem;
}

button {
  font: inherit;
  font-weight: bold;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background: var(--bg);
  color: var(--accent);
  margin-right: 0.75rem;
}

/* The pressed state lives in aria-pressed; the fill only mirrors it. */
button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg);
}

button:disabled {
  color: var(--muted);
}

#finder-form label {
  font-weight: bold;
  margin-right: 0.5rem;
}

footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  color: var(--muted);
  font-size: 1rem;
}
