/* VocabKit base: reset + typography + layout primitives. */

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

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  border-radius: var(--r-sm);
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  line-height: var(--lh-tight);
  font-weight: 700;
  color: var(--text);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

img { max-width: 100%; display: block; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
}

input, select, textarea { font: inherit; color: inherit; }

mark, b {
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.muted { color: var(--text-mute); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Topbar ───────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  padding: var(--s-3) var(--s-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text);
  font-weight: 800;
  font-size: var(--fs-lg);
}
.brand:hover { color: var(--primary); text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topnav {
  display: flex;
  gap: var(--s-2);
  flex: 1;
}
.topnav a {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  color: var(--text-mute);
  font-weight: 600;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topnav a.active { background: var(--primary-bg); color: var(--primary); }

.topbar-actions { display: flex; gap: var(--s-2); }

.icon-btn {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--primary-bg); border-color: var(--primary); }

/* ── Main ─────────────────────────────────────────── */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ── Footer ───────────────────────────────────────── */
.footer {
  padding: var(--s-4) var(--s-6);
  text-align: center;
  color: var(--text-mute);
  font-size: var(--fs-sm);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-sep { opacity: .5; margin: 0 var(--s-2); }

/* ── Flash ────────────────────────────────────────── */
.flash {
  margin: var(--s-4) auto;
  max-width: 720px;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--fs-sm);
}
.flash-success { background: var(--primary-bg); border-color: var(--primary); color: var(--green-900); }
.flash-error   { background: var(--pink-50);   border-color: var(--pink-300); color: var(--pink-700); }

@media (max-width: 640px) {
  .topbar { padding: var(--s-3) var(--s-4); gap: var(--s-3); }
  .brand-name { display: none; }
}
