:root {
  --gold: #C89B3C;
  --gold-dark: #9c7526;
  --ink: #17140d;
  --paper: #fffdf8;
  --paper-alt: #f6f1e6;
  --line: #e7ddc4;
  --text: #2b2618;
  --text-soft: #6b6349;
  --radius: 10px;
  --maxw: 1040px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.6;
}

a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

header.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
}
.header-inner img.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-weight: 800; letter-spacing: 0.02em; font-size: 17px; color: var(--ink); }
.brand-name small { display: block; font-weight: 500; font-size: 11px; color: var(--text-soft); letter-spacing: 0.06em; text-transform: uppercase; }

nav.top-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
  font-size: 13.5px;
}
nav.top-nav a {
  color: var(--text);
  padding: 7px 10px;
  border-radius: 7px;
}
nav.top-nav a:hover { background: var(--paper-alt); text-decoration: none; }
nav.top-nav a.current { background: var(--ink); color: #fff; }

main { max-width: var(--maxw); margin: 0 auto; padding: 36px 20px 80px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-dark);
  margin: 0 0 6px;
}

h1 { font-size: 30px; margin: 0 0 10px; color: var(--ink); }
h2 { font-size: 21px; margin: 40px 0 12px; color: var(--ink); border-top: 1px solid var(--line); padding-top: 28px; }
main > h2:first-of-type,
.no-rule { border-top: none; padding-top: 0; }
h3 { font-size: 16.5px; margin: 22px 0 8px; color: var(--ink); }
p { margin: 0 0 14px; color: var(--text); }
p.lede { font-size: 17px; color: var(--text-soft); max-width: 62ch; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 6px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code {
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.92em;
}
pre {
  background: var(--ink);
  color: #f2ead2;
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
}
pre code { background: none; border: none; padding: 0; color: inherit; }

.card {
  border: 1px solid var(--line);
  background: var(--paper-alt);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 18px 0;
}
.card h4 { margin: 0 0 6px; font-size: 14px; color: var(--ink); }
.card p:last-child { margin-bottom: 0; }

.notice {
  border-left: 4px solid var(--gold);
  background: #fbf3df;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 14.5px;
}
.notice.legal {
  border-left-color: #b0432e;
  background: #fbeae6;
}
.notice strong { color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}
.tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--paper);
}
.tile h4 { margin: 0 0 6px; font-size: 14.5px; }
.tile p { margin: 0; font-size: 13.5px; color: var(--text-soft); }
.tile a.stretched { position: absolute; inset: 0; }
.tile { position: relative; }

table { width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-soft); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em; }

.hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 34px 0 10px;
  flex-wrap: wrap;
}
.hero img { width: 92px; height: 92px; flex: none; }

.btn {
  display: inline-block;
  background: var(--ink);
  color: #fff !important;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none !important;
}
.btn:hover { background: #000; }
.btn.gold { background: var(--gold); color: var(--ink) !important; }
.btn.gold:hover { background: var(--gold-dark); color: #fff !important; }

footer.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  color: var(--text-soft);
  font-size: 13px;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.site-footer a { color: var(--text-soft); }

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  background: var(--paper-alt);
  margin: 20px 0 30px;
}
.toc .eyebrow { margin-bottom: 8px; }
.toc ul { columns: 2; margin: 0; padding-left: 18px; }
.toc li { break-inside: avoid; font-size: 13.5px; }
@media (max-width: 560px) { .toc ul { columns: 1; } }

.anchor-target { scroll-margin-top: 74px; }

.redirect-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.redirect-box { max-width: 460px; padding: 20px; }
.redirect-box img { width: 56px; height: 56px; margin-bottom: 14px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
  margin: 14px auto 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2ead2; --paper: #16130d; --paper-alt: #1f1b12;
    --line: #332c1c; --text: #ece4cf; --text-soft: #b7ac8d; --gold: #d9ac4f;
  }
  pre { background: #000; }
  .btn { color: #16130d !important; background: var(--gold); }
  .btn:hover { background: #e8c06a; }
  .btn.gold { color: #16130d !important; }
}
