/* ==========================================================================
   Home hero: 5-service network (templates/home/hero-v1.php + assets/js/home-hero-v1.js).
   Front page only. Scoped under .ah-hero. Uses the theme's --at-* tokens.
   CTAs use the shared .at-btn. Decorative motion pauses off-screen, never on hover.
   ========================================================================== */
.ah-hero {
	--ah-teal: var(--at-teal, #57b3b7);
	--ah-btn: var(--at-btn, #377d81);
	--ah-btn-hover: var(--at-btn-hover, #2f6c6f);
	--ah-ink: var(--at-ink, #020202);
	--ah-body: var(--at-body, #252525);
	--ah-muted: var(--at-muted, #666);
	--ah-line: var(--at-line, #ececf1);
	--ah-soft: var(--at-soft, #f6f6fa);
	--ah-gutter: var(--at-gutter, clamp(16px, 4vw, 240px));
	--ah-ease: var(--at-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
	--ah-deep: #316466;
	--ah-mint: #71cdd0;
	--ah-mint-soft: #e3f6f7;
	--ah-amber: #f0a35e;        /* secondary accent — use sparingly */
	--ah-amber-soft: #fdf1e5;
	--ah-node: clamp(54px, 5.2vw, 72px);
	--ah-dur: 5200ms; /* auto-cycle interval, mirrored in JS */

	padding-top: clamp(16px, 2.5vw, 40px);
	color: var(--ah-body);
	font-family: Kalameh, Vazirmatn, Tahoma, sans-serif;
	direction: rtl;
}
.ah-hero *, .ah-hero *::before, .ah-hero *::after { box-sizing: border-box; }
:where(.ah-hero) :where(h1, h2, h3, p, ul, figure) { margin: 0; }
:where(.ah-hero) ul { padding: 0; list-style: none; }
:where(.ah-hero) a { color: inherit; }

.ah-icon { width: 24px; height: 24px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ah-hl { color: var(--ah-teal); }

/* ---------- box ---------- */
.ah-hero__box {
	position: relative; isolation: isolate; overflow: hidden;
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); grid-template-areas: "text net";
	align-items: center; gap: clamp(24px, 4vw, 64px);
	min-height: min(780px, calc(100vh - 120px)); padding: clamp(32px, 4vw, 64px);
	border-radius: 40px;
	background:
		radial-gradient(55% 70% at 22% 45%, rgba(113, 205, 208, .20), transparent 70%),
		radial-gradient(45% 55% at 95% 100%, rgba(87, 179, 183, .10), transparent 70%),
		linear-gradient(180deg, #fff, var(--ah-soft));
	box-shadow: 0 0 3px rgba(43, 43, 43, .22);
}
.ah-hero__particles { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

/* ---------- text column ---------- */
.ah-hero__text { grid-area: text; display: flex; flex-direction: column; gap: 0; min-width: 0; }
.ah-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--ah-teal); font-size: 15px; font-weight: 500; }
.ah-eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.ah-hero__title { color: var(--ah-ink); font-size: clamp(26px, 10px + 2.1vw, 42px); font-weight: 700; line-height: 1.6; text-wrap: balance; }
.ah-hero__lead { max-width: 560px; margin-top: 14px; color: var(--ah-muted); font-size: 17px; line-height: 2; }

/* active-service card */
.ah-detail {
	position: relative; margin-top: 28px; padding: 22px 22px 18px; border-radius: 24px;
	background: rgba(255, 255, 255, .86); backdrop-filter: blur(8px);
	box-shadow: 0 0 0 1px var(--ah-line), 0 18px 40px -26px rgba(15, 58, 60, .45);
	overflow: hidden;
}
.ah-detail__top { display: flex; align-items: center; gap: 14px; }
.ah-detail__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--ah-btn); color: #fff; flex: 0 0 auto; }
.ah-detail__k { color: #c97a35; font-size: 13px; font-weight: 500; }
.ah-detail__title { color: var(--ah-ink); font-size: 19px; font-weight: 700; line-height: 1.5; }
.ah-detail__text { margin-top: 12px; color: var(--ah-muted); line-height: 2; min-height: 4em; }
.ah-detail__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.ah-detail__count { color: var(--ah-muted); font-size: 13px; }
.ah-detail__count b { color: var(--ah-ink); }
.ah-detail__bar { position: absolute; inset: auto 0 0 0; height: 3px; background: var(--ah-line); }
.ah-detail__bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); margin-inline-start: 0; background: linear-gradient(90deg, var(--ah-teal), var(--ah-amber)); }
.ah-detail.is-swap .ah-detail__top, .ah-detail.is-swap .ah-detail__text { animation: ah-swap .5s var(--ah-ease); }
@keyframes ah-swap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ah-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ah-btn); font-weight: 600; text-decoration: none; }
.ah-link .ah-icon { width: 18px; height: 18px; transition: transform .3s var(--ah-ease); }
.ah-link:hover .ah-icon, .ah-link:focus-visible .ah-icon { transform: translateX(-4px); }

.ah-actions { display: flex; flex-wrap: wrap; gap: 16px 20px; margin-top: 28px; }

/* CTAs use the shared .at-btn / .at-btn--outline (atiehertebat_button). */
.ah-actions .at-btn { /* layout only; look comes from style.css */ }

/* ---------- network ---------- */
.ah-net { grid-area: net; position: relative; width: 100%; max-width: 620px; aspect-ratio: 1; margin-inline: auto; }
.ah-net__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.ah-ring { fill: none; stroke: rgba(55, 125, 129, .18); stroke-width: 1.2; }
.ah-ring--dash { stroke-dasharray: 2 8; stroke-linecap: round; transform-origin: 300px 300px; animation: ah-spin 80s linear infinite; }
.ah-ring--inner { stroke-dasharray: 1 10; transform-origin: 300px 300px; animation: ah-spin 50s linear infinite reverse; }
@keyframes ah-spin { to { transform: rotate(360deg); } }

.ah-mesh { stroke: rgba(55, 125, 129, .14); stroke-width: 1; stroke-dasharray: 4 6; }
.ah-spoke { stroke: rgba(55, 125, 129, .22); stroke-width: 1.5; transition: stroke .4s ease, stroke-width .4s ease; }
.ah-spoke.is-on { stroke: var(--ah-teal); stroke-width: 2.5; stroke-dasharray: 8 6; animation: ah-flow .9s linear infinite; }
@keyframes ah-flow { to { stroke-dashoffset: -14; } }

.ah-packet { fill: var(--ah-teal); opacity: .75; }
.ah-packet--alt { fill: var(--ah-amber); opacity: .7; }
.ah-packet.is-on { opacity: 1; filter: drop-shadow(0 0 4px rgba(87, 179, 183, .9)); }
.ah-packet--alt.is-on { filter: drop-shadow(0 0 4px rgba(240, 163, 94, .85)); }

/* hub */
.ah-hub {
	position: absolute; left: 50%; top: 50%; z-index: 2; display: grid; place-items: center;
	width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
	background: radial-gradient(circle at 50% 35%, #fff, #f1fbfb); box-shadow: 0 0 0 1px rgba(87, 179, 183, .25), 0 24px 50px -24px rgba(15, 58, 60, .55);
}
.ah-hub img { width: 62%; height: auto; }
.ah-hub::before, .ah-hub::after { content: ""; position: absolute; inset: -10%; border-radius: 50%; border: 1.5px solid rgba(113, 205, 208, .45); animation: ah-ping 3.2s var(--ah-ease) infinite; }
.ah-hub::after { animation-delay: 1.6s; border-color: rgba(240, 163, 94, .35); }
@keyframes ah-ping { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }

/* service nodes (buttons) */
.ah-node {
	position: absolute; left: var(--x); top: var(--y); z-index: 3; transform: translate(-50%, -50%);
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	padding: 0; border: 0; background: none; font: inherit; color: var(--ah-body); cursor: pointer;
}
.ah-node__dot {
	position: relative; display: grid; place-items: center; width: var(--ah-node); height: var(--ah-node); border-radius: 22px;
	background: #fff; color: var(--ah-btn); box-shadow: 0 0 0 1px var(--ah-line), 0 14px 28px -16px rgba(15, 58, 60, .5);
	transition: transform .4s var(--ah-ease), background-color .3s ease, color .3s ease, box-shadow .3s ease;
}
.ah-node__dot .ah-icon { width: calc(var(--ah-node) * .44); height: calc(var(--ah-node) * .44); }
.ah-node__label { padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .9); font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: 0 0 0 1px var(--ah-line); transition: background-color .3s ease, color .3s ease; }
.ah-node:hover .ah-node__dot { transform: translateY(-3px); }
.ah-node[aria-pressed="true"] .ah-node__dot { background: var(--ah-btn); color: #fff; transform: scale(1.08); box-shadow: 0 0 0 6px rgba(113, 205, 208, .22), 0 18px 34px -14px rgba(55, 125, 129, .7); }
.ah-node[aria-pressed="true"] .ah-node__label { background: var(--ah-deep); color: #fff; box-shadow: none; }
.ah-node__dot::after { content: ""; position: absolute; top: -3px; inset-inline-end: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--ah-amber); box-shadow: 0 0 0 3px #fff; transform: scale(0); transition: transform .35s var(--ah-ease); }
.ah-node[aria-pressed="true"] .ah-node__dot::after { transform: scale(1); }
.ah-node:focus-visible { outline: none; }
.ah-node:focus-visible .ah-node__dot { outline: 2px solid var(--ah-ink); outline-offset: 4px; }
.ah-node { animation: ah-bob 6s var(--ah-ease) infinite; animation-delay: calc(var(--i) * -1s); }
@keyframes ah-bob { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }

/* ---------- responsive ---------- */
@media (max-width: 1199.98px) {
	.ah-node__label { font-size: 13px; }
}
@media (max-width: 991.98px) {
	.ah-hero__box { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "net"; min-height: 0; }
	.ah-net { max-width: 520px; }
	.ah-hero__text { display: contents; }
	.ah-eyebrow, .ah-hero__title, .ah-hero__lead { grid-area: auto; }
	/* order: heading → network → detail card → actions */
	.ah-hero__head { order: 1; }
	.ah-net { order: 2; }
	.ah-detail { order: 3; margin-top: 0; }
	.ah-actions { order: 4; margin-top: 0; }
}
@media (max-width: 767.98px) {
	.ah-hero__box { padding: 28px 18px; border-radius: 28px; gap: 22px; }
	.ah-hero__lead { font-size: 15px; }
	.ah-node__label { font-size: 11px; padding: 2px 8px; }
	.ah-hero { --ah-node: 48px; }
	.ah-node__dot { border-radius: 15px; }
	.ah-hub img { width: 70%; }
	.ah-actions .at-btn { flex: 1 1 auto; justify-content: center; }
}

/* Pause decorative motion while the hero is off-screen (toggled by JS). */
.ah-hero.is-away .ah-ring--dash,
.ah-hero.is-away .ah-ring--inner,
.ah-hero.is-away .ah-spoke.is-on,
.ah-hero.is-away .ah-hub::before,
.ah-hero.is-away .ah-hub::after,
.ah-hero.is-away .ah-node,
.ah-hero.is-away .ah-detail.is-swap .ah-detail__top,
.ah-hero.is-away .ah-detail.is-swap .ah-detail__text {
	animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
	.ah-hero *, .ah-hero *::before, .ah-hero *::after { animation: none !important; transition: none !important; }
}
