/* ==========================================================================
   QI About — "Our Story" section with animated Iqra medallion
   ========================================================================== */

.qi-about {
	--qi-primary: #1f7a4d;
	--qi-heading: #143d2c;
	--qi-gold: #c49a3a;
	--qi-bg: #ffffff;
	--qi-mint: #dcefe3;
	--qi-text: #5f6b66;
	--qi-ease: cubic-bezier(.22, 1, .36, 1);

	position: relative;
	overflow: hidden;
	padding: 96px 24px;
	background: var(--qi-bg);
	color: var(--qi-text);
	font-size: 16px;
	line-height: 1.7;
	box-sizing: border-box;
}

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

.qi-about__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	align-items: center;
	gap: 80px;
	max-width: 1180px;
	margin: 0 auto;
}

.qi-about--image-right .qi-about__visual {
	order: 2;
}

/* ==========================================================================
   Visual
   ========================================================================== */
.qi-about__visual {
	position: relative;
	padding: 0 0 28px;
}

.qi-about__frame {
	position: relative;
	aspect-ratio: 1 / 1;
	border-radius: 28px;
	overflow: hidden;
	background: var(--qi-mint);
	box-shadow: 0 40px 70px -40px rgba(20, 61, 44, .45), inset 0 0 0 1px rgba(31, 122, 77, .08);
	isolation: isolate;
}

.qi-about__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Drifting hexagon lattice */
.qi-about__lattice {
	position: absolute;
	inset: -20%;
	z-index: -2;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='97' viewBox='0 0 84 97'%3E%3Cg fill='none' stroke='%231f7a4d' stroke-opacity='.16' stroke-width='1.2'%3E%3Cpath d='M42 4 78 24.5v41L42 86 6 65.5v-41z'/%3E%3Cpath d='M42 18 66 31.7v27.6L42 73 18 59.3V31.7z' stroke-opacity='.1'/%3E%3C/g%3E%3C/svg%3E");
	background-size: 84px 97px;
	animation: qi-about-drift 60s linear infinite;
}

.qi-about__glow {
	position: absolute;
	z-index: -1;
	left: 50%;
	top: 50%;
	width: 90%;
	height: 90%;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .35) 38%, transparent 66%);
	animation: qi-about-breathe 6s ease-in-out infinite;
}

/* Medallion */
.qi-about__medallion {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 56%;
	aspect-ratio: 1 / 1;
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
}

.qi-about__ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.qi-about__ring--outer {
	color: rgba(31, 122, 77, .45);
	transform: scale(1.12);
	animation: qi-about-spin 70s linear infinite;
}

.qi-about__ring--main {
	color: rgba(31, 122, 77, .55);
	animation: qi-about-spin 26s linear infinite;
}

.qi-about__ring--gold {
	color: var(--qi-gold);
	opacity: .75;
	animation: qi-about-spin 38s linear infinite reverse;
}

/* 8-point star outline, slowly turning */
.qi-about__star,
.qi-about__star::before {
	position: absolute;
	width: 46%;
	aspect-ratio: 1 / 1;
	border: 1.5px solid rgba(196, 154, 58, .55);
	border-radius: 6px;
}

.qi-about__star {
	animation: qi-about-spin 48s linear infinite;
}

.qi-about__star::before {
	content: "";
	width: 100%;
	inset: -1.5px;
	transform: rotate(45deg);
}

/* Pulses */
.qi-about__pulse {
	position: absolute;
	inset: 12%;
	border-radius: 50%;
	border: 1.5px solid rgba(31, 122, 77, .35);
	animation: qi-about-pulse 4.5s ease-out infinite;
}

.qi-about__pulse--2 {
	animation-delay: 2.25s;
}

/* The word */
.qi-about__word {
	position: relative;
	z-index: 1;
	font-family: "Amiri", "Scheherazade New", "Traditional Arabic", serif;
	font-size: clamp(44px, 6vw, 76px);
	font-weight: 700;
	line-height: 1.4;
	background: linear-gradient(180deg, #2a8f5e, var(--qi-heading));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	filter: drop-shadow(0 6px 10px rgba(20, 61, 44, .18));
	animation: qi-about-float 6s ease-in-out infinite;
}

.qi-about__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 9%;
	text-align: center;
	color: var(--qi-primary);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	opacity: .75;
}

