/*
 * The Take Point — the one stylesheet.
 *
 * Plain CSS, no build step. Fonts are self-hosted in /fonts/ under the OFL
 * (the licence texts sit beside them). Nothing here loads from another host:
 * scripts/check_dist.py fails a deploy on url() to another host or on an
 * import rule.
 *
 * Light and dark follow the reader's system setting through
 * prefers-color-scheme. There is no switch, so the site stores nothing on the
 * device. Text colours meet 4.5:1 on both backgrounds (checked 2026-12-05):
 * light ink 16.4, muted 6.9, accent 6.7; dark ink 15.2, muted 7.3, accent 7.6.
 * Form-field borders use --muted, which meets the 3:1 rule for controls.
 *
 * The look must not read as a BackgammonDB page: no Inter, no violet.
 * Newsreader (serif) carries the text and the headlines; Public Sans carries
 * the labels, the navigation and the meta lines. The accent is brick red.
 */

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/public-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  --paper: #faf7f2;
  --surface: #f2ede4;
  --ink: #1c1917;
  --muted: #5c554f;
  --rule: #ddd5c8;
  --accent: #a52a1a;
  --accent-soft: #f6e3dc;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --text-width: 40rem;
  --page-width: 64rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14120f;
    --surface: #1f1b17;
    --ink: #ede7dd;
    --muted: #a8a097;
    --rule: #3a332c;
    --accent: #f0896c;
    --accent-soft: #3a211a;
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

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

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--text {
  max-width: calc(var(--text-width) + 2 * var(--gutter));
}

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

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.875rem;
  border-radius: var(--radius);
}
.skip-link:focus {
  top: 0.5rem;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--ink);
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}
.wordmark__mark {
  width: 2rem;
  height: 2rem;
  flex: none;
}
.wordmark__text {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1;
}
.wordmark__the {
  font-style: italic;
  font-weight: 450;
}
.mark__tile {
  fill: var(--ink);
}
.mark__point {
  fill: var(--accent);
}
.mark__checker {
  fill: var(--paper);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

/* ---------- Main ---------- */

.site-main {
  flex: 1;
  padding-block: clamp(1.5rem, 5vw, 3rem) clamp(3rem, 8vw, 5rem);
}

/* Labels: the category kicker and the meta lines. */
.kicker {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.kicker:hover {
  text-decoration: underline;
}

.draft-badge {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  color: var(--accent);
}

/* ---------- Lists of posts ---------- */

.list-header {
  margin-block-end: 1.5rem;
  padding-block-end: 1rem;
  border-bottom: 1px solid var(--rule);
}
.list-header__kicker {
  margin: 0 0 0.25rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.list-header__title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.post-list {
  display: grid;
}

.card {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.card:first-child {
  padding-block-start: 0.5rem;
}
.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.9rem;
  margin: 0 0 0.4rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}
.card__title {
  margin: 0;
  font-size: clamp(1.4rem, 3.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.card__title a {
  color: var(--ink);
  text-decoration: none;
}
.card__title a:hover {
  color: var(--accent);
}
.card__summary {
  margin: 0.5rem 0 0;
  max-width: var(--text-width);
  color: var(--muted);
}

@media (min-width: 48rem) {
  /* The newest post leads the home page at a larger size. */
  .post-list > .card:first-child .card__title {
    font-size: 2.4rem;
  }
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-block-start: 2rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
}
.pagination__count {
  color: var(--muted);
}

.term-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
}
.term-list li {
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.term-list--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.term-list--inline li {
  padding: 0;
  border: 0;
}
.term-list--inline a {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
}
.term-list__count {
  color: var(--muted);
  font-size: 0.85em;
}

.empty-state {
  max-width: var(--text-width);
  padding-block: 3rem;
  font-size: 1.3rem;
  color: var(--muted);
}

/* ---------- A post ---------- */

.post__header {
  margin-block-end: 2rem;
}
.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.9rem;
  margin: 0 0 0.75rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}
.post__checked {
  font-weight: 600;
  color: var(--ink);
}
.post__title {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 3.25rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.post__dek {
  margin: 0.9rem 0 0;
  font-size: 1.35rem;
  line-height: 1.4;
  color: var(--muted);
  text-wrap: pretty;
}
.byline {
  margin: 1.25rem 0 0;
  padding-block-start: 0.9rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}
.byline__author {
  font-weight: 700;
  color: var(--ink);
}

.post__footer {
  margin-block-start: 3rem;
}
.post__footer-title {
  margin: 0 0 0.5rem;
  padding-block-start: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.875rem;
  text-decoration: none;
}
.chip:hover {
  border-color: var(--accent);
}

/* ---------- The body text ---------- */

.prose > * {
  margin-block: 0 1.1em;
}
.prose h2,
.prose h3,
.prose h4 {
  margin-block: 2em 0.5em;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.prose h2 {
  font-size: 1.65rem;
  font-weight: 650;
}
.prose h3 {
  font-size: 1.3rem;
  font-weight: 650;
}
.prose h4 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
}
.prose ul,
.prose ol {
  padding-inline-start: 1.4em;
}
.prose li + li {
  margin-block-start: 0.35em;
}
.prose blockquote {
  margin-inline: 0;
  padding-inline-start: 1.1rem;
  border-inline-start: 3px solid var(--accent);
  font-style: italic;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin-block: 2.5em;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.1em 0.3em;
  background: var(--surface);
  border-radius: 3px;
}
.prose pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.5;
}
.prose pre code {
  padding: 0;
  background: none;
}
.prose img {
  border-radius: var(--radius);
}

/* Tables: the plugin wraps each one, and the wrapper scrolls sideways on a phone. */
.table-wrap {
  overflow-x: auto;
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
}
.table-wrap:focus-visible {
  outline-offset: -2px;
}
@media (min-width: 48rem) {
  .table-wrap {
    margin-inline: 0;
    padding-inline: 0;
  }
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.prose th,
.prose td {
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.prose th {
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.prose td:first-child {
  font-weight: 600;
}

/* Obsidian callouts, as cress renders them. */
.callout {
  padding: 0.9rem 1rem;
  border-inline-start: 3px solid var(--muted);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block-end: 0.35rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 700;
}
.callout-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}
.callout-content > :last-child {
  margin-block-end: 0;
}
.callout-content > :first-child {
  margin-block-start: 0;
}
.callout-warning,
.callout-error {
  border-inline-start-color: var(--accent);
}
.callout-warning .callout-title,
.callout-error .callout-title {
  color: var(--accent);
}

/* The disclosure box: the top of every post that judges a competitor. */
.disclosure {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.disclosure__label {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.disclosure__text {
  margin: 0;
}

/* A reference page ends with "## Changes" and a dated list. */
.post--reference .prose h2#changes {
  margin-block-start: 3rem;
  padding-block-start: 1rem;
  border-top: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.post--reference .prose h2#changes + ul {
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--ink);
  background: var(--surface);
  font-family: var(--sans);
  font-size: 0.9375rem;
}
.site-footer__inner {
  display: grid;
  gap: 2rem;
  padding-block: 2.5rem;
}
@media (min-width: 48rem) {
  .site-footer__inner {
    grid-template-columns: 3fr 2fr;
    align-items: end;
  }
}

.signup__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 650;
}
.signup__line {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
}
.signup__form label {
  display: block;
  margin-block-end: 0.35rem;
  font-weight: 600;
}
.signup__field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.signup__field input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
}

.button {
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 700;
  color: var(--paper);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}
.button:hover {
  filter: brightness(1.08);
}

.site-footer__line {
  margin: 0 0 0.75rem;
  color: var(--muted);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.footer-nav a {
  color: var(--ink);
}
