/*
Theme Name: h-ai
Theme URI: https://h-ai.au
Author: h-ai
Author URI: https://h-ai.au
Description: h-ai, AI lower-funnel marketing. A Twenty Twenty-Five child theme with a human and machine view, machine-readable notes, schema, an automatic llms.txt and a one-click page rebuild tool (Tools > h-ai pages).
Template: twentytwentyfive
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: h-ai
*/

/* ---------- Tokens ---------- */
:root {
	--hai-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	--hai-radius: 10px;
	--hai-section-pad: clamp(56px, 7vw, 96px);
}

/* Machine view: the same page, re-skinned. Every block using a preset colour or font flips automatically. */
html[data-view="machine"] {
	--wp--preset--color--base: #121A17;
	--wp--preset--color--contrast: #D9E4D6;
	--wp--preset--color--accent-1: #F08A5D;
	--wp--preset--color--accent-2: #1C2722;
	--wp--preset--color--accent-3: #BFE3C8;
	--wp--preset--color--accent-4: #9FB0A7;
	--wp--preset--color--accent-5: #1C2722;
	--wp--preset--color--accent-6: #2A3832;
	--wp--preset--color--on-accent: #121A17;
	--wp--preset--font-family--heading: var(--hai-mono);
	--wp--preset--font-family--body: var(--hai-mono);
}

body {
	transition: background-color 0.25s ease, color 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
	body { transition: none; }
}

html[data-view="machine"] h1.wp-block-heading::before { content: "# "; color: var(--wp--preset--color--accent-1); }
html[data-view="machine"] h2.wp-block-heading::before { content: "## "; color: var(--wp--preset--color--accent-1); }
html[data-view="machine"] h3.wp-block-heading::before { content: "### "; color: var(--wp--preset--color--accent-1); }
html[data-view="machine"] h1.wp-block-heading,
html[data-view="machine"] h2.wp-block-heading,
html[data-view="machine"] h3.wp-block-heading { letter-spacing: -0.01em; }

/* ---------- Page rhythm ---------- */
main.wp-block-group { margin-block-start: 0; }
.wp-block-post-content > .alignfull { margin-block-start: 0; margin-block-end: 0; }

.hai-section {
	padding-top: var(--hai-section-pad);
	padding-bottom: var(--hai-section-pad);
	padding-left: clamp(16px, 4vw, 48px);
	padding-right: clamp(16px, 4vw, 48px);
}
.hai-rule { border-top: 1px solid var(--wp--preset--color--accent-6); }
.hai-tinted { background-color: var(--wp--preset--color--accent-2); }

.hai-row.wp-block-columns { gap: clamp(24px, 3vw, 40px); align-items: flex-start; }
.hai-row + .hai-row { margin-top: 0; padding-top: 32px; border-top: 1px solid var(--wp--preset--color--accent-6); }
.hai-stages { margin-top: 40px; }
.hai-stages > .hai-row { margin-top: 0; margin-bottom: 0; padding-bottom: 32px; }
.hai-stages > .hai-row:first-child { padding-top: 32px; border-top: 1px solid var(--wp--preset--color--accent-6); }
.hai-stages > .hai-row:last-child { border-bottom: 1px solid var(--wp--preset--color--accent-6); }
.hai-stages > .hai-row p:last-child { margin-bottom: 0; }
.hai-stages + .wp-block-buttons { margin-top: 32px; }

/* WordPress centres anything narrower than the content width. Keep narrow text left-aligned with the headings instead. */
.is-layout-constrained > .hai-lead,
.is-layout-constrained > .hai-measure,
.is-layout-constrained > .hai-hero-title,
.hai-cta.is-layout-constrained > .wp-block-heading {
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size, 1240px)) / 2)) !important;
	margin-right: auto !important;
}