/* Twinkling sparkles */
.qi-about__spark {
	position: absolute;
	width: 14px;
	height: 14px;
	background: var(--qi-gold);
	clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
	animation: qi-about-twinkle 3.2s ease-in-out infinite;
}

.qi-about__spark--1 { top: 14%; left: 16%; }
.qi-about__spark--2 { top: 22%; right: 14%; width: 10px; height: 10px; animation-delay: .8s; }
.qi-about__spark--3 { bottom: 22%; left: 12%; width: 9px; height: 9px; animation-delay: 1.6s; }
.qi-about__spark--4 { bottom: 16%; right: 20%; animation-delay: 2.4s; }

/* Floating stat chips */
.qi-about__chip {
	position: absolute;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 18px 12px 12px;
	border-radius: 16px;
	background: rgba(255, 255, 255, .92);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(31, 122, 77, .12);
	box-shadow: 0 18px 36px -18px rgba(20, 61, 44, .45);
	animation: qi-about-bob 5s ease-in-out infinite;
}

.qi-about__chip--1 { top: 9%; right: -28px; }
.qi-about__chip--2 { top: 46%; left: -32px; animation-delay: -2.5s; }
.qi-about__chip--3 { top: 74%; right: -20px; animation-delay: -1.2s; }

.qi-about__chip-icon {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: linear-gradient(145deg, var(--qi-primary), var(--qi-heading));
	color: #fff;
}

.qi-about__chip--2 .qi-about__chip-icon {
	background: linear-gradient(145deg, #d6ad4b, #a97e22);
}

.qi-about__chip-icon svg {
	width: 20px;
	height: 20px;
}

.qi-about__chip-text {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.qi-about__chip-text strong {
	color: var(--qi-heading);
	font-size: 20px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.qi-about__chip-text small {
	margin-top: 2px;
	color: var(--qi-text);
	font-size: 12px;
	font-weight: 500;
}

/* Est. badge */
.qi-about__badge {
	position: absolute;
	z-index: 4;
	right: -22px;
	bottom: 0;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 22px 13px 14px;
	border-radius: 14px;
	background: linear-gradient(135deg, #d8b04f, #b8892e);
	color: var(--qi-heading);
	font-size: 14px;
	font-weight: 800;
	overflow: hidden;
	box-shadow: 0 20px 36px -16px rgba(150, 110, 30, .65);
	animation: qi-about-bob 5.5s ease-in-out infinite;
	animation-delay: -1s;
}

.qi-about__badge::after {
	content: "";
	position: absolute;
	top: 0;
	left: -60%;
	width: 40%;
	height: 100%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
	transform: skewX(-20deg);
	animation: qi-about-shine 4s ease-in-out infinite 1.5s;
}

.qi-about__badge-icon {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: rgba(20, 61, 44, .14);
}

.qi-about__badge-icon svg {
	width: 18px;
	height: 18px;
}

/* ==========================================================================
   Content
   ========================================================================== */
.qi-about__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 14px;
	margin-bottom: 18px;
	border-radius: 999px;
	background: var(--qi-mint);
	color: var(--qi-primary);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.qi-about__dot {
	position: relative;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--qi-primary);
}

.qi-about__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--qi-primary);
	animation: qi-about-ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}

.qi-about__title {
	margin: 0 0 22px;
	color: var(--qi-heading);
	font-size: clamp(30px, 3.6vw, 44px);
	font-weight: 800;
	line-height: 1.18;
	letter-spacing: -.01em;
}

.qi-about__line {
	display: block;
}

.qi-about__highlight {
	position: relative;
	display: inline-block;
	color: var(--qi-gold);
}

/* Gold swash that draws itself in */
.qi-about__highlight::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -.12em;
	height: .26em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M3 10C55 3 110 3 165 7s90 5 132-3' fill='none' stroke='%23c49a3a' stroke-width='4.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
	transform-origin: left;
	transition: transform 1.1s var(--qi-ease) .7s;
}

.qi-about__text p {
	margin: 0 0 16px;
	font-size: 16.5px;
}

.qi-about__text p:last-child {
	margin-bottom: 0;
}

.qi-about__points {
	display: grid;
	gap: 12px;
	margin: 28px 0 0;
	padding: 0;
	list-style: none;
}

