/*
Theme Name: Ask an AI Engineer
Theme URI: https://askanaiengineer.com
Author: Philip Lacey
Description: Lightweight dark block theme with cyan highlights for Ask an AI Engineer. You ask. I build. We learn.
Version: 0.1.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aae
Font: Inter (SIL Open Font License 1.1) — see assets/fonts/OFL.txt
*/

/* ---------- Tokens (mirror theme.json for use in plain CSS) ---------- */
:root {
	--aae-bg: #080f19;
	--aae-surface: #101b2b;
	--aae-surface-raised: #162438;
	--aae-border: #26394d;
	--aae-text: #f4f8fc;
	--aae-muted: #a8b8ca;
	--aae-cyan: #22d3ee;
	--aae-cyan-hover: #67e8f9;
	--aae-cyan-dark: #0e7490;
	--aae-focus: #67e8f9;
	--aae-error: #fda4af;
	--aae-radius: 16px;
	color-scheme: dark;
}

/* ---------- Base ---------- */
body {
	background: var(--aae-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

::selection { background: var(--aae-cyan); color: var(--aae-bg); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--aae-focus);
	outline-offset: 3px;
	border-radius: 4px;
}

a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

img { height: auto; }

.wp-element-button,
.wp-block-button__link { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--aae-text);
	border-color: var(--aae-border);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--aae-surface-raised);
	color: var(--aae-text);
	border-color: var(--aae-cyan);
}

.skip-link.screen-reader-text:focus {
	background: var(--aae-cyan);
	color: var(--aae-bg);
}

/* ---------- Header ---------- */
.aae-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(8, 15, 25, .82);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid rgba(38, 57, 77, .6);
}
.admin-bar .aae-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .aae-header { top: 0; } }

.aae-header__inner {
	min-height: 72px;
	gap: 1.5rem;
}

.aae-brand {
	display: inline-flex;
	align-items: center;
	gap: .7rem;
	color: var(--aae-text);
	text-decoration: none;
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: -0.01em;
	white-space: nowrap;
}
.aae-brand:hover { color: var(--aae-text); }
.aae-brand__mark { width: 58px; height: auto; display: block; }
.aae-brand__ai { color: var(--aae-cyan); }

.aae-header .wp-block-navigation {
	font-size: .95rem;
	font-weight: 500;
	gap: 1.75rem;
}
.aae-header .wp-block-navigation a { text-decoration: none; color: var(--aae-muted); }
.aae-header .wp-block-navigation a:hover,
.aae-header .wp-block-navigation .current-menu-item > a { color: var(--aae-text); }

.aae-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--aae-bg);
	color: var(--aae-text);
	padding: 1.5rem;
}
.aae-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 1.25rem; font-size: 1.25rem; }

.aae-header .wp-block-button__link { padding: .6rem 1.05rem; font-size: .925rem; }

/* "Ask a Question" is a button on desktop and a menu item inside the mobile overlay. */
@media (min-width: 600px) {
	.aae-header .aae-nav-ask { display: none; }
}
@media (max-width: 599px) {
	.aae-header__cta { display: none; }
}
@media (max-width: 420px) {
	.aae-brand__text { font-size: .95rem; }
	.aae-brand__mark { width: 46px; }
}

/* ---------- Sections ---------- */
.aae-section { padding-block: var(--wp--preset--spacing--60); }
.aae-section--alt {
	background: linear-gradient(180deg, rgba(16, 27, 43, .55), rgba(16, 27, 43, 0));
	border-top: 1px solid rgba(38, 57, 77, .55);
}

.aae-eyebrow {
	font-size: .8rem !important;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--aae-cyan);
	margin-bottom: 0;
}
.aae-lead { font-size: var(--wp--preset--font-size--large); color: var(--aae-muted); max-width: 40rem; }
.aae-muted { color: var(--aae-muted); }

.aae-section__head { margin-bottom: 2.25rem; }
.aae-section__head > * + * { margin-top: .6rem; }
.aae-section__head .wp-block-heading { margin-top: .5rem; }

