/* app/styles/base.css
   Reset, typography and the auth gate (replaces the old inline FOUC <style> blocks). */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

h1 { font-size: var(--fs-xl); font-weight: 600; line-height: 1.35; }
h2 { font-size: var(--fs-lg); font-weight: 600; line-height: 1.4; }
h3 { font-size: var(--fs-md); font-weight: 600; line-height: 1.45; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }

code, kbd, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }

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

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--sp-2); left: var(--sp-2);
  z-index: 1000;
  padding: var(--sp-2) var(--sp-4);
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: var(--radius);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; text-decoration: none; }

/* Auth gate: nothing of the console is visible until the session is verified.
   Kept in an external stylesheet so the page works with a CSP that forbids inline styles. */
html[data-auth="pending"] #app,
html[data-auth="pending"] #overlay-root { visibility: hidden; }
html[data-auth="pending"] body::after {
  content: "";
  position: fixed; inset: 0; margin: auto;
  width: 28px; height: 28px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: hf-spin 0.8s linear infinite;
}

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

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