:root {
  --bg: #0e0a14;
  --bg-2: #15101e;
  --bg-3: #1c1626;
  --line: #2a2236;
  --text: #d9d2e3;
  --muted: #8f85a0;
  --head: #f0e6d2;
  --accent: #e0a24a;
  --accent-2: #c8663a;
  --link: #d8a5ff;
  --code-bg: #1a1424;
  --max: 46rem;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 17px/1.65 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--head);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.top nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.92rem;
}

.top nav a:hover, .brand:hover { color: var(--accent); }

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

footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

h1, h2, h3 {
  color: var(--head);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
}

h1 { font-size: 2.3rem; margin: 0 0 0.75rem; }
h1 + p { color: var(--muted); margin-top: 0; }
h1 + p strong { color: var(--text); font-weight: 500; }

h2 {
  font-size: 1.45rem;
  margin: 3rem 0 0.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

h3 { font-size: 1.1rem; margin: 1.8rem 0 0.5rem; color: var(--accent); }

p { margin: 0 0 1rem; }

a { color: var(--link); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: currentColor; }

strong { color: var(--head); font-weight: 600; }

hr { display: none; }

ul, ol { padding-left: 1.4rem; margin: 0 0 1rem; }
li { margin: 0.25rem 0; }
li::marker { color: var(--muted); }

/* contents list */
h2 + ol { columns: 2; column-gap: 2rem; }
h2 + ol li { break-inside: avoid; }
@media (max-width: 600px) { h2 + ol { columns: 1; } }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.93rem;
}

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

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #3a3050;
}

tbody tr:hover { background: var(--bg-2); }

td:first-child { color: var(--head); }
td:first-child strong { color: var(--head); }
.table-wrap, table { max-width: 100%; }
@media (max-width: 600px) { table { display: block; overflow-x: auto; } }

blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-2);
  border-radius: 0 6px 6px 0;
  color: var(--text);
}
blockquote p { margin: 0; }

code {
  font: 0.88em/1.5 ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  background: var(--code-bg);
  color: #f3c98b;
  padding: 0.12em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--line);
}

pre { background: var(--code-bg); padding: 0.9rem 1rem; border-radius: 6px; overflow-x: auto; border: 1px solid var(--line); }
pre code { border: 0; padding: 0; background: none; }

details {
  margin: 0.75rem 0;
  padding: 0.7rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

details[open] { background: var(--bg-3); }

summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }
summary::before { content: "\25B8"; display: inline-block; width: 1.1em; color: var(--muted); transition: transform 0.15s; }
details[open] summary::before { transform: rotate(90deg); }
summary strong { color: inherit; }

details p, details ul { margin-top: 0.75rem; }

em { color: var(--muted); }
