/* Trust's own palette and type pair. this desk sits outside the app-a-day
   family system, so nothing here is borrowed from families.json.
   every pair below clears 4.5:1 in both themes. */

:root {
  --bg: #fbfbfc;
  --surface: #ffffff;
  --raised: #f1f3f6;
  --ink: #15181d;
  --muted: #4f5663;
  --line: #dfe3ea;
  --accent: #1f4d8f;
  --accent-ink: #ffffff;

  --radius: 4px;
  --measure: 68ch;
  --display: Spectral, ui-serif, Georgia, serif;
  --body: Inter, ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216;
    --surface: #161a20;
    --raised: #1d222a;
    --ink: #e7eaef;
    --muted: #a0a8b6;
    --line: #29303a;
    --accent: #8fb6ec;
    --accent-ink: #0b1220;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1216;
  --surface: #161a20;
  --raised: #1d222a;
  --ink: #e7eaef;
  --muted: #a0a8b6;
  --line: #29303a;
  --accent: #8fb6ec;
  --accent-ink: #0b1220;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.shell {
  width: 100%;
  max-width: 76ch;
  margin: 0 auto;
  padding: 0 1rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
}

.skip-link:focus {
  left: 0.75rem;
}

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding-top: 1rem;
}

.masthead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.theme-toggle {
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

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

.nav a {
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}

main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.stamp {
  margin: 0 0 1.5rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--raised);
  color: var(--muted);
  font-size: 0.85rem;
}

.contents {
  margin: 0 0 2rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.contents p {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.contents ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.92rem;
}

.prose {
  max-width: var(--measure);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 2.25rem 0 0.75rem;
}

.prose h1 {
  font-size: 2.1rem;
  margin-top: 0;
}

.prose h2 {
  font-size: 1.45rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.prose h3 {
  font-size: 1.1rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--raised);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.prose blockquote {
  margin: 0 0 1rem;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

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

.prose th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.footer {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
