/* ==========================================================================
   GrowthStudioz — footer

   The site's only dark region. Foregrounds come from the --gs-on-dark roles in
   base.css rather than being flipped here, so nothing inherits --gs-ink and
   renders black on black.
   ========================================================================== */

.gs-footer {
	position: relative;
	background: var(--gs-surface-dark);
	color: var(--gs-on-dark);
	overflow: hidden;
}

/* The red bloom, per Figma "Ellipse 21872": 500x271, #520C0C at 50%, layer
   blur 323.6. Reproduced as a real blurred ellipse rather than a radial
   gradient, because a gradient cannot match a Gaussian blur's falloff.

   BLUR VALUE IS HALVED, deliberately. Figma's layer-blur number and CSS
   blur() are not the same unit: CSS takes a standard deviation, Figma's is
   closer to a diameter, so blur(323.6px) spreads a 271px-tall ellipse until it
   is all but invisible. blur(161.8px) is the same ellipse at the density the
   mockup shows. Every other value here is the Figma number verbatim.

   Anchored bottom-right so it sits behind the contact block, as in the design.
   .gs-footer has overflow:hidden, which is what keeps the 323.6px bleed from
   spilling onto the page. pointer-events:none so it can never eat a click. */
.gs-footer::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	width: 500px;
	height: 271px;
	border-radius: 50%;
	background: #520C0C;
	opacity: 0.5;
	filter: blur(161.8px);
	pointer-events: none;
	z-index: 0;
	/* Promote to its own layer: a blur this large is expensive to repaint, and
	   without this it re-rasterises on scroll. */
	will-change: transform;
}

.gs-footer > * {
	position: relative;
	z-index: 1;
}

/* :where() so this contributes ZERO specificity. Written as `.gs-footer a` it
   scores 0,1,1 and beats every single-class rule below it — which is exactly
   how the white CTA ended up with white text on a white pill. A blanket reset
   must never outrank the components it is resetting. */
:where(.gs-footer) a {
	color: inherit;
	text-decoration: none;
}

/* ==========================================================================
   Social row (desktop)

   Equal cells divided by hairlines, sized by however many platforms actually
   have a URL. --gs-social-count comes from the render callback, so adding a
   fifth link needs no CSS change.
   ========================================================================== */

.gs-footer__social-row {
	display: grid;
	grid-template-columns: repeat(var(--gs-social-count, 3), minmax(0, 1fr));
	border-block: var(--gs-border-width) solid var(--gs-border-dark);
}

.gs-footer__social-cell {
	display: flex;
	align-items: center;
	gap: var(--gs-space-3);
	padding: var(--gs-space-4) var(--gs-space-5);
	font-size: var(--gs-b4);
	border-inline-start: var(--gs-border-width) solid var(--gs-border-dark);
	transition: background-color var(--gs-dur-hover) ease;
}

.gs-footer__social-cell:first-child {
	border-inline-start: 0;
}

.gs-footer__social-arrow {
	transition: transform var(--gs-dur-hover) var(--gs-ease-out);
}

@media (hover: hover) and (pointer: fine) {
	.gs-footer__social-cell:hover {
		background: rgb(255 255 255 / 6%);
		color: var(--gs-on-dark);
	}

	.gs-footer__social-cell:hover .gs-footer__social-arrow {
		transform: translateX(3px);
	}
}

/* ==========================================================================
   Main grid

   Desktop: columns band on top, then brand + contact beneath it.
   Source order leads with the brand because that is the phone order; desktop
   reorders rather than duplicating the markup.
   ========================================================================== */

.gs-footer__inner {
	display: grid;
	gap: var(--gs-space-7);
	padding-block: var(--gs-space-8) var(--gs-space-7);
}

@media (min-width: 900px) {
	.gs-footer__inner {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
		grid-template-areas:
			"cols cols"
			"brand contact";
		column-gap: var(--gs-space-8);
	}

	.gs-footer__brand { grid-area: brand; }
	.gs-footer__cols { grid-area: cols; }
	.gs-footer__contact { grid-area: contact; }
}

