/* =========================================================
   Ainush — Site Footer
   ---------------------------------------------------------
   A self-contained deep-navy section with:
     1. a large SVG concave arc bridging the page above into the footer,
     2. a full-footer backdrop of evenly spaced, individually staggered
        twinkling particles,
     3. a four-column content grid over the top.
   The backdrop spans the whole footer (not per column) and never takes
   pointer events, so every link and button stays clickable.
   ========================================================= */

.site-footer {
	--footer-navy: #080D45;
	--footer-navy-deep: #05082F;
	/* Colour the arc has to blend into — the page background above the footer.
	   A section that ends on white can override this on its own page. */
	--footer-curve-fill: var(--color-bg, #F5FAFA);
	--footer-curve-h: clamp(44px, 6.8vw, 126px);
	--footer-heading: #FFFFFF;
	--footer-body: rgba(226, 234, 255, 0.78);
	--footer-link: rgba(220, 230, 252, 0.82);
	--footer-rule: rgba(150, 178, 235, 0.20);

	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--footer-navy);
	background-image: radial-gradient(120% 80% at 50% 0%, #0A1150 0%, var(--footer-navy) 45%, var(--footer-navy-deep) 100%);
	color: var(--footer-body);
	font-family: var(--font-body);
	padding: 0;
}

/* ---------- 1. Curved top edge ----------
   A stretched SVG rather than a border-radius: preserveAspectRatio="none"
   lets one control-point pair describe the same smooth, flat-centred arc at
   every width, and the fill is the page colour above so the two meet cleanly. */
.footer-curve {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--footer-curve-h);
	z-index: 2;
	line-height: 0;
	pointer-events: none;
}
.footer-curve svg {
	display: block;
	width: 100%;
	height: 100%;
}
.footer-curve path {
	fill: var(--footer-curve-fill);
}

/* The arc has to finish in whatever colour the section above it painted, or a
   seam shows along the join. These sections end on white; anything else falls
   through to the page background set on .site-footer. */
#main-content:has(> :last-child.faq) + .site-footer,
#main-content:has(> :last-child.blog) + .site-footer,
#main-content:has(> :last-child.section--alt) + .site-footer {
	--footer-curve-fill: var(--color-white);
}

/* ---------- 2. Backdrop ---------- */
.footer-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
}

/* Twinkling particle grid.
   Unconnected dots on an even grid, written by footer-particles.js. Each is
   handed its own duration, delay, peak alpha and size, so the field twinkles
   out of step. Only `opacity` and `transform` animate, both of which stay off
   the layout path. */
.footer-particles {
	position: absolute;
	inset: 0;
}
.footer-particle {
	position: absolute;
	left: var(--x);
	top: var(--y);
	width: var(--size);
	height: var(--size);
	border-radius: 50%;
	background: #DCE9FF;
	/* Every dot carries a halo, not just the bright ones — it is what makes the
	   field read as glowing rather than as flat pinpricks. */
	box-shadow: 0 0 4px 0 rgba(170, 205, 255, 0.55);
	opacity: var(--min, 0.1);
	will-change: opacity, transform;
	animation: ainush-particle-blink var(--dur, 4s) ease-in-out var(--delay, 0s) infinite;
}
.footer-particle--bright {
	background: #FFFFFF;
	box-shadow: 0 0 9px 1px rgba(160, 200, 255, 0.75);
}

@keyframes ainush-particle-blink {
	0%, 100% { opacity: var(--min, 0.15); transform: scale(1); }
	50%      { opacity: var(--peak, 0.65); transform: scale(1.3); }
}

/* ---------- 3. Content ---------- */
.footer-inner {
	position: relative;
	z-index: 3;
	/* Clear the arc before the first row of content starts. */
	padding-top: calc(var(--footer-curve-h) + clamp(26px, 3.2vw, 50px));
	padding-bottom: 0;
	max-width: 1400px;
}

.footer-grid {
	display: grid;
	/* Not four equal tracks: the logo column and the services column carry the
	   widest content, so they take a little more than the links column. */
	grid-template-columns: 1.12fr 0.86fr 1.14fr 1.06fr;
	gap: 40px 52px;
	padding-bottom: clamp(32px, 3.8vw, 56px);
}

