/* tcrga project site — shared stylesheet
   Self-contained, no external fonts or frameworks. */

:root {
  --bg: #fbfaf7;
  --bg-raised: #ffffff;
  --text: #1c1b19;
  --text-muted: #55524a;
  --heading: #14130f;
  --link: #7a3b12;
  --link-visited: #5c3a63;
  --border: #ddd6c9;
  --border-strong: #b8ae97;
  --code-bg: #f0ece0;
  --code-text: #3a2f1e;
  --accent: #7a3b12;
  --callout-bg: #f3ecd8;
  --callout-border: #c9a86a;
  --table-stripe: #f2efe6;
  --nav-bg: #efe9db;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171613;
    --bg-raised: #1f1d19;
    --text: #e8e4d9;
    --text-muted: #b3ac9b;
    --heading: #f5f1e6;
    --link: #e2a26b;
    --link-visited: #c9a3d6;
    --border: #3a372e;
    --border-strong: #514c3d;
    --code-bg: #26241d;
    --code-text: #e8e0c9;
    --accent: #e2a26b;
    --callout-bg: #2a2515;
    --callout-border: #6b5628;
    --table-stripe: #1d1b16;
    --nav-bg: #1f1d19;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #171613;
  --bg-raised: #1f1d19;
  --text: #e8e4d9;
  --text-muted: #b3ac9b;
  --heading: #f5f1e6;
  --link: #e2a26b;
  --link-visited: #c9a3d6;
  --border: #3a372e;
  --border-strong: #514c3d;
  --code-bg: #26241d;
  --code-text: #e8e0c9;
  --accent: #e2a26b;
  --callout-bg: #2a2515;
  --callout-border: #6b5628;
  --table-stripe: #1d1b16;
  --nav-bg: #1f1d19;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.65;
  font-size: 17px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  padding-top: env(safe-area-inset-top, 0px);
}

.site-header-inner {
  max-width: 70ch;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 0.9rem;
}

.site-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-tagline {
  display: block;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

nav.site-nav {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.92rem;
}

nav.site-nav a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.15rem;
  white-space: nowrap;
}

nav.site-nav a:hover,
nav.site-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

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

main {
  max-width: 70ch;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem calc(2rem + env(safe-area-inset-bottom, 0px));
  padding: 1.5rem 1.25rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
}

footer.site-footer .footer-inner {
  max-width: 70ch;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

footer.site-footer a {
  color: var(--text-muted);
}

h1, h2, h3, h4 {
  color: var(--heading);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.85rem;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2.2rem 0 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

h3 {
  font-size: 1.08rem;
  margin: 1.6rem 0 0.6rem;
}

p {
  margin: 0 0 1.1rem;
}

.lede {
  font-size: 1.12rem;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
}

a {
  color: var(--link);
}

a:visited {
  color: var(--link-visited);
}

ul, ol {
  margin: 0 0 1.1rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.4rem;
}

strong {
  color: var(--heading);
}

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.88em;
}

code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.12em 0.35em;
  border-radius: 4px;
  word-break: break-word;
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.9rem 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 1.2rem;
  border: 1px solid var(--border);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  word-break: normal;
  white-space: pre;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.3rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 0.92rem;
}

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

thead th {
  background: var(--table-stripe);
  color: var(--heading);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: var(--table-stripe);
}

blockquote {
  margin: 0 0 1.2rem;
  padding: 0.15rem 1.1rem;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
}

.callout {
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  margin: 0 0 1.3rem;
}

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

.callout-title {
  font-weight: 700;
  color: var(--heading);
  display: block;
  margin-bottom: 0.3rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  background: var(--bg-raised);
}

.card h3 {
  margin-top: 0;
}

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

.page-list {
  list-style: none;
  padding-left: 0;
}

.page-list li {
  padding: 0.15rem 0;
}

.prompt-block {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 0 0 0.6rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  overflow-x: auto;
}

.prompt-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
  font-weight: 600;
}

.prompt-note {
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 2rem;
}

.prompt-note:last-child {
  margin-bottom: 2rem;
}

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

.meta-links {
  font-size: 0.95rem;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}
