/**
 * Boman Tractor — presentation layer.
 *
 * theme.json owns the design tokens (color, type scale, spacing). This file
 * owns the two structural devices the design is built on:
 *
 *   1. .grade-line   A surveyor's datum rule. Its station marks carry the
 *                    reasons to call, so the device is informational rather
 *                    than decorative.
 *   2. .is-style-cut A soil-horizon cut at the top edge of a section, so
 *                    moving down the page reads as moving down through ground.
 *
 * Everything else here is restraint: quiet cards, honest focus rings, and a
 * call bar that stays reachable with a thumb.
 */

/* -------------------------------------------------------------------------
 * 1. Foundations
 * ---------------------------------------------------------------------- */

:root {
	--gl-color: var(--wp--preset--color--clay);
	--rule-hairline: 1px solid rgba(35, 32, 27, 0.18);
	--rule-inverse: 1px solid rgba(223, 219, 208, 0.22);
	--ease: 180ms cubic-bezier(0.2, 0, 0.2, 1);
}

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Keep the footer down even on thin pages. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* Every interactive element gets a visible, high-contrast focus ring. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--clay-deep);
	outline-offset: 3px;
	border-radius: 1px;
}

.is-dark :where(a, button, input, textarea, select, summary):focus-visible {
	outline-color: var(--wp--preset--color--hi-vis);
}

/* Skip link. */
.skip-link:focus {
	background: var(--wp--preset--color--hi-vis);
	color: var(--wp--preset--color--soil);
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 0.75rem 1.25rem;
	z-index: 999;
}

/* -------------------------------------------------------------------------
 * 2. Signature: the grade line
 *
 * A datum rule with minor ticks every 6.25% and major ticks every 25%,
 * carrying stationed facts. This is the one place the design spends boldness.
 * ---------------------------------------------------------------------- */

/* The rule, its ticks, and the stations are one flex container, so every
   station is an ordinary editable paragraph rather than raw HTML. */
.grade-line {
	position: relative;
	width: 100%;
	border-top: 1.5px solid var(--gl-color);
	padding-top: 1.35rem;
}

/* Minor ticks — short, dense. */
.grade-line::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: 0.35rem;
	background-image: linear-gradient(to right, var(--gl-color) 0 1px, transparent 1px);
	background-size: 6.25% 100%;
	pointer-events: none;
}

/* Major ticks — taller, quartered. */
.grade-line::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: 0.8rem;
	background-image: linear-gradient(to right, var(--gl-color) 0 1.5px, transparent 1.5px);
	background-size: 25% 100%;
	pointer-events: none;
}

.grade-line__station {
	position: relative;
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--mono) !important;
	font-size: 0.8125rem !important;
	font-weight: 400;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: var(--wp--preset--color--subsoil);
	line-height: 1.35;
}

/* Each station carries its own tick up to the datum, so the marks line up
   with the facts rather than falling wherever the grid happens to land. */
.grade-line__station::before {
	content: "";
	position: absolute;
	top: -1.35rem;
	left: 0;
	width: 1.5px;
	height: 0.8rem;
	background: var(--gl-color);
}

.grade-line__station strong {
	display: block;
	font-weight: 500;
	font-size: 1.05rem;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--soil);
}

/* Inverse treatment on dark bands. */
.is-dark .grade-line,
.grade-line.is-inverse {
	--gl-color: var(--wp--preset--color--hi-vis);
}

.is-dark .grade-line__station {
	color: rgba(223, 219, 208, 0.72);
}

.is-dark .grade-line__station strong {
	color: var(--wp--preset--color--bone-pale);
}

/* Narrow screens wrap the stations onto two rows. Each tick is drawn above its
   own station, so on a second row it lands in the middle of the row above.
   A fixed two-column grid makes the rows deterministic, and only the row that
   actually meets the datum keeps its tick. Selector carries two classes so it
   outranks the block layout's generated display:flex. */
@media (max-width: 781px) {
	.wp-block-group.grade-line {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 1.4rem 1rem;
	}

	.grade-line__station:nth-child(n + 3)::before {
		content: none;
	}
}

/* -------------------------------------------------------------------------
 * 3. Signature: soil-horizon cut
 *
 * A machine cut is straight, so this edge is straight. The stratification is
 * what carries the meaning, not a decorative wave.
 * ---------------------------------------------------------------------- */

.is-style-cut {
	position: relative;
}

