/* ProductMoat — shared design tokens & chrome (Swiss / editorial system) */
/* Used by every page: index.html, person.html, map.html */

:root {
  --paper: #121212;
  --paper-alt: #1b1b1a;
  --ink: #f4f3ee;
  --ink-body: #d6d4cb;
  --ink-dim: #a8a69e;
  --line: #f4f3ee;
  --line-soft: #3a3a38;
  --accent: #ff5b3f;
  --accent-ink: #ffffff;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Courier New", Courier, monospace;
}

body.light {
  --paper: #f2f1ec;
  --paper-alt: #e9e7de;
  --ink: #111111;
  --ink-body: #3d3b35;
  --ink-dim: #5c584f;
  --line: #111111;
  --line-soft: #d8d6cc;
  --accent: #b3311f;
  --accent-ink: #ffffff;
}

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

html { color-scheme: dark; }
body.light { color-scheme: light; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
ul { list-style: none; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Masthead nav (shared across all pages) ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.logo-mark {
  width: 22px;
  height: 22px;
  background: url("favicon.svg") no-repeat center / contain;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-body);
}

.nav-links a {
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-btn:hover { background: var(--ink); color: var(--paper); }
.theme-btn svg { display: block; }

/* Compact CTA variant for the nav bar (e.g. the Sign up button, map.html's
   "Put yourself on the map") — smaller than the default .btn padding so it
   sits comfortably next to the 34px theme toggle. */
.nav-cta {
  padding: 9px 16px;
  font-size: 12.5px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- Member nav (avatar + dropdown, injected once signed in) ---------- */

.member-nav {
  position: relative;
  flex-shrink: 0;
}

.member-avatar-btn {
  display: flex;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  overflow: hidden;
  flex-shrink: 0;
}

.member-avatar {
  width: 100%;
  height: 100%;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  z-index: 60;
}

.member-nav:hover .member-dropdown,
.member-nav.open .member-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.member-dropdown a {
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-body);
}
.member-dropdown a:hover { background: var(--paper-alt); color: var(--ink); }
.member-dropdown a + a { border-top: 1px solid var(--line-soft); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 26px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-alt); }

/* ---------- Small text utilities ---------- */

.label-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-dim);
}

.bracket-link {
  font-family: var(--font-mono);
  font-size: 14.5px;
  letter-spacing: 0.01em;
  color: var(--ink-body);
  border-bottom: 1px solid var(--line-soft);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.bracket-link:hover { border-color: var(--ink); color: var(--accent); }

/* ---------- Shared avatar medallion (flat, monochrome — no gradients) ---------- */

.avatar, .avatar-big, .avatar-xl {
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img, .avatar-big img, .avatar-xl img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
