/*
 * amarea redesign — base layer
 * Modern CSS reset + typography defaults + utilities.
 * Завантажується ПІСЛЯ tokens.css.
 */

/* ============================================================
 *  Reset (variant of Andy Bell's modern reset)
 * ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
	min-height: 100vh;
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-family: var(--font-sans);
	font-size: var(--text-body);
	color: var(--c-ink);
	background: var(--c-paper);
	font-feature-settings: "ss01" on, "cv01" on; /* Inter Tight stylistic */
}

img, picture, video, canvas, svg {
	display: block;
	max-width: 100%;
}

input, button, textarea, select { font: inherit; color: inherit; }

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

ul, ol { list-style: none; padding: 0; }

a {
	color: inherit;
	text-decoration: none;
	transition: color var(--duration-fast) var(--ease-out);
}

a:hover { color: var(--c-accent-ink); }

/* ============================================================
 *  Focus-ring (accessibility)
 * ============================================================ */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: none;
	box-shadow: var(--shadow-focus);
	border-radius: var(--radius-2);
}

/* ============================================================
 *  Typography presets (use as classes OR as base element styles)
 * ============================================================ */
.t-display-xl,
.t-display-l,
.t-display-m {
	font-family: var(--font-display);
	font-weight: var(--fw-regular);
	letter-spacing: var(--tracking-tight);
}

.t-display-xl { font-size: var(--text-display-xl); line-height: var(--lh-display-xl); }
.t-display-l  { font-size: var(--text-display-l);  line-height: var(--lh-display-l); letter-spacing: var(--tracking-tight); }
.t-display-m  { font-size: var(--text-display-m);  line-height: var(--lh-display-m); letter-spacing: var(--tracking-snug); }

h1, .t-h1 {
	font-size: var(--text-h1);
	line-height: var(--lh-h1);
	font-weight: var(--fw-medium);
	letter-spacing: var(--tracking-snug);
}
h2, .t-h2 {
	font-size: var(--text-h2);
	line-height: var(--lh-h2);
	font-weight: var(--fw-medium);
	letter-spacing: var(--tracking-snug);
}
h3, .t-h3 {
	font-size: var(--text-h3);
	line-height: var(--lh-h3);
	font-weight: var(--fw-medium);
}

.t-body   { font-size: var(--text-body);    line-height: var(--lh-body);   font-weight: var(--fw-regular); }
.t-body-s { font-size: var(--text-body-s);  line-height: 1.50;             font-weight: var(--fw-regular); color: var(--c-ink-soft); }
.t-ui     { font-size: var(--text-ui);      line-height: var(--lh-ui);     font-weight: var(--fw-medium); letter-spacing: var(--tracking-loose); }
.t-micro  {
	font-size: var(--text-micro);
	line-height: 1.30;
	font-weight: var(--fw-medium);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
}

.t-mono {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
}

.t-num {
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" on;
}

/* Body text default reading width */
.t-prose {
	max-width: 65ch;
}

/* ============================================================
 *  Layout helpers
 * ============================================================ */
.container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-pad-mobile);
}

@media (min-width: 1024px) {
	.container { padding-inline: var(--container-pad-desktop); }
}

/* Stack: vertical rhythm. Default gap = --space-4. */
.stack > * + * { margin-top: var(--space-4); }
.stack-2 > * + * { margin-top: var(--space-2); }
.stack-5 > * + * { margin-top: var(--space-5); }
.stack-6 > * + * { margin-top: var(--space-6); }
.stack-7 > * + * { margin-top: var(--space-7); }

/* ============================================================
 *  Accessibility helpers
 * ============================================================ */
.visually-hidden {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@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;
	}
}

/* ============================================================
 *  Selection
 * ============================================================ */
::selection {
	background: var(--c-accent);
	color: var(--c-ink);
}
