/*--------------------------------------------------
"What we do" section (index.html, .svc-section). Behavior: js/services.js,
the orbit line itself: js/thread.js (data-thread-orbit).

  1. Heading     lines rise out of a blur, drift with scroll speed
  2. Orbit       the thread splits around a light bulb, nodes light up as
                 the line reaches them, the bulb lights when the ring closes
  3. Accordion   pinned while scrolling; the open service closes as the
                 next one opens, in step with the scroll. On desktop the
                 thread draws a fingerprint in the left column meanwhile
                 (.svc-acc-print, js/thread.js data-thread-fingerprint)
---------------------------------------------------*/

.svc-section {
	--svc-accent: #FFD400;                       /* same as data-primary-color */
	--svc-text: #f4f1ec;
	--svc-muted: rgba(244, 241, 236, 0.58);
	--svc-faint: rgba(244, 241, 236, 0.2);
	--svc-bg: #1D31FF;                           /* keep in sync with data-bgcolor */
	--svc-pad: 80px;
	color: var(--svc-text);
	text-align: left;
}

.svc-section ul,
.svc-section li {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Small caption style shared by the section's labels */
.svc-section .svc-kicker,
.svc-section .svc-discipline-title,
.svc-section .svc-acc-label {
	margin: 0;
	font-size: 12px;
	line-height: 18px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--svc-muted);
}

/*-- 1. Heading --*/

.svc-heading-scene {
	padding: 15vh var(--svc-pad) 4vh;
}

.svc-section .svc-kicker {
	margin-bottom: 28px;
}

.svc-section .svc-heading {
	margin: 0;
	font-size: clamp(32px, 4.3vw, 92px);
	line-height: 0.98;
	font-weight: 600;
	letter-spacing: -0.035em;
	text-transform: uppercase;
	color: var(--svc-text);
}

.svc-line-reveal {
	display: block;
}

.svc-line-reveal:nth-child(2) {
	padding-left: 0.45em;
}

.svc-line-reveal:last-child {
	color: var(--svc-accent);
}

.svc-line {
	display: inline-block;
	will-change: transform;
}

.svc-js .svc-line-reveal {
	opacity: 0;
	filter: blur(10px);
	transform: translateY(26%);
	transition: opacity 0.9s ease, filter 0.9s ease, transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
	transition-delay: calc(var(--i, 0) * 0.12s);
}

.svc-js .svc-heading.is-in .svc-line-reveal {
	opacity: 1;
	filter: blur(0);
	transform: none;
}

/*-- 2. Orbit --*/

.svc-orbit-scene {
	padding: 170px var(--svc-pad) 150px;
}

.svc-orbit {
	--thread-ring-shape: circle;                 /* read by js/thread.js */
	--d: min(560px, 62vh, 40vw);
	position: relative;
	width: var(--d);
	height: var(--d);
	margin: 0 auto;
}

/* Discipline captions sit just above the ring, left and right of the split */
.svc-section .svc-discipline-title {
	position: absolute;
	top: -44px;
	white-space: nowrap;
	transform: translateX(-50%);
	transition: color 0.5s ease;
}

.svc-discipline-left .svc-discipline-title { left: 0; }
.svc-discipline-right .svc-discipline-title { left: 100%; }

.svc-orbit-scene:not([data-thread-orbit="idle"]) .svc-discipline-title {
	color: var(--svc-text);
}

/* Nodes sit on the ring at angle --a (0deg = top), text offset by --c */
.svc-node {
	position: absolute;
	top: calc(50% - cos(var(--a)) * 50%);
	left: calc(50% - sin(var(--a)) * 50%);
	width: 0;
	height: 0;
}

.svc-discipline-right .svc-node {
	left: calc(50% + sin(var(--a)) * 50%);
}

.svc-dot {
	position: absolute;
	left: -9px;
	top: -9px;
	width: 18px;
	height: 18px;
	box-sizing: border-box;
	border-radius: 50%;
	border: 2px solid var(--svc-faint);
	background: var(--svc-bg);
	transition: border-color 0.4s ease;
}

