/**
 * GeneX CSS Reset
 * 
 * Modern CSS reset for consistent cross-browser rendering.
 * Based on modern-normalize with GeneX-specific additions.
 */

/* ============================================
   BOX SIZING
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ============================================
   DOCUMENT
   ============================================ */

html {
    /* Prevent font-size inflation on mobile */
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;

    /* Smooth scrolling (respects reduced motion) */
    scroll-behavior: smooth;

    /* Prevent scroll on html when modals are open */
    overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   BODY
   ============================================ */

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: var(--leading-normal);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    text-wrap: balance;
}

p {
    margin: 0;
    text-wrap: pretty;
}

/* ============================================
   LINKS
   ============================================ */

a {
    color: var(--text-link);
    text-decoration: none;
    transition: var(--transition-color);
}

a:hover {
    color: var(--text-link-hover);
}

a:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ============================================
   LISTS
   ============================================ */

ul, ol {
    margin: 0;
    padding: 0;
}

/* Remove list styles on lists with a list role */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

/* ============================================
   MEDIA
   ============================================ */

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

/* ============================================
   FORMS
   ============================================ */

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

input, textarea {
    border: none;
    outline: none;
    background: none;
}

textarea {
    resize: vertical;
}

/* Remove default fieldset styles */
fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

/* Remove default legend styles */
legend {
    padding: 0;
}

/* ============================================
   TABLE
   ============================================ */

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ============================================
   MISC
   ============================================ */

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@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;
    }
}

/* Hidden but accessible */
.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;
}

/* Hidden visually and from screen readers */
.hidden {
    display: none !important;
}

/* Focus visible only for keyboard users */
:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background-color: var(--color-primary-200);
    color: var(--color-primary-900);
}

[data-theme="dark"] ::selection {
    background-color: var(--color-primary-700);
    color: var(--color-primary-100);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--color-gray-300);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-gray-400);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background-color: var(--color-gray-700);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-gray-600);
}