/**
 * CSS Reset & Normalize
 *
 * Modern CSS reset based on best practices from:
 * - Josh Comeau's CSS Reset
 * - Normalize.css
 * - Andy Bell's Modern CSS Reset
 */

/* ============================================
   Box Sizing & Reset
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================
   Document & Root
   ============================================ */
html {
    height: 100%;
    width: 100%;
    /* Improve text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Prevent font size adjustments on orientation change (iOS) */
    -webkit-text-size-adjust: 100%;
    /* iOS safe areas handled by individual page components (headers, footers) */
    /* Always show scrollbar to prevent layout shift between pages */
    overflow-y: scroll;
    overscroll-behavior-y: none;
}

/* Fluid root scale on large displays — bumps the rem base so all rem-based type
   AND spacing scale up (text feels too small on big monitors otherwise). Uses
   PERCENTAGES (not px or vw): respects the user's browser font preference and
   browser zoom, unlike a vw-based root which would break both. Laptops + 1080p
   (<2000px) are deliberately untouched; only genuinely large/retina/ultrawide
   displays scale. Step 1 of the responsive-scaling plan — see design notes. */
@media (min-width: 2000px) { html { font-size: 106.25%; } }  /* ~17px from a 16px base */
@media (min-width: 2560px) { html { font-size: 112.5%; } }   /* ~18px — 5K/27" logical */
@media (min-width: 3200px) { html { font-size: 118.75%; } }  /* ~19px — XDR / large 4K */

body {
    min-height: 100%;
    width: 100%;
    line-height: var(--line-height-normal, 1.6);
    background: var(--bg-primary, #1a1a1a);
    color: var(--text-primary, #ffffff);
    font-family: var(--font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif);
    font-size: var(--font-size-base, 1rem);
    font-weight: var(--font-weight-normal, 400);
    overflow-x: clip;
    overscroll-behavior-y: none;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    line-height: var(--line-height-tight, 1.25);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-primary, #ffffff);
}

p, li, blockquote {
    max-width: var(--content-max-width, 65ch);
}

a {
    color: inherit;
    text-decoration: inherit;
}

/* ============================================
   Media Elements
   ============================================ */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ============================================
   Form Elements
   ============================================ */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Remove default button styles */
button::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* ============================================
   Lists
   ============================================ */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

/* ============================================
   Tables
   ============================================ */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ============================================
   Text Selection
   ============================================ */
::selection {
    background: var(--color-primary);
    color: var(--text-primary, #ffffff);
}

::-moz-selection {
    background: var(--color-primary);
    color: var(--text-primary, #ffffff);
}

/* ============================================
   Scrollbar Styling (Webkit)
   ============================================ */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary, #0f0f0f);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full, 9999px);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Accessibility
   ============================================ */
/* Remove all animations for people who prefer 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;
    }
}

/* Improve focus visibility for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Hide content visually but keep it accessible to 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;
}
