/* Sky's the limit: tokens and base styles.
   Token names match the agency design system. Per project, only the values in
   the "per-project" block change (from design-tokens.md). Everything else is fixed. */

:root {
	/* Per-project tokens */
	--color-primary: #1b4fd8;
	--color-secondary: #0f2a6b;
	--color-accent: #ff7a1a;
	--color-text: #1a1f2b;
	--color-text-muted: #5b6474;
	--color-surface: #ffffff;
	--color-surface-alt: #f4f6fa;
	--color-border: #e3e7ee;
	--color-on-primary: #ffffff;
	--font-heading: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

	/* Fixed type scale */
	--text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.85rem);
	--text-sm: clamp(0.8rem, 0.78rem + 0.15vw, 0.875rem);
	--text-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
	--text-lg: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
	--text-xl: clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
	--text-2xl: clamp(1.3rem, 1.05rem + 1.25vw, 1.75rem);
	--text-3xl: clamp(1.6rem, 1.15rem + 2.25vw, 2.5rem);
	--text-4xl: clamp(2rem, 1.3rem + 3.5vw, 3.5rem);
	--text-5xl: clamp(2.5rem, 1.6rem + 4.5vw, 4.5rem);

	/* Fixed spacing scale */
	--space-2xs: clamp(0.25rem, 0.22rem + 0.15vw, 0.375rem);
	--space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
	--space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1.1rem);
	--space-md: clamp(1rem, 0.8rem + 1vw, 1.5rem);
	--space-lg: clamp(1.75rem, 1.4rem + 1.75vw, 2.75rem);
	--space-xl: clamp(2.5rem, 1.9rem + 3vw, 4.5rem);
	--space-2xl: clamp(3rem, 2rem + 5vw, 7rem);
	--space-3xl: clamp(4rem, 2.5rem + 7.5vw, 10rem);

	/* Fixed shape tokens */
	--radius-sm: 6px;
	--radius-md: 12px;
	--radius-lg: 20px;
	--radius-full: 999px;
	--container-max: 1200px;
	--shadow-card: 0 4px 24px rgba(0, 0, 0, 0.07);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: 1.65;
	color: var(--color-text);
	background: var(--color-surface);
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--color-accent); }
h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; }
ul, ol { padding-left: 1.25em; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-md); top: -100px; padding: var(--space-xs) var(--space-md); background: var(--color-primary); color: var(--color-on-primary); border-radius: var(--radius-sm); z-index: 1000; }
.skip-link:focus { top: var(--space-md); }

/* Typography classes */
.text-display { font-family: var(--font-heading); font-size: var(--text-5xl); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.text-h1 { font-family: var(--font-heading); font-size: var(--text-4xl); font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
.text-h2 { font-family: var(--font-heading); font-size: var(--text-3xl); font-weight: 650; line-height: 1.2; }
.text-h3 { font-family: var(--font-heading); font-size: var(--text-2xl); font-weight: 600; line-height: 1.3; }
.text-h4 { font-family: var(--font-heading); font-size: var(--text-xl); font-weight: 600; line-height: 1.35; }
.text-body-lg { font-family: var(--font-body); font-size: var(--text-lg); line-height: 1.6; color: var(--color-text); }
.text-body { font-family: var(--font-body); font-size: var(--text-base); line-height: 1.65; color: var(--color-text); }
.text-small { font-family: var(--font-body); font-size: var(--text-sm); line-height: 1.5; color: var(--color-text-muted); }
.text-eyebrow { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent); }

/* Layout classes */
.section { padding-block: var(--space-2xl); background: var(--color-surface); }
.section-alt { padding-block: var(--space-2xl); background: var(--color-surface-alt); }
.section-hero { padding-block: var(--space-3xl); }
.section-compact { padding-block: var(--space-lg); }
.container { max-width: var(--container-max); margin-inline: auto; padding-inline: var(--space-md); }
.stack-xs { display: flex; flex-direction: column; gap: var(--space-xs); }
.stack-md { display: flex; flex-direction: column; gap: var(--space-md); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-lg); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; }
.grid-2 { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

/* Components */
.btn-primary, .btn-secondary {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs);
	padding: var(--space-xs) var(--space-md); border-radius: var(--radius-md);
	font-family: var(--font-body); font-weight: 600; text-decoration: none; line-height: 1.2;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); border: 1px solid var(--color-primary); }
