/* OfficialX public site design system.
   Loaded after each page's inline styles so every public route shares one
   set of colors, typography, spacing, radii, shadows, and navigation rules. */

:root {
  /* Backgrounds and surfaces */
  --bg: #050506;
  --bg-2: #0a0a0c;
  --bg-deep: #030304;
  --surface: #121215;
  --card: #121215;
  --card-2: #1a1a1f;
  --card-hover: #1b1b21;
  --bg-input: #0f0f13;

  /* Text */
  --text-hi: #f8fafc;
  --text-main: #f8fafc;
  --text-mid: #94a3b8;
  --text-low: #64748b;
  --text-dim: #475569;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.12);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(239, 68, 68, 0.26);
  --hover-bg: rgba(255, 255, 255, 0.05);

  /* Accent and states */
  --accent: #ef4444;
  --accent-2: #dc2626;
  --accent-hover: #dc2626;
  --accent-soft: rgba(239, 68, 68, 0.12);
  --accent-subtle: rgba(239, 68, 68, 0.08);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* Layout and spacing */
  --nav-height: 72px;
  --content-max: 1200px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radii and shadows */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 31, 45, 0.4) transparent;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-hi);
  -webkit-overflow-scrolling: touch;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 31, 45, 0.65);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
  background: #ff1f2d;
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

[id] {
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

h1,
h2,
h3,
h4,
h5,
h6,
.nav-brand-text {
  font-family: var(--font-display);
}

/* Shared width for public page content and navigation. */
.page {
  max-width: var(--content-max);
  padding-inline: var(--space-5);
}

/* Navigation. All public pages use the same component from site-nav.js. */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 6, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-inner {
  display: flex;
  align-items: center;
  max-width: var(--content-max);
  height: var(--nav-height);
  margin: 0 auto;
  padding: 0 var(--space-5);
  gap: var(--space-2);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: var(--space-3);
  margin-right: auto;
  color: var(--text-hi);
  text-decoration: none;
}

.nav-brand-logo {
  display: block;
  width: auto;
  height: 58px;
  flex-shrink: 0;
}

.nav-brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 11px;
  border: 1px solid var(--border-2);
  background: var(--card);
  box-shadow: none;
}

.nav-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
  box-shadow: none;
}

.nav-brand-text {
  font-size: 18px;
  font-weight: var(--weight-extrabold);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  color: var(--text-mid);
  font-size: 13.5px;
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-links a:hover {
  color: var(--text-hi);
  background: var(--hover-bg);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: var(--weight-semibold);
}

.nav-invite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  gap: 7px;
  padding: 0 16px;
  margin-left: var(--space-2);
  color: #fff;
  background: var(--accent);
  font-size: 13.5px;
  font-weight: var(--weight-bold);
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-invite:hover {
  background: var(--accent-2);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transform: none;
}

.nav-invite svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 7px;
  color: var(--text-mid);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.mobile-toggle:hover {
  color: var(--text-hi);
  background: var(--hover-bg);
}

.mobile-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  inset-inline: 0;
  z-index: 99;
  max-height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  padding: var(--space-3) var(--space-4) var(--space-4);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  flex-direction: column;
  gap: var(--space-1);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--space-4);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  color: var(--text-mid);
  text-decoration: none;
  border-radius: var(--radius-md);
}

.mobile-menu a svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-menu a:hover {
  color: var(--text-hi);
  background: var(--hover-bg);
}

.mobile-menu a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.mobile-menu a.mobile-invite {
  margin-top: var(--space-2);
  justify-content: center;
  color: #fff;
  background: var(--accent);
}

.mobile-menu a.mobile-invite:hover {
  background: var(--accent-2);
}

.nav a:focus-visible,
.nav button:focus-visible,
.mobile-menu a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  .nav-inner,
  .page {
    padding-inline: 20px;
  }
}

@media (max-width: 900px) {
  .nav-links,
  .nav-invite {
    display: none;
  }

  .mobile-toggle {
    display: inline-flex;
  }
}

@media (max-width: 600px) {
  .nav-inner,
  .page {
    padding-inline: var(--space-4);
  }
}

@media (max-width: 420px) {
  .nav-inner {
    gap: var(--space-1);
  }

  .nav-brand {
    gap: 9px;
  }

  .nav-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .nav-brand-logo {
    height: 46px;
  }

  .nav-brand-text {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
