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

html,
body {
  min-height: 100vh;
}

html {
  font-family: var(--font-body);
  background: var(--color-bg-deep);
  color: var(--color-pixel-cream);
  line-height: 1.5;
}

body {
  min-width: var(--viewport-min);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
}

img.pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.font-pixel {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-body);
}

.font-kanji {
  font-family: var(--font-kanji);
}

:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

.crt-scanline {
  position: relative;
}

.crt-scanline::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Moving scanline bands (rolling) */
  background:
    linear-gradient(transparent 50%, rgba(0, 0, 0, 0.38) 50%),
    /* Static fine-line grid for CRT phosphor texture */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.12) 2px,
      rgba(0, 0, 0, 0.12) 3px
    );
  background-size: 100% 6px, 100% 3px;
  animation: scanline 0.2s linear infinite;
  /* Below everything — background texture only */
  z-index: 1;
}

@keyframes scanline {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 6px, 0 0;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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