/* FactLot landing page. No framework, no build step. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --text: #1b1f24;
  --muted: #4b5563;
  --accent: #1d4ed8;
  --accent-text: #ffffff;
  --border: #d5d9e0;
  --code-bg: #f1f3f6;
  --focus: #b45309;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-alt: #171a20;
    --text: #e8eaed;
    --muted: #a7adb8;
    --accent: #8ab4f8;
    --accent-text: #0f1115;
    --border: #2d323b;
    --code-bg: #1a1e25;
    --focus: #fbbf24;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

code {
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.45;
  margin: 0.75rem 0 1.25rem;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.75rem);
  max-width: 24ch;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  margin-top: 0;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

p {
  margin: 0 0 1rem;
}

.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 16px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  z-index: 10;
}

.skip:focus {
  top: 8px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

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

.site-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.site-header nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.25rem 0;
}

.site-header nav a:hover {
  text-decoration: underline;
}

/* Sections */

section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

section:nth-of-type(even) {
  background: var(--bg-alt);
}

.hero {
  padding: 4rem 0 3rem;
}

.eyebrow {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}

.lede {
  font-size: 1.2rem;
  max-width: 60ch;
}

.note,
.small {
  color: var(--muted);
  font-size: 0.9375rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}

.button {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  border: 2px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  color: var(--accent-text);
}

.button:hover {
  text-decoration: underline;
}

/* Cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.stats div {
  border-top: 2px solid var(--accent);
  padding-top: 0.4rem;
}

.stats dt {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats dd {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Example */

.example h3 {
  font-size: 1.05rem;
}

/* Table */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

tbody th {
  white-space: nowrap;
  font-weight: 600;
}

@media (max-width: 40rem) {
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tr {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  th,
  td {
    display: block;
    border: 0;
    padding: 0.15rem 0;
  }

  tbody th {
    white-space: normal;
  }
}

/* Lists */

ul.plain,
ul.principles {
  padding-left: 1.25rem;
}

ul.plain li,
ul.principles li {
  margin-bottom: 0.75rem;
}

/* Footer */

.site-footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
