/* Base reset + typography + watermark */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--ui-font);
  font-size: var(--ui-fs-base);
  line-height: var(--ui-lh-base);
  color: var(--ui-text-primary);
  background: var(--ui-page-bg);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

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

a {
  color: var(--ui-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, .ui-h1 {
  margin: 0;
  font-size: var(--ui-fs-h1);
  line-height: var(--ui-lh-h1);
  font-weight: var(--ui-fw-h1);
  letter-spacing: -0.02em;
}

h2, .ui-h2 {
  margin: 0;
  font-size: var(--ui-fs-h2);
  line-height: var(--ui-lh-h2);
  font-weight: var(--ui-fw-h2);
}

h3, .ui-h3 {
  margin: 0;
  font-size: var(--ui-fs-h3);
  line-height: var(--ui-lh-h3);
  font-weight: var(--ui-fw-h3);
}

h4, .ui-h4 {
  margin: 0;
  font-size: var(--ui-fs-h4);
  line-height: var(--ui-lh-h4);
  font-weight: var(--ui-fw-h4);
}

.ui-body-lg {
  font-size: var(--ui-fs-lg);
  line-height: var(--ui-lh-lg);
  font-weight: 400;
}

.ui-body {
  font-size: var(--ui-fs-base);
  line-height: var(--ui-lh-base);
  font-weight: 400;
}

.ui-body-sm {
  font-size: var(--ui-fs-sm);
  line-height: var(--ui-lh-sm);
  font-weight: 400;
}

.ui-caption {
  font-size: var(--ui-fs-caption);
  line-height: var(--ui-lh-caption);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ui-text-muted { color: var(--ui-text-muted); }
.ui-text-secondary { color: var(--ui-text-secondary); }

/* Brand watermark (toggle: add class ui-brand-off on <body>) */
.ui-watermark {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
  background-image: repeating-linear-gradient(
    -18deg,
    transparent 0,
    transparent 72px,
    rgba(27, 97, 209, 0.018) 72px,
    rgba(27, 97, 209, 0.018) 73px
  );
}

.ui-watermark::before {
  content: var(--ui-brand-watermark-text);
  position: absolute;
  inset: -10% -10%;
  font-family: var(--ui-font);
  font-weight: 800;
  font-size: 72px;
  line-height: 2.2;
  letter-spacing: 0.4em;
  color: var(--ui-brand-watermark-color);
  white-space: pre-wrap;
  word-spacing: 1.8em;
  transform: rotate(-18deg);
}

body.ui-brand-off .ui-watermark {
  display: none;
}

.ui-page {
  position: relative;
  z-index: 1;
}

/* Visual / pure capture mode */
html.ui-visual *,
html.ui-visual *::before,
html.ui-visual *::after {
  animation: none !important;
  transition: none !important;
  caret-color: transparent !important;
}

html.ui-pure .ui-audit-only {
  display: none !important;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ui-focus-ring);
}

.ui-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
