:root {
  --bg: #F4F1EA;
  --card: #FBFAF6;
  --ink: #2A2622;
  --muted: #6F685F;
  --gold: #EDB441;
  --gold-lip: #B98418;
  --gold-ink: #3A2B07;
  --line: rgba(42, 38, 34, 0.1);
  --coral: #E8735C;
  --green: #3FA968;
  --radius: 22px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1916;
    --card: #24211D;
    --ink: #F3EEE6;
    --muted: #B3AA9E;
    --line: rgba(243, 238, 230, 0.12);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* Header */
header.site { padding: 22px 0; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -0.3px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
nav.site { display: flex; gap: 18px; font-size: 15px; font-weight: 600; }
nav.site a { text-decoration: none; color: var(--muted); }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--ink); }

/* Hero */
.hero { text-align: center; padding: 36px 0 28px; }
.hero img.loco { width: 180px; height: auto; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .hero img.loco { animation: none; } }
.hero h1 { font-size: clamp(34px, 7vw, 56px); line-height: 1.05; letter-spacing: -1.2px; margin: 18px 0 12px; font-weight: 900; }
.hero p.lead { font-size: clamp(18px, 3vw, 21px); color: var(--muted); max-width: 600px; margin: 0 auto 26px; }

/* Coin button */
.coin {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold); color: var(--gold-ink);
  font-weight: 800; font-size: 17px; text-decoration: none;
  padding: 14px 26px; border-radius: 999px;
  box-shadow: 0 4px 0 var(--gold-lip);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.coin:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-lip); }
.note { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 18px 0 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 10px 0 4px; font-size: 18px; letter-spacing: -0.2px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.token {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px;
  background: var(--gold); color: var(--gold-ink); box-shadow: 0 3px 0 var(--gold-lip);
}
.token.coral { background: var(--coral); color: #3E120A; box-shadow: 0 3px 0 #A9483A; }
.token.green { background: var(--green); color: #06301A; box-shadow: 0 3px 0 #23794A; }

.langs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 44px; }
.langs span { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 15px; font-weight: 600; }

section h2 { font-size: 26px; letter-spacing: -0.5px; margin: 8px 0 6px; }
section.center { text-align: center; }

/* Documents */
article.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); margin: 10px 0 40px; }
article.doc h1 { font-size: clamp(30px, 6vw, 40px); letter-spacing: -0.8px; margin: 0 0 4px; line-height: 1.1; }
article.doc .updated { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
article.doc h2 { font-size: 21px; margin: 28px 0 6px; letter-spacing: -0.2px; }
article.doc p, article.doc li { color: var(--ink); }
article.doc ul { padding-left: 22px; }
article.doc .summary { background: color-mix(in srgb, var(--gold) 16%, transparent); border-radius: 16px; padding: 14px 18px; margin: 0 0 8px; }
details { border-top: 1px solid var(--line); padding: 14px 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; font-size: 17.5px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "–"; }
details p { margin: 8px 0 0; color: var(--muted); }

footer.site { border-top: 1px solid var(--line); padding: 22px 0 36px; color: var(--muted); font-size: 14px; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
footer.site nav { display: flex; gap: 16px; }
footer.site a { text-decoration: none; }
footer.site a:hover { color: var(--ink); }
