:root {
	--bg: #f2efe8;
	--ink: #16140f;
	--orange: #d9531e;
	--orange-light: #ff7a3d;
	--muted: #4a463d;
	--muted-2: #6b665b;
	--on-dark-muted: #a39e92;
	--on-dark: #cfc9bc;
	--line: #d6d1c4;
	--line-dark: #3a362d;
	--img: #2a2720;
	--gutter: clamp(20px, 4vw, 56px);
	--section-y: clamp(72px, 10vw, 140px);
	--sans: 'Archivo', sans-serif;
	--mono: 'IBM Plex Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--orange); }
*, *::before, *::after { box-sizing: border-box; }

.skip-link {
	position: absolute;
	left: -9999px;
	top: 8px;
	z-index: 20;
	padding: 10px 16px;
	background: var(--bg);
	color: var(--ink);
	font: 500 15px/1 var(--sans);
}
.skip-link:focus { left: 8px; }

.site { position: relative; min-height: 100vh; }
.wrap { max-width: 1440px; margin: 0 auto; padding: var(--section-y) var(--gutter); }

/* Shared type */
.display {
	margin: 0;
	font: 900 clamp(48px, 7vw, 104px)/.9 var(--sans);
	font-stretch: 72%;
	text-transform: uppercase;
}
.eyebrow {
	font: 500 13px/1 var(--mono);
	letter-spacing: .08em;
	color: var(--orange);
}

/* Header */
.site-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 32px;
	padding: 24px var(--gutter);
	color: var(--bg);
}
/* Logo: orange parts are fixed, the dark "INFRA" parts follow the header text colour. */
.site-logo { display: block; color: inherit; }
.site-logo:hover { color: inherit; }
.logo { display: block; width: auto; height: 30px; }
.site-nav { margin-left: auto; }
.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
	font: 500 15px/1 var(--sans);
}
.site-nav li { white-space: nowrap; }
.site-nav li:last-child a { color: var(--orange-light); }
.site-nav li:last-child a:hover { color: var(--orange); }
.menu-toggle { display: none; }
/* Phones: hamburger menu that opens a panel under the logo.
   Without JS (no .js class) the links stay visible as a wrapped row. */
@media (max-width: 720px) {
	.logo { height: 24px; }
	.site-nav { margin-left: 0; width: 100%; }
	.site-nav ul { gap: 10px 20px; }

	.js .menu-toggle {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: 6px;
		width: 44px;
		height: 44px;
		margin: -10px -10px -10px auto;
		padding: 10px;
		background: none;
		border: 0;
		color: inherit;
		cursor: pointer;
	}
	.menu-toggle span { display: block; height: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
	.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
	.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
	.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

	.js .site-nav { display: none; }
	.js .site-header.is-open { background: var(--ink); }
	.js .site-header.is-open .site-nav { display: block; }
	.js .site-nav ul { flex-direction: column; gap: 0; font-size: 22px; }
	.js .site-nav a { display: block; padding: 14px 0; border-top: 1px solid var(--line-dark); }
}

/* Hero */
.hero {
	position: relative;
	min-height: 520px;
	display: flex;
	align-items: flex-end;
	height: 100vh;
	/* Portrait photo: 76% keeps the excavator above the headline on wide screens. */
	background: var(--img) url('images/hero-kaivinkone.jpg') center 76%/cover no-repeat;
}
/* Tall screens (phones, portrait tablets) would show the whole photo; zoom in on the excavator. */
@media (max-aspect-ratio: 4/5) {
	.hero { background-size: auto 170%; background-position: 48% 79%; }
}
.hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(14,12,9,.55) 0%, rgba(14,12,9,.1) 35%, rgba(14,12,9,.7) 100%);
}
.hero h1 {
	position: relative;
	margin: 0;
	padding: 0 var(--gutter) clamp(32px, 6vw, 72px);
	font: 900 clamp(64px, 13vw, 220px)/.86 var(--sans);
	font-stretch: 72%;
	letter-spacing: -.01em;
	color: var(--bg);
	text-transform: uppercase;
}
/* Phones: as wide as the screen allows ("TAIDOLLA" ≈ 4.3 × font size) and lifted off the bottom. */
@media (max-width: 720px) {
	.hero h1 { font-size: 20vw; padding-bottom: 16vh; }
}

/* Palvelut */
.services__lead {
	margin: 0 0 clamp(56px, 8vw, 100px);
	max-width: 880px;
	font: 500 clamp(24px, 2.6vw, 36px)/1.25 var(--sans);
	text-wrap: pretty;
}
.services__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
	gap: clamp(32px, 4vw, 56px);
}
.service__img { aspect-ratio: 4/3; background: var(--img) center/cover no-repeat; }
.service__img--pohja { background-image: url('images/pohjarakentaminen-tyomaa.jpg'); background-position: center 85%; }
.service__img--alue { background-image: url('images/aluerakentaminen-kanavankoulu.jpg'); }
.service__head {
	display: flex;
	align-items: baseline;
	gap: 16px;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 2px solid var(--ink);
}
.service__num { font: 500 13px/1 var(--mono); color: var(--orange); }
.service__head h2 {
	margin: 0;
	font: 800 clamp(34px, 3.4vw, 48px)/1 var(--sans);
	font-stretch: 80%;
	text-transform: uppercase;
}
.service p {
	margin: 16px 0 0;
	max-width: 520px;
	font-size: 17px;
	line-height: 1.55;
	color: var(--muted);
	text-wrap: pretty;
}

