/* base.css — reset, typography, layout primitives. Mobile-first (360px). */

:root {
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --maxw: 768px;
  --gap: 1rem;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 4rem; /* room for bottom nav on mobile */
}

h1, h2, h3, h4 { line-height: 1.25; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }

a { color: var(--color-link); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: .5rem 1rem;
  z-index: 1000;
}
.skip-link:focus { top: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--color-primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 48px;
}
.topbar .brand     { font-weight: 600; font-size: 1.05rem; }
.topbar .placement-context {
  font-size: .875rem;
  opacity: .9;
}
.topbar .spacer    { flex: 1; }
.topbar .profile-btn {
  background: rgba(255,255,255,.2);
  border: none;
  color: inherit;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
}

main { flex: 1; }
.container { max-width: var(--maxw); margin: 0 auto; padding: var(--gap); }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--color-bg-elev);
  border-top: 1px solid var(--color-border);
  z-index: 100;
}
.bottom-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-fg);
  font-size: .875rem;
  min-height: 44px;
}
.bottom-nav a[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 600;
}

@media (min-width: 768px) {
  .container { padding: 1.5rem; max-width: 960px; }
  body       { padding-bottom: 0; }
  .bottom-nav { display: none; }
  h1 { font-size: 1.75rem; }
}