.btn-primary:hover { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-primary); }
.btn-secondary { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary); color: var(--color-on-primary); }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-md); }
.card a { color: inherit; text-decoration: none; }
.card a:hover { color: var(--color-primary); }
.input-field { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: var(--space-xs) var(--space-sm); font-family: var(--font-body); font-size: var(--text-base); width: 100%; }
.input-field:focus { border-color: var(--color-primary); outline: none; }
.badge { display: inline-block; background: var(--color-surface-alt); color: var(--color-text-muted); font-size: var(--text-sm); border-radius: var(--radius-full); padding: var(--space-2xs) var(--space-sm); }

/* Image frames: the frame fixes the box, the image fills it */
.stl-frame { position: relative; overflow: hidden; border-radius: var(--radius-md); background: var(--color-surface-alt); }
.stl-frame img { width: 100%; height: 100%; object-fit: var(--stl-fit, cover); object-position: var(--stl-position, center); }
.stl-frame__empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--text-sm); color: var(--color-text-muted); }

/* Rich text output */
.stl-richtext > * + * { margin-top: var(--space-xs); }
.stl-richtext ul, .stl-richtext ol { padding-left: 1.25em; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); min-height: 72px; }
.site-logo { display: inline-flex; align-items: center; text-decoration: none; color: var(--color-text); }
.site-logo__frame { width: 160px; height: 44px; background: none; border-radius: 0; }
.site-logo__text { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-xl); }
.site-nav { display: flex; align-items: center; gap: var(--space-md); }
.site-nav__list { display: flex; gap: var(--space-md); list-style: none; margin: 0; padding: 0; }
.site-nav__list a { color: var(--color-text); text-decoration: none; font-weight: 500; }
.site-nav__list a:hover, .site-nav__list .current-menu-item > a { color: var(--color-primary); }
.site-nav__list .sub-menu { display: none; position: absolute; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-xs); list-style: none; min-width: 200px; box-shadow: var(--shadow-card); }
.site-nav__list li { position: relative; }
.site-nav__list li:hover > .sub-menu, .site-nav__list li:focus-within > .sub-menu { display: block; }
.site-nav__list .sub-menu a { display: block; padding: var(--space-2xs) var(--space-xs); }
.nav-toggle { display: none; background: none; border: 0; padding: var(--space-xs); cursor: pointer; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after { display: block; width: 24px; height: 2px; background: var(--color-text); position: relative; transition: transform 0.2s; }
.nav-toggle__bar::before, .nav-toggle__bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bar::before { top: -7px; }
.nav-toggle__bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
	.nav-toggle { display: block; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; padding: var(--space-md); background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
	.site-nav.is-open { display: flex; }
	.site-nav__list { flex-direction: column; gap: var(--space-xs); }
	.site-nav__list .sub-menu { display: block; position: static; border: 0; box-shadow: none; padding-left: var(--space-md); }
}

/* Footer */
.site-footer { background: var(--color-secondary); color: var(--color-on-primary); padding-block: var(--space-xl) var(--space-md); margin-top: auto; }
.site-footer a { color: inherit; }
.site-footer .text-small { color: rgba(255, 255, 255, 0.75); }
.site-footer__inner { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.site-footer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2xs); }
.site-footer__legal { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid rgba(255, 255, 255, 0.15); }

/* Home sections (reference example) */
.hero__inner { display: grid; gap: var(--space-xl); align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.hero__image { border-radius: var(--radius-lg); }
.feature__icon { width: 56px; background: none; }
.cta__inner { text-align: center; align-items: center; background: var(--color-surface-alt); border-radius: var(--radius-lg); padding: var(--space-xl) var(--space-md); }

/* Default page and single */
.page-default__body, .single__content { max-width: 72ch; }
.single__content > * + * { margin-top: var(--space-sm); }
.single__content img { border-radius: var(--radius-md); }
.pagination .nav-links { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.pagination .page-numbers { padding: var(--space-2xs) var(--space-sm); border: 1px solid var(--color-border); border-radius: var(--radius-sm); text-decoration: none; }
.pagination .page-numbers.current { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }

/* Page layout: footer stays at the bottom on short pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; }
