/* ==========================================================================
   STM Legal — sections added in 1.9.0
   --------------------------------------------------------------------------
   Everything here is built from the tokens in main.css: the same teal and
   amber, the same spacing ramp, the same two radii, the same shadow pair. No
   new colour, no new typeface, no new radius. The one motif — a stroke that
   runs past its own frame — is reused at larger scale in the hero frame, the
   feature image and the attestation route.

   Logical properties throughout, so the file serves RTL and LTR alike. The
   few rotations that have to mirror are flipped under .stm-dir-rtl.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero — split with a picture
   -------------------------------------------------------------------------- */

.stm-hero__visual {
	display: none;
	margin: 0;
}

@media (min-width: 62em) {
	.stm-hero__grid {
		display: grid;
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
		gap: clamp(2.5rem, 1rem + 4vw, 5rem);
		align-items: center;
	}

	.stm-hero__visual {
		display: block;
		position: relative;
		justify-self: end;
		inline-size: min(100%, 25rem);
		margin-block-end: var(--stm-s7);
	}

	.stm-hero__photo {
		position: relative;
		z-index: 1;
		display: block;
		inline-size: 100%;
		aspect-ratio: 4 / 5;
		object-fit: cover;
		border-radius: var(--stm-radius-lg);
		box-shadow: var(--stm-shadow-lg);
	}

	/* The hairline frame sits behind the photo, pushed down and outward. */
	.stm-hero__frame {
		position: absolute;
		inset-block: 1.25rem -1.25rem;
		inset-inline: 1.25rem -1.25rem;
		border: 1px solid var(--stm-line-strong);
		border-radius: var(--stm-radius-lg);
	}

	/* …and the stem runs past the bottom of it. */
	.stm-hero__stem {
		position: absolute;
		z-index: 2;
		inset-block-end: -3.5rem;
		inset-inline-end: 2.75rem;
		inline-size: 1px;
		block-size: 7rem;
		background: linear-gradient(to bottom, var(--stm-teal) 0 62%, var(--stm-gold) 62% 100%);
		transform-origin: 50% 0;
	}

	.stm-hero__pair {
		position: absolute;
		z-index: 3;
		inset-block-end: 2rem;
		inset-inline-start: -2rem;
		display: inline-flex;
		align-items: center;
		gap: var(--stm-s3);
		padding: 0.7rem 1.1rem;
		background: var(--stm-card);
		border: 1px solid var(--stm-border);
		border-radius: var(--stm-radius);
		box-shadow: var(--stm-shadow);
		font-size: 0.95rem;
		font-weight: 600;
		line-height: 1.4;
		color: var(--stm-ink);
		white-space: nowrap;
	}

	.stm-hero__pair-rule {
		inline-size: 2rem;
		block-size: 1px;
		background: var(--stm-teal);
	}
}

/* --------------------------------------------------------------------------
   2. Cards — pointer spotlight
   --------------------------------------------------------------------------
   A soft tint follows the pointer across the card. The position arrives as
   --mx / --my from sections.js; without it the card is simply a card.
   -------------------------------------------------------------------------- */

.stm-card--spot::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(16rem circle at var(--mx, 50%) var(--my, 0%), var(--stm-teal-soft), transparent 70%);
	opacity: 0;
	transition: opacity var(--stm-slow) var(--stm-ease);
}

@media (hover: hover) {
	.stm-card--spot:hover::after {
		opacity: 1;
	}
}

.stm-card--spot > * {
	position: relative;
	z-index: 1;
}

.stm-types__more {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--stm-s4) var(--stm-s5);
	margin-block-start: var(--stm-s7);
	color: var(--stm-body);
	text-align: center;
}

/* --------------------------------------------------------------------------
   3. Feature — picture beside text
   -------------------------------------------------------------------------- */

.stm-feature {
	display: grid;
	gap: var(--stm-s7);
	align-items: center;
}

@media (min-width: 62em) {
	.stm-feature {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: clamp(3rem, 1rem + 5vw, 6rem);
	}
}

.stm-feature__media {
	position: relative;
	margin: 0;
	margin-inline-end: 1rem;
	margin-block-end: 1rem;
}

.stm-feature__media::before {
	content: "";
	position: absolute;
	inset-block: 1rem -1rem;
	inset-inline: 1rem -1rem;
	border: 1px solid var(--stm-line-strong);
	border-radius: var(--stm-radius-lg);
}

