:root {
  --bg: #f6f4ef;
  --fg: #1c1b19;
  --muted: #6f6b63;
  --rule: #dcd8cf;
  --accent: #1c1b19;
  --card: #fbfaf7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --fg: #ecebe6;
    --muted: #9a968d;
    --rule: #2e2d2a;
    --accent: #ecebe6;
    --card: #1b1b19;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.serif,
h1, h2, h3, .wordmark, .app-name {
  font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 8px 12px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 6px;
  text-decoration: none;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Header */
header.site {
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
}
.wordmark {
  font-size: 20px;
  color: var(--fg);
  text-decoration: none;
}
nav.primary ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
nav.primary a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.15s ease;
}
nav.primary a:hover,
nav.primary a:focus-visible,
nav.primary a[aria-current="page"] { color: var(--fg); }

/* Main */
main { flex: 1; }

.hero { padding: 80px 0 56px; }
.hero h1 {
  font-size: clamp(36px, 7vw, 56px);
  line-height: 1.1;
  margin-bottom: 24px;
}
.lede {
  color: var(--muted);
  font-size: 20px;
  max-width: 40ch;
}

.page-title { padding: 64px 0 24px; }
.page-title h1 {
  font-size: clamp(32px, 6vw, 44px);
  line-height: 1.15;
  margin-bottom: 12px;
}
.page-title .lede { font-size: 19px; }

section.block {
  padding: 40px 0;
  border-top: 1px solid var(--rule);
}
section.block:first-of-type { border-top: 0; }

.label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

h2 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 16px;
}
h3 {
  font-size: 21px;
  line-height: 1.3;
  margin: 28px 0 8px;
}
h2 + h3 { margin-top: 8px; }

p { margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }

ul.plain, ol.plain { padding-left: 1.2em; margin-bottom: 16px; }
ul.plain li, ol.plain li { margin-bottom: 8px; }

a { color: var(--fg); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.muted { color: var(--muted); }
.small { font-size: 15px; }

/* Definition list used on about/contact */
dl.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 28px;
  margin: 8px 0 16px;
}
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd { margin-bottom: 12px; }
}

/* App card */
.app-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  color: var(--fg);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.app-card:hover,
.app-card:focus-visible { border-color: var(--fg); }
.app-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.app-card .app-name { font-size: 26px; margin-bottom: 6px; display: block; }
.app-card .app-tag { color: var(--muted); display: block; margin-bottom: 12px; font-size: 15px; }
.app-card p { margin-bottom: 12px; }
.app-card .app-link { color: var(--muted); font-size: 15px; }
.app-card:hover .app-link { color: var(--fg); }

.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  margin: 12px 0 0;
}
.links-row a { font-size: 15px; }

/* Three-up facts on home */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 24px 32px;
}
.grid h3 { margin-top: 0; font-size: 19px; }
.grid p { color: var(--muted); font-size: 15px; }

/* Footer */
footer.site {
  border-top: 1px solid var(--rule);
  padding: 32px 0 40px;
  color: var(--muted);
  font-size: 14px;
}
footer.site .wrap {
  display: grid;
  gap: 24px 32px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
footer.site .legal { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--rule); }
footer.site a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
footer.site a:hover,
footer.site a:focus-visible { color: var(--fg); }
footer.site ul { list-style: none; }
footer.site li { margin-bottom: 6px; }
footer.site .col-title { color: var(--fg); margin-bottom: 8px; font-weight: 500; }
