/*
Theme Name: Torched
Theme URI: https://torched.io
Author: Torched
Description: One-page theme for torched.io — cannabis advertising, state-market email campaigns. Built from scratch, no page builder. Fluent Forms for the lead form.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: torched
*/

/* ---------------------------------------------------------------
   Tokens
   Palette is sampled from the flame mark: #D42824 (deep) -> #FB581D (hot)
--------------------------------------------------------------- */
:root {
	--ember-deep: #d42824;
	--ember: #e2381f;
	--ember-hot: #fb581d;
	--ember-wash: #fdeee8;

	--char: #211c1a; /* warm charcoal, from the wordmark */
	--soot: #4a423e;
	--smoke: #77706b;
	--ash: #f4f2f0;
	--rule: #ddd8d4;
	--paper: #ffffff;

	--measure: 62ch;
	--shell: 1120px;
	--gutter: 24px;

	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.3125rem;
	--step-2: 1.75rem;
	--step-3: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
	--step-4: clamp(2.5rem, 1.5rem + 4.4vw, 4.75rem);
}

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

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--char);
	font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
	font-size: var(--step-0);
	line-height: 1.6;
	font-synthesis-weight: none;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--ember-deep);
	text-underline-offset: 3px;
}

h1,
h2,
h3 {
	margin: 0;
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.06;
	text-wrap: balance;
}

p {
	margin: 0 0 1.1em;
}

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

.t-shell {
	width: 100%;
	max-width: var(--shell);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.t-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--char);
	color: #fff;
	padding: 12px 18px;
	z-index: 99;
}

.t-skip:focus {
	left: 0;
}

.t-lede {
	max-width: var(--measure);
	color: var(--soot);
	font-size: var(--step-1);
	line-height: 1.5;
}

/* ---------------------------------------------------------------
   Masthead — logo centred, hairline under
--------------------------------------------------------------- */
.t-masthead {
	padding: 34px 0 30px;
	text-align: center;
	border-bottom: 1px solid var(--rule);
}

.t-masthead__logo {
	display: inline-block;
	line-height: 0;
}

.t-masthead__logo img {
	width: 212px;
	max-width: 62vw;
	height: auto;
	margin-inline: auto;
}

.t-masthead__name {
	display: inline-block;
	font-size: var(--step-2);
	font-weight: 800;
	letter-spacing: 0.04em;
	color: var(--char);
	text-decoration: none;
}

/* ---------------------------------------------------------------
   Hero
--------------------------------------------------------------- */
.t-hero {
	padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 5vw, 64px);
	text-align: center;
}

.t-hero__title {
	font-size: var(--step-4);
	font-weight: 800;
	max-width: 16ch;
	margin-inline: auto;
}

.t-hero .t-lede {
	margin: 26px auto 0;
	text-wrap: pretty;
}

.t-hero__actions {
	margin-top: 34px;
	display: flex;
	flex-wrap: wrap;
	gap: 14px 22px;
	align-items: center;
	justify-content: center;
}

.t-btn {
	display: inline-block;
	background: var(--ember);
	background-image: linear-gradient(100deg, var(--ember-deep), var(--ember-hot));
	color: #fff;
	font-weight: 700;
	font-size: var(--step-0);
	letter-spacing: -0.01em;
	text-decoration: none;
	padding: 15px 30px;
	border: 0;
	border-radius: 2px;
	cursor: pointer;
	transition: filter 0.18s ease;
}

.t-btn:hover {
	filter: saturate(1.15) brightness(1.06);
}

.t-hero__aside {
	color: var(--smoke);
	font-size: var(--step--1);
}

/* ---------------------------------------------------------------
   Coverage grid — the state cartogram
--------------------------------------------------------------- */
.t-coverage {
	padding-bottom: clamp(56px, 7vw, 92px);
}

.t-grid {
	display: grid;
	grid-template-columns: repeat(11, minmax(0, 1fr));
	gap: clamp(4px, 0.8vw, 9px);
	max-width: 780px;
	margin: 0 auto;
}

.t-grid__cell {
	grid-column: var(--col);
	grid-row: var(--row);
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 2px;
	font-size: clamp(0.5rem, 1.15vw, 0.8125rem);
	font-weight: 700;
	letter-spacing: 0.01em;
	background: var(--ash);
	color: #b4ada8;
	border: 1px solid transparent;
}

.t-grid__cell--live {
	color: #fff;
	background-image: linear-gradient(135deg, var(--ember-deep), var(--ember-hot));
	background-size: 260% 260%;
	background-position: calc(var(--gx) * 1%) calc(var(--gy) * 1%);
}

.t-grid__legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px 28px;
	margin-top: 30px;
	color: var(--smoke);
	font-size: var(--step--1);
}

.t-grid__legend span {
	display: inline-flex;
	align-items: center;
	gap: 9px;
}

.t-grid__swatch {
	width: 13px;
	height: 13px;
	border-radius: 2px;
	background: var(--ash);
}

.t-grid__swatch--live {
	background-image: linear-gradient(135deg, var(--ember-deep), var(--ember-hot));
}

.t-grid__note {
	max-width: 54ch;
	margin: 18px auto 0;
	text-align: center;
	color: var(--soot);
}

