/*
 * Aynexon Tech Fluency Handbook — promotional 3D showcase.
 * Everything is scoped under .tfhbp so it cannot affect the rest of the page.
 * Palette and type follow index.html (--orange #FF8C42, Poppins display, Inter body).
 */

.tfhbp {
	--p-bg: #0b0a09;
	--p-bg2: #100e0c;
	--p-orange: #FF8C42;
	--p-orange2: #FFA866;
	--p-deep: #C2410C;
	--p-text: #f6f5f3;
	--p-muted: #b3aca3;
	--p-muted2: #8d867c;
	--p-line: rgba(255, 140, 66, .18);
	--p-line2: rgba(255, 255, 255, .08);
	--p-display: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--p-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

	/* Card box. Artwork is contained inside on its own backdrop colour. */
	--p-card-w: 360px;
	--p-card-h: 450px;

	position: relative;
	overflow: hidden;
	padding: 84px 0 76px;
	background: linear-gradient(180deg, var(--p-bg), var(--p-bg2));
	color: var(--p-text);
	font-family: var(--p-body);
	line-height: 1.6;
	isolation: isolate;
}

.tfhbp *, .tfhbp *::before, .tfhbp *::after { box-sizing: border-box; }

.tfhbp-glow {
	position: absolute;
	inset: -20% -10% auto -10%;
	height: 620px;
	background: radial-gradient(760px 380px at 50% 0%, rgba(255, 140, 66, .16), transparent 66%);
	pointer-events: none;
	z-index: 0;
}

.tfhbp-inner {
	position: relative;
	z-index: 1;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ── Header ── */

.tfhbp-head { text-align: center; max-width: 780px; margin: 0 auto 44px; }

.tfhbp-pill {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 8px 16px;
	border-radius: 100px;
	border: 1px solid var(--p-line);
	background: rgba(255, 140, 66, .07);
	color: var(--p-orange2);
	font-weight: 600;
	font-size: 13px;
}

.tfhbp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--p-orange); box-shadow: 0 0 10px var(--p-orange); }

.tfhbp-head h2 {
	font-family: var(--p-display);
	font-size: clamp(30px, 5vw, 50px);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -.01em;
	margin: 18px 0 16px;
	color: var(--p-text);
}

.tfhbp-accent { color: var(--p-orange); }

.tfhbp-lead { color: var(--p-muted); font-size: 16.5px; margin: 0 auto; max-width: 660px; }

.tfhbp-facts {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	list-style: none;
	margin: 28px 0 0;
	padding: 0;
}

.tfhbp-facts li {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 96px;
	padding: 12px 18px;
	border: 1px solid var(--p-line2);
	border-radius: 14px;
	background: rgba(255, 255, 255, .03);
}

.tfhbp-facts b { font-family: var(--p-display); font-size: 24px; font-weight: 800; color: var(--p-orange); line-height: 1.1; }
.tfhbp-facts span { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--p-muted2); margin-top: 4px; }

/* ── 3D stage ── */

.tfhbp-stage-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
}

.tfhbp-stage {
	position: relative;
	width: 100%;
	height: calc(var(--p-card-h) + 96px);
	/* The perspective is what makes the side cards recede rather than just shrink. */
	perspective: 1500px;
	perspective-origin: 50% 45%;
	transform-style: preserve-3d;
	touch-action: pan-y;
	cursor: grab;
}

.tfhbp-stage.is-dragging { cursor: grabbing; }

.tfhbp-card {
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--p-card-w);
	height: var(--p-card-h);
	margin: 0;
	border-radius: 18px;
	background: var(--plate, #16181d);
	border: 1px solid var(--p-line2);
	box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
	overflow: hidden;
	transform-origin: 50% 50%;
	/* Positioned entirely from JS; the transition is what animates the rotation. */
	transform: translate(-50%, -50%);
	transition: transform .62s cubic-bezier(.22, .61, .36, 1), opacity .62s ease, visibility .62s;
	will-change: transform, opacity;
	backface-visibility: hidden;
	outline: none;
}

.tfhbp-card.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.tfhbp-card.is-active { cursor: zoom-in; border-color: var(--p-line); }
.tfhbp-card:focus-visible { box-shadow: 0 0 0 3px var(--p-orange), 0 30px 70px rgba(0, 0, 0, .55); }

.tfhbp-shot { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.tfhbp-shot picture { display: contents; }

.tfhbp-shot img {
	width: 100%;
	height: 100%;
	/* contain, on the artwork's own backdrop colour, so nothing is cropped and the
	   letterboxing is invisible. */
	object-fit: contain;
	object-position: center;
	user-select: none;
	-webkit-user-drag: none;
}

.tfhbp-cap {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	/* Kept shallow: the artwork carries its own call to action near the foot, and
	   the caption should sit under it rather than across it. */
	padding: 34px 18px 14px;
	background: linear-gradient(180deg, transparent, rgba(6, 6, 6, .55) 42%, rgba(6, 6, 6, .93) 78%);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .34s ease, transform .34s ease;
	pointer-events: none;
}

.tfhbp-card.is-active .tfhbp-cap { opacity: 1; transform: none; }

.tfhbp-kicker {
	display: block;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--p-orange);
	margin-bottom: 5px;
}

