/**
 * Harbor Coffee Roasters — Base layer
 *
 * Modern reset, box-sizing, responsive media and mobile-first typographic
 * defaults. Depends on assets/css/design-tokens.css for every value.
 * Breakpoints used across the theme (mobile-first, min-width only):
 *   600px  — large phone / small tablet
 *   900px  — tablet / small laptop
 *   1200px — desktop
 */

/* ---------- Reset ---------- */

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

html {
	-webkit-text-size-adjust: 100%;
	-moz-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
	margin: 0;
}

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

body {
	min-height: 100vh;
	margin: 0;
	/* Guards against any child that overflows: the page never scrolls sideways. */
	overflow-x: hidden;
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-weight: var(--weight-regular);
	line-height: var(--leading-normal);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* ---------- Responsive media ---------- */

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

img,
video,
canvas {
	height: auto;
}

iframe,
embed,
object {
	border: 0;
}

/* ---------- Forms & interactive ---------- */

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

textarea {
	resize: vertical;
}

button {
	cursor: pointer;
}

a {
	color: var(--color-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--duration-fast) var(--ease-default);
}

a:hover {
	color: var(--color-link-hover);
}

/* Baseline focus ring. assets/css/controls.css refines it per surface and
   per control; it is never removed without a replacement. The element keeps
   its own border-radius so pill buttons are not squared off on focus. */
:focus-visible {
	outline: 3px solid var(--color-primary-700);
	outline-offset: 2px;
}

/* ---------- Typography ---------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-heading);
	font-weight: var(--weight-bold);
	line-height: var(--leading-tight);
	letter-spacing: var(--letter-tight);
	color: var(--color-neutral-900);
	text-wrap: balance;
}

h1 {
	font-size: var(--text-4xl);
	letter-spacing: var(--letter-tighter);
}

h2 {
	font-size: var(--text-3xl);
}

h3 {
	font-size: var(--text-2xl);
}

h4 {
	font-size: var(--text-xl);
}

h5 {
	font-size: var(--text-lg);
	font-weight: var(--weight-semibold);
}

h6 {
	/* --text-md, not --text-base: every heading level is on the fluid scale. */
	font-size: var(--text-md);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--letter-wide);
	text-transform: uppercase;
}

p,
li,
dd,
blockquote {
	max-width: var(--measure);
}

p + p,
ul + p,
ol + p,
p + ul,
p + ol {
	margin-top: var(--space-4);
}

blockquote {
	margin: var(--space-6) 0;
	padding-left: var(--space-5);
	border-left: var(--space-1) solid var(--color-primary-300);
	color: var(--color-text-muted);
	font-size: var(--text-lg);
}

small {
	font-size: var(--text-sm);
}

strong,
b {
	font-weight: var(--weight-semibold);
}

hr {
	height: var(--border-width);
	margin: var(--space-10) 0;
	border: 0;
	background-color: var(--color-border);
}

code,
pre {
	font-family: ui-monospace, "SFMono-Regular", "Menlo", monospace;
	font-size: var(--text-sm);
}

pre {
	overflow-x: auto;
	max-width: 100%;
	padding: var(--space-4);
	border-radius: var(--radius-md);
	background-color: var(--color-surface);
}

table {
	width: 100%;
	border-collapse: collapse;
}

/* Long words and URLs never force a horizontal scrollbar on narrow phones. */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
td,
th,
a {
	overflow-wrap: break-word;
}

/* ---------- Accessibility helpers ---------- */

.screen-reader-text,
.harbor-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.harbor-skip-link {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: 999;
	padding: var(--space-2) var(--space-4);
	border-radius: var(--radius-md);
	background-color: var(--color-primary-600);
	color: var(--color-on-primary);
	text-decoration: none;
	transform: translateY(-200%);
	transition: transform var(--duration-fast) var(--ease-default);
}

.harbor-skip-link:focus-visible {
	color: var(--color-on-primary);
	transform: translateY(0);
}