/* Referenssit */
.refs { background: var(--ink); color: var(--bg); }
.refs__top {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 40px;
}
.refs__note { font: 400 13px/1.4 var(--mono); color: var(--on-dark-muted); }
.refs__head,
.refs__row {
	display: grid;
	grid-template-columns: minmax(0, 2.2fr) 110px minmax(0, 2.4fr);
	gap: 24px;
}
.refs__head {
	padding: 0 0 12px;
	border-bottom: 1px solid var(--bg);
	font: 500 12px/1 var(--mono);
	letter-spacing: .08em;
	color: var(--on-dark-muted);
}
.refs__row {
	padding: 20px 0;
	border-bottom: 1px solid var(--line-dark);
	align-items: baseline;
}
.refs__name { font: 700 19px/1.25 var(--sans); }
.refs__year { font: 400 14px/1.4 var(--mono); color: var(--on-dark); }
.refs__scope { font-size: 15px; line-height: 1.45; color: var(--on-dark); text-wrap: pretty; }
.refs.is-collapsed .refs__row.is-extra { display: none; }
.refs__toggle {
	margin-top: 32px;
	padding: 14px 22px;
	background: transparent;
	color: var(--bg);
	border: 1px solid var(--bg);
	font: 500 15px/1 var(--sans);
	cursor: pointer;
}
.refs__toggle:hover { background: var(--bg); color: var(--ink); }
.refs__toggle[hidden] { display: none; }

/* Yritys */
.company__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
	gap: clamp(40px, 6vw, 96px);
	align-items: center;
}
.company .display { margin-top: 16px; }
.company__text {
	margin: 28px 0 0;
	max-width: 520px;
	font-size: 18px;
	line-height: 1.55;
	color: var(--muted);
	text-wrap: pretty;
}
.company__facts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin-top: 40px;
	max-width: 520px;
}
.fact { padding-top: 14px; border-top: 2px solid var(--ink); }
.fact__value { font: 800 28px/1 var(--sans); font-stretch: 85%; }
.fact__label { margin-top: 6px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.certs {
	display: grid;
	/* minmax(0, …): don't let the logos' natural width (640–800 px) stretch the tiles past the screen. */
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(12px, 1.5vw, 20px);
	margin: 0;
	padding: 0;
	list-style: none;
}
.cert {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	aspect-ratio: 1;
	padding: 14%;
	background: #fff;
}
.cert img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Ajankohtaista */
.news { border-top: 1px solid var(--line); }
.news .wrap { padding-top: clamp(72px, 10vw, 120px); padding-bottom: clamp(72px, 10vw, 120px); }
.news__title {
	margin: 0 0 40px;
	font: 900 clamp(40px, 5vw, 72px)/.9 var(--sans);
	font-stretch: 72%;
	text-transform: uppercase;
}
.news__row {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr);
	gap: 24px;
	padding: 22px 0;
	border-top: 1px solid var(--ink);
	align-items: baseline;
}
.news__date { font: 400 14px/1.4 var(--mono); color: var(--muted-2); }
.news__heading { margin: 0; font: 700 clamp(20px, 2vw, 26px)/1.2 var(--sans); }
.news__row p {
	margin: 8px 0 0;
	max-width: 720px;
	font-size: 16px;
	line-height: 1.5;
	color: var(--muted);
	text-wrap: pretty;
}

/* Yhteystiedot */
.contact { background: #e8622a; color: var(--ink); }
.contact__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	gap: 40px;
	margin-top: clamp(40px, 6vw, 72px);
}
.person { padding-top: 16px; border-top: 2px solid var(--ink); }
.person__name { font: 800 26px/1.1 var(--sans); }
.person__role { margin-top: 4px; font-size: 15px; }
.person__links { margin-top: 16px; font: 500 15px/1.6 var(--mono); }

/* Footer */
.site-footer { background: var(--ink); color: var(--on-dark); }
.site-footer__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	gap: 32px;
	max-width: 1440px;
	margin: 0 auto;
	padding: 56px var(--gutter);
	font-size: 14px;
	line-height: 1.6;
}
.site-footer__logo { color: var(--bg); }
.site-footer__logo .logo { height: 26px; }
.site-footer__company { margin-top: 10px; }
.site-footer__label { color: var(--bg); }
.site-footer__links { display: flex; flex-direction: column; }

/* 404 */
.notfound { max-width: 1440px; margin: 0 auto; padding: clamp(160px, 18vw, 240px) var(--gutter) var(--section-y); }
.notfound p { margin: 28px 0 0; max-width: 520px; font-size: 18px; line-height: 1.55; color: var(--muted); }
.notfound__back { display: inline-block; margin-top: 40px; font: 500 15px/1 var(--mono); }

/* Narrow screens: the four-column reference table and the date column don't fit a phone. */
@media (max-width: 720px) {
	.refs__head { display: none; }
	.refs__row {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: 'name year' 'scope scope';
		gap: 6px 16px;
	}
	.refs__name { grid-area: name; }
	.refs__year { grid-area: year; }
	.refs__scope { grid-area: scope; }
}
@media (max-width: 560px) {
	.news__row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