.stm-feature__media img {
	position: relative;
	display: block;
	inline-size: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--stm-radius-lg);
	box-shadow: var(--stm-shadow-lg);
}

.stm-feature__body .stm-heading {
	margin-block-end: var(--stm-s5);
}

.stm-feature__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--stm-s3);
	margin-block-start: var(--stm-s6);
}

/* Checklist */
.stm-checks {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--stm-s3);
}

.stm-checks li {
	display: flex;
	align-items: flex-start;
	gap: var(--stm-s3);
	color: var(--stm-ink);
	font-weight: 500;
	line-height: 1.7;
}

.stm-checks .stm-icon {
	inline-size: 1.5rem;
	block-size: 1.5rem;
	padding: 0.25rem;
	margin-block-start: 0.15rem;
	border-radius: 50%;
	background: var(--stm-teal-soft);
	color: var(--stm-teal-deep);
	stroke-width: 2.2;
}

@media (min-width: 40em) {
	.stm-checks--titles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--stm-s3) var(--stm-s5);
	}
}

.stm-disclaimer--center {
	max-width: 52rem;
	margin-inline: auto;
}

/* --------------------------------------------------------------------------
   4. Passport stage
   --------------------------------------------------------------------------
   Two objects: the passport, and the sheet it is translated onto. The sheet
   is ruled paper — it carries no invented text. Resting state is the finished
   picture, so nothing depends on the animation having run.
   -------------------------------------------------------------------------- */

.stm-passport {
	position: relative;
	inline-size: min(100%, 27rem);
	aspect-ratio: 1 / 1;
	margin-inline: auto;
}

.stm-passport__cover,
.stm-passport__sheet {
	position: absolute;
	inset-block-start: 6%;
	inline-size: 52%;
	will-change: transform;
}

.stm-passport__cover {
	z-index: 2;
	inset-inline-start: 6%;
	transform: rotate(-5deg);
	filter: drop-shadow(0 22px 26px rgba(14, 47, 52, .28));
}

.stm-passport__cover img {
	display: block;
	inline-size: 100%;
	block-size: auto;
	border-radius: 4px 10px 10px 4px;
}

.stm-passport__sheet {
	z-index: 1;
	inset-inline-end: 4%;
	aspect-ratio: 635 / 900;
	display: flex;
	flex-direction: column;
	gap: 7%;
	padding: 12% 10%;
	background: var(--stm-card);
	border: 1px solid var(--stm-border);
	border-radius: 6px;
	box-shadow: var(--stm-shadow-lg);
	transform: rotate(6deg);
}

.stm-dir-rtl .stm-passport__cover { transform: rotate(5deg); }
.stm-dir-rtl .stm-passport__sheet { transform: rotate(-6deg); }
.stm-dir-rtl .stm-passport__cover img { border-radius: 10px 4px 4px 10px; }

.stm-passport__tag {
	align-self: flex-start;
	padding: 0.2em 0.7em;
	border: 1px solid var(--stm-line-strong);
	border-radius: 100px;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--stm-teal-deep);
}

.stm-passport__line {
	display: block;
	block-size: 2px;
	border-radius: 2px;
	background: var(--stm-border);
	transform-origin: var(--stm-line-origin, 0) 50%;
}

.stm-dir-rtl .stm-passport__line { --stm-line-origin: 100%; }

.stm-passport__line--head {
	block-size: 4px;
	inline-size: 62%;
	background: var(--stm-teal);
}

.stm-passport__line--short { inline-size: 54%; }

.stm-passport__seal {
	margin-block-start: auto;
	align-self: flex-end;
	inline-size: 26%;
	aspect-ratio: 1;
	border: 2px solid var(--stm-gold);
	border-radius: 50%;
	box-shadow: inset 0 0 0 4px var(--stm-card), inset 0 0 0 5px var(--stm-gold);
	opacity: .85;
}

.stm-passport__label {
	position: absolute;
	inset-block-end: 2%;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--stm-body);
}

.stm-passport__label--from { inset-inline-start: 6%; inline-size: 52%; text-align: center; }
.stm-passport__label--to { inset-inline-end: 4%; inline-size: 52%; text-align: center; }

/* --------------------------------------------------------------------------
   5. Choice chips (request builder, attestation route)
   -------------------------------------------------------------------------- */

.stm-builder__group {
	margin: 0;
	padding: 0;
	border: 0;
	min-inline-size: 0;
}

