/*
Theme Name: Saffron & Signal
Description: A custom block theme scaffolded by Studio Code.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: saffron-signal
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

/* WordPress inserts a margin-block-start equal to the block gap (24px unless
   theme.json sets styles.spacing.blockGap) between the template's top-level
   sections (header part, main, footer part) — a gap that exists even when no
   markup asks for it. Zero it so sections butt edge-to-edge and own their
   vertical rhythm via padding; this does not affect block gaps inside nested
   layouts. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main carries its own vertical padding so templates this
   theme does not author (WooCommerce shop, product, cart…) still clear the
   header and footer. A descendant selector, not a child one: WooCommerce wraps
   the single-product main in an extra group. Templates built from full-bleed
   sections opt out with is-flush and let the sections own the rhythm. */
.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

:root {
	--k-bg: var(--wp--preset--color--background);
	--k-surface: var(--wp--preset--color--surface);
	--k-surface2: var(--wp--preset--color--surface2);
	--k-text: var(--wp--preset--color--text);
	--k-secondary: var(--wp--preset--color--secondary);
	--k-muted: var(--wp--preset--color--muted);
	--k-primary: var(--wp--preset--color--primary);
	--k-cyan: var(--wp--preset--color--cyan);
	--k-success: var(--wp--preset--color--success);
	--k-amber: var(--wp--preset--color--amber);
	--k-border: rgba(255, 255, 255, 0.08);
	--k-border-hover: rgba(232, 119, 46, 0.35);
	--k-glow: rgba(232, 119, 46, 0.35);
	--k-glow-soft: rgba(232, 119, 46, 0.12);
	--k-ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
	--k-ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
	--k-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
	--k-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

	color-scheme: dark;
}

/* === reset === */
html { scroll-behavior: smooth; }
body { background: var(--k-bg); }

/* === header === */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(9, 9, 11, 0.6);
	border-bottom: 1px solid transparent;
	transition: background 300ms ease, border-color 300ms ease, backdrop-filter 300ms ease;
}
.site-header.scrolled {
	background: rgba(9, 9, 11, 0.9);
	border-bottom: 1px solid var(--k-border);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}
.header-inner {
	max-width: 1280px;
	margin-inline: auto;
	padding: 14px clamp(1.25rem, 5vw, 3rem);
	gap: 24px;
}
.site-logo img {
	max-height: 42px;
	width: auto;
	display: block;
	transition: opacity 200ms ease;
}
.site-logo a:hover img { opacity: 0.82; }
.main-nav a {
	color: var(--k-secondary);
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none;
	transition: color 160ms ease;
}
.main-nav a:hover { color: var(--k-primary); }
.main-nav .wp-block-navigation-item__content { padding: 6px 2px; position: relative; }
.main-nav .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 2px;
	right: 2px;
	bottom: 2px;
	height: 2px;
	border-radius: 2px;
	background: var(--k-primary);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 260ms var(--k-ease-quart);
}
.main-nav .wp-block-navigation-item__content:hover::after,
.main-nav .wp-block-navigation-item__content:focus-visible::after {
	transform: scaleX(1);
}
.header-cta .wp-block-button, .header-cta { margin: 0; }

/* === scroll-bar === */
#scroll-bar {
	position: fixed;
	top: 0;
	left: 0;
	height: 2px;
	z-index: 999;
	background: linear-gradient(90deg, var(--k-primary), var(--k-amber));
	width: 0%;
	transition: none;
}

/* === words headline === */
.words-animate { display: block; }
.word-wrap {
	overflow: hidden;
	display: inline-block;
	margin-right: 0.24em;
	vertical-align: bottom;
}
.word-inner {
	display: inline-block;
	transform: translateY(110%);
	opacity: 0;
	animation: wordUp 0.65s var(--k-ease-expo) forwards;
}
@keyframes wordUp {
	to { transform: translateY(0); opacity: 1; }
}

/* === reveal === */
.reveal {
	opacity: 1;
	transform: none;
	/* JS adds .pre-reveal only when it runs — without it, stays visible in the editor */
	transition: opacity 0.55s var(--k-ease-expo), transform 0.55s var(--k-ease-expo);
}
.reveal.pre-reveal { opacity: 0; transform: translateY(24px); }
.reveal-left.pre-reveal { transform: translateX(-24px); }
.reveal-scale.pre-reveal { transform: scale(0.94); }
.reveal.pre-reveal.in-view { opacity: 1; transform: translateX(0) translateY(0) scale(1); }

