/**
 * Shared public page shell — nav, canvas, theme chrome.
 * Import after public-tokens.css + components.css.
 */
@import url("/css/site-canvas.css");

:root {
  --layout-max: var(--page-max, 1180px);
}

body.public-page,
body.ob-page,
body.status-page,
body.auth-page,
body.error-page,
body.has-site-public-nav {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  font-size: var(--text-base, 1rem);
  line-height: 1.6;
  background: transparent;
  color: var(--color-text-primary, #f8fafc);
}

.home-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: var(--nav-offset);
  height: auto;
  padding-top: var(--safe-top);
  overflow-x: clip;
  border-bottom: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  background: rgba(6, 7, 11, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[data-theme="light"] .home-nav {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--color-border-subtle);
}

.home-nav__inner {
  max-width: var(--layout-max);
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  min-height: var(--nav-h);
  padding: 0.5rem max(1.25rem, env(safe-area-inset-right, 0px)) 0.5rem
    max(1.25rem, env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1vw, 1rem);
  box-sizing: border-box;
}

.home-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.home-logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.home-nav__links {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
  align-items: center;
  gap: clamp(0.55rem, 0.95vw, 1.25rem);
  font-size: clamp(0.78rem, 0.88vw, 0.9rem);
}

.home-nav__links a {
  color: var(--home-nav-link, #e8eef6);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.home-nav__links a:hover {
  color: var(--home-nav-link-hover, #f8fafc);
}

/* light nav: light-theme.css */

@media (min-width: 1100px) {
  .home-nav:not(.home-nav--compact) .home-nav__links {
    display: flex;
  }
}

/* Auth top bar (login / register) */
.auth-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  box-sizing: border-box;
  padding-top: var(--safe-top);
  overflow: visible;
  border-bottom: 1px solid var(--color-border-subtle);
  background: rgba(6, 7, 11, 0.88);
  backdrop-filter: blur(16px);
}

html[data-theme="light"] .auth-topbar {
  background: rgba(255, 255, 255, 0.92);
}

.auth-topbar__inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0.65rem max(1.25rem, env(safe-area-inset-right, 0px)) 0.65rem
    max(1.25rem, env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.auth-topbar .home-logo {
  margin-right: auto;
}

.auth-topbar .home-logo img {
  width: 132px;
  height: auto;
}

.auth-lang-bar {
  display: none;
}

/* Bottom site links — status, docs, similar public pages */
.public-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  margin-top: 2.5rem;
  padding: 0.5rem;
  padding-bottom: max(0.85rem, calc(0.5rem + env(safe-area-inset-bottom, 0px)));
  border-top: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 14px);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8125rem;
  line-height: 1.2;
}

html[data-theme="light"] .public-footer {
  background: rgba(15, 23, 42, 0.04);
  border-top-color: var(--color-border-subtle, rgba(15, 23, 42, 0.1));
}

.public-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  max-width: 11rem;
  padding: 0.5rem 0.65rem;
  border-radius: 999px;
  color: var(--color-text-secondary, #a1a1aa);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    color var(--duration-fast, 150ms) ease,
    background var(--duration-fast, 150ms) ease;
}

.public-footer a:hover {
  color: var(--color-text-primary, #f8fafc);
  background: rgba(123, 66, 246, 0.12);
}

html[data-theme="light"] .public-footer a:hover {
  color: #0f172a;
  background: rgba(123, 66, 246, 0.08);
}

.public-footer a.nav-auth--in {
  font-weight: 600;
  color: #c4b5fd;
  background: rgba(123, 66, 246, 0.18);
  border: 1px solid rgba(123, 66, 246, 0.28);
}

.public-footer a.nav-auth--in:hover {
  color: #fff;
  background: rgba(123, 66, 246, 0.28);
  border-color: rgba(167, 139, 250, 0.45);
}

@media (min-width: 480px) {
  .public-footer {
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    padding-bottom: max(1rem, calc(0.65rem + env(safe-area-inset-bottom, 0px)));
  }

  .public-footer a {
    flex: 0 1 auto;
    padding: 0.45rem 0.9rem;
  }
}
