/* chrome.css: the shared site chrome: header, nav, profile menu, footer.
 * Values are ported verbatim from home.css so the homepage is pixel-identical;
 * namespaced --c-* tokens keep the chrome consistent on every page regardless
 * of each page's own :root (dashboard, docs, legal, login, ...).
 */
:root {
  --c-bg: #0b0b0c;
  --c-surface: #121214;
  --c-surface-hover: #18181b;
  --c-border: #222226;
  --c-border-strong: #323238;
  --c-text: #f2f2f5;
  --c-text-secondary: #bcbcc6;
  --c-text-muted: #9a9aa4;
  --c-accent: #d46a58;
  --c-serif: 'Cormorant Garamond', Georgia, serif;
  --c-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --c-mono: 'JetBrains Mono', monospace;
}

/* ── Header (ported verbatim from home.css) ─────────────────── */
/* Root font-size fixed at 15px (matching the homepage) so the chrome's
   rem-based sizes render identically on every page. */
html { font-size: 15px; overflow-x: hidden; }
body { overflow-x: hidden; padding-top: 56px; }

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  border-bottom: 1px solid var(--c-border);
  height: 56px;
  display: flex;
  align-items: center;
  background: rgba(11, 11, 12, 0.88);
  backdrop-filter: blur(10px);
  z-index: 50;
  line-height: 1.5;
}

.header .container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
  user-select: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  display: block;
  flex-shrink: 0;
}

.brand-mark .wbar {
  fill: var(--c-accent);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.brand:hover .brand-mark .wbar-1 { transform: scaleY(1.12); }
.brand:hover .brand-mark .wbar-2 { transform: scaleY(1.28); }
.brand:hover .brand-mark .wbar-3 { transform: scaleY(1.12); }

.brand-word {
  font-family: var(--c-serif);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  color: var(--c-text);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  font-size: 0.88rem;
  margin: 0;
  padding: 0;
}

/* Page stylesheets may add global ul/li margins (e.g. docs.css). Never let
   them leak into the fixed header's nav. */
.header .nav, .header .nav li { margin: 0; padding: 0; }

.nav a { color: var(--c-text-secondary); transition: color 0.15s ease; }
.nav a:hover { color: var(--c-text); }

.nav-btn {
  color: #fff !important;
  background: var(--c-accent);
  border: 1px solid var(--c-accent);
  padding: 7px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.86rem;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 0 0 rgba(212, 106, 88, 0);
  white-space: nowrap;
}

.nav-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(212, 106, 88, 0.35);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-login { font-size: 0.86rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--c-border-strong);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ── Profile menu (signed-in users; logout lives here) ───────── */
.profile { position: relative; }

.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--c-border-strong);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  color: var(--c-text-secondary);
  font-family: var(--c-sans);
  font-size: 0.86rem;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.profile-btn:hover { color: var(--c-text); border-color: var(--c-text-muted); }

.profile-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-chev { transition: transform 0.15s ease; }
.profile[data-open] .profile-chev { transform: rotate(180deg); }

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 70;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 4px;
}

.profile-mail {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}

.pm-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--c-text-secondary);
  font-family: var(--c-sans);
  font-size: 0.88rem;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

.pm-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--c-text); }
.pm-logout:hover { color: #e88b8b; }

/* ── Footer (ported verbatim from home.css) ──────────────────── */
.footer {
  padding: 32px 0 48px;
  font-size: 0.84rem;
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-border);
}

.footer .container { max-width: 1020px; margin: 0 auto; padding: 0 24px; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.footer-links a { color: var(--c-text-muted); }
.footer-links a:hover { color: var(--c-text); }

/* ── Responsive nav (ported verbatim from home.css) ──────────── */
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }

  .nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    display: none;
    background: rgba(11, 11, 12, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--c-border);
    padding: 6px 0 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  }

  .nav.open { display: flex; }

  .nav a { display: block; padding: 14px 24px; font-size: 1rem; border-bottom: 1px solid var(--c-border); }

  .nav li:last-child a { border-bottom: none; }

  .nav .nav-btn { margin: 12px 24px 4px; padding: 12px; text-align: center; font-size: 1rem; }

  .nav-auth { flex-direction: column; align-items: stretch; gap: 0; }

  .profile { width: 100%; }
  .profile-btn { width: 100%; justify-content: space-between; border-radius: 6px; padding: 12px 24px; border-bottom: 1px solid var(--c-border); }
  .profile-menu { position: static; width: 100%; margin: 0 0 8px; }
}

@media (max-width: 480px) {
  .profile-label { display: none; }
}