/* ==========================================================================
   Base Typography, Page Frame, Accessibility & Motion Guardrails
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(47, 100, 49, 0.55) transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: var(--bg-tex);
  background-size: 320px 320px;
  image-rendering: pixelated;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

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

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

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* Chinese-friendly small label (replaces .mono wherever the text has CJK) */
.label {
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(47, 100, 49, 0.45);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--on-lime);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

::selection {
  background: var(--lime);
  color: var(--on-lime);
}

/* Growcode-inspired architectural side rails */
.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0 clamp(12px, 1.8vw, 24px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