.qi-about__point {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	color: var(--qi-heading);
	font-size: 15.5px;
	font-weight: 500;
	line-height: 1.45;
}

.qi-about__check {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--qi-primary);
	color: #fff;
	box-shadow: 0 6px 12px -6px rgba(31, 122, 77, .8);
	transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
	transition-delay: calc(var(--i, 0) * 150ms + 900ms);
}

.qi-about__check svg {
	width: 16px;
	height: 16px;
}

.qi-about__check path {
	stroke-dasharray: 20;
	stroke-dashoffset: 0;
	transition: stroke-dashoffset .5s ease-out;
	transition-delay: calc(var(--i, 0) * 150ms + 1.1s);
}

.qi-about__btn,
.qi-about__btn:visited {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 32px;
	padding: 14px 28px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--qi-primary), var(--qi-heading));
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 14px 28px -14px rgba(20, 61, 44, .75);
	transition: transform .35s var(--qi-ease), box-shadow .35s;
}

.qi-about__btn svg {
	width: 18px;
	height: 18px;
	transition: transform .35s var(--qi-ease);
}

.qi-about__btn:hover {
	color: #fff;
	transform: translateY(-2px);
}

.qi-about__btn:hover svg {
	transform: translateX(4px);
}

/* ==========================================================================
   Scroll-in choreography
   ========================================================================== */
.qi-about--animate.qi-ready .qi-about__frame {
	opacity: 0;
	transform: scale(.92) rotate(-2deg);
	transition: opacity .9s var(--qi-ease), transform 1.1s var(--qi-ease);
}

.qi-about--animate.qi-ready .qi-about__word {
	clip-path: inset(0 0 0 100%);
	transition: clip-path 1.4s var(--qi-ease) .6s;
}

.qi-about--animate.qi-ready .qi-about__chip,
.qi-about--animate.qi-ready .qi-about__badge {
	opacity: 0;
	translate: 0 24px;
	transition: opacity .7s var(--qi-ease), translate .8s var(--qi-ease);
}

.qi-about--animate.qi-ready .qi-about__chip--1 { transition-delay: .7s; }
.qi-about--animate.qi-ready .qi-about__chip--2 { transition-delay: .9s; }
.qi-about--animate.qi-ready .qi-about__chip--3 { transition-delay: 1.1s; }
.qi-about--animate.qi-ready .qi-about__badge   { transition-delay: 1.2s; }

.qi-about--animate.qi-ready .qi-about__content > * {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity .75s var(--qi-ease), transform .75s var(--qi-ease);
}

.qi-about--animate.qi-ready .qi-about__content > :nth-child(1) { transition-delay: .15s; }
.qi-about--animate.qi-ready .qi-about__content > :nth-child(2) { transition-delay: .25s; }
.qi-about--animate.qi-ready .qi-about__content > :nth-child(3) { transition-delay: .4s; }
.qi-about--animate.qi-ready .qi-about__content > :nth-child(4) { transition-delay: .55s; }
.qi-about--animate.qi-ready .qi-about__content > :nth-child(5) { transition-delay: .7s; }

.qi-about--animate.qi-ready .qi-about__highlight::after {
	transform: scaleX(0);
}

.qi-about--animate.qi-ready .qi-about__check {
	transform: scale(0);
}

.qi-about--animate.qi-ready .qi-about__check path {
	stroke-dashoffset: 20;
}

/* Visible state */
.qi-about--animate.qi-ready.is-visible .qi-about__frame {
	opacity: 1;
	transform: none;
}

.qi-about--animate.qi-ready.is-visible .qi-about__word {
	clip-path: inset(0 0 0 0);
}

.qi-about--animate.qi-ready.is-visible .qi-about__chip,
.qi-about--animate.qi-ready.is-visible .qi-about__badge {
	opacity: 1;
	translate: 0 0;
}

.qi-about--animate.qi-ready.is-visible .qi-about__content > * {
	opacity: 1;
	transform: none;
}

.qi-about--animate.qi-ready.is-visible .qi-about__highlight::after {
	transform: scaleX(1);
}

.qi-about--animate.qi-ready.is-visible .qi-about__check {
	transform: scale(1);
}

