/* ============================================================
   REIDOS World — base.css
   Reset, document chrome, typography, boot state, a11y floor.
   Tokens come from css/tokens.css. Mobile-first.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

img, svg, video { display: block; max-width: 100%; }
canvas { display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- document ---------- */
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Floor crossfade — descent.js retints the body as you descend. */
  transition: background-color .8s ease;
}
@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}

/* ---------- typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: .01em;
  color: var(--ink);
  margin-bottom: .45em;
}
h1 { font-size: clamp(28px, 6vw, 44px); }
h2 { font-size: clamp(22px, 4.5vw, 32px); }
h3 { font-size: clamp(18px, 3.5vw, 24px); }
h4 { font-size: 16.5px; }

p { margin: 0 0 .9em; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.2em; margin: 0 0 .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
small { font-size: 12.5px; color: var(--muted); }

a { color: var(--gold); text-decoration: none; }
a:hover {
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

::selection { background: var(--gold); color: #14101f; }

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

/* ---------- fixed layers ---------- */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#mount {
  position: relative;
  z-index: 1;
}

/* ---------- boot state ---------- */
.boot-state {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  font-family: var(--serif);
  font-size: 16.5px;
  color: var(--muted);
}
.boot-mark {
  font-size: 54px;
  line-height: 1;
  color: var(--gold);
  animation: boot-pulse 3.2s ease-in-out infinite;
}
@keyframes boot-pulse {
  0%, 100% { opacity: .35; transform: scale(.96); }
  50%      { opacity: 1;   transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .boot-mark { animation: none; opacity: .85; }
}

/* ---------- screen-reader utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- quiet scrollbars (cosmetic only) ---------- */
@media (min-width: 821px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: var(--line-2);
    border-radius: 8px;
    border: 2px solid var(--bg);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }
}