/* one orchestrated moment: the covered states light up once on load */
@media (prefers-reduced-motion: no-preference) {
	.t-grid--ignite .t-grid__cell--live {
		animation: t-ignite 0.5s ease-out both;
		animation-delay: calc(var(--i) * 26ms + 120ms);
	}
}

@keyframes t-ignite {
	from {
		opacity: 0;
		transform: scale(0.86);
		filter: saturate(0.2);
	}
	to {
		opacity: 1;
		transform: none;
		filter: none;
	}
}

/* ---------------------------------------------------------------
   Explainer
--------------------------------------------------------------- */
.t-explain {
	background: var(--ash);
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
	padding: clamp(56px, 7vw, 92px) 0;
}

.t-explain__head {
	max-width: 22ch;
	font-size: var(--step-3);
}

.t-explain__body {
	max-width: var(--measure);
	margin-top: 22px;
	color: var(--soot);
}

.t-spec {
	margin: clamp(38px, 5vw, 58px) 0 0;
	display: grid;
	gap: 0;
	border-top: 1px solid var(--rule);
}

.t-spec__row {
	display: grid;
	grid-template-columns: minmax(190px, 23%) 1fr;
	gap: 8px 40px;
	padding: 22px 0;
	border-bottom: 1px solid var(--rule);
}

.t-spec__term {
	font-weight: 700;
	font-size: var(--step-0);
	margin: 0;
}

.t-spec__def {
	margin: 0;
	color: var(--soot);
	max-width: 58ch;
}

/* ---------------------------------------------------------------
   Contact / form
--------------------------------------------------------------- */
.t-contact {
	padding: clamp(56px, 7vw, 96px) 0 clamp(48px, 6vw, 80px);
}

.t-contact__head {
	text-align: center;
	font-size: var(--step-3);
	max-width: 18ch;
	margin-inline: auto;
}

.t-contact__lede {
	margin: 20px auto 0;
	text-align: center;
	max-width: 50ch;
	color: var(--soot);
}

.t-form {
	max-width: 620px;
	margin: clamp(32px, 4vw, 48px) auto 0;
}

.t-form__missing {
	border: 1px dashed var(--rule);
	background: var(--ash);
	padding: 24px;
	color: var(--soot);
	font-size: var(--step--1);
}

/* Fluent Forms, restyled to match */
.t-form .fluentform .ff-el-group {
	margin-bottom: 20px;
}

.t-form .fluentform .ff-el-input--label label {
	font-weight: 700;
	font-size: var(--step--1);
	color: var(--char);
	margin-bottom: 7px;
}

.t-form .fluentform .ff-el-form-control {
	width: 100%;
	font-family: inherit;
	font-size: var(--step-0);
	color: var(--char);
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: 2px;
	padding: 13px 14px;
	box-shadow: none;
	transition: border-color 0.15s ease;
}

.t-form .fluentform .ff-el-form-control:focus {
	border-color: var(--ember);
	outline: 2px solid var(--ember-wash);
	outline-offset: 0;
}

.t-form .fluentform textarea.ff-el-form-control {
	min-height: 132px;
}

.t-form .fluentform .ff-btn-submit {
	background-image: linear-gradient(100deg, var(--ember-deep), var(--ember-hot));
	background-color: var(--ember);
	color: #fff;
	font-family: inherit;
	font-weight: 700;
	font-size: var(--step-0);
	border: 0;
	border-radius: 2px;
	padding: 15px 32px;
	cursor: pointer;
}

.t-form .fluentform .ff-btn-submit:hover {
	filter: saturate(1.15) brightness(1.06);
}

.t-form .fluentform .ff-el-is-error .ff-el-form-control {
	border-color: var(--ember-deep);
}

.t-form .fluentform .error-text,
.t-form .fluentform .text-danger {
	color: var(--ember-deep);
	font-size: var(--step--1);
}

.t-form .ff-message-success {
	border: 1px solid var(--rule);
	border-left: 4px solid var(--ember);
	background: var(--ash);
	color: var(--char);
	padding: 20px 22px;
}

/* ---------------------------------------------------------------
   Footer
--------------------------------------------------------------- */
.t-footer {
	border-top: 1px solid var(--rule);
	padding: 38px 0 52px;
	text-align: center;
	color: var(--smoke);
	font-size: var(--step--1);
}

.t-footer__mark {
	width: 26px;
	margin: 0 auto 16px;
}

.t-footer__legal {
	max-width: 56ch;
	margin: 0 auto;
}

.t-footer__meta {
	margin: 14px 0 0;
}

/* ---------------------------------------------------------------
   Fallback page template
--------------------------------------------------------------- */
.t-page {
	padding: clamp(48px, 6vw, 80px) 0;
}

.t-page__inner {
	max-width: var(--measure);
	margin-inline: auto;
}

.t-page__title {
	font-size: var(--step-3);
	margin-bottom: 24px;
}

/* ---------------------------------------------------------------
   Small screens
--------------------------------------------------------------- */
@media (max-width: 720px) {
	.t-spec__row {
		grid-template-columns: 1fr;
		gap: 4px;
		padding: 18px 0;
	}

	.t-grid {
		max-width: 460px;
	}
}

@media (max-width: 420px) {
	:root {
		--gutter: 18px;
	}
}
