/* Just Us — base: reset, typography, focus, layout primitives. Logical properties only (RTL-ready). */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  font-size: 100%;
  line-height: var(--lh);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
}

html[data-text-size="112"] {
  font-size: 112.5%;
}

html[data-text-size="125"] {
  font-size: 125%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  block-size: 100vh;
  block-size: var(--vvh, 100dvh);
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: var(--fs-2xl);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--fs-xl);
  line-height: 1.25;
  font-weight: 650;
}

h3 {
  font-size: var(--fs-lg);
  font-weight: 650;
}

a {
  color: var(--accent-fg);
  text-underline-offset: 0.15em;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img,
svg,
video {
  display: block;
  max-inline-size: 100%;
}

ol,
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

:focus {
  outline: none;
}

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

/* Headings receive programmatic focus on screen changes (screen-reader context); they are not interactive controls. */
[tabindex="-1"]:focus {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon {
  inline-size: 24px;
  block-size: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  inline-size: 18px;
  block-size: 18px;
}

.icon--lg {
  inline-size: 32px;
  block-size: 32px;
}

[dir="rtl"] .icon--flip {
  transform: scaleX(-1);
}

.app {
  flex: 1 1 auto;
  min-block-size: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-block-size: 0;
}

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

.small {
  font-size: var(--fs-sm);
}

.mono {
  font-family: var(--mono);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.stack--sm {
  gap: var(--s-2);
}

.stack--lg {
  gap: var(--s-5);
}

.row-inline {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.spinner {
  display: inline-block;
  inline-size: 18px;
  block-size: 18px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  flex: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.boot {
  display: grid;
  place-items: center;
  flex: 1;
  gap: var(--s-4);
  padding: var(--s-6);
  text-align: center;
}

.brand-mark {
  inline-size: 72px;
  block-size: 72px;
  color: var(--accent-fg);
}

/* the boot splash is painted before the app colour is known, so it carries no accent colour (no flash, ADR-037) */
.boot .brand-mark {
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }

  .spinner {
    animation: none;
    border-inline-end-color: currentColor;
    opacity: 0.6;
  }
}

@media (forced-colors: active) {
  :focus-visible {
    outline: 2px solid Highlight;
  }

  .icon {
    stroke: CanvasText;
  }
}

.privacy-blurred .app {
  filter: blur(18px);
}
