:root {
  --color-bg:        #000000;
  --color-surface:   #141424;
  --color-surface-alt: #1a1a2e;
  --color-blue:      #3366FF;
  --color-blue-light: #5C85FF;
  --color-gold:      #D4A843;
  --color-gold-light: #E8C96A;
  --color-cream:     #F5F0E8;
  --color-muted:     #8888A0;
  --color-secondary: #AAAAAA;
  --color-border:    #222222;
  --color-danger:    #e05555;
  --color-success:   #55aa55;
  --color-warning:   #FFCC00;
  --font-heading:    'EB Garamond', serif;
  --font-body:       'Inter', system-ui, sans-serif;
  --font-mono:       'JetBrains Mono', monospace;
  --radius:          8px;
  --max-width:       1000px;
}

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

html { color-scheme: dark; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; color: var(--color-gold); }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; margin: 2.5rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
h3 { font-size: 1.2rem; color: var(--color-cream); margin: 1.5rem 0 0.5rem; }

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

pre, code { font-family: var(--font-mono); font-size: 0.85rem; }
pre { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem; overflow-x: auto; }

header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
header a { color: var(--color-muted); }
header a:hover { color: var(--color-gold); text-decoration: none; }

footer {
  text-align: center;
  padding: 2rem;
  color: var(--color-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
}

nav.card-grid {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
nav.card-grid a {
  display: block;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-cream);
  text-decoration: none;
  transition: border-color 0.2s;
}
nav.card-grid a:hover { border-color: var(--color-gold); }
nav.card-grid a h3 { color: var(--color-gold); font-size: 1.1rem; margin: 0 0 0.25rem; }
nav.card-grid a p { color: var(--color-muted); font-size: 0.9rem; }

.method { font-weight: 600; font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; }
.get { background: var(--color-success); color: #000; }
.post { background: var(--color-blue); color: #fff; }
.put { background: #CC8844; color: #000; }
.ws { background: #8844cc; color: #fff; }
.del { background: var(--color-danger); color: #fff; }

.admonition {
  border-left: 3px solid var(--color-blue);
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.admonition.warning { border-left-color: var(--color-gold); }
.admonition.danger { border-left-color: var(--color-danger); }
.admonition.tip { border-left-color: var(--color-success); }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--color-border); font-size: 0.85rem; }
th { color: var(--color-gold); }

main { max-width: var(--max-width); margin: 2rem auto; padding: 0 1rem; }

@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  header { flex-direction: column; align-items: flex-start; }
}
