/* ============================================================
   AS Apps Developer Portal — Modern CSS Reset
   ============================================================
   Normalizes cross-browser behavior. Based on modern reset
   principles (Andy Bell, Josh Comeau).
   ============================================================ */

/* ── Box Sizing ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ── Remove Default Margins & Padding ── */
* {
  margin: 0;
  padding: 0;
}

/* ── Document ── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 100%; /* 16px base */
  tab-size: 4;
}

/* ── Respect reduced motion preference ── */
@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 ── */
body {
  min-height: 100vh;
  line-height: var(--leading-normal, 1.5);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  text-wrap: balance;
}

p {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

/* ── Media ── */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Form Elements ── */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Lists ── */
ul,
ol {
  list-style: none;
}

/* ── Links ── */
a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── Tables ── */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ── Misc ── */
[hidden] {
  display: none !important;
}

/* ── Focus Visible (Accessibility) ── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Selection ── */
::selection {
  background-color: var(--color-primary-subtle);
  color: var(--color-primary-light);
}

/* ── Scrollbar (Webkit) ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-text-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

/* ── Firefox Scrollbar ── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-text-tertiary) var(--color-bg);
}

/* ── Skip to Content (Accessibility) ── */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-max);
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: #FFFFFF;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: var(--font-semibold);
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: 0;
}

/* ── 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-width: 0;
}
