/* ──────────────────────────────────────────────────────────
   Reset + design tokens (shared across themes).
   Per-theme tokens live in themes.css and individual theme files.
   ────────────────────────────────────────────────────────── */

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--paper);
  letter-spacing: var(--track-body, 0);
  font-feature-settings: var(--font-features-body, normal);
  /* Avoid iOS jank from rubber-banding on dark themes */
  background-attachment: fixed;
  overflow-x: hidden;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

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

::selection {
  background: var(--accent);
  color: var(--paper);
}

/* Minimal scrollbar styling for desktop dark themes */
@media (pointer: fine) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb, #5556) transparent;
  }
  *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  *::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb, #5556);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
  }
}

/* Boot-screen shown during initial render (replaced by app) */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.75rem;
  font-family: var(--font-mono, 'JetBrains Mono', 'Courier Prime', monospace);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--accent, #7af9ff);
  background: var(--paper);
  padding: 2rem;
  text-transform: uppercase;
}
.boot-line {
  opacity: 0;
  animation: bootline 1.4s ease-out forwards;
}
.boot-line:nth-child(1) {
  animation-delay: 0.05s;
}
.boot-line:nth-child(2) {
  animation-delay: 0.45s;
}
.boot-line:nth-child(3) {
  animation-delay: 0.85s;
}
@keyframes bootline {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 0.85;
    transform: none;
  }
}

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

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