.stm-builder__legend {
	padding: 0;
	margin-block-end: var(--stm-s3);
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--stm-ink);
}

.stm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--stm-s2);
}

.stm-chip {
	position: relative;
	display: inline-flex;
	cursor: pointer;
}

.stm-chip input {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.stm-chip span {
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
	padding: 0.5rem 1.05rem;
	background: var(--stm-card);
	border: 1px solid var(--stm-border);
	border-radius: 100px;
	color: var(--stm-body);
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.4;
	transition:
		background var(--stm-fast) var(--stm-ease),
		border-color var(--stm-fast) var(--stm-ease),
		color var(--stm-fast) var(--stm-ease);
}

.stm-chip:hover span {
	border-color: var(--stm-line-strong);
	color: var(--stm-ink);
}

.stm-chip input:checked + span {
	background: var(--stm-teal-soft);
	border-color: var(--stm-teal);
	color: var(--stm-teal-deep);
	font-weight: 600;
}

.stm-chip input:focus-visible + span {
	outline: 2px solid var(--stm-teal-deep);
	outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   6. Request builder
   -------------------------------------------------------------------------- */

.stm-builder {
	display: grid;
	gap: var(--stm-s6);
	padding: clamp(1.5rem, 1rem + 2.5vw, 3rem);
	background: var(--stm-card);
	border: 1px solid var(--stm-border);
	border-radius: var(--stm-radius-lg);
	box-shadow: var(--stm-shadow);
}

@media (min-width: 62em) {
	.stm-builder {
		grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
		gap: clamp(2.5rem, 1rem + 4vw, 5rem);
		align-items: start;
	}
}

.stm-builder__intro .stm-heading {
	margin-block-end: 0;
}

.stm-builder__form {
	display: grid;
	gap: var(--stm-s5);
}

.stm-builder__foot {
	display: grid;
	gap: var(--stm-s4);
	padding-block-start: var(--stm-s5);
	border-block-start: 1px solid var(--stm-line);
}

.stm-builder__summary {
	margin: 0;
	color: var(--stm-body);
	font-size: 0.95rem;
	line-height: 1.8;
	white-space: pre-line;
}

.stm-builder__summary:empty {
	display: none;
}

.stm-builder__send {
	justify-self: start;
}

@media (max-width: 39.99em) {
	.stm-builder__send {
		justify-self: stretch;
	}
}

/* --------------------------------------------------------------------------
   7. Attestation route
   --------------------------------------------------------------------------
   A numbered sequence joined by one line: vertical on phones, horizontal from
   56em up. The line is the stem motif laid along the route.
   -------------------------------------------------------------------------- */

.stm-path__controls {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--stm-s5) var(--stm-s8);
	margin-block-end: var(--stm-s7);
}

.stm-path__route + .stm-path__route {
	margin-block-start: var(--stm-s7);
}

.stm-path__route-title {
	font-size: 1.15rem;
	margin-block-end: var(--stm-s5);
}

.stm-path.is-ready .stm-path__route-title {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.stm-path.is-ready .stm-path__route[hidden],
.stm-path.is-ready .stm-path__text[hidden] {
	display: none;
}

.stm-path.is-ready .stm-path__route + .stm-path__route {
	margin-block-start: 0;
}

.stm-path.is-ready .stm-path__kind {
	display: none;
}

.stm-path__kind::after {
	content: " — ";
	font-weight: 400;
}

.stm-path__steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	counter-reset: stm-path;
}

.stm-path__step {
	counter-increment: stm-path;
	position: relative;
	padding-inline-start: 4rem;
	padding-block-end: var(--stm-s6);
}

.stm-path__step:last-child {
	padding-block-end: 0;
}

/* The line between one node and the next. */
.stm-path__step::before {
	content: "";
	position: absolute;
	inset-block: 2.75rem 0;
	inset-inline-start: calc(1.375rem - 0.5px);
	inline-size: 1px;
	background: var(--stm-line-strong);
}

.stm-path__step:last-child::before {
	display: none;
}

.stm-path__node {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	inline-size: 2.75rem;
	block-size: 2.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--stm-teal);
	border-radius: 50%;
	background: var(--stm-card);
	color: var(--stm-teal-deep);
	font-family: var(--stm-font-body);
	font-size: 1rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.stm-path__node::before {
	content: counter(stm-path);
}

.stm-path__step:last-child .stm-path__node {
	background: var(--stm-teal);
	color: var(--stm-ink-on-teal);
}

.stm-path__title {
	margin-block: 0 var(--stm-s2);
	padding-block-start: 0.45rem;
	font-size: 1.1rem;
	line-height: 1.5;
}

.stm-lang-ar .stm-path__title,
.stm-lang-ur .stm-path__title {
	font-size: 1.3rem;
}

.stm-path__text {
	margin: 0;
	color: var(--stm-body);
	font-size: 0.98rem;
	line-height: 1.8;
}

.stm-path__text + .stm-path__text {
	margin-block-start: var(--stm-s2);
}

@media (min-width: 56em) {
	.stm-path__steps {
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
		gap: var(--stm-s5);
	}

	.stm-path__step {
		padding-inline-start: 0;
		padding-block: 4rem 0;
	}

	.stm-path__step::before {
		inset-block: calc(1.375rem - 0.5px) auto;
		inset-inline: 2.75rem calc(-1 * var(--stm-s5));
		inline-size: auto;
		block-size: 1px;
	}
}

/* --------------------------------------------------------------------------
   8. Service-area cards
   -------------------------------------------------------------------------- */

.stm-areas {
	display: grid;
	gap: var(--stm-s5);
}

@media (min-width: 40em) {
	.stm-areas {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 62em) {
	.stm-areas {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.stm-areas > * { grid-column: span 2; }

	/* Five: two wide above three. Four: two rows of two. Two: side by side. */
	.stm-areas--5 > :nth-child(-n+2),
	.stm-areas--4 > *,
	.stm-areas--2 > * { grid-column: span 3; }
}

.stm-area-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--stm-card);
	border: 1px solid var(--stm-border);
	border-radius: var(--stm-radius-lg);
	overflow: hidden;
	box-shadow: var(--stm-shadow);
	transition:
		border-color var(--stm-slow) var(--stm-ease),
		box-shadow var(--stm-slow) var(--stm-ease),
		transform var(--stm-slow) var(--stm-ease);
}

.stm-area-card:hover,
.stm-area-card:focus-within {
	border-color: var(--stm-line-strong);
	box-shadow: var(--stm-shadow-lg);
	transform: translateY(-3px);
}

.stm-area-card__media {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--stm-bg-soft);
}

