/* Thawkeeper site: single stylesheet, no external resources. Light/dark via prefers-color-scheme. */
:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --text: #1c2530;
  --muted: #536171;
  --border: #d9e1e8;
  --accent: #b4461f;
  --accent-text: #ffffff;
  --link: #1f5f99;
  --code-bg: #eef2f6;
  --quote-bg: #fff6ec;
  --quote-border: #e2a064;
  --radius: 10px;
  --wrap: 760px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151b;
    --surface: #17202a;
    --text: #e3e9ef;
    --muted: #9aa8b6;
    --border: #2a3643;
    --accent: #f08a5d;
    --accent-text: #1a0f0a;
    --link: #8cc4ff;
    --code-bg: #1f2a36;
    --quote-bg: #241c16;
    --quote-border: #a8683a;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 10;
}

/* Header and footer */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.95rem;
}

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

.site-header nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.site-footer {
  margin-top: 48px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 4px 0;
}

/* Documents */
main {
  padding-top: 24px;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 8px 0 12px;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 36px 0 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  margin: 24px 0 8px;
}

h4 {
  font-size: 1rem;
  margin: 20px 0 6px;
}

h1 + p,
.meta {
  color: var(--muted);
}

p,
ul,
ol {
  margin: 0 0 14px;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin: 4px 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 5px;
}

pre {
  background: var(--code-bg);
  padding: 12px;
  border-radius: var(--radius);
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: none;
}

blockquote {
  margin: 16px 0;
  padding: 10px 14px;
  background: var(--quote-bg);
  border-left: 4px solid var(--quote-border);
  border-radius: 0 var(--radius) var(--radius) 0;
}

blockquote p {
  margin: 0;
}

/* Tables scroll inside their own box; the page never scrolls sideways. */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  min-width: 7.5rem;
  overflow-wrap: anywhere;
}

th {
  background: var(--code-bg);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

/* Narrow screens: tables with 3+ columns become stacked cards (label from data-label). */
@media (max-width: 640px) {
  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack td {
    display: block;
    width: 100%;
  }

  table.stack tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }

  table.stack tr:last-child {
    border-bottom: 0;
  }

  table.stack td {
    min-width: 0;
    border-bottom: 0;
    padding: 3px 12px;
  }

  table.stack td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  table.stack td:first-child {
    font-weight: 600;
  }
}

/* FAQ */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 10px;
  padding: 0 14px;
}

summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
}

details p {
  margin: 0 0 14px;
}

/* Home page */
.hero {
  padding: 32px 0 8px;
}

.hero h1 {
  font-size: 2.1rem;
  margin-bottom: 4px;
}

.tagline {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 8px;
}

.button {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.pill-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-list li {
  margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.92rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}

.card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.card strong {
  display: block;
  color: var(--link);
}

.card span {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }
}
