/* ============================================================
   PIKMO Games — Base Styles & Reset
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

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

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

@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;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--clr-text);
  background-color: var(--clr-bg);
  min-height: 100vh;
  transition: background-color var(--dur-slow) var(--ease),
              color var(--dur-slow) var(--ease);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-snug);
  color: var(--clr-text);
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl)); }
h4 { font-size: clamp(var(--text-lg), 2vw, var(--text-2xl)); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  line-height: var(--leading-relaxed);
  color: var(--clr-text-secondary);
  max-width: 68ch;
}

p + p { margin-top: var(--sp-4); }

strong, b { font-weight: var(--weight-semibold); color: var(--clr-text); }
em, i { font-style: italic; }

small { font-size: var(--text-sm); }

/* === Links === */
a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

a:hover { color: var(--clr-primary-hover); }

a:focus-visible {
  outline: 2px solid var(--clr-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* === Lists === */
ul, ol {
  padding-left: var(--sp-6);
}

li { line-height: var(--leading-relaxed); }

/* === Images === */
img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Forms === */
input, button, textarea, select {
  font: inherit;
}

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

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

/* === Tables === */
table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--clr-border);
}

th {
  font-weight: var(--weight-semibold);
  color: var(--clr-text);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* === Code === */
code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--clr-surface-2);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  color: var(--clr-primary);
}

/* === Horizontal Rule === */
hr {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: var(--sp-8) 0;
}

/* === Skip navigation === */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: var(--z-toast);
  background: var(--clr-primary);
  color: var(--clr-text-inverse);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  transition: top var(--dur-fast);
}

.skip-link:focus {
  top: var(--sp-4);
  outline: 2px solid var(--clr-accent);
  outline-offset: 2px;
}

/* === Selection === */
::selection {
  background: var(--brand-teal);
  color: #fff;
}

/* === Scrollbar (non-critical, decorative) === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--clr-bg-alt); }
::-webkit-scrollbar-thumb {
  background: var(--clr-border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--clr-text-tertiary); }

/* === Screen reader only === */
.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;
}
