/* ==========================================================================
   VLab-4000 — Modern CSS Reset
   Based on Josh Comeau's reset + Sanitize.css best practices
   ========================================================================== */

/* 1. Box sizing rules — apply to all elements */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* 2. Remove default margin and padding on everything */
* {
    margin: 0;
    padding: 0;
}

/* 3. Root / HTML setup */
html {
    /* Prevent font size inflation on mobile */
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;

    /* Smooth scrolling (overridden by prefers-reduced-motion below) */
    scroll-behavior: smooth;

    /* Tab size for code blocks */
    tab-size: 4;

    /* Better line height base */
    line-height: 1.5;
}

/* 4. Body defaults */
body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: system-ui, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 5. Improve media defaults */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

/* 6. Remove default list styles when list role is applied */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

/* 7. Input and button normalization */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* 8. Avoid overflow issues with long words */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

/* 9. Remove text-decoration from anchor tags by default
   (we'll add our own styles in typography.css) */
a {
    text-decoration: none;
    color: inherit;
}

/* 10. Remove built-in form typography styles */
button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0;
}

/* 11. Button cursor */
button,
[type='button'],
[type='reset'],
[type='submit'] {
    -webkit-appearance: button;
    cursor: pointer;
    background-color: transparent;
    background-image: none;
    border: 0;
}

/* 12. Fieldset normalization */
fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

/* 13. Table normalization */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* 14. Details / Summary */
summary {
    cursor: pointer;
    list-style: none;
}
summary::-webkit-details-marker {
    display: none;
}

/* 15. HR */
hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
    border-top-style: solid;
}

/* 16. Code normalization */
code,
kbd,
samp,
pre {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 1em;
}

pre {
    overflow-x: auto;
}

/* 17. Small */
small {
    font-size: 80%;
}

/* 18. Sub and sup */
sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}
sub { bottom: -0.25em; }
sup { top: -0.5em; }

/* 19. Scrollbar gutter reservation (prevents layout shift) */
html {
    scrollbar-gutter: stable;
}

/* 20. Focus styles — visible for keyboard users, hidden for mouse */
:focus-visible {
    outline: 2px solid #D90429;
    outline-offset: 3px;
    border-radius: 3px;
}

:focus:not(:focus-visible) {
    outline: none;
}

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

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

/* 23. Disabled inputs */
[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

/* 24. Abbreviation styling */
abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

/* 25. Dialog reset */
dialog {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    max-width: 100vw;
    max-height: 100vh;
}
