/* ==========================================================================
   Kami — Base / Reset
   Modern reset plus document-level defaults.
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
}

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

/* Lenis controls scroll; native smooth-scroll only when JS is absent. */
html:not(.lenis) {
	scroll-behavior: smooth;
}

html.lenis,
html.lenis body {
	height: auto;
}

.lenis.lenis-smooth {
	scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
	overflow: hidden;
}

body {
	background-color: var(--kami-bg);
	color: var(--kami-text);
	font-family: var(--font-sans);
	font-weight: var(--fw-regular);
	font-size: var(--fs-base);
	line-height: var(--lh-base);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
	min-height: 100vh;
	/* Global warm safety-net so any imagery sits in one palette */
	-webkit-tap-highlight-color: transparent;
}

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

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

button {
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
}

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

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

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

a:hover {
	color: var(--kami-secondary);
}

::selection {
	background: var(--kami-highlight);
	color: var(--kami-bg);
}

:focus-visible {
	outline: 2px solid var(--kami-accent);
	outline-offset: 3px;
}

/* Skip link */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: var(--z-skiplink);
	background: var(--kami-text);
	color: var(--kami-bg);
	padding: var(--space-2xs) var(--space-sm);
	letter-spacing: var(--ls-wide);
	text-transform: lowercase;
	font-size: var(--fs-small);
}

.skip-link:focus {
	left: var(--space-sm);
	top: var(--space-sm);
}

/* Screen-reader only */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
}

.screen-reader-text:focus {
	background-color: var(--kami-bg);
	clip: auto;
	clip-path: none;
	color: var(--kami-text);
	display: block;
	height: auto;
	left: var(--space-sm);
	padding: var(--space-2xs) var(--space-sm);
	top: var(--space-sm);
	width: auto;
	z-index: var(--z-skiplink);
}

/* Prevent body scroll when nav overlay is open */
body.nav-open {
	overflow: hidden;
}
