/* Reset all default styles while keeping essential elements functional */
*:where(:not(iframe, canvas, img, svg, video):not(svg *)) {
    all: unset;
    display: revert;
}

/* Set a consistent box-sizing model */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default margins and paddings */
body, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
dl, dd, ol, ul, figure, hr, fieldset, legend {
    margin: 0;
    padding: 0;
}

/* Remove default list styles */
ol, ul {
    list-style: none;
}

/* Ensure images never exceed their container */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Table resets */
table {
    border-collapse: collapse;
    width: 100%;
}

/* Remove default button styling */
button {
    all: unset;
    cursor: pointer;
}

/* Reset form elements */
input, textarea, select, button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
}

/* Revert Safari’s white-space property on textarea */
textarea {
    white-space: revert;
    resize: vertical;
}

/* Set a basic input width */
input {
    width: 100px;
}

/* Prevent videos from being visually distorted */
video {
    mask-image: radial-gradient(circle, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0));
    backface-visibility: hidden;
}

/* Remove text decoration on links */
a {
    text-decoration: none;
    color: inherit;
}

/* Prevent text overflows */
pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Ensure blockquotes and fieldsets remain visible */
blockquote, fieldset {
    border: none;
}

/* Make elements that are normally focusable accessible again */
[hidden] {
    display: none !important;
}