/* --- brand ---------------------------------------------------------------- */

.gs-footer__logo {
	display: inline-block;
	/* currentColor on the mark: white here, ink in the header, one file. */
	color: var(--gs-on-dark);
}

/* The wordmark is not a normal link. base.css turns links red on hover, and
   because the mark inherits currentColor that tinted the whole logo. A brand
   mark holds its colour. `a.` in front: base.css's `a:not(.gs-btn):hover`
   is (0,2,1) and beat the bare class (0,2,0); this is (0,2,1) and loads
   later, so it wins. */
a.gs-footer__logo:hover,
a.gs-footer__logo:focus-visible {
	color: var(--gs-on-dark);
}

.gs-footer__logo .gs-logo {
	width: 184px;
}

@media (min-width: 900px) {
	/* Logo and paragraph sit side by side, per the mockup, with the mark
	   optically centred against the paragraph block rather than aligned to
	   its first line. */
	.gs-footer__brand {
		display: flex;
		align-items: center;
		gap: var(--gs-space-6);
	}

	.gs-footer__logo {
		flex: none;
	}
}

.gs-footer__blurb {
	margin-block-start: var(--gs-space-4);
	max-width: 46ch;
	color: var(--gs-on-dark-muted);
	font-size: var(--gs-b3);
	line-height: var(--gs-lh-body);
}

.gs-footer__blurb p {
	margin: 0;
	max-width: none;
}

/* --- columns -------------------------------------------------------------- */

.gs-footer__cols {
	display: grid;
	gap: var(--gs-space-6);
}

@media (min-width: 900px) {
	.gs-footer__cols {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--gs-space-7);
	}
}

.gs-footer__col-heading {
	margin: 0;
	font-size: var(--gs-b4);
	letter-spacing: 0.12em;
	line-height: 1;
	text-transform: uppercase;
	/* The heading is not display type; reset the tight display tracking that
	   base.css applies to every h1-h6. */
	font-weight: var(--gs-weight-medium);
}

.gs-footer__col-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--gs-space-4);
	width: 100%;
	padding: var(--gs-space-4) 0;
	border: 0;
	background: none;
	color: var(--gs-accent);
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	text-align: start;
	cursor: pointer;
}

.gs-footer__chev {
	flex: none;
	font-size: var(--gs-b3);
	transition: transform var(--gs-dur-hover) var(--gs-ease-out);
}

.gs-footer__list {
	display: flex;
	flex-direction: column;
	gap: var(--gs-space-3);
	margin: 0;
	padding: 0 0 var(--gs-space-4);
	list-style: none;
}

.gs-footer__list li {
	max-width: none;
}

.gs-footer__list a {
	color: var(--gs-on-dark-muted);
	font-size: var(--gs-b5);
	transition: color var(--gs-dur-hover) ease;
}

@media (hover: hover) and (pointer: fine) {
	.gs-footer__list a:hover {
		color: var(--gs-on-dark);
	}
}

/* --- contact -------------------------------------------------------------- */

.gs-footer__contact {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--gs-space-4);
}

@media (min-width: 900px) {
	/* The block sits on the right of the footer, but everything inside it is
	   left-aligned to a shared edge. align-items:flex-end would right-align
	   each row instead, leaving the icons and the button ragged down the left
	   — which is what it was doing. width:max-content lets the block shrink to
	   its widest row so margin-inline-start:auto can push it right. */
	.gs-footer__contact {
		align-items: flex-start;
		justify-content: flex-end;
		width: max-content;
		margin-inline-start: auto;
	}

	/* The paragraph already carries the logo's top margin in this row. */
	.gs-footer__blurb {
		margin-block-start: 0;
	}
}

.gs-footer__contact-item {
	display: inline-flex;
	align-items: center;
	gap: var(--gs-space-3);
	color: var(--gs-on-dark-muted);
	font-size: var(--gs-b4);
	transition: color var(--gs-dur-hover) ease;
}

