:root {
  --ink: #241d35;
  --ink-soft: #57506b;
  --ink-muted: #8a839c;
  --purple: #4e3d7f;
  --purple-deep: #34245d;
  --bar: #fbf8f1;
  --line: rgba(78, 61, 127, 0.12);
}

html { scroll-padding-top: 104px; }
body.public-page {
  min-height: 100vh;
  height: auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.public-content { flex: 1; min-width: 0; }
.public-content :is(h1, h2, h3) { text-wrap: balance; overflow-wrap: break-word; }
.public-content :is(p, li) { text-wrap: pretty; }

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 48px;
  height: 84px;
  flex-shrink: 0;
  gap: 24px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
.nav--hidden { transform: translateY(-100%); }
.nav:focus-within { transform: translateY(0); }
.nav-links { display: flex; align-items: center; gap: 28px; justify-self: start; }
.nav-link { font-size: .875rem; color: var(--ink-soft); font-weight: 600; text-decoration: none; transition: color 140ms; }
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.nav-logo { justify-self: center; height: 84px; display: flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 132px; width: auto; display: block; mix-blend-mode: multiply; filter: contrast(1.08) brightness(1.04); }
.nav-actions { display: flex; align-items: center; gap: 16px; justify-self: end; }
.nav-cta { padding: 9px 18px; background: var(--purple); color: #fff; border-radius: 9px; font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background 140ms; }
.nav-cta:hover { background: var(--purple-deep); }

.site-footer {
  background: var(--bar);
  border-top: 1px solid var(--line);
  padding: 28px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.footer-logo { display: flex; align-items: center; }
.footer-logo img { height: 34px; width: auto; display: block; }
.footer-links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
.footer-link { font-size: .82rem; color: var(--ink-muted); text-decoration: none; transition: color 140ms; }
.footer-link:hover { color: var(--ink-soft); }
.footer-copy { color: var(--ink-muted); font-size: .78rem; }
.nav a:focus-visible, .site-footer a:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; border-radius: 3px; }

@media (max-width: 900px) {
  html { scroll-padding-top: 84px; }
  .nav { grid-template-columns: minmax(0, 1fr) auto; padding: 0 20px; height: 64px; gap: 16px; }
  .nav-links { display: none; }
  .nav-logo { height: 64px; min-width: 0; justify-self: start; }
  .nav-logo img { height: auto; max-height: 44px; width: 100%; max-width: 180px; object-fit: contain; }
  .nav-actions { gap: 12px; }
  .nav-link { white-space: nowrap; }
  .site-footer { flex-direction: column; gap: 16px; padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav, .nav-link, .nav-cta, .footer-link { transition: none; }
}