/* ---------- Type helpers ---------- */
.hai-hero-title { max-width: 17ch; }
.hai-lead { font-size: var(--wp--preset--font-size--large); color: var(--wp--preset--color--accent-4); max-width: 58ch; }
.hai-measure { max-width: 62ch; }
.hai-muted { color: var(--wp--preset--color--accent-4); }
.hai-stage-num {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 2.5rem;
	line-height: 1;
	color: var(--wp--preset--color--accent-1);
	margin-bottom: 0.5rem;
}
/* Commitment cards. Also restyles the older version of this block (one line per column) without editing the page. */
.hai-section.hai-commit-band,
.hai-tinted:has(> .hai-commit) {
	padding-top: clamp(32px, 4vw, 56px);
	padding-bottom: clamp(32px, 4vw, 56px);
}
.hai-commit.wp-block-columns { gap: 16px; align-items: stretch; }
.hai-commit > .wp-block-column {
	display: flex;
	flex-direction: column;
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 4px;
	padding: 24px 24px 20px;
}
.hai-commit > .wp-block-column > p { margin: 0; }
.hai-commit > .wp-block-column > p:first-child {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 1.375rem;
	line-height: 1.25;
	letter-spacing: -0.015em;
}
.hai-commit .wp-block-column > .hai-commit-text {
	flex: 1;
	margin-top: 12px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--wp--preset--color--accent-4);
}
.hai-commit .wp-block-column > .hai-commit-tag {
	align-self: flex-start;
	margin-top: 16px;
	padding: 6px 10px;
	border-radius: 3px;
	background-color: var(--wp--preset--color--accent-2);
	font-family: var(--hai-mono);
	font-size: 0.6875rem;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--contrast);
}


/* ---------- Machine note (block style on Preformatted) ---------- */
.wp-block-preformatted.is-style-machine-note {
	font-family: var(--hai-mono);
	font-size: 0.84rem;
	line-height: 1.7;
	background-color: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--accent-3);
	border: 0;
	border-radius: var(--hai-radius);
	padding: 1.25rem 1.5rem;
	margin: 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.hai-tinted .wp-block-preformatted.is-style-machine-note { background-color: var(--wp--preset--color--base); }

/* ---------- Lists ---------- */
.hai-industry-list {
	list-style: none;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
	column-gap: 40px;
}
.hai-industry-list li {
	padding: 18px 0;
	border-top: 1px solid var(--wp--preset--color--accent-6);
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.hai-industry-list li strong {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--large);
}
.hai-industry-list li a { text-decoration: none; }
.hai-industry-list li span {
	font-family: var(--hai-mono);
	font-size: 0.82rem;
	color: var(--wp--preset--color--accent-4);
}

/* ---------- Call to action band ---------- */
.hai-cta .wp-block-heading { max-width: 20ch; }
.hai-cta a:where(:not(.wp-element-button)) { color: inherit; }
.hai-btn-invert .wp-block-button__link {
	background-color: var(--wp--preset--color--on-accent);
	color: var(--wp--preset--color--accent-1);
}
.hai-btn-invert .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* ---------- Header and toggle ---------- */
.hai-header { border-bottom: 1px solid var(--wp--preset--color--accent-6); }
.hai-header .wp-block-site-title a { text-decoration: none; }

/* Inline logo: letters follow the text colour, the cursor follows the signal colour, so it flips with machine view. */
.hai-logo { display: inline-flex; color: var(--wp--preset--color--contrast); line-height: 0; }
.hai-logo svg { height: 34px; width: auto; display: block; }
.hai-logo-cursor { fill: var(--wp--preset--color--accent-1); }
.hai-logo:hover .hai-logo-cursor { animation: hai-blink 1s steps(1) infinite; }
.hai-logo:focus-visible { outline: 2px solid var(--wp--preset--color--accent-1); outline-offset: 4px; border-radius: 4px; }
@keyframes hai-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hai-logo:hover .hai-logo-cursor { animation: none; } }

/* Footer line built from the live tagline */
.hai-footer-id { gap: 0.35em !important; }
.hai-footer-id p, .hai-footer-id .wp-block-site-tagline { margin: 0; color: inherit; font-size: inherit; }
.hai-footer-id .wp-block-site-tagline + p { margin-left: -0.35em; }

.hai-view-toggle { display: none; }
.hai-js .hai-view-toggle {
	display: inline-flex;
	padding: 4px;
	gap: 2px;
	border-radius: 999px;
	background-color: var(--wp--preset--color--accent-2);
	border: 1px solid var(--wp--preset--color--accent-6);
}
.hai-view-toggle button {
	font-family: var(--hai-mono);
	font-size: 0.8125rem;
	min-height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	background: transparent;
	color: var(--wp--preset--color--contrast);
}
.hai-view-toggle button[aria-pressed="true"] {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}
.hai-view-toggle button:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1);
	outline-offset: 2px;
}

/* ---------- Footer ---------- */
.hai-footer { border-top: 1px solid var(--wp--preset--color--accent-6); font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--accent-4); }
.hai-footer a { color: inherit; }
.hai-footer .hai-mono { font-family: var(--hai-mono); }

/* ---------- FAQ ---------- */
.wp-block-details { border-top: 1px solid var(--wp--preset--color--accent-6); padding: 18px 0; }
.wp-block-details summary { font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: var(--wp--preset--font-size--large); cursor: pointer; }
