/*
 * Element defaults. Theme-neutral — no chess-specific styles here.
 */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--text-on-light);
  background: var(--surface-ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-4);
  color: inherit;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

p {
  margin: 0 0 var(--space-4);
  max-width: 70ch;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--dur-quick) var(--ease-out);
}

a:hover,
a:focus-visible {
  color: var(--brand-orange);
  text-decoration: underline;
}

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

ul, ol {
  padding-left: var(--space-5);
  margin: 0 0 var(--space-4);
}

li {
  margin-bottom: var(--space-2);
}

hr {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: var(--space-7) 0;
}

blockquote {
  border-left: 3px solid var(--brand-orange);
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  margin: var(--space-5) 0;
  color: var(--text-on-light-muted);
  font-style: italic;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

button {
  font: inherit;
  cursor: pointer;
}

.visually-hidden {
  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: fixed;
  top: 0;
  left: 0;
  transform: translateY(-200%);
  background: var(--surface-board-dark);
  color: var(--text-on-dark);
  padding: var(--space-3) var(--space-5);
  z-index: var(--z-modal);
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
  transition: transform var(--dur-quick) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}