.tfhbp-caption { display: block; font-size: 14px; font-weight: 600; color: #fff; line-height: 1.4; }

/* ── Arrows ── */

.tfhbp-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 20;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px; height: 48px;
	border-radius: 50%;
	border: 1px solid var(--p-line2);
	background: rgba(14, 12, 11, .8);
	backdrop-filter: blur(8px);
	color: var(--p-text);
	cursor: pointer;
	transition: border-color .2s, color .2s, transform .2s;
}

.tfhbp-arrow:hover { border-color: var(--p-orange); color: var(--p-orange2); }
.tfhbp-arrow:focus-visible { outline: 2px solid var(--p-orange); outline-offset: 3px; }
.tfhbp-arrow-prev { left: 0; }
.tfhbp-arrow-next { right: 0; }

/* ── Dots ── */

.tfhbp-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; }

.tfhbp-dotbtn {
	width: 9px; height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
	cursor: pointer;
	transition: background .22s, width .22s, transform .22s;
}

.tfhbp-dotbtn:hover { background: rgba(255, 255, 255, .45); }
.tfhbp-dotbtn.is-on { width: 26px; border-radius: 6px; background: var(--p-orange); }
.tfhbp-dotbtn:focus-visible { outline: 2px solid var(--p-orange); outline-offset: 3px; }

/* ── CTA ── */

.tfhbp-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	/* A centred column keeps the block symmetric with the centred header, and
	   removes the wrap-dependent drift a row layout produced at some widths. */
	flex-direction: column;
	gap: 18px;
	margin: 40px auto 0;
	padding: 24px 26px;
	max-width: 680px;
	text-align: center;
	border: 1px solid var(--p-line);
	border-radius: 20px;
	background: rgba(255, 140, 66, .05);
}

.tfhbp-price { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 10px; }
.tfhbp-was { color: var(--p-muted2); text-decoration: line-through; font-size: 16px; }
.tfhbp-now { font-family: var(--p-display); font-size: 34px; font-weight: 800; color: var(--p-orange); line-height: 1; }
.tfhbp-note { width: 100%; font-size: 12px; color: var(--p-muted2); letter-spacing: .04em; margin-top: 2px; }

.tfhbp-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.tfhbp-btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-family: var(--p-body);
	font-weight: 700;
	font-size: 15px;
	padding: 14px 26px;
	border-radius: 12px;
	border: 1px solid transparent;
	text-decoration: none;
	cursor: pointer;
	transition: transform .2s, box-shadow .2s, border-color .2s, color .2s;
}

.tfhbp-btn-wa { background: #25D366; color: #06301a; box-shadow: 0 10px 30px rgba(37, 211, 102, .26); }
.tfhbp-btn-wa:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(37, 211, 102, .36); color: #06301a; }

.tfhbp-btn-ghost { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .16); color: var(--p-text); }
.tfhbp-btn-ghost:hover { border-color: var(--p-orange); color: var(--p-orange2); }
.tfhbp-btn:focus-visible { outline: 2px solid var(--p-orange); outline-offset: 3px; }

/* ── Lightbox ── */

.tfhbp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 4vh 3vw;
	background: rgba(4, 4, 4, .92);
	backdrop-filter: blur(7px);
	opacity: 0;
	transition: opacity .26s ease;
}

.tfhbp-lightbox[hidden] { display: none; }
.tfhbp-lightbox.is-open { opacity: 1; }

.tfhbp-lb-figure {
	margin: 0;
	max-width: min(1100px, 88vw);
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	transform: scale(.96);
	transition: transform .26s cubic-bezier(.22, .61, .36, 1);
}

.tfhbp-lightbox.is-open .tfhbp-lb-figure { transform: none; }

.tfhbp-lb-figure img {
	max-width: 100%;
	max-height: 78vh;
	width: auto; height: auto;
	border-radius: 14px;
	box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
	user-select: none;
	-webkit-user-drag: none;
}

.tfhbp-lb-figure figcaption { color: var(--p-muted); font-size: 14px; text-align: center; max-width: 640px; }

.tfhbp-lb-close {
	position: absolute;
	top: 18px; right: 20px;
	width: 44px; height: 44px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .16);
	background: rgba(255, 255, 255, .06);
	color: #fff;
	font-size: 27px;
	line-height: 1;
	cursor: pointer;
	transition: border-color .2s, color .2s;
}

