/*
 * global.css — PanchatWeb
 * Reset, base styles, and scrollbar.
 * No design tokens here — all CSS variables are in /shared/shared.css.
 */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* Prevent layout shift when scrollbar appears/disappears */
  scrollbar-gutter: stable;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  /* Prevent horizontal scroll on mobile */
  overflow-x: hidden;
}

/* ─── Typography baseline ─────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 400; /* headings use DM Serif Display weight */
}

p { line-height: 1.6; }

a { color: inherit; }

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

button {
  font-family: var(--sans);
  cursor: pointer;
}

input, select, textarea {
  font-family: var(--sans);
}

/* Remove number input spinners site-wide */
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* ─── Custom scrollbar (dark mode default) ───────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg2);
}
::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border2) var(--bg2);
}

/* ─── Reduced motion ──────────────────────────────────────────────────────── */
@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;
  }
}

/* ─── Selection colour ────────────────────────────────────────────────────── */
::selection {
  background: rgba(200, 241, 53, 0.25);
  color: var(--text);
}

/* ─── Focus ring (accessibility) ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Remove default focus outline where we handle focus styling ourselves */
:focus:not(:focus-visible) {
  outline: none;
}
