/**
 * Import Global Design System
 */
@import url('../src/lib/styles/tokens.css');
@import url('../src/lib/styles/breakpoints.css');
@import url('../src/lib/styles/containers.css');

/**
 * CSS Reset & Base Styles
 */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	/* Base font size for rem calculations */
	font-size: 16px;
	/* Prevent font size inflation on mobile */
	-webkit-text-size-adjust: 100%;
}

html, body {
	position: relative;
	width: 100%;
	height: 100%;
	scroll-behavior: smooth;
}

body {
	color: var(--color-dark, #1a1a1a);
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: var(--line-height-normal, 1.6);
	background-color: var(--color-white, #ffffff);
	font-size: var(--font-size-base, 1rem);
}

a {
	color: inherit;
	text-decoration: none;
	transition: all var(--duration-normal, 0.3s) var(--ease-in-out, ease);
	/* Ensure minimum touch target size */
	min-height: var(--touch-target-min, 44px);
	display: inline-flex;
	align-items: center;
}

a:hover {
	opacity: 0.8;
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--color-primary, #96bf13);
	outline-offset: 2px;
}

button {
	font-family: inherit;
	font-size: inherit;
	cursor: pointer;
	border: none;
	outline: none;
	transition: all var(--duration-normal, 0.3s) var(--ease-in-out, ease);
}

button:not(.dot):not(.defense-dot):not(.slider-dot):not(.carousel-indicator) {
	/* Ensure minimum touch target size for non-indicator buttons */
	min-height: var(--touch-target-min, 44px);
	min-width: var(--touch-target-min, 44px);
	padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
}

/* Slider/carousel indicator dots - small touch targets OK */
.dot,
.defense-dot,
.slider-dot,
.carousel-indicator {
	min-height: unset !important;
	min-width: unset !important;
	padding: 0 !important;
}

button:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

/* Ensure interactive elements are accessible */
input,
select,
textarea {
	min-height: var(--touch-target-min, 44px);
	font-family: inherit;
	font-size: inherit;
}

/* Improve text readability */
p, li {
	/* Minimum font size for body text */
	font-size: max(var(--font-size-base, 1rem), 16px);
	line-height: var(--line-height-normal, 1.6);
}

/* Prevent text overflow */
h1, h2, h3, h4, h5, h6, p {
	overflow-wrap: break-word;
	hyphens: auto;
}

/**
 * Accessibility: Reduced Motion Support
 * Respects user's motion preferences (prefers-reduced-motion)
 * WCAG 2.1 Level AAA compliance
 */
@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;
	}

	/* Specifically disable problematic animations */
	.hexagons-track,
	.carousel,
	[class*="slide"],
	[class*="scroll"],
	[class*="animate"] {
		animation: none !important;
	}
}

/**
 * Accessibility: High Contrast Mode Support
 */
@media (prefers-contrast: high) {
	* {
		border-width: 2px !important;
	}

	button,
	a {
		text-decoration: underline;
	}
}

/**
 * Responsive Typography
 * Slightly reduce font size on very small screens while maintaining readability
 */
@media (max-width: 768px) {
	html {
		font-size: 15px;
	}
}

@media (max-width: 480px) {
	html {
		font-size: 15px;
	}

	/* Ensure minimum readable sizes even on small screens */
	p, li {
		font-size: max(0.9375rem, 14px);
	}
}

/**
 * Print Styles
 */
@media print {
	* {
		background: white !important;
		color: black !important;
		box-shadow: none !important;
		text-shadow: none !important;
	}

	a,
	a:visited {
		text-decoration: underline;
	}

	a[href]:after {
		content: " (" attr(href) ")";
	}

	img {
		max-width: 100% !important;
	}

	@page {
		margin: 2cm;
	}
}
