/* Reset + base typography -------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink-700);
  background-color: var(--bg-app);
  background-image: var(--bg-app-accent);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; color: var(--ink-900); font-weight: 700; line-height: 1.25; }
h1 { font-size: var(--fs-3xl); letter-spacing: -.02em; }
h2 { font-size: var(--fs-xl); letter-spacing: -.01em; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-base); }
p  { margin: 0; }

a { color: var(--purple-600); 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; background: none; border: 0; padding: 0; }

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

:focus-visible {
  outline: 2px solid var(--purple-500);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--purple-200); color: var(--ink-900); }

[hidden] { display: none !important; }

.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;
}

/* Scrollbars (desktop) */
@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: var(--ink-200) transparent; }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
  *::-webkit-scrollbar-track { background: transparent; }
}

/* Boot screen -------------------------------------------------------------- */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg-app);
  background-image: var(--bg-app-accent);
}
.boot__inner { display: grid; justify-items: center; gap: 12px; }
.boot__name { font-family: var(--font-brand); font-size: var(--fs-xl); font-weight: 700; color: #000; letter-spacing: -.015em; }
.boot__bar { width: 180px; height: 4px; border-radius: 999px; background: var(--purple-100); overflow: hidden; }
.boot__bar span {
  display: block; width: 40%; height: 100%; border-radius: 999px; background: var(--purple-600);
  animation: bootSlide 1.1s var(--ease) infinite;
}
.boot__msg { font-size: var(--fs-md); color: var(--ink-400); }
.boot--error .boot__bar { display: none; }
.boot--error .boot__msg {
  color: var(--red-500); font-weight: 700; font-size: var(--fs-lg);
  max-width: 40ch; text-align: center;
}

.boot__inner { padding: 24px; }
.boot__help {
  max-width: 60ch;
  margin-top: 4px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink-500);
  font-size: var(--fs-md);
  line-height: 1.6;
}
.boot__help p + p { margin-top: 10px; }
.boot__help hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.boot__help pre {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--ink-900);
  color: #E8E6F5;
  overflow-x: auto;
}
.boot__help code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-sm); }

@keyframes bootSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

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