/* === kinetic button === */
.wp-block-button .wp-block-button__link {
	position: relative;
	transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, transform 160ms ease;
}
.wp-block-button .wp-block-button__link::before,
.wp-block-button .wp-block-button__link::after {
	content: none;
}
.wp-block-button:hover .wp-block-button__link {
	background: color-mix(in srgb, var(--k-primary) 85%, white);
	box-shadow: 0 12px 30px -14px var(--k-glow);
	transform: translateY(-1px);
}
.wp-block-button:active .wp-block-button__link {
	transform: translateY(0) scale(0.98);
}
.wp-block-button .wp-block-button__link:focus-visible {
	outline: 2px solid var(--k-primary);
	outline-offset: 3px;
}
/* keep the header CTA compact so it sits light in the nav */
.header-cta .wp-block-button__link {
	padding: 0.55rem 1.4rem;
	font-size: 0.95rem;
}
.is-style-outline .wp-block-button__link {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: var(--k-text);
	box-shadow: none;
}
.is-style-outline .wp-block-button__link:hover {
	background: rgba(232, 119, 46, 0.08);
	border-color: var(--k-primary);
	color: var(--k-primary);
	box-shadow: none;
	transform: translateY(-1px);
}

/* === cards === */
.is-style-card {
	background: var(--k-surface);
	border: 1px solid var(--k-border);
	border-radius: var(--wp--custom--rounded--lg, 14px);
	padding: 28px;
}

/* keep cards in a wide column grid equal height */
.wp-block-columns.alignwide > .wp-block-column > .is-style-card {
	height: 100%;
}

/* === premium micro-interactions ===
   Pure transform/translate + transition, no JS. The lift uses the
   separate `translate` property so it composes with the reveal's
   `transform` instead of overriding it. All disabled by
   prefers-reduced-motion below. */
.is-style-card {
	transition: translate 320ms var(--k-ease-quart), border-color 320ms ease, box-shadow 320ms ease;
}
.is-style-card:hover {
	translate: 0 -6px;
	border-color: var(--k-border-hover);
	box-shadow:
		0 0 0 1px rgba(232, 119, 46, 0.10),
		0 24px 50px -24px rgba(0, 0, 0, 0.65),
		0 18px 40px -32px var(--k-glow);
}
.is-style-card img {
	border-radius: 8px;
	transform: scale(1);
	transition: transform 480ms var(--k-ease-quart);
}
.is-style-card:hover img {
	transform: scale(1.04);
}
.is-style-card .feature-icon {
	display: inline-block;
	transition: transform 280ms var(--k-ease-quart);
}
.is-style-card:hover .feature-icon {
	transform: translateY(-2px) scale(1.06);
}

/* === metrics === */
.metric-number {
	font-family: var(--wp--preset--font-family--jetbrains-mono);
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 500;
	color: var(--k-primary);
	line-height: 1;
}
.metric-label {
	color: var(--k-muted);
	font-size: 0.85rem;
}