.svc-dot::after {
	content: "";
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: var(--svc-accent);
	transform: scale(0);
	transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.svc-node[data-thread-reached] .svc-dot,
.svc-orbit-scene[data-thread-orbit=""] .svc-dot {
	border-color: var(--svc-accent);
}

.svc-node[data-thread-reached] .svc-dot::after,
.svc-orbit-scene[data-thread-orbit=""] .svc-dot::after {
	transform: scale(1);
}

.svc-node-text {
	display: block;
	position: absolute;
	top: -12px;
	width: clamp(150px, calc((100vw - var(--d)) / 2 - var(--svc-pad) - 34px), 270px);
	transition: opacity 0.6s ease, filter 0.6s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.svc-discipline-left .svc-node-text {
	right: var(--c, 28px);
	text-align: right;
}

.svc-discipline-right .svc-node-text {
	left: var(--c, 28px);
	text-align: left;
}

.svc-node-text strong,
.svc-node-text small,
.svc-node-text em {
	display: block;
}

.svc-section .svc-node-text strong {
	font-size: 17px;
	line-height: 24px;
	font-weight: 500;
	color: var(--svc-text);
}

.svc-node-num {
	margin-right: 6px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.08em;
	color: var(--svc-accent);
	vertical-align: 2px;
}

.svc-node-text small {
	margin-top: 4px;
	font-size: 13px;
	line-height: 19px;
	color: var(--svc-muted);
}

.svc-node-text em {
	margin-top: 8px;
	font-family: 'Geologica', sans-serif;          /* the template sets em to the serif */
	font-weight: 500;
	font-style: normal;
	font-size: 10.5px;
	line-height: 16px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(244, 241, 236, 0.4);
}

/* Not reached yet (only once js/thread.js has taken over the scene) */
.svc-orbit-scene:not([data-thread-orbit=""]) .svc-node:not([data-thread-reached]) .svc-node-text {
	opacity: 0.14;
	filter: blur(4px);
}

.svc-orbit-scene:not([data-thread-orbit=""]) .svc-discipline-left .svc-node:not([data-thread-reached]) .svc-node-text {
	transform: translateX(12px);
}

.svc-orbit-scene:not([data-thread-orbit=""]) .svc-discipline-right .svc-node:not([data-thread-reached]) .svc-node-text {
	transform: translateX(-12px);
}

/* Light bulb: drawn with the ring (--thread-orbit), lit when it closes */
.svc-bulb {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 38%;
	transform: translate(-50%, -46%);
	pointer-events: none;
}

.svc-bulb svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.svc-bulb .b-draw {
	fill: none;
	stroke: rgba(244, 241, 236, 0.72);
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: stroke 0.6s ease, fill 0.8s ease;
}

.svc-orbit-scene:not([data-thread-orbit=""]) .svc-bulb .b-draw {
	stroke-dasharray: 1 1;
	stroke-dashoffset: calc(1 - clamp(0, (var(--thread-orbit, 0) - var(--from, 0)) / (var(--to, 1) - var(--from, 0)), 1));
}

.svc-bulb-glow {
	opacity: calc(var(--thread-orbit, 0) * var(--thread-orbit, 0) * 0.22);
}

.svc-bulb-rays path {
	fill: none;
	stroke: var(--svc-accent);
	stroke-width: 3.2;
	stroke-linecap: round;
	stroke-dasharray: 1 1;
	stroke-dashoffset: 1;
	transition: stroke-dashoffset 0.25s ease;
}

/* Lit (also the state without JS) */
.svc-orbit-scene[data-thread-orbit="complete"] .svc-bulb-glass,
.svc-orbit-scene[data-thread-orbit=""] .svc-bulb-glass {
	stroke: #fff;
	fill: rgba(250, 130, 29, 0.1);
}

.svc-orbit-scene[data-thread-orbit="complete"] .svc-bulb-filament,
.svc-orbit-scene[data-thread-orbit=""] .svc-bulb-filament {
	stroke: #ffd29a;
	filter: drop-shadow(0 0 4px #FFD400) drop-shadow(0 0 10px rgba(250, 130, 29, 0.8));
}

.svc-orbit-scene[data-thread-orbit="complete"] .svc-bulb-glow,
.svc-orbit-scene[data-thread-orbit=""] .svc-bulb-glow {
	opacity: 1;
}

.svc-orbit-scene[data-thread-orbit="complete"] .svc-bulb-glow {
	animation: svc-flicker 1.1s linear both, svc-breathe 3.4s ease-in-out 1.2s infinite;
}

.svc-orbit-scene[data-thread-orbit="complete"] .svc-bulb-rays path,
.svc-orbit-scene[data-thread-orbit=""] .svc-bulb-rays path {
	stroke-dashoffset: 0;
	transition: stroke-dashoffset 0.55s cubic-bezier(0.16, 1, 0.3, 1);
	transition-delay: calc(0.35s + var(--r, 0) * 0.06s);
}

@keyframes svc-flicker {
	0% { opacity: 0.2; }
	8% { opacity: 0.95; }
	13% { opacity: 0.25; }
	22% { opacity: 1; }
	30% { opacity: 0.55; }
	42% { opacity: 1; }
	100% { opacity: 1; }
}

@keyframes svc-breathe {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.78; }
}

/*-- 3. Scroll accordion --*/
/* Modeled on zeyna.pethemes.com/agency "What we do?". While the block is
   pinned, js/services.js sets each panel's height from the scroll position:
   the open service closes while the next one opens. Services that aren't
   open dim to 25%. Without JS every panel is open. */

.svc-acc-scene {
	padding: 8vh calc(var(--svc-pad) + 1.5vw) 15vh var(--svc-pad);
}

.svc-acc-pin {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	column-gap: 6vw;
	align-items: start;
	will-change: transform;
}

/* Left column: heading on top, intro below (pinned: at the bottom of the screen) */
.svc-acc-side {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.svc-acc-intro {
	margin-top: 60px;
	padding-left: 30%;
}

.svc-section .svc-acc-title {
	margin: 0;
	font-size: clamp(38px, 4.6vw, 84px);
	line-height: 1;
	font-weight: 600;
	letter-spacing: -0.035em;
	text-transform: uppercase;
	color: var(--svc-text);
}

/* Heading letters rise out of a mask one by one, and spin when hovered */
.svc-word {
	display: inline-block;
	white-space: nowrap;
}

.svc-char-mask {
	display: inline-block;
	overflow: hidden;
	vertical-align: top;
}

/* Resets instantly (off screen), animates only on the way in */
.svc-char {
	display: inline-block;
	transform: translate3d(0, 110%, 0);
}

.svc-acc-title.is-in .svc-char {
	transform: none;
	transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
	transition-delay: calc(var(--ci, 0) * 0.1s);
}

.svc-char-mask.is-spin {
	animation: svc-char-spin 1s cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes svc-char-spin {
	from { transform: rotateY(0deg); }
	to { transform: rotateY(360deg); }
}

.svc-section .svc-acc-text {
	max-width: 380px;
	margin: 18px 0 34px;
	font-size: 18px;
	line-height: 28px;
	color: var(--svc-text);
}

.svc-acc-item {
	transition: opacity 0.4s ease;
}

.svc-acc.has-open .svc-acc-item:not(.is-open) {
	opacity: 0.25;
}

.svc-acc.has-open .svc-acc-item:not(.is-open):has(.svc-acc-head:focus-visible) {
	opacity: 0.6;
}

@media (hover: hover) and (pointer: fine) {
	.svc-acc.has-open .svc-acc-item:not(.is-open):has(.svc-acc-head:hover) {
		opacity: 0.6;
	}
}

.svc-section .svc-acc-item h3 {
	margin: 0;
	font-size: inherit;
	line-height: inherit;
}

.svc-acc-head {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	width: 100%;
	margin: 0;
	padding: clamp(8px, 1.5vh, 13px) 0 clamp(6px, 1.1vh, 10px);
	border: 0;
	border-bottom: 1px solid rgba(244, 241, 236, 0.6);
	background: none;
	color: var(--svc-text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.svc-acc-name {
	font-size: clamp(26px, min(3vw, 5.2vh), 46px);
	line-height: 1.2;
	font-weight: 500;
	letter-spacing: -0.025em;
}

.svc-acc-head:focus-visible {
	outline: 2px solid var(--svc-accent);
	outline-offset: 4px;
}

/* A dot that stretches into a dash when the service opens */
.svc-acc-icon {
	position: relative;
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
}

.svc-acc-icon::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--svc-text);
	transform: translate(-50%, -50%);
	transition: width 0.4s cubic-bezier(0.65, 0, 0.35, 1), height 0.4s cubic-bezier(0.65, 0, 0.35, 1), border-radius 0.4s ease, background-color 0.4s ease;
}

.svc-acc-item.is-open .svc-acc-icon::before {
	width: 14px;
	height: 2px;
	border-radius: 1px;
	background: var(--svc-accent);
}

/* JS sets the height. In click mode (no pin) it animates. */
.svc-acc-panel {
	overflow: hidden;
}

.svc-js .svc-acc-panel {
	height: 0;
}

.svc-acc-scene.is-click .svc-acc-panel {
	transition: height 0.9s cubic-bezier(0.87, 0, 0.13, 1);
}

.svc-acc-body {
	padding: clamp(12px, 2.4vh, 22px) 0 clamp(24px, 4.5vh, 40px);
}

.svc-section .svc-acc-tagline {
	margin: 0 0 clamp(8px, 1.6vh, 14px);
	font-size: 15px;
	line-height: 24px;
	color: rgba(244, 241, 236, 0.42);
}

.svc-section .svc-acc-body p.svc-acc-copy {
	max-width: 640px;
	margin: 0;
	font-size: clamp(17px, min(1.6vw, 2.9vh), 24px);
	line-height: 1.42;
	letter-spacing: -0.02em;
	color: var(--svc-text);
}

.svc-section .svc-acc-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: clamp(18px, 3.8vh, 36px);
}

.svc-section .svc-acc-tags li {
	padding: clamp(6px, 1.1vh, 10px) 22px;
	border-radius: 50px;
	background: rgba(244, 241, 236, 0.07);
	font-size: 12px;
	line-height: 20px;
	color: var(--svc-text);
}

.svc-acc-spacer {
	height: 0;
}

/* Empty box where js/thread.js draws the fingerprint (desktop only) */
.svc-acc-print {
	display: none;
}

/* Pinned on desktop: the left column fills the screen (--svc-room is set by
   JS) and the fingerprint box takes the space between heading and intro.
   The orbit's line leaves straight down the middle, toward the gap between
   the two columns where it runs down to the fingerprint. */
@media only screen and (min-width: 1025px) {
	.svc-orbit-scene {
		--thread-side: center;
	}
	.svc-acc-print {
		display: block;
		flex: 1 1 auto;
		align-self: stretch;
		min-height: 0;
	}
	.svc-acc-scene.is-pinned .svc-acc-side {
		height: var(--svc-room, auto);
		padding-bottom: 3vh;
	}
	.svc-acc-scene.is-pinned .svc-acc-intro {
		margin-top: auto;
	}
}

/*-- Reduced motion --*/

@media (prefers-reduced-motion: reduce) {
	.svc-js .svc-line-reveal,
	.svc-node-text,
	.svc-acc-scene.is-click .svc-acc-panel {
		transition: none;
	}
	.svc-char {
		transform: none;
		transition: none;
	}
	.svc-orbit-scene[data-thread-orbit="complete"] .svc-bulb-glow,
	.svc-char-mask.is-spin {
		animation: none;
	}
}

/*-- Responsive --*/

@media only screen and (max-width: 1466px) {
	.svc-section { --svc-pad: 60px; }
}

/* Tablets and phones: the ring becomes two lanes (as on the reference site's
   phone layout) and the bulb sits between them. */
@media only screen and (max-width: 1024px) {
	.svc-section { --svc-pad: 40px; }

	.svc-orbit-scene {
		padding: 140px var(--svc-pad) 130px;
	}

	.svc-orbit {
		--thread-ring-shape: lanes;
		--d: auto;
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		column-gap: 30%;
		width: 100%;
		max-width: 760px;
		height: auto;
		padding-bottom: 80px;
	}

	.svc-acc-pin {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 40px;
	}

	.svc-acc-intro {
		margin-top: 28px;
		padding-left: 0;
	}

	.svc-section .svc-acc-text {
		margin-bottom: 26px;
	}

	.svc-section .svc-discipline-title {
		position: static;
		margin-bottom: 64px;
		transform: none;
		white-space: normal;
	}

	.svc-discipline-left .svc-discipline-title {
		padding-right: 22px;
		text-align: right;
	}

	.svc-discipline-right .svc-discipline-title {
		padding-left: 22px;
	}

	.svc-node,
	.svc-discipline-right .svc-node {
		position: relative;
		top: auto;
		left: auto;
		width: auto;
		height: auto;
		margin-bottom: 30px;
	}

	.svc-node:last-child {
		margin-bottom: 0;
	}

	.svc-dot {
		top: 3px;
	}

	.svc-discipline-left .svc-dot {
		left: auto;
		right: -9px;
	}

	.svc-node-text,
	.svc-discipline-left .svc-node-text,
	.svc-discipline-right .svc-node-text {
		position: static;
		width: auto;
	}

	.svc-discipline-left .svc-node-text { padding-right: 22px; }
	.svc-discipline-right .svc-node-text { padding-left: 22px; }

	.svc-bulb {
		width: 26%;
		transform: translate(-50%, -50%);
	}
}

@media only screen and (max-width: 767px) {
	.svc-section { --svc-pad: 30px; }

	.svc-heading-scene {
		padding: 12vh 44px 2vh var(--svc-pad);
	}

	.svc-line-reveal:nth-child(2) {
		padding-left: 0;
	}

	.svc-orbit-scene {
		padding: 120px var(--svc-pad) 120px;
	}

	.svc-orbit {
		max-width: none;
	}

	.svc-section .svc-node-text strong {
		font-size: 15px;
		line-height: 22px;
	}

	.svc-node-num {
		display: block;
		margin: 0 0 2px;
		vertical-align: 0;
	}

	.svc-node-text small {
		font-size: 12px;
		line-height: 17px;
	}

	.svc-node-text em {
		font-size: 9.5px;
		line-height: 14px;
	}

	.svc-bulb .b-draw {
		stroke-width: 4;
	}

	.svc-bulb-rays path {
		stroke-width: 5;
	}

	.svc-acc-scene {
		padding: 6vh 44px 12vh var(--svc-pad);
	}

	.svc-acc-head {
		padding: 12px 0 9px;
	}

	.svc-section .svc-acc-text {
		font-size: 16px;
		line-height: 25px;
	}

	.svc-acc-body {
		padding: 18px 0 34px;
	}

	.svc-section .svc-acc-tagline {
		font-size: 13px;
		line-height: 20px;
	}

	.svc-section .svc-acc-body p.svc-acc-copy {
		font-size: 17px;
		line-height: 1.45;
	}

	.svc-section .svc-acc-tags {
		gap: 8px;
		margin-top: 28px;
	}

	.svc-section .svc-acc-tags li {
		padding: 8px 16px;
	}
}

@media only screen and (max-width: 479px) {
	.svc-section { --svc-pad: 20px; }

	.svc-orbit {
		column-gap: 26%;
	}
}