.footer-col h4 {
	font-family: var(--font-heading);
	color: var(--footer-heading);
	font-size: clamp(1.3rem, 1.5vw, 1.72rem);
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 20px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--footer-rule);
}

.site-footer a {
	color: var(--footer-link);
	text-decoration: none;
	transition: color 0.22s ease, transform 0.22s ease;
}
.site-footer a:hover,
.site-footer a:focus-visible {
	color: var(--footer-heading);
}

/* Column 1 — logo + description */
.footer-brand__logo {
	display: block;
	margin-bottom: 18px;
}
.footer-brand__logo img,
.footer-brand__logo .custom-logo {
	width: auto;
	max-width: 175px;
	height: auto;
}
.footer-brand__logo--text {
	font-family: var(--font-heading);
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--footer-heading);
	letter-spacing: 0.02em;
}
.footer-brand__text {
	margin: 0;
	max-width: 302px;
	font-size: 1.04rem;
	line-height: 1.75;
	color: var(--footer-body);
}

/* Columns 2 & 3 — link lists. The generous row rhythm is what gives the
   reference its airy feel, so it is set here rather than left to line-height. */
.footer-links {
	list-style: none;
	margin: 0;
	padding: 0;
}
.footer-links li + li {
	margin-top: 15px;
}
.footer-links a {
	display: inline-block;
	font-size: 1.1rem;
	line-height: 1.45;
}
.footer-links a:hover,
.footer-links a:focus-visible {
	transform: translateX(3px);
}

/* Column 4 — contact */
.footer-contact {
	list-style: none;
	margin: 0 0 22px;
	padding: 0;
	font-size: 1.08rem;
	line-height: 1.7;
}
.footer-contact li + li {
	margin-top: 6px;
}
.footer-contact__label {
	color: var(--footer-body);
}

.footer-social {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	flex-wrap: wrap;
}
.footer-social a {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(168, 187, 220, 0.88);
	color: #0A1145;
	transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}
.footer-social a svg {
	width: 17px;
	height: 17px;
	fill: currentColor;
	display: block;
}
.footer-social a:hover,
.footer-social a:focus-visible {
	background: #FFFFFF;
	color: #080D45;
	transform: translateY(-4px);
	box-shadow: 0 8px 20px rgba(120, 165, 255, 0.35);
}

/* ---------- 4. Copyright ---------- */
.footer-bottom {
	position: relative;
	z-index: 3;
	border-top: 1px solid var(--footer-rule);
	padding: 20px 0 26px;
	text-align: center;
	font-size: 0.95rem;
	color: rgba(178, 197, 236, 0.75);
}
.footer-bottom a {
	color: rgba(178, 197, 236, 0.85);
}
.footer-bottom a:hover {
	color: #FFFFFF;
}
.footer-bottom__sep {
	display: inline-block;
	width: 0.9em;
}

/* ---------- 5. Responsive ---------- */

/* Tablet — two columns. */
@media (max-width: 1024px) {
	.footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: 44px 40px;
	}
	.footer-brand__text { max-width: 420px; }
}

/* Mobile — single column, shallower arc, backdrop kept. */
@media (max-width: 620px) {
	.site-footer {
		--footer-curve-h: clamp(34px, 11vw, 62px);
	}
	.footer-inner {
		padding-top: calc(var(--footer-curve-h) + 44px);
	}
	.footer-grid {
		grid-template-columns: 1fr;
		gap: 38px;
	}
	.footer-col h4 {
		font-size: 1.22rem;
		margin-bottom: 20px;
		padding-bottom: 14px;
	}
	.footer-links li + li { margin-top: 15px; }
	.footer-brand__text { max-width: none; }
	.footer-bottom { font-size: 0.88rem; padding: 22px 0 28px; }
}

/* ---------- 6. Reduced motion ----------
   The backdrop stays — only the movement stops, held at a legible alpha. */
@media (prefers-reduced-motion: reduce) {
	.footer-particle {
		animation: none;
	}
	.footer-particle {
		opacity: var(--peak, 0.55);
	}
	.site-footer a:hover,
	.site-footer a:focus-visible,
	.footer-social a:hover,
	.footer-social a:focus-visible {
		transform: none;
	}
}