@media (hover: hover) and (pointer: fine) {
	.gs-footer__contact-item:hover {
		color: var(--gs-on-dark);
	}
}

/* --- footer CTA ----------------------------------------------------------
   Deliberately not .gs-btn. The header action is an outlined ink rectangle on
   white; this is a filled white pill on black, lowercase and wide-tracked.
   Two different buttons, so two components rather than one with a modifier
   that overrides most of it.
   -------------------------------------------------------------------------- */

/* .gs-btn--light gives the white fill on black. The hover goes to brand red
   rather than the default ink, because ink on a black footer is invisible. */
.gs-footer__cta {
	--btn-fill-hover: var(--gs-accent);
	--btn-ink-hover: var(--gs-on-dark);

	margin-block-start: var(--gs-space-2);
}

/* --- compact socials (phones) --------------------------------------------- */

.gs-footer__social-compact {
	display: none;
	flex-direction: column;
	align-items: center;
	gap: var(--gs-space-4);
	padding-block-start: var(--gs-space-6);
	border-block-start: var(--gs-border-width) solid var(--gs-border-dark);
}

.gs-footer__social-heading {
	margin: 0;
	color: var(--gs-on-dark-muted);
	font-size: var(--gs-b4);
	max-width: none;
}

.gs-footer__social-icons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--gs-space-5);
	margin: 0;
	padding: 0;
	list-style: none;
}

.gs-footer__social-icons li {
	max-width: none;
}

.gs-footer__social-icons a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	color: var(--gs-on-dark-muted);
	font-size: var(--gs-b2);
	transition: color var(--gs-dur-hover) ease;
}

@media (hover: hover) and (pointer: fine) {
	.gs-footer__social-icons a:hover {
		color: var(--gs-on-dark);
	}
}

/* ==========================================================================
   Phones

   Columns become accordions, the labelled social row is replaced by the icon
   row, and the CTA goes full width.
   ========================================================================== */

@media (max-width: 899px) {
	.gs-footer__social-row {
		display: none;
	}

	.gs-footer__social-compact {
		display: flex;
	}

	.gs-footer__inner {
		gap: var(--gs-space-6);
		padding-block: var(--gs-space-7) var(--gs-space-6);
	}

	.gs-footer__col {
		border-block-start: var(--gs-border-width) solid var(--gs-border-dark);
	}

	.gs-footer__cols {
		gap: 0;
	}

	.gs-footer__col-toggle {
		color: var(--gs-on-dark);
	}

	/* Collapsed by default. A grid 0fr -> 1fr animates to the panel's own
	   height without measuring it in JS, and without the jump a max-height
	   guess produces. */
	.gs-footer__col-panel {
		display: grid;
		grid-template-rows: 0fr;
		transition: grid-template-rows var(--gs-dur-exit) var(--gs-ease-out);
	}

	.gs-footer__col-panel > .gs-footer__col-inner {
		overflow: hidden;
		min-height: 0;
	}

	.gs-footer__col.is-open .gs-footer__col-panel {
		grid-template-rows: 1fr;
	}

	.gs-footer__col.is-open .gs-footer__chev {
		transform: rotate(180deg);
	}

	.gs-footer__cta {
		width: 100%;
	}

	.gs-footer__contact {
		width: 100%;
	}

	/* The mockup runs accordions straight into the button on phones. The
	   address and number are still one tap away in the Contact Us page, and
	   still present on desktop. */
	.gs-footer__contact-item {
		display: none;
	}
}

/* Desktop: the toggle is not a control, so strip every affordance and let the
   panel stand open. Keeping one markup shape for both is what makes the
   accordion possible without a second render path. */
@media (min-width: 900px) {
	.gs-footer__col-toggle {
		padding-block: 0 var(--gs-space-4);
		cursor: default;
		pointer-events: none;
	}

	.gs-footer__chev {
		display: none;
	}
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.gs-footer__col-panel {
		transition: none;
	}

	.gs-footer__social-cell:hover .gs-footer__social-arrow {
		transform: none;
	}
}
