/* Base: tokens, theme, reset, global shell */

:root {
  --site-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --site-header-height: 69px;
  --site-radius-sm: 10px;
  --site-radius-md: 16px;
  --site-radius-lg: 18px;

  --site-bg-light-0: #f7f7fb;
  --site-bg-light-1: #ffffff;
  --site-fg-light: #2a2a2a;
  --site-muted-light: #5c6470;
  --site-border-light: #d7dbe3;
  --site-border-light-strong: #cbd2dc;
  --site-surface-light: #eef2f6;
  --site-surface-light-strong: #e7ecf3;
  --site-panel-bg-light: #ffffff;
  --site-tooltip-bg-light: #ffffff;
  --site-header-bg-light: #ffffff;
  --site-header-btn-border-light: #cfd6df;
  --site-header-btn-bg-light: #f1f4f8;

  --site-bg-dark-0: #070709;
  --site-bg-dark-1: #0b0b10;
  --site-fg-dark: #eef2f7;
  --site-muted-dark: #a8b3c6;
  --site-border-dark: #2c3442;
  --site-border-dark-strong: #3a4557;
  --site-surface-dark: #151b24;
  --site-surface-dark-strong: #1b2330;
  --site-panel-bg-dark: #111722;
  --site-tooltip-bg-dark: #111722;
  --site-header-bg-dark: #0b0f16;
  --site-header-btn-border-dark: #354052;
  --site-header-btn-bg-dark: #151d29;

  --site-accent: #8bb9ff;
  --site-focus-ring: 0 0 0 3px rgba(139, 185, 255, 0.22);

  --shadow-md: 0 22px 60px rgba(0, 0, 0, 0.20);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.28);
  --shadow-tooltip: 0 18px 50px rgba(0, 0, 0, 0.16);
  --shadow-panel-dark: 0 22px 60px rgba(0, 0, 0, 0.34);
  --shadow-tooltip-dark: 0 18px 50px rgba(0, 0, 0, 0.32);
  --shadow-legal-dark: 0 24px 70px rgba(0, 0, 0, 0.28);

  /* light theme is the default */
  --site-fg: var(--site-fg-light);
  --site-muted: var(--site-muted-light);
  --site-border: var(--site-border-light);
  --site-border-strong: var(--site-border-light-strong);
  --site-surface: var(--site-surface-light);
  --site-surface-strong: var(--site-surface-light-strong);
  --site-page-bg: linear-gradient(180deg, var(--site-bg-light-0), var(--site-bg-light-1));
  --site-header-bg: var(--site-header-bg-light);
  --site-header-btn-border: var(--site-header-btn-border-light);
  --site-header-btn-bg: var(--site-header-btn-bg-light);
  --site-panel-bg: var(--site-panel-bg-light);
  --site-tooltip-bg: var(--site-tooltip-bg-light);
  --site-panel-shadow: var(--shadow-md);
  --site-tooltip-shadow: var(--shadow-tooltip);
  --site-card-shadow: var(--shadow-lg);
}

html[data-ui-theme="dark"],
body[data-ui-theme="dark"] {
  --site-fg: var(--site-fg-dark);
  --site-muted: var(--site-muted-dark);
  --site-border: var(--site-border-dark);
  --site-border-strong: var(--site-border-dark-strong);
  --site-surface: var(--site-surface-dark);
  --site-surface-strong: var(--site-surface-dark-strong);
  --site-page-bg: linear-gradient(180deg, var(--site-bg-dark-0), var(--site-bg-dark-1));
  --site-header-bg: var(--site-header-bg-dark);
  --site-header-btn-border: var(--site-header-btn-border-dark);
  --site-header-btn-bg: var(--site-header-btn-bg-dark);
  --site-panel-bg: var(--site-panel-bg-dark);
  --site-tooltip-bg: var(--site-tooltip-bg-dark);
  --site-panel-shadow: var(--shadow-panel-dark);
  --site-tooltip-shadow: var(--shadow-tooltip-dark);
  --site-card-shadow: var(--shadow-legal-dark);
}

/* reset */
html,
body {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--site-font-sans);
  background: var(--site-page-bg);
  color: var(--site-fg);
}

main {
  min-height: calc(100dvh - var(--site-header-height));
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* shared header shell */
.siteMenuRoot {
  position: relative;
  display: block;
}

.siteHeader {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: var(--site-header-height);
  padding: 12px 16px;
  border-bottom: 1px solid var(--site-border);
  background: var(--site-header-bg);
  color: var(--site-fg);

}

.siteHeader__brand {
  grid-column: 1;
  justify-self: start;
  max-width: min(70vw, 520px);
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  font-weight: 700;
  letter-spacing: .3px;
}

.siteHeader__center {
  grid-column: 2;
  justify-self: center;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.siteHeader__menuBtn {
  grid-column: 3;
  justify-self: end;
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--site-header-btn-border);
  border-radius: var(--site-radius-sm);
  background: var(--site-header-btn-bg);
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.siteHeader__menuIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}


