:root {
  --bg: #0f1115;
  --text: #d4d4d8;
  --muted: #8a8f98;
  --faint: #5a5f68;
  --accent: #a3e635;
  --rule: rgba(255,255,255,0.08);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font: 16px/1.7 Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--bg);
  max-width: 64ch;
  margin: 3rem auto;
  padding: 0 1.25rem;
}

a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

h1 { font-size: 26px; font-weight: normal; margin: 0 0 1.5rem; }
h2 { font-size: 20px; font-weight: normal; font-style: italic; margin: 2.5rem 0 1rem; }
h3 { font-size: 17px; font-weight: normal; font-style: italic; margin: 1.5rem 0 0.5rem; }

p { margin: 0 0 1rem; }
code { font: 0.92em ui-monospace, "JetBrains Mono", "SFMono-Regular", Consolas, monospace; }

.meta  { color: var(--muted); font-size: 13px; font-style: italic; }
.muted { color: var(--muted); font-size: 14px; }
.faint { color: var(--faint); font-size: 12px; }
.sep   { color: var(--faint); margin: 0 0.4rem; }

nav { font-size: 13.6px; margin-bottom: 2.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1rem; }
nav a { color: var(--muted); text-decoration: none; display: inline-block; padding: 0.5rem 0; }
nav a[aria-current="page"] { color: var(--accent); }

footer { color: var(--faint); font-size: 12px; margin: 3rem 0 1rem; }

figure { margin: 1.5rem 0; }
figure img { max-width: 100%; height: auto; display: block; }
figcaption { color: var(--muted); font-size: 13px; font-style: italic; margin-top: 0.4rem; }

/* Zingarate */
article { margin-bottom: 1rem; }
article h2 { margin-bottom: 0.5rem; }

/* Wide layouts (vocabularies, photo archive) */
body.wide { max-width: 1080px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; margin: 1rem 0 2rem; }
.gallery img { width: 100%; height: 180px; object-fit: cover; display: block; }
.gallery video { width: 100%; height: 180px; object-fit: cover; display: block; background: #000; }
hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 1.5rem 0; }
.vocab-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; align-items: start; }
.vocab-sidebar > summary { display: none; }
.vocab-sidebar .sort { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.vocab-sidebar .sort a { color: var(--muted); text-decoration: none; }
.vocab-sidebar .sort a.active { color: var(--accent); }
.vocab-sidebar .cat { color: var(--faint); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: normal; font-style: normal; margin: 1.25rem 0 0.4rem; }
.vocab-sidebar ul { list-style: none; padding: 0; margin: 0; }
.vocab-sidebar li a { display: block; color: var(--text); text-decoration: none; padding: 0.15rem 0; line-height: 1.4; }
.vocab-sidebar li a.active { color: var(--accent); }
.vocab-sidebar li a:hover { text-decoration: underline; }
.vocab-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.vocab-head h2 { margin: 0; }
.vocab-table { margin-top: 1.25rem; }
.vocab-table .row { display: grid; grid-template-columns: 90px 1fr auto; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rule); cursor: pointer; align-items: baseline; }
.vocab-table .code { font: 0.92em ui-monospace, "JetBrains Mono", Consolas, monospace; color: var(--accent); }
.vocab-table .aux { color: var(--faint); font-size: 12px; text-align: right; }
.vocab-table .row.copied .code { color: var(--muted); }

@media (max-width: 700px) {
  .vocab-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .vocab-sidebar > summary { display: list-item; cursor: pointer; color: var(--muted); padding: 0.5rem 0; }
}

@media (max-width: 600px) {
  nav .sep { margin: 0 0.75rem; }
  nav a { padding: 0.6rem 0; }
}