.stm-area-card__media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	transition: transform 900ms var(--stm-ease);
}

.stm-area-card:hover .stm-area-card__media img {
	transform: scale(1.04);
}

.stm-area-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--stm-s3);
	flex: 1;
	padding: var(--stm-s5);
}

/* The icon tile straddles the picture's edge. */
.stm-area-card__body .stm-card__icon {
	align-self: flex-start;
	margin-block: calc(-1 * var(--stm-s5) - 1.75rem) 0;
	background: var(--stm-card);
	box-shadow: var(--stm-shadow);
}

.stm-area-card:hover .stm-card__icon {
	background: var(--stm-card);
}

.stm-area-card__title {
	margin: var(--stm-s2) 0 0;
	font-size: 1.28rem;
	color: var(--stm-teal-deep);
}

[data-scheme="dark"] .stm-area-card__title {
	color: var(--stm-ink);
}

.stm-area-card__title a {
	color: inherit;
	text-decoration: none;
}

.stm-area-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.stm-area-card__text {
	margin: 0;
	flex: 1;
	color: var(--stm-body);
	font-size: 1.03rem;
	line-height: 1.8;
}

.stm-area-card:hover .stm-card__more .stm-icon {
	transform: translateX(3px);
}

.stm-dir-rtl .stm-area-card:hover .stm-card__more .stm-icon {
	transform: scaleX(-1) translateX(3px);
}

/* --------------------------------------------------------------------------
   9. Audiences
   -------------------------------------------------------------------------- */

.stm-audiences {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--stm-s5) var(--stm-s6);
}