/* === typewriter === */
.quote-target { min-height: 4.5em; }
/* === sections === */
.section {
	padding-block: var(--wp--preset--spacing--xxl) var(--wp--preset--spacing--xxxl);
}
.eyebrow {
	color: var(--k-primary);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-weight: 700;
	font-size: 0.72rem;
	margin: 0;
}
.lead {
	color: var(--k-secondary);
	font-size: 1.15rem;
	line-height: 1.7;
	max-width: 60ch;
}
.hero {
	position: relative;
	overflow: hidden;
	padding-block: clamp(4rem, 10vw, 8rem) clamp(4rem, 8vw, 7rem);
}
.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(900px 480px at 78% -10%, rgba(232, 119, 46, 0.18), transparent 60%),
		radial-gradient(700px 420px at 15% 20%, rgba(6, 182, 212, 0.07), transparent 60%);
	pointer-events: none;
}
.hero-title {
	max-width: 15ch;
}
.tag-chip {
	border: 1px solid var(--k-border);
	border-radius: var(--wp--custom--rounded--full, 999px);
	padding: 8px 16px;
	color: var(--k-secondary);
	font-size: 0.85rem;
	background: var(--k-surface);
}
.proof-strip {
	border: 1px solid var(--k-border);
	border-radius: var(--wp--custom--rounded--md, 10px);
	background: var(--k-surface);
	padding: 18px 24px;
}
.step-num {
	font-family: var(--wp--preset--font-family--jetbrains-mono);
	color: var(--k-primary);
	font-size: 0.8rem;
	letter-spacing: 0.1em;
}
.feature-icon {
	font-size: 1.6rem;
	color: var(--k-primary);
}
.bignum {
	font-family: var(--wp--preset--font-family--jetbrains-mono);
	font-size: clamp(2.4rem, 5vw, 3.6rem);
	font-weight: 500;
	color: var(--k-primary);
	line-height: 1;
}
.bignum small { color: var(--k-muted); font-size: 1rem; }
.promise-check {
	color: var(--k-success);
	font-weight: 700;
}
.outline-btn { display: inline-block; }
.pack-badge {
	display: inline-block;
	background: rgba(232, 119, 46, 0.12);
	border: 1px solid rgba(232, 119, 46, 0.28);
	color: var(--k-primary);
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 16px;
}
.pack-price {
	font-family: var(--wp--preset--font-family--jetbrains-mono);
	font-size: clamp(1.8rem, 3vw, 2.4rem);
	font-weight: 500;
	color: var(--k-text);
}
.pack-price small { color: var(--k-muted); font-size: 0.85rem; }
.popular-card {
	border-color: var(--k-border-hover) !important;
	box-shadow: 0 0 0 1px var(--k-glow-soft), 0 12px 48px var(--k-glow-soft);
}
.popular-card .pack-badge {
	background: var(--k-primary);
	border-color: var(--k-primary);
	color: #fff;
}
/* ✓ feature ticks, so each plan scans like a checklist */
.pack-list {
	list-style: none;
	padding: 0;
	margin: 4px 0 12px;
}
.pack-list li {
	position: relative;
	padding-left: 26px;
	margin-bottom: 11px;
	color: var(--k-secondary);
	font-size: 0.95rem;
	line-height: 1.5;
}
.pack-list li::before {
	content: "\2713";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--k-primary);
	font-weight: 700;
}
.attr {
	color: var(--k-muted);
	font-size: 0.8rem;
}
.side-card { position: sticky; top: 96px; }
.side-line { color: var(--k-muted); font-size: 0.9rem; }
.side-line a { color: var(--k-secondary); text-decoration: none; }
.side-line a:hover { color: var(--k-primary); }
.section-head { margin-bottom: var(--wp--preset--spacing--xl); }
.hero-card {
	overflow: hidden;
	position: relative;
	box-shadow: 0 0 0 1px var(--k-border), 0 24px 80px rgba(0,0,0,0.5);
}
.hero-card img { border-radius: inherit; }
.float-chip {
	position: absolute;
	right: -10px;
	bottom: 22px;
	animation: floatSlow 6s var(--k-ease-in-out) infinite;
	box-shadow: 0 0 0 1px var(--k-border-hover), 0 8px 32px var(--k-glow);
	color: var(--k-text);
}
@keyframes floatSlow {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-10px); }
}
.metrics .wp-block-column {
	border: 1px solid var(--k-border);
	border-radius: var(--wp--custom--rounded--md, 10px);
	background: var(--k-surface);
	padding: 18px 16px;
}
.quote-card { max-width: 760px; margin-inline: auto; }
.quote-target {
	font-size: clamp(1.25rem, 2.4vw, 1.6rem);
	font-weight: 600;
	line-height: 1.4;
	color: var(--k-text);
}
.cta-card {
	border: 1px solid var(--k-border-hover);
	border-radius: var(--wp--custom--rounded--lg, 14px);
	padding: var(--wp--preset--spacing--xxxl);
	background:
		radial-gradient(700px 340px at 85% 0%, rgba(232,119,46,0.16), transparent 60%),
		var(--k-surface);
	box-shadow: 0 0 0 1px rgba(232,119,46,0.12), 0 24px 90px rgba(0,0,0,0.5);
}

/* === faq === */
.faq-item {
	border: 1px solid var(--k-border);
	border-radius: var(--wp--custom--rounded--md, 10px);
	background: var(--k-surface);
	padding: 20px 24px;
}
.faq-q {
	color: var(--k-text);
	font-weight: 600;
	margin: 0 0 6px;
}
.faq-a { color: var(--k-secondary); margin: 0; }

/* === form === */
.wp-block-jetpack-contact-form {
	border: 1px solid var(--k-border);
	border-radius: var(--wp--custom--rounded--lg, 14px);
	background: var(--k-surface);
	padding: 26px;
}
.wp-block-jetpack-contact-form input[type],
.wp-block-jetpack-contact-form textarea,
.wp-block-jetpack-contact-form select {
	width: 100%;
	background: var(--k-bg);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	color: var(--k-text);
	padding: 11px 14px;
	font-family: inherit;
	transition: border-color 150ms ease, box-shadow 150ms ease;
}
.wp-block-jetpack-contact-form input:focus,
.wp-block-jetpack-contact-form textarea:focus,
.wp-block-jetpack-contact-form select:focus {
	outline: none;
	border-color: var(--k-primary);
	box-shadow: 0 0 0 3px rgba(232, 119, 46, 0.2), 0 0 0 1px var(--k-primary);
}