.qi-about--animate.qi-ready.is-visible .qi-about__check path {
	stroke-dashoffset: 0;
}

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes qi-about-spin    { to { transform: rotate(360deg); } }
@keyframes qi-about-drift   { to { background-position: 84px 97px; } }
@keyframes qi-about-breathe { 50% { transform: translate(-50%, -50%) scale(1.08); opacity: .8; } }
@keyframes qi-about-float   { 50% { transform: translateY(-6px); } }
@keyframes qi-about-bob     { 50% { transform: translateY(-10px); } }
@keyframes qi-about-ping    { 75%, 100% { transform: scale(2.4); opacity: 0; } }

@keyframes qi-about-pulse {
	0%   { transform: scale(.85); opacity: .9; }
	100% { transform: scale(1.55); opacity: 0; }
}

@keyframes qi-about-twinkle {
	0%, 100% { transform: scale(.4) rotate(0deg); opacity: .25; }
	50%      { transform: scale(1) rotate(45deg); opacity: 1; }
}

@keyframes qi-about-shine {
	0%, 60% { left: -60%; }
	100%    { left: 130%; }
}

/* the ring that sits outside the main ring keeps its scale while spinning */
.qi-about__ring--outer {
	animation-name: qi-about-spin-outer;
}

@keyframes qi-about-spin-outer {
	from { transform: scale(1.12) rotate(0deg); }
	to   { transform: scale(1.12) rotate(360deg); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
	.qi-about__inner {
		gap: 56px;
	}

	.qi-about__chip--1 { right: -12px; }
	.qi-about__chip--2 { left: -14px; }
	.qi-about__badge   { right: -8px; }
}

@media (max-width: 860px) {
	.qi-about {
		padding: 64px 20px;
	}

	.qi-about__inner {
		grid-template-columns: 1fr;
		gap: 48px;
	}

	.qi-about--image-right .qi-about__visual {
		order: 0;
	}

	.qi-about__visual {
		max-width: 480px;
		width: 100%;
		margin: 0 auto;
	}
}

@media (max-width: 560px) {
	.qi-about {
		padding: 56px 16px;
	}

	.qi-about__frame {
		border-radius: 22px;
	}

	.qi-about__chip {
		gap: 8px;
		padding: 8px 12px 8px 8px;
		border-radius: 12px;
	}

	.qi-about__chip-icon {
		width: 32px;
		height: 32px;
		border-radius: 9px;
	}

	.qi-about__chip-icon svg {
		width: 16px;
		height: 16px;
	}

	.qi-about__chip-text strong {
		font-size: 16px;
	}

	.qi-about__chip-text small {
		font-size: 10.5px;
	}

	.qi-about__chip--1 { top: 5%; right: -6px; }
	.qi-about__chip--2 { top: 52%; left: -6px; }
	.qi-about__chip--3 { display: none; }

	.qi-about__badge {
		right: 50%;
		translate: 50% 0 !important;
		padding: 10px 16px 10px 10px;
		font-size: 12.5px;
		white-space: nowrap;
	}

	.qi-about--animate.qi-ready:not(.is-visible) .qi-about__badge {
		translate: 50% 24px !important;
	}

	.qi-about__caption {
		font-size: 10px;
		bottom: 14%;
	}

	.qi-about__title {
		font-size: 28px;
	}

	/* Underline follows each wrapped line of the highlight */
	.qi-about__highlight {
		display: inline;
		padding-bottom: .12em;
		background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M3 10C55 3 110 3 165 7s90 5 132-3' fill='none' stroke='%23c49a3a' stroke-width='4.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left bottom / 100% .22em;
		-webkit-box-decoration-break: clone;
		box-decoration-break: clone;
	}

	.qi-about__highlight::after {
		content: none;
	}

	.qi-about__text p {
		font-size: 15.5px;
	}
}

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

	.qi-about--animate.qi-ready .qi-about__frame,
	.qi-about--animate.qi-ready .qi-about__chip,
	.qi-about--animate.qi-ready .qi-about__badge,
	.qi-about--animate.qi-ready .qi-about__content > * {
		opacity: 1;
		transform: none;
		translate: 0 0;
	}

	.qi-about--animate.qi-ready .qi-about__word {
		clip-path: none;
	}

	.qi-about--animate.qi-ready .qi-about__highlight::after,
	.qi-about--animate.qi-ready .qi-about__check {
		transform: none;
	}

	.qi-about--animate.qi-ready .qi-about__check path {
		stroke-dashoffset: 0;
	}
}