@media (min-width: 40em) {
	.stm-audiences { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 62em) {
	.stm-audiences { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.stm-audience {
	position: relative;
	display: flex;
	gap: var(--stm-s4);
	padding-block-start: var(--stm-s5);
	border-block-start: 1px solid var(--stm-line);
}

.stm-audience::after {
	content: "";
	position: absolute;
	inset-block-start: -1px;
	inset-inline-start: 0;
	inline-size: 2rem;
	block-size: 1px;
	background: var(--stm-teal);
}

.stm-audience > .stm-icon {
	inline-size: 1.6rem;
	block-size: 1.6rem;
	margin-block-start: 0.2rem;
	color: var(--stm-teal);
}

.stm-audience__title {
	margin-block: 0 var(--stm-s2);
	font-size: 1.1rem;
}

.stm-lang-ar .stm-audience__title,
.stm-lang-ur .stm-audience__title {
	font-size: 1.3rem;
}

.stm-audience__text {
	margin: 0;
	color: var(--stm-body);
	font-size: 0.98rem;
	line-height: 1.8;
}

/* --------------------------------------------------------------------------
   10. Motion
   --------------------------------------------------------------------------
   Two classes, set at different moments:

   .stm-anim  is written onto <html> by a one-line script in the head, before
              first paint, and only when motion is on and the visitor has not
              asked for less of it. It hides what the hero sequence is about to
              bring in, so nothing flashes and then jumps.
   .stm-gsap  is added by main.js once GSAP has actually loaded, and hands the
              scroll reveals over from the built-in observer to ScrollTrigger.

   Every hidden state has a way back that does not need JavaScript: a CSS
   animation that simply shows the element after three seconds. If a script
   fails to load, the page is late by a moment, never blank.
   -------------------------------------------------------------------------- */

@keyframes stm-failsafe {
	to {
		opacity: 1;
		transform: none;
		clip-path: none;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.stm-anim .stm-hero__eyebrow,
	.stm-anim .stm-hero__title,
	.stm-anim .stm-hero__text,
	.stm-anim .stm-hero__actions,
	.stm-anim .stm-hero__facts,
	.stm-anim .stm-hero__visual {
		opacity: 0;
		animation: stm-failsafe 1ms linear 3s forwards;
	}

	.stm-anim.stm-gsap .stm-hero__eyebrow,
	.stm-anim.stm-gsap .stm-hero__title,
	.stm-anim.stm-gsap .stm-hero__text,
	.stm-anim.stm-gsap .stm-hero__actions,
	.stm-anim.stm-gsap .stm-hero__facts,
	.stm-anim.stm-gsap .stm-hero__visual {
		animation: none;
	}

	/* ScrollTrigger owns the reveals from here; the observer's transition
	   would fight GSAP for the same properties. */
	.stm-gsap .stm-reveal {
		opacity: 0;
		transform: none;
		transition: none;
	}

	.stm-gsap .stm-reveal.is-in {
		opacity: 1;
	}

	/* Split headline: each word rides in its own clipped line box. */
	.stm-word {
		display: inline-block;
		overflow: hidden;
		vertical-align: top;
		/* Room for Arabic descenders and marks so the clip never shaves them. */
		padding-block: 0.12em 0.22em;
		margin-block: -0.12em -0.22em;
	}

	.stm-word > span {
		display: inline-block;
		will-change: transform;
	}

	/* A slow sheen across the hero label. */
	.stm-gsap .stm-hero__eyebrow {
		background-image: linear-gradient(
			100deg,
			transparent 0 40%,
			color-mix(in srgb, var(--stm-teal) 22%, transparent) 50%,
			transparent 60% 100%
		);
		background-size: 250% 100%;
		background-position: 120% 0;
		animation: stm-sheen 5.5s var(--stm-ease) 1.6s infinite;
	}

	@keyframes stm-sheen {
		0%, 55% { background-position: 120% 0; }
		100% { background-position: -60% 0; }
	}
}

/* Lenis: the library drives scrolling, so native smooth scrolling is off. */
html.lenis,
html.lenis body {
	height: auto;
}

html.lenis {
	scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
	overflow: clip;
}

[data-stm-magnet] {
	will-change: transform;
}

/* --------------------------------------------------------------------------
   11. Print
   -------------------------------------------------------------------------- */

@media print {
	.stm-hero__visual,
	.stm-builder,
	.stm-path__controls,
	.stm-passport {
		display: none !important;
	}
}

/* --------------------------------------------------------------------------
   12. Header dropdown — a bridge across the gap
   --------------------------------------------------------------------------
   The panel sits half a rem below its parent. Without something to hover on
   in between, the pointer leaves the item on its way down and the panel
   closes under it. Desktop menu only; the drawer lists its children inline.
   -------------------------------------------------------------------------- */

.stm-header .stm-menu__sub::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-end: 100%;
	block-size: 0.75rem;
}

.stm-drawer .stm-menu__sub::before {
	content: none;
}