/* ---------- Hero ---------- */
.aae-hero {
	position: relative;
	padding-block: var(--wp--preset--spacing--70) var(--wp--preset--spacing--60);
	overflow: hidden;
	isolation: isolate;
}
.aae-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(55% 65% at 85% 10%, rgba(34, 211, 238, .14), transparent 70%),
		radial-gradient(40% 50% at 10% 90%, rgba(14, 116, 144, .16), transparent 70%);
}
.aae-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(rgba(38, 57, 77, .35) 1px, transparent 1px),
		linear-gradient(90deg, rgba(38, 57, 77, .35) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(70% 70% at 70% 30%, #000 10%, transparent 75%);
	mask-image: radial-gradient(70% 70% at 70% 30%, #000 10%, transparent 75%);
}
.aae-hero .wp-block-columns { align-items: center; gap: clamp(2rem, 5vw, 4rem); }
.aae-hero h1 { margin-block: 1rem 1.25rem; }
.aae-hero h1 .aae-hl { color: var(--aae-cyan); }
.aae-hero .wp-block-buttons { margin-top: 2rem; }

.aae-hero__visual {
	position: relative;
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border-radius: 24px;
	background: linear-gradient(160deg, rgba(22, 36, 56, .9), rgba(16, 27, 43, .7));
	border: 1px solid var(--aae-border);
	box-shadow: 0 0 0 1px rgba(34, 211, 238, .05), 0 30px 80px -30px rgba(0, 0, 0, .7);
	text-align: center;
}
.aae-hero__visual::before {
	content: "";
	position: absolute;
	inset: -1px;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(140deg, rgba(34, 211, 238, .55), transparent 40%, transparent 70%, rgba(34, 211, 238, .25));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}
.aae-hero__visual img { width: 100%; max-width: 420px; margin-inline: auto; display: block; }

.aae-pills {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .6rem;
	margin: 1.75rem 0 0;
	padding: 0;
	list-style: none;
}
.aae-pills li {
	font-size: .85rem;
	font-weight: 600;
	letter-spacing: .04em;
	padding: .45rem .9rem;
	border-radius: 999px;
	border: 1px solid var(--aae-border);
	background: rgba(8, 15, 25, .6);
	color: var(--aae-text);
}
.aae-pills li::before { content: "●"; color: var(--aae-cyan); margin-right: .5rem; font-size: .6em; vertical-align: .2em; }

.aae-trust {
	margin-top: var(--wp--preset--spacing--50);
	padding-top: 1.5rem;
	border-top: 1px solid rgba(38, 57, 77, .6);
	color: var(--aae-muted);
	font-size: .925rem;
	letter-spacing: .02em;
}

/* ---------- How it works ---------- */
.aae-steps { counter-reset: aae-step; }
.aae-step {
	counter-increment: aae-step;
	position: relative;
	padding: 1.5rem;
	border-radius: var(--aae-radius);
	background: var(--aae-surface);
	border: 1px solid var(--aae-border);
	transition: border-color .2s ease, background-color .2s ease;
}
.aae-step:hover { border-color: rgba(34, 211, 238, .45); background: var(--aae-surface-raised); }
.aae-step::before {
	content: counter(aae-step, decimal-leading-zero);
	display: block;
	font-family: var(--wp--preset--font-family--mono);
	font-size: .8rem;
	color: var(--aae-cyan);
	margin-bottom: .9rem;
}
.aae-step h3 { font-size: 1.2rem; margin: 0 0 .4rem; }
.aae-step p { margin: 0; color: var(--aae-muted); font-size: .95rem; line-height: 1.6; }

/* ---------- Cards & queries ---------- */
.aae-card {
	height: 100%;
	padding: 0 0 1.25rem;
	border-radius: var(--aae-radius);
	background: var(--aae-surface);
	border: 1px solid var(--aae-border);
	overflow: hidden;
	transition: border-color .2s ease, transform .2s ease;
}
.aae-card:hover { border-color: rgba(34, 211, 238, .5); transform: translateY(-2px); }
.aae-card > *:not(.wp-block-post-featured-image) { padding-inline: 1.25rem; }
.aae-card .wp-block-post-featured-image { margin: 0 0 1.1rem; }
.aae-card .wp-block-post-featured-image img { border-radius: 0; }
.aae-card .wp-block-post-title { font-size: 1.2rem; margin: 0; }
.aae-card .wp-block-post-title a { color: var(--aae-text); text-decoration: none; }
.aae-card .wp-block-post-title a:hover { color: var(--aae-cyan); }
.aae-card > * + * { margin-top: .5rem; }
.aae-card .wp-block-post-excerpt__excerpt { margin: 0; font-size: .95rem; }
.aae-card .wp-block-post-terms { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding-top: 1.1rem; }
.aae-card .wp-block-post-terms a { color: var(--aae-cyan); text-decoration: none; }

.aae-empty {
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border-radius: var(--aae-radius);
	border: 1px dashed var(--aae-border);
	background: rgba(16, 27, 43, .5);
	color: var(--aae-muted);
}
.aae-empty strong { color: var(--aae-text); }

.wp-block-query-pagination { margin-top: 2.5rem; }
.wp-block-query-pagination a { text-decoration: none; }

/* ---------- Two-up editorial ---------- */
.aae-panel {
	height: 100%;
	padding: clamp(1.5rem, 4vw, 2.25rem);
	border-radius: var(--aae-radius);
	background: var(--aae-surface);
	border: 1px solid var(--aae-border);
}
.aae-panel h3 { margin-top: .4rem; }
.aae-panel p { color: var(--aae-muted); }

/* ---------- Final CTA ---------- */
.aae-cta-band {
	position: relative;
	padding: clamp(2rem, 6vw, 4rem);
	border-radius: 24px;
	background:
		radial-gradient(80% 120% at 100% 0%, rgba(34, 211, 238, .16), transparent 60%),
		var(--aae-surface);
	border: 1px solid var(--aae-border);
	text-align: center;
}
.aae-cta-band h2 { margin-top: 0; }
.aae-cta-band p { color: var(--aae-muted); margin-inline: auto; max-width: 36rem; }
.aae-cta-band .wp-block-buttons { justify-content: center; margin-top: 1.75rem; }

/* ---------- Page / single ---------- */
.aae-main { padding-block: var(--wp--preset--spacing--60); }
.aae-page-head { margin-bottom: var(--wp--preset--spacing--50); }
.aae-page-head h1 { font-size: var(--wp--preset--font-size--xx-large); margin: .25rem 0 0; }
.aae-page-head .wp-block-post-date,
.aae-page-head .wp-block-post-terms { margin-top: .75rem; }
.aae-page-head .wp-block-post-terms a { color: var(--aae-cyan); text-decoration: none; font-weight: 600; }
.wp-block-post-featured-image img { border-radius: var(--aae-radius); }
.wp-block-post-content h2 { font-size: var(--wp--preset--font-size--x-large); margin-top: 2.5rem; }
.wp-block-post-content h3 { font-size: var(--wp--preset--font-size--large); margin-top: 2rem; }
.wp-block-post-content :where(ul, ol) { padding-left: 1.25rem; }
.wp-block-post-content li + li { margin-top: .35rem; }
.wp-block-embed iframe { border-radius: var(--aae-radius); }
.wp-block-embed__wrapper { border-radius: var(--aae-radius); overflow: hidden; }

.aae-404 { text-align: center; }

/* ---------- Footer ---------- */
.aae-footer {
	margin-top: var(--wp--preset--spacing--60);
	padding-block: var(--wp--preset--spacing--50) 2rem;
	border-top: 1px solid var(--aae-border);
	color: var(--aae-muted);
	font-size: .925rem;
}
.aae-footer__top { gap: 2rem; align-items: flex-start; }
.aae-footer__tagline { margin: .75rem 0 0; color: var(--aae-muted); }
.aae-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.aae-footer__links a { color: var(--aae-muted); text-decoration: none; }
.aae-footer__links a:hover { color: var(--aae-cyan); }
.aae-footer__legal { margin-top: 2.5rem; font-size: .85rem; color: #7f91a6; }

/* ---------- Question form ---------- */
.aae-form {
	padding: clamp(1.25rem, 4vw, 2.25rem);
	border-radius: var(--aae-radius);
	background: var(--aae-surface);
	border: 1px solid var(--aae-border);
}
.aae-form--done h2 { font-size: var(--wp--preset--font-size--x-large); margin-top: 0; }
.aae-form--done:focus { outline: none; }

.aae-field + .aae-field { margin-top: 1.4rem; }
.aae-field label { display: block; font-weight: 600; margin-bottom: .4rem; }
.aae-field__opt,
.aae-field__req { font-weight: 400; color: var(--aae-muted); font-size: .875rem; }

.aae-form input[type="text"],
.aae-form input[type="email"],
.aae-form select,
.aae-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: .8rem .95rem;
	border-radius: 10px;
	border: 1px solid var(--aae-border);
	background: var(--aae-bg);
	color: var(--aae-text);
	font: inherit;
	line-height: 1.5;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.aae-form textarea { resize: vertical; min-height: 10rem; }
.aae-form :is(input, select, textarea):hover { border-color: #3a536e; }
.aae-form :is(input, select, textarea):focus {
	outline: none;
	border-color: var(--aae-cyan);
	box-shadow: 0 0 0 3px rgba(34, 211, 238, .25);
}
.aae-form [aria-invalid="true"] { border-color: var(--aae-error); }

.aae-field__help { margin: .45rem 0 0; font-size: .875rem; color: var(--aae-muted); line-height: 1.5; }
.aae-field__error { margin: .45rem 0 0; font-size: .9rem; color: var(--aae-error); font-weight: 500; }
.aae-form__alert {
	margin: 0 0 1.5rem;
	padding: .85rem 1rem;
	border-radius: 10px;
	border: 1px solid rgba(253, 164, 175, .5);
	background: rgba(253, 164, 175, .08);
	color: var(--aae-error);
}

.aae-field--check {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: .75rem;
	align-items: start;
}
.aae-field--check label { font-weight: 400; margin: 0; }
.aae-field--check .aae-field__error { grid-column: 2; }
.aae-field--check input {
	width: 1.2rem;
	height: 1.2rem;
	margin-top: .25rem;
	accent-color: var(--aae-cyan);
}
.aae-form .wp-block-buttons { margin-top: 2rem; }
.aae-form button.wp-block-button__link { cursor: pointer; font-family: inherit; }

.aae-hp {
	position: absolute !important;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
	.aae-card:hover { transform: none; }
}