.is-style-cut::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: 9px;
	background: linear-gradient(
		to bottom,
		var(--wp--preset--color--clay) 0 2px,
		var(--wp--preset--color--clay-deep) 2px 4px,
		var(--wp--preset--color--subsoil) 4px 9px
	);
	pointer-events: none;
	z-index: 1;
}

/* -------------------------------------------------------------------------
 * 4. Header
 * ---------------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 60;
	background: var(--wp--preset--color--bone);
	border-bottom: var(--rule-hairline);
	backdrop-filter: saturate(1.1);
}

.header-call .wp-block-button__link {
	white-space: nowrap;
}

/* The phone number is the conversion. On a phone-sized screen the header has
   no room for it, so it moves to the fixed call bar instead.
   Scoped to .site-header to outrank core's .wp-block-buttons { display: flex }. */
@media (max-width: 781px) {
	.site-header .header-call {
		display: none;
	}
}

/* -------------------------------------------------------------------------
 * 5. Mobile call bar
 * ---------------------------------------------------------------------- */

.call-bar {
	display: none;
}

@media (max-width: 781px) {
	.call-bar {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 80;
		display: block;
		padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
		background: var(--wp--preset--color--soil);
		border-top: 2px solid var(--wp--preset--color--clay);
	}

	.call-bar__link {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 0.6rem;
		width: 100%;
		min-height: 3.25rem;
		background: var(--wp--preset--color--hi-vis);
		color: var(--wp--preset--color--soil) !important;
		font-family: var(--wp--preset--font-family--display);
		font-size: 1.375rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.045em;
		text-decoration: none !important;
		border-radius: 2px;
	}

	/* Keep the fixed bar from covering the end of the page. */
	.wp-site-blocks > footer {
		padding-bottom: 5rem;
	}
}

/* -------------------------------------------------------------------------
 * 6. Content devices
 * ---------------------------------------------------------------------- */

/* Mono eyebrow label above section headings. */
.eyebrow {
	font-family: var(--wp--preset--font-family--mono) !important;
	font-size: 0.8125rem !important;
	font-weight: 500;
	letter-spacing: 0.15em !important;
	text-transform: uppercase;
	color: var(--wp--preset--color--clay-deep);
	margin-bottom: 0.75rem !important;
}

.is-dark .eyebrow {
	color: var(--wp--preset--color--hi-vis);
}

/* Constrain running prose to a comfortable measure even in wide containers.
   margin-inline-start is pinned so WordPress's constrained-layout auto margins
   cannot centre the paragraph away from the heading it belongs to. */
.measure {
	max-width: 34rem;
	margin-inline-start: 0;
}

/* The hero lead sits directly under a very large headline, so it carries a
   longer line than body prose without looking like a stray column. */
.hero-lead {
	max-width: 42rem;
	margin-inline-start: 0;
}

/* Service cards. Quiet by default; the whole card is the target. */
.service-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--wp--preset--color--bone-pale);
	border: var(--rule-hairline);
	border-top: 3px solid var(--wp--preset--color--clay);
	transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

/* WordPress's constrained layout puts `margin-inline: auto` on every child.
   Inside a flex column that shrink-wraps short headings and centres them, so
   the inline margins are reset and only the block axis is left to the layout. */
.service-card > * {
	margin-inline: 0;
	width: 100%;
}

/* The implement line sits at the foot of every card regardless of how much
   description sits above it. */
.service-card .implement {
	margin-top: auto !important;
}

.implement {
	padding-top: 0.9rem;
	border-top: var(--rule-hairline);
	font-family: var(--wp--preset--font-family--mono) !important;
	font-size: 0.75rem !important;
	font-weight: 500;
	letter-spacing: 0.12em !important;
	text-transform: uppercase;
	color: var(--wp--preset--color--clay-deep);
	margin-bottom: 0 !important;
}

.is-dark .implement {
	color: var(--wp--preset--color--hi-vis);
	border-top-color: rgba(223, 219, 208, 0.22);
}

.service-card:hover,
.service-card:focus-within {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px -14px rgba(35, 32, 27, 0.4);
}

.service-card .wp-block-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}

/* Make the card heading link cover the card without nesting anchors. */
.service-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.is-dark .service-card {
	background: rgba(223, 219, 208, 0.05);
	border-color: rgba(223, 219, 208, 0.18);
}

/* FAQ. Rules rather than boxes, so the list reads as a spec sheet.
   Held to a readable width and pinned left, under its own heading. */
.faq-list {
	max-width: 46rem;
	margin-inline-start: 0;
}

.faq-list .wp-block-details {
	border-top: var(--rule-hairline);
	padding-block: 1.15rem;
}

.faq-list .wp-block-details:last-child {
	border-bottom: var(--rule-hairline);
}

.faq-list summary {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1.25rem;
	cursor: pointer;
	list-style: none;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.3rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	line-height: 1.15;
}

.faq-list summary::-webkit-details-marker {
	display: none;
}

.faq-list summary::after {
	content: "+";
	flex: none;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 1.15rem;
	color: var(--wp--preset--color--clay-deep);
	transition: transform var(--ease);
}

.faq-list details[open] summary::after {
	content: "–";
}

.faq-list .wp-block-details > *:not(summary) {
	max-width: 34rem;
	margin-top: 0.9rem;
}

/* Numbered figure used for stats — mono keeps it reading as measurement. */
.stat__figure {
	font-family: var(--wp--preset--font-family--display) !important;
	font-size: clamp(2.5rem, 5vw, 3.75rem) !important;
	font-weight: 700;
	line-height: 0.9 !important;
	color: var(--wp--preset--color--clay);
	margin-bottom: 0.35rem !important;
}

.stat__label {
	font-family: var(--wp--preset--font-family--mono) !important;
	font-size: 0.8125rem !important;
	letter-spacing: 0.1em !important;
	text-transform: uppercase;
	color: var(--wp--preset--color--subsoil);
}

.is-dark .stat__label {
	color: rgba(223, 219, 208, 0.7);
}

/* Field-note image frame — a photo pinned to a clipboard, lightly. */
.is-style-field-note img {
	border: 1px solid rgba(35, 32, 27, 0.2);
	box-shadow: 0 12px 28px -16px rgba(35, 32, 27, 0.45);
}

/* Before / after pair. */
.proof-pair {
	position: relative;
}

.proof-pair figcaption,
.proof-pair .wp-element-caption {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.proof-tag {
	display: inline-block;
	padding: 0.3rem 0.6rem;
	background: var(--wp--preset--color--soil);
	color: var(--wp--preset--color--bone-pale);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.proof-tag--after {
	background: var(--wp--preset--color--hi-vis);
	color: var(--wp--preset--color--soil);
}

/* Section head: label and title on a left rail, prose on the right. Gives the
   wide band something to hold on both sides instead of a column of dead space. */
.section-head {
	align-items: start;
}

.section-head .eyebrow {
	margin-top: 0.4rem !important;
}

/* The call band is the one place the page centres. Coming after a run of
   left-aligned sections, the shift in rhythm is itself the emphasis. */
.cta-band {
	text-align: center;
}

.cta-band .measure {
	margin-inline: auto;
}

.cta-band .wp-block-buttons {
	justify-content: center;
}

/* The datum keeps its stationing regardless of the band's alignment. */
.cta-band .grade-line {
	text-align: left;
}

/* -------------------------------------------------------------------------
 * 7. Dark bands
 * ---------------------------------------------------------------------- */

.is-dark,
.is-dark p,
.is-dark li {
	color: var(--wp--preset--color--bone);
}

.is-dark :is(h1, h2, h3, h4) {
	color: var(--wp--preset--color--bone-pale);
}

.is-dark a:not(.wp-element-button) {
	color: var(--wp--preset--color--hi-vis);
}

.is-dark hr,
.is-dark .wp-block-separator {
	border-color: rgba(223, 219, 208, 0.22);
	color: rgba(223, 219, 208, 0.22);
}

/* -------------------------------------------------------------------------
 * 8. Forms
 * ---------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
	width: 100%;
	padding: 0.85rem 1rem;
	background: var(--wp--preset--color--white);
	border: 1px solid rgba(35, 32, 27, 0.3);
	border-radius: 2px;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.0625rem;
	color: var(--wp--preset--color--soil);
}

input:focus,
textarea:focus,
select:focus {
	border-color: var(--wp--preset--color--clay-deep);
}

label {
	display: block;
	margin-bottom: 0.4rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--subsoil);
}

/* -------------------------------------------------------------------------
 * 9. Motion
 *
 * The page carries its weight statically: the grade line, the soil cuts, and
 * the section drawing are the interest. Scroll-triggered reveals were tried and
 * cut — they added nothing here and risk hiding content where scroll-driven
 * animation is unsupported. What remains is hover feedback and honest focus.
 * ---------------------------------------------------------------------- */

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

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}

/* -------------------------------------------------------------------------
 * 10. Print
 * ---------------------------------------------------------------------- */

@media print {
	.site-header,
	.call-bar {
		position: static;
	}

	.call-bar {
		display: none;
	}
}