/* === footer === */
.site-footer {
	border-top: 1px solid var(--k-border);
	background: var(--k-surface2);
}
.footer-logo img { max-height: 36px; }
.footer-blurb { color: var(--k-muted); max-width: 34ch; }
.footer-h {
	color: var(--k-secondary);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}
.footer-line { color: var(--k-muted); font-size: 0.9rem; }
.footer-line a { color: var(--k-secondary); text-decoration: none; }
.footer-line a:hover { color: var(--k-primary); }
.footer-ok { color: var(--k-success); }
.footer-nav a { color: var(--k-secondary); font-size: 0.9rem; text-decoration: none; transition: color 160ms ease, transform 220ms var(--k-ease-quart); }
.footer-nav a:hover { color: var(--k-primary); transform: translateX(3px); }
.footer-rule { background: var(--k-border); border: none; height: 1px; margin-block: var(--wp--preset--spacing--xxl); }
.footer-copy { color: var(--k-muted); font-size: 0.82rem; }

/* === mobile === */
.wp-block-buttons.mobile-bar {
	display: none;
}
.mobile-bar .wp-block-button {
	flex: 1;
	margin: 0;
}
.mobile-bar .wp-block-button__link {
	width: 100%;
	justify-content: center;
	display: flex;
	padding: 0.72rem 1.1rem;
	font-size: 0.95rem;
}
.mobile-bar .mobile-bar-primary .wp-block-button__link::after { display: none; }
.mobile-bar .mobile-bar-ghost .wp-block-button__link::after { display: none; }
.mobile-bar .mobile-bar-ghost .wp-block-button__link::before { display: none; }

@media (max-width: 640px) {
	.wp-block-buttons.mobile-bar {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 200;
		gap: 10px;
		padding: 10px 14px;
		background: rgba(9, 9, 11, 0.94);
		backdrop-filter: blur(14px);
		border-top: 1px solid var(--k-border);
	}
	body { padding-bottom: 74px; }
	.main-nav { display: none; }
	.header-cta { display: none; }
	.site-footer .wp-block-columns { flex-direction: column; }
}

/* === blog === */
.wp-block-post-template.blog-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--wp--preset--spacing--lg);
	padding: 0;
	margin: 0;
}
.wp-block-post-template.blog-grid > li {
	list-style: none;
	min-width: 0;
}
.blog-card {
	height: 100%;
	display: flex;
	flex-direction: column;
}
.blog-card img {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 8px;
}
.blog-card .wp-block-post-date {
	color: var(--k-muted);
	font-size: 0.82rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-top: 16px;
}
.blog-card .wp-block-post-title {
	margin: 8px 0 0;
}
.blog-card .wp-block-post-title a {
	color: var(--k-text);
	text-decoration: none;
	transition: color 200ms ease;
}
.blog-card .wp-block-post-title a:hover {
	color: var(--k-primary);
}
.blog-card .wp-block-post-excerpt {
	color: var(--k-secondary);
	font-size: 0.95rem;
	margin-top: 10px;
}
.blog-card .wp-block-post-excerpt__more-text a {
	color: var(--k-primary);
	text-decoration: none;
}
.blog-pagination {
	margin-top: var(--wp--preset--spacing--xl);
}
.blog-pagination .page-numbers,
.blog-pagination .wp-block-query-pagination a {
	color: var(--k-secondary);
	text-decoration: none;
	padding: 8px 12px;
	border-radius: 999px;
	transition: color 160ms ease, background-color 160ms ease;
}
.blog-pagination .page-numbers.current {
	background: var(--k-primary);
	color: #fff;
}
.blog-pagination a:hover {
	color: var(--k-primary);
}
@media (max-width: 900px) {
	.wp-block-post-template.blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.wp-block-post-template.blog-grid { grid-template-columns: 1fr; }
}

/* === reduced-motion === */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
	html { scroll-behavior: auto; }
	.word-inner { transform: translateY(0); opacity: 1; }
	.reveal.pre-reveal { opacity: 1; transform: none; }
	.is-style-card:hover { translate: none; box-shadow: none; border-color: var(--k-border); }
	.is-style-card:hover img, .is-style-card:hover .feature-icon { transform: none; }
	.main-nav .wp-block-navigation-item__content::after { transform: scaleX(0); }
	.footer-nav a:hover { transform: none; }
}
