/* ═══════════════════════════════════════════════════════════
   SPATIAL WATCH — Base Styles
   Global resets and foundational styles
   ═══════════════════════════════════════════════════════════ */

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── App Shell ── */
.app-shell {
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

/* ── Screens ── */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.screen[hidden] {
  display: none !important;
}

/* ── Typography utilities ── */
.text--primary   { color: var(--text-primary); }
.text--secondary { color: var(--text-secondary); }
.text--tertiary  { color: var(--text-tertiary); }
.text--gold      { color: var(--gold); }
.text--violet    { color: var(--violet); }
.text--presence  { color: var(--presence); }
.text--danger    { color: var(--danger); }

/* ── Interactive elements baseline ── */
button,
a,
[role="button"] {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

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

/* ── Inputs baseline ── */
input,
textarea,
select {
  font-size: 16px; /* Prevents iOS zoom */
  font-family: var(--font-body);
}

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ── Selection ── */
::selection {
  background-color: var(--gold-bg);
  color: var(--text-primary);
}

/* ── Scrollbar (Webkit) ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--surface-4);
}

/* ── Hidden utility ── */
[hidden] {
  display: none !important;
}

/* ── Screen reader only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
