/*
 * BASE - the design rules used on every page.
 *
 * EASY WORDING: fonts, text sizes and small building blocks
 * (buttons, links, containers). Everything else builds on top of this.
 *
 * All colours, sizes and speeds live in tokens.css (the recipe book).
 * This file only uses them - it never invents its own values.
 */

/* ------------------------------------------------------------------
 * 1. Reset (small and calm - only what we actually need)
 * --------------------------------------------------------------- */

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

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

body {
	margin: 0;
	font-family: var(--aitio-font);
	font-size: var(--aitio-body-m);
	line-height: 1.5;
	color: var(--aitio-ink);
	background: var(--aitio-page);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a {
	color: inherit;
	text-decoration: none;
}

/* Headings follow the plan v2 type scale (see tokens.css).
 * Headings carry a small 3% letter spacing; body text has none. */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em;
	letter-spacing: 0.03em;
	text-wrap: balance;
}

/* H1 - the big uppercase titles (Alte Haas Grotesk Bold) */
h1 {
	font-family: var(--aitio-font-display);
	font-size: var(--aitio-h1);
	font-weight: 700;
	line-height: 1.1;
	text-transform: uppercase;
}

h2 {
	font-size: var(--aitio-h2);
	font-weight: 500;
	line-height: 1.2;
}

h3 {
	font-size: var(--aitio-h3);
	font-weight: 500;
	line-height: 1.3;
}

h4 {
	font-size: var(--aitio-h4);
	font-weight: 400;
	line-height: 1.3;
}

h5 {
	font-size: var(--aitio-h5);
	font-weight: 500;
	line-height: 1.4;
}

h6 {
	font-size: var(--aitio-h6);
	font-weight: 400;
	line-height: 1.4;
}

p {
	margin: 0 0 1em;
}

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

button {
	font: inherit;
}

/* keyboard focus is always visible (accessibility) */
:focus-visible {
	outline: 2px solid var(--aitio-ink);
	outline-offset: 3px;
}

/* ------------------------------------------------------------------
 * 2. Helpers
 * --------------------------------------------------------------- */

.aitio-container {
	width: 100%;
	max-width: var(--aitio-container);
	margin: 0 auto;
	padding-left: var(--aitio-gutter);
	padding-right: var(--aitio-gutter);
	box-sizing: border-box;
}

@media (min-width: 1441px) {
	.aitio-container {
		position: relative;
		left: calc((100vw - 100%) / 2);
	}
}

/* vertical space around a section */
.aitio-pad {
	padding-top: clamp(56px, 8vw, 110px);
	padding-bottom: clamp(56px, 8vw, 110px);
}

.aitio-overline {
	margin: 0 0 12px;
	font-size: var(--aitio-overline);
	font-weight: 800;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--aitio-ink-faint);
}

.aitio-copy p:last-child {
	margin-bottom: 0;
}

.aitio-screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	word-wrap: normal !important;
}

.aitio-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--aitio-ink);
	color: var(--aitio-white);
	padding: 10px 18px;
	z-index: 1000;
	border-radius: 0 0 10px 0;
}

.aitio-skip-link:focus {
	left: 0;
}

/* ------------------------------------------------------------------
 * 3. Buttons and links
 *
 * The old .aitio-button is kept as-is so nothing on the site breaks.
 * New buttons use the marquee pill .aitio-btn - see components.css.
 * --------------------------------------------------------------- */

.aitio-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--aitio-ink);
	color: var(--aitio-white);
	border: 0;
	border-radius: 999px;
	padding: 15px 30px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: transform 0.2s var(--aitio-ease), background 0.2s ease, color 0.2s ease;
}

.aitio-button:hover {
	transform: translateY(-2px);
	background: var(--aitio-yellow);
	color: var(--aitio-black);
}

.aitio-button--light {
	background: var(--aitio-white);
	color: var(--aitio-ink);
}

.aitio-button--light:hover {
	background: var(--aitio-yellow);
}

.aitio-button--small {
	padding: 10px 20px;
	font-size: 14px;
}

.aitio-button--ghost {
	background: transparent;
	border: 1px solid var(--aitio-line);
	color: var(--aitio-ink);
}

.aitio-button--ghost:hover {
	background: var(--aitio-ink);
	border-color: var(--aitio-ink);
	color: var(--aitio-white);
}

.aitio-text-link {
	font-weight: 600;
	border-bottom: 2px solid var(--aitio-yellow);
	padding-bottom: 2px;
	transition: border-color 0.15s ease;
}

.aitio-text-link:hover {
	border-color: var(--aitio-ink);
}

/* small round labels (industry / expertise on a case study) */
.aitio-pill {
	display: inline-flex;
	align-items: center;
	background: var(--aitio-cream);
	border: 1px solid var(--aitio-line);
	color: var(--aitio-ink-soft);
	border-radius: 999px;
	padding: 7px 16px;
	font-size: 13.5px;
	font-weight: 600;
	transition: background 0.15s ease, color 0.15s ease;
}

.aitio-pill:hover {
	background: var(--aitio-ink);
	color: var(--aitio-white);
}

/* a heading row: title on the left, link on the right */
.aitio-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: clamp(28px, 4vw, 48px);
	flex-wrap: wrap;
}

.aitio-section-head h2 {
	margin: 0;
}

/* friendly empty message */
.aitio-empty-note {
	background: var(--aitio-cream);
	border: 1px dashed var(--aitio-line);
	border-radius: var(--aitio-radius);
	padding: 40px;
	text-align: center;
	color: var(--aitio-ink-faint);
}

/* ------------------------------------------------------------------
 * 4. Forms (used by the contact form + the work filters)
 * --------------------------------------------------------------- */

.aitio-input {
	width: 100%;
	border: 1px solid var(--aitio-line);
	border-radius: var(--aitio-radius-sm);
	background: var(--aitio-paper);
	color: var(--aitio-ink);
	padding: 13px 16px;
	font: inherit;
	font-size: var(--aitio-body-s);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aitio-input:focus {
	outline: none;
	border-color: var(--aitio-ink);
	box-shadow: 0 0 0 3px var(--aitio-yellow-soft);
}

textarea.aitio-input {
	resize: vertical;
}

/* ------------------------------------------------------------------
 * 5. Grids used by many sections
 * --------------------------------------------------------------- */

.aitio-grid {
	display: grid;
	gap: clamp(18px, 2.5vw, 30px);
}

.aitio-grid--cards {
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.aitio-grid--hubs {
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.aitio-grid--team {
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

@media (max-width: 860px) {
	.aitio-input {
		font-size: 16px;
	}
}

picture.aitio-picture {
	display: contents;
}