.tfhbp-lb-close:hover { border-color: var(--p-orange); color: var(--p-orange2); }

.tfhbp-lb-nav {
	flex: 0 0 auto;
	width: 50px; height: 50px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .16);
	background: rgba(255, 255, 255, .06);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: border-color .2s, color .2s;
}

.tfhbp-lb-nav:hover { border-color: var(--p-orange); color: var(--p-orange2); }
.tfhbp-lb-close:focus-visible,
.tfhbp-lb-nav:focus-visible { outline: 2px solid var(--p-orange); outline-offset: 3px; }

/* ── Responsive ── */

@media (max-width: 1024px) {
	.tfhbp { --p-card-w: 300px; --p-card-h: 375px; }
}

@media (max-width: 720px) {
	.tfhbp { --p-card-w: 236px; --p-card-h: 295px; padding: 60px 0 56px; }
	.tfhbp-inner { padding: 0 16px; }
	.tfhbp-head { margin-bottom: 30px; }
	.tfhbp-facts li { min-width: 76px; padding: 10px 13px; }
	.tfhbp-facts b { font-size: 20px; }
	.tfhbp-arrow { width: 40px; height: 40px; }
	.tfhbp-arrow-prev { left: -6px; }
	.tfhbp-arrow-next { right: -6px; }
	.tfhbp-cta { flex-direction: column; text-align: center; gap: 18px; padding: 20px; }
	.tfhbp-price { justify-content: center; }
	.tfhbp-buttons { width: 100%; flex-direction: column; }
	.tfhbp-btn { justify-content: center; width: 100%; }
	.tfhbp-lb-nav { width: 40px; height: 40px; }
	.tfhbp-lightbox { padding: 3vh 2vw; }
}

/* ── Motion preferences ── */

@media (prefers-reduced-motion: reduce) {
	.tfhbp-card,
	.tfhbp-cap,
	.tfhbp-lb-figure,
	.tfhbp-lightbox { transition-duration: .01ms !important; }
	.tfhbp-btn:hover { transform: none; }
}

/* ── Host-theme chrome ────────────────────────────────────────────────────────
   Same reasoning as reader.css: the promo page carries its own hero and
   branding, so the theme's text site-title, tagline and duplicate page heading
   are suppressed. Loaded only on a page containing [aynexon_handbook_promo]. */
.tfhb-host-clean .site-branding,
.tfhb-host-clean .site-header__titles,
.tfhb-host-clean .site-header .site-title,
.tfhb-host-clean .site-header .site-description,
.tfhb-host-clean .wp-block-site-title,
.tfhb-host-clean .wp-block-site-tagline,
.tfhb-host-clean .page-header,
.tfhb-host-clean .entry-title{
  display:none !important;
}
.tfhb-host-clean .site-main,
.tfhb-host-clean .page-content{
  margin:0 !important;
  padding:0 !important;
  max-width:none !important;
}

/* ── Back to the site ──
   The promo page hides the theme header, so this is the only way back.
   Pinned top-left so it sits in exactly the same place as the reader's, and
   written as `.tfhbp a.tfhbp-back` (0,2,1) so the host theme's link colour
   cannot repaint it. */
.tfhbp { position: relative; }

.tfhbp a.tfhbp-back,
.tfhbp a.tfhbp-back:link,
.tfhbp a.tfhbp-back:visited {
	position: absolute;
	top: 20px;
	left: 22px;
	z-index: 30;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 9px 15px 9px 12px;
	border: 1px solid rgba(255, 140, 66, .22);
	border-radius: 100px;
	background: rgba(255, 140, 66, .07);
	color: #FFA866;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	box-shadow: none;
	transition: background .16s, border-color .16s, color .16s;
}
.tfhbp a.tfhbp-back:hover {
	background: rgba(255, 140, 66, .15);
	border-color: #FF8C42;
	color: #FF8C42;
}
.tfhbp a.tfhbp-back:focus-visible { outline: 2px solid #FF8C42; outline-offset: 3px; }
.tfhbp a.tfhbp-back svg { fill: none !important; stroke: currentColor !important; display: block; }

@media (max-width: 600px) {
	.tfhbp a.tfhbp-back { top: 12px; left: 12px; padding: 8px 13px 8px 10px; font-size: 13px; }
}

/* The `hidden` attribute is only honoured by the UA rule `[hidden]{display:none}`,
   which any author `display` declaration silently overrides. */
.tfhbp [hidden] { display: none !important; }

/* Same cascade problem as the reader: the host theme styles bare buttons and
   links more specifically than a lone class can answer. */
.tfhbp a.tfhbp-btn,
.tfhbp button.tfhbp-btn { box-shadow: none; text-shadow: none; text-transform: none; letter-spacing: normal; }
