/* ==========================================================================
	Universal reset/normalize hybrid
	- Modern baseline for consistent rendering
	- Sensible defaults, not "everything: 0" destructive reset
	- Includes form controls normalization + media/layout safety
========================================================================== */

/* ---- 1) Box sizing ----------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

/* ---- 2) Document & typography baseline -------------------------------- */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	tab-size: 4;
	line-height: 1.15;
}
ul,ol,li {
	list-style: none;
}
body {
	margin: 0;
	min-height: 100dvh;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Provide a reasonable default font inheritance */
body,
button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

/* ---- 3) Headings, paragraphs, lists ----------------------------------- */
/* Keep margins predictable (not zeroing all typography) */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
}

p {
	margin: 0;
}

ul,
ol {
	margin: 0;
	padding-left: 1.5em;
}

li {
	margin: 0;
}

/* ---- 4) Links ---------------------------------------------------------- */
a {
	color: inherit;
	text-decoration: inherit;
}

a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

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

svg {
	fill: currentColor;
}

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

th,
td {
	padding: 0;
	text-align: left;
	vertical-align: top;
}

/* ---- 7) Form controls normalization ----------------------------------- */
button,
input,
select,
textarea {
	margin: 0;
}

button,
[type="button"],
[type="submit"],
[type="reset"] {
	-webkit-appearance: button;
	appearance: button;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

input,
textarea {
	border-radius: 0; /* iOS rounding surprises */
}

textarea {
	resize: vertical;
}

/* Remove inner padding in Firefox */
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner {
	border-style: none;
	padding: 0;
}

/* Normalize focus outline in Firefox */
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="submit"]:-moz-focusring,
[type="reset"]:-moz-focusring {
	outline: 1px dotted ButtonText;
}

/* Number input spinners (optional: keep if you like them) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
	height: auto;
}

/* Search input normalization */
input[type="search"] {
	-webkit-appearance: textfield;
	outline-offset: -2px;
}
input[type="search"]::-webkit-search-decoration {
	-webkit-appearance: none;
}

/* File upload button normalization */
input[type="file"]::-webkit-file-upload-button {
	-webkit-appearance: button;
	font: inherit;
}

/* Placeholder normalization */
::placeholder {
	color: inherit;
	opacity: 0.55;
}

/* ---- 8) Interactive elements ------------------------------------------ */
details {
	display: block;
}

summary {
	display: list-item;
	cursor: pointer;
}

/* ---- 9) Text-level semantics ------------------------------------------ */
b,
strong {
	font-weight: bolder;
}

small {
	font-size: 0.875em;
}

sub,
sup {
	font-size: 0.75em;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}

sub {
	bottom: -0.25em;
}

sup {
	top: -0.5em;
}

/* ---- 10) Horizontal rule ------------------------------------------------ */
hr {
	box-sizing: content-box;
	height: 0;
	overflow: visible;
	border: 0;
	border-top: 1px solid currentColor;
	opacity: 0.2;
	margin: 0;
}

/* ---- 11) Hidden attribute --------------------------------------------- */
[hidden] {
	display: none !important;
}

/* ---- 12) Reduced motion preference ------------------------------------ */
/* Keep animations accessible; does not force remove, only respects user pref */
@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;
	}
}
