/* ============================================================
   reset.css — Normalize & Enterprise CSS Standards
   Layout stability, Scrollbar styling, High-contrast text & A11y
   ============================================================ */

*, *::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%;
  overflow-y: auto;
  scrollbar-gutter: stable; /* Prevents layout shift across routes */
}

body {
  min-height: 100vh;
  line-height: var(--leading-normal);
  font-family: var(--font-sans);
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* RTL line height balance */
[dir="rtl"] p,
[dir="rtl"] .prose,
[dir="rtl"] article {
  line-height: 1.65;
}

img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
}

img, video {
  height: auto;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

input, textarea, select {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

/* Prevent browser autofill from breaking dark mode */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
  -webkit-background-clip: text;
  -webkit-text-fill-color: var(--color-text-primary) !important;
  transition: background-color 50000s ease-in-out 0s;
}

fieldset {
  border: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

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

/* Hidden attribute */
[hidden] { display: none !important; }

/* Visually hidden but accessible for screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Enterprise Focus Ring (2px Cyan #06b6d4) ──────── */
*:focus-visible {
  outline: 2px solid transparent !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #06b6d4 !important;
}

/* ── Custom Cyan Scrollbar ─────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(9, 9, 11, 0.4);
}

.light-mode ::-webkit-scrollbar-track {
  background: rgba(240, 241, 244, 0.6);
}

::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 212, 0.3); /* 30% Cyan */
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.65); /* 65% Cyan */
}

/* Utility to hide scrollbar while keeping scrollable */
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }
