/*
Theme Name:   CivilWorks
Theme URI:    https://phiregroup.com
Author:       Phire Group
Author URI:   https://phiregroup.com
Description:  Hardcoded single-page landing theme for CivilWorks.
Version:      1.0.0
Requires PHP: 7.4
Text Domain:  civilworks
*/

/* =========================================================
   Fonts — Halis Grotesque (Fontspring webfont license)
   One family, three weights.
   ========================================================= */
@font-face {
	font-family: "Halis";
	src: url("assets/fonts/halis-light.woff2") format("woff2"),
	     url("assets/fonts/halis-light.woff") format("woff");
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Halis";
	src: url("assets/fonts/halis-book.woff2") format("woff2"),
	     url("assets/fonts/halis-book.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Halis";
	src: url("assets/fonts/halis-medium.woff2") format("woff2"),
	     url("assets/fonts/halis-medium.woff") format("woff");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

/* =========================================================
   Tokens
   ========================================================= */
:root {
	/* Color */
	--black:  #000;
	--paper:  #F8F6EF;
	--white:  #fff;
	--green:  #8BC53F;
	--orange: #F58A1F;
	--teal:   #54A6B4;
	--yellow: #FFD430;
	--brick:  #B84626;

	/* Type */
	--font: "Halis", system-ui, -apple-system, "Segoe UI", sans-serif;
	--fw-light:  300;
	--fw-book:   400;
	--fw-medium: 500;

	--fs-display: clamp(2.375rem, 2rem + 1.4vw, 3.125rem); /* hero */
	--fs-h2:      clamp(2.125rem, 1.9rem + .9vw, 2.5rem);  /* section titles */
	--fs-h3:      1.375rem;                                /* sub heads / card titles */
	--fs-body:    1.0625rem;
	--fs-small:   .875rem;

	/* Layout */
	--container: 1170px;
	--wide: 1440px;        /* masthead logo + nav cap */
	--gutter: clamp(1.25rem, 3vw, 1.875rem);
	--section-y: clamp(3.5rem, 8.5vw, 7.5rem);
	--radius-pill: 999px;
	--ease: cubic-bezier(.4, 0, .2, 1);
}

/* =========================================================
   Reset / base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	font-family: var(--font);
	font-weight: var(--fw-book);
	font-size: var(--fs-body);
	line-height: 1.45;
	color: var(--black);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.1; font-weight: var(--fw-light); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-medium); line-height: 1.25; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
[id] { scroll-margin-top: 1.5rem; }

/* =========================================================
   Utilities
   ========================================================= */
.container {
	width: 100%;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }

.eyebrow {
	margin: 0 0 1rem;
	font-size: 1rem;
	font-weight: var(--fw-medium);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 1rem; left: 1rem; z-index: 999;
	width: auto; height: auto;
	clip: auto; clip-path: none;
	padding: .75rem 1rem;
	background: var(--white);
	color: var(--black);
}

:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* =========================================================
   Components
   ========================================================= */

/* --- Outline pill (Jump to links) --- */
.btn-pill {
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	padding: .3rem .9rem;
	border: 1.5px solid currentColor;
	border-radius: var(--radius-pill);
	font-size: var(--fs-small);
	font-weight: var(--fw-medium);
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .2s var(--ease), color .2s var(--ease);
}
.btn-pill:hover { background: var(--white); color: var(--black); }

/* --- Solid green button --- */
.btn,
.signup .gform_footer .gform_button,
.signup .gform_footer button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	padding: .5rem 1.25rem;
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--green);
	color: var(--black);
	font: var(--fw-medium) var(--fs-small)/1 var(--font);
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s var(--ease);
}
.btn:hover,
.signup .gform_footer .gform_button:hover,
.signup .gform_footer button:hover {
	background: color(from var(--green) srgb calc(r * .88) calc(g * .88) calc(b * .88));
}

/* --- Hex icon --- */
.hex { width: 30px; height: 35px; }
.hex--teal   { color: var(--teal); }
.hex--orange { color: var(--orange); }
.hex--yellow { color: var(--yellow); }
.hex--brick  { color: var(--brick); }

/* --- Signup form (Gravity Forms, GF CSS disabled) ---
   GF markup: .gform_wrapper > form > (.gform_validation_errors) .gform_body .gform_footer */
.signup { --field-fg: var(--black); --field-border: var(--black); max-width: 36rem; }
.signup--dark { --field-fg: var(--white); --field-border: var(--white); }

.signup form {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .875rem;
}
.signup .gform_body { width: 100%; }
.signup .gform_fields { display: grid; gap: .5rem; }
.signup .gfield { margin: 0; padding: 0; border: 0; min-width: 0; }
.signup .gfield_label,
.signup .gform_required_legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.signup input[type="email"],
.signup input[type="text"] {
	width: 100%;
	min-height: 3rem;
	padding: .5rem 1.25rem;
	border: 1.5px solid var(--field-border);
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--field-fg);
	font: var(--fw-medium) var(--fs-small)/1.2 var(--font);
	-webkit-appearance: none;
	appearance: none;
}
.signup input::placeholder { color: var(--field-fg); opacity: 1; }
.signup input:focus { outline: 2px solid var(--green); outline-offset: 2px; }

.signup .gform_footer { margin: 0; padding: 0; }

/* Things GF's own CSS normally hides */
.signup .gform_validation_container,
.signup .gform_hidden,
.signup .gfield--type-honeypot,
.signup .gform_ajax_spinner,
.signup .gform-loader { display: none !important; }

/* Messages */
.signup .validation_message,
.signup .gform_validation_errors { font-size: var(--fs-small); color: var(--brick); }
.signup--dark .validation_message,
.signup--dark .gform_validation_errors { color: var(--orange); }
.signup .gform_validation_errors { width: 100%; }
.signup .gform_validation_errors h2 { font: inherit; margin: 0; }
.signup .gfield_error input { border-color: var(--brick); }
.signup .gform_confirmation_message { font-weight: var(--fw-medium); }

@media (min-width: 600px) {
	.signup form { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: .375rem; }
	.signup .gform_validation_errors { flex-basis: 100%; order: -1; }
	.signup .gform_body { flex: 1 1 0; width: auto; }
	.signup .gform_footer { flex: none; }
}

/* =========================================================
   Masthead / Hero
   Mobile: logo / headline / jump nav stacked
   Desktop: logo + nav on top row, headline below on the container
   ========================================================= */
.masthead {
	display: grid;
	grid-template-areas:
		"logo"
		"title"
		"nav";
	grid-template-rows: auto 1fr auto;
	min-height: 31.5rem;
	padding: 1.25rem var(--gutter) 1.5rem;
	color: var(--white);
	background-color: var(--black);
	background-image: url("assets/img/hex-pattern.svg");
	background-repeat: no-repeat;
	background-position: right top;
	background-size: auto 100%;
}

.masthead__logo { grid-area: logo; justify-self: start; }
.masthead__logo img { width: min(223px, 60vw); }

.masthead__title { grid-area: title; padding-block: 3.5rem 2.5rem; }
.masthead__title h1 {
	max-width: 8em;
	margin: 0;
	font-size: var(--fs-display);
	line-height: 1.05;
}

.jump-nav {
	grid-area: nav;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .375rem;
}
.jump-nav__label {
	margin-right: .5rem;
	font-size: .8125rem;
	font-weight: var(--fw-medium);
}

@media (min-width: 900px) {
	.masthead {
		grid-template-areas:
			"logo  nav"
			"title title";
		grid-template-columns: 1fr auto;
		grid-template-rows: auto 1fr;
		min-height: 31.25rem;
		/* bg stays full-bleed; logo + nav stop at the 1440px mark */
		padding: 1.875rem max(var(--gutter), calc((100% - var(--wide)) / 2 + var(--gutter))) 0;
		background-size: 924px auto;
	}
	.masthead__title {
		align-self: center;
		width: 100%;
		max-width: var(--container);
		margin-inline: auto;
		padding-block: 2rem 5rem;
	}
	.masthead__title h1 { max-width: 9em; }
	.jump-nav { align-self: start; }
}

/* =========================================================
   Intro — "There has to be a better way."
   Mobile: stacked, arrow flipped on the right above the field
   Desktop: title left (~1/3), body right, arrow hangs left of the form
   ========================================================= */
.intro__title {
	margin-bottom: 1.5rem;
	font-size: var(--fs-h2);
}
.intro__body { line-height: 1.35; }
.intro__body > p { margin-bottom: 0; }
.intro__body h3 { margin: 1.75rem 0 .625rem; }

.intro__signup { position: relative; margin-top: 1.25rem; }
.intro__cta { margin: 0 0 1.5rem; padding-right: 3.5rem; }

.intro__arrow {
	position: absolute;
	top: .25rem;
	right: .25rem;
	width: 38px;
	transform: scaleX(-1);
	pointer-events: none;
}

@media (min-width: 900px) {
	.intro__grid {
		display: grid;
		grid-template-columns: 3fr 5fr;
		gap: 2rem;
		align-items: start;
	}
	.intro__title { max-width: 9em; margin: 0; }

	.intro__cta { margin-bottom: 1.25rem; padding-right: 0; }
	.intro__arrow {
		top: .5rem;
		right: auto;
		left: -3.25rem;
		width: 43px;
		transform: none;
	}
}

/* =========================================================
   Sections — built in later passes
   ========================================================= */
.expect h2,
.team h2 { font-size: var(--fs-h2); }