/* ============================================================
   AvestaTech — services, framed as one macOS app window
   A Finder-style source list picks a service; the detail pane
   shows what you get, a live preview of the work, the stack and
   the delivery window. The previews themselves live in scenes.css.
   ============================================================ */

.avesta-svc-lead {
	max-inline-size: 46rem;
	margin-inline: auto;
	margin-block: 0.75rem 0;
	font-size: 1.05rem;
}

.avesta-svc {
	position: relative;
	margin-block-start: clamp(2rem, 4vw, 3.25rem);
}

.avesta-svc-radio {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---- The window shell ---- */

.avesta-svc-window {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	border-radius: var(--avesta-radius);
	background: var(--avesta-glass-bg-strong);
	-webkit-backdrop-filter: blur(var(--avesta-blur)) saturate(180%);
	backdrop-filter: blur(var(--avesta-blur)) saturate(180%);
	border: 1px solid var(--avesta-glass-border);
	box-shadow:
		0 0 0 1px var(--avesta-glass-ring),
		var(--avesta-shadow),
		inset 0 1px 0 var(--avesta-glass-top);
}

.avesta-svc-titlebar {
	/* Like a real window, the traffic lights stay at the physical left
	   even though the interface is RTL. */
	direction: ltr;
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.9rem 1.35rem;
	border-block-end: 1px solid var(--avesta-hairline);
	background: linear-gradient(180deg,
		color-mix(in srgb, var(--wp--preset--color--contrast) 4%, transparent),
		transparent);
}

.avesta-svc-titlebar .avesta-window-bar {
	position: static;
	padding: 0;
	cursor: default;
	flex: 0 0 auto;
}

.avesta-svc-titletext {
	direction: rtl;
	flex: 1 1 auto;
	text-align: right;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--wp--preset--color--muted);
}

.avesta-svc-body {
	display: grid;
	grid-template-columns: 17rem minmax(0, 1fr);
	align-items: stretch;
}

/* ---- Source list ---- */

.avesta-svc-rail {
	display: grid;
	align-content: start;
	gap: 0.3rem;
	padding: 1.1rem 0.85rem;
	border-inline-end: 1px solid var(--avesta-hairline);
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 3.5%, transparent);
}

.avesta-svc-rail-label {
	padding-inline: 0.65rem;
	margin-block-end: 0.35rem;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--muted);
}

.avesta-svc-item {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.6rem 0.65rem;
	border-radius: 0.75rem;
	cursor: pointer;
	color: var(--wp--preset--color--contrast);
	transition: background-color 180ms var(--avesta-ease), color 180ms var(--avesta-ease);
}

.avesta-svc-item:hover {
	background: color-mix(in srgb, var(--wp--preset--color--primary) 10%, transparent);
}

.avesta-svc-item-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 1.85rem;
	block-size: 1.85rem;
	border-radius: 0.6rem;
	background: color-mix(in srgb, var(--wp--preset--color--primary) 12%, transparent);
	color: var(--wp--preset--color--primary);
	transition: background-color 180ms var(--avesta-ease), color 180ms var(--avesta-ease);
}

.avesta-svc-item-icon svg {
	inline-size: 1rem;
	block-size: 1rem;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.avesta-svc-item-title {
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.45;
}

.avesta-svc-rail-foot {
	margin-block-start: 0.9rem;
	padding: 0.85rem 0.65rem 0;
	border-block-start: 1px solid var(--avesta-hairline);
	display: grid;
	gap: 0.45rem;
	justify-items: start;
}

.avesta-svc-rail-foot p {
	margin: 0;
	font-size: 0.82rem;
	line-height: 1.7;
}

.avesta-svc-rail-link {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.85rem;
	font-weight: 800;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.avesta-svc-rail-link svg {
	inline-size: 0.9rem;
	block-size: 0.9rem;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: translate 180ms var(--avesta-ease);
}

.avesta-svc-rail-link:hover svg {
	translate: -3px 0;
}

/* Selected row — macOS fills the whole pill with the accent colour */
#avesta-svc-cms:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="cms"],
#avesta-svc-code:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="code"],
#avesta-svc-cart:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="cart"],
#avesta-svc-uiux:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="uiux"],
#avesta-svc-api:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="api"],
#avesta-svc-rocket:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="rocket"] {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--on-primary);
	box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--wp--preset--color--primary) 70%, transparent);
}

#avesta-svc-cms:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="cms"] .avesta-svc-item-icon,
#avesta-svc-code:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="code"] .avesta-svc-item-icon,
#avesta-svc-cart:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="cart"] .avesta-svc-item-icon,
#avesta-svc-uiux:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="uiux"] .avesta-svc-item-icon,
#avesta-svc-api:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="api"] .avesta-svc-item-icon,
#avesta-svc-rocket:checked ~ .avesta-svc-window .avesta-svc-item[data-svc="rocket"] .avesta-svc-item-icon {
	background: color-mix(in srgb, var(--wp--preset--color--on-primary) 22%, transparent);
	color: var(--wp--preset--color--on-primary);
}

#avesta-svc-cms:focus-visible ~ .avesta-svc-window .avesta-svc-item[data-svc="cms"],
#avesta-svc-code:focus-visible ~ .avesta-svc-window .avesta-svc-item[data-svc="code"],
#avesta-svc-cart:focus-visible ~ .avesta-svc-window .avesta-svc-item[data-svc="cart"],
#avesta-svc-uiux:focus-visible ~ .avesta-svc-window .avesta-svc-item[data-svc="uiux"],
#avesta-svc-api:focus-visible ~ .avesta-svc-window .avesta-svc-item[data-svc="api"],
#avesta-svc-rocket:focus-visible ~ .avesta-svc-window .avesta-svc-item[data-svc="rocket"] {
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

/* ---- Detail pane ---- */

.avesta-svc-panes {
	position: relative;
	padding: clamp(1.4rem, 2.4vw, 2.1rem);
}

.avesta-svc-pane {
	display: none;
	gap: clamp(1.15rem, 2vw, 1.65rem);
	align-content: start;
}

#avesta-svc-cms:checked ~ .avesta-svc-window .avesta-svc-pane[data-svc="cms"],
#avesta-svc-code:checked ~ .avesta-svc-window .avesta-svc-pane[data-svc="code"],
#avesta-svc-cart:checked ~ .avesta-svc-window .avesta-svc-pane[data-svc="cart"],
#avesta-svc-uiux:checked ~ .avesta-svc-window .avesta-svc-pane[data-svc="uiux"],
#avesta-svc-api:checked ~ .avesta-svc-window .avesta-svc-pane[data-svc="api"],
#avesta-svc-rocket:checked ~ .avesta-svc-window .avesta-svc-pane[data-svc="rocket"] {
	display: grid;
}

@keyframes avesta-svc-enter {
	from {
		opacity: 0;
		translate: 0 10px;
	}
	to {
		opacity: 1;
		translate: 0 0;
	}
}

.avesta-svc-pane > * {
	animation: avesta-svc-enter 460ms var(--avesta-ease) backwards;
}

.avesta-svc-pane > :nth-child(2) {
	animation-delay: 80ms;
}

.avesta-svc-pane-head {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding-block-end: clamp(1rem, 1.8vw, 1.4rem);
	border-block-end: 1px solid var(--avesta-hairline);
}

/* A macOS app icon: squircle, gradient, sitting on its own soft shadow */
.avesta-svc-appicon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 3.4rem;
	block-size: 3.4rem;
	border-radius: 1.05rem;
	color: var(--wp--preset--color--on-primary);
	background: linear-gradient(155deg,
		color-mix(in srgb, var(--wp--preset--color--primary) 88%, #FFFFFF),
		var(--wp--preset--color--primary) 55%,
		color-mix(in srgb, var(--wp--preset--color--primary) 78%, #0B1020));
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.45),
		0 12px 22px -12px color-mix(in srgb, var(--wp--preset--color--primary) 85%, transparent);
}

.avesta-svc-appicon svg {
	inline-size: 1.7rem;
	block-size: 1.7rem;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.avesta-svc-pane-title {
	flex: 1 1 auto;
	display: grid;
	gap: 0.2rem;
}

.avesta-svc-pane-title h3 {
	margin: 0;
	font-size: clamp(1.3rem, 1.05rem + 0.8vw, 1.7rem);
	font-weight: 800;
	line-height: 1.35;
}

.avesta-svc-pane-title p {
	margin: 0;
	font-size: 0.95rem;
}

.avesta-svc-pane-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	gap: clamp(1.25rem, 2.4vw, 2.25rem);
	align-items: stretch;
}

/* Flex, not grid: the CTA row takes the leftover height with margin auto so
   the copy column always ends level with the preview beside it. */
.avesta-svc-pane-copy {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.avesta-svc-desc {
	margin: 0;
	font-size: 1rem;
	line-height: 2.1;
}

.avesta-svc-legend {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-block-start: 0.15rem;
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--muted);
}

/* Hairline that runs from the label to the edge, like a Finder section rule */
.avesta-svc-legend::after {
	content: "";
	flex: 1 1 auto;
	block-size: 1px;
	background: var(--avesta-hairline);
}

.avesta-svc-deliver {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.avesta-svc-deliver li {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.6rem 0.7rem;
	border-radius: 0.7rem;
	border: 1px solid var(--avesta-hairline);
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 3%, transparent);
	font-size: 0.88rem;
	line-height: 1.6;
}

.avesta-svc-deliver i {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 1.2rem;
	block-size: 1.2rem;
	border-radius: 50%;
	background: color-mix(in srgb, #28C840 20%, transparent);
	color: #1E8E3E;
}

html[data-theme="dark"] .avesta-svc-deliver i {
	color: #4ADE80;
}

.avesta-svc-deliver svg {
	inline-size: 0.7rem;
	block-size: 0.7rem;
	stroke: currentColor;
	fill: none;
	stroke-width: 2.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---- Copy footer: delivery window + the ask ---- */

.avesta-svc-pane-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.85rem;
	margin-block-start: auto;
	padding-block-start: clamp(1.05rem, 2vw, 1.4rem);
	border-block-start: 1px solid var(--avesta-hairline);
}

.avesta-svc-eta {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.42rem 0.85rem;
	border-radius: 999px;
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	background: color-mix(in srgb, var(--wp--preset--color--primary) 10%, transparent);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--primary) 22%, transparent);
	white-space: nowrap;
}

.avesta-svc-eta svg {
	inline-size: 0.95rem;
	block-size: 0.95rem;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.avesta-svc-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.7rem 1.35rem;
	border-radius: 999px;
	font-size: 0.92rem;
	font-weight: 800;
	text-decoration: none;
	color: var(--wp--preset--color--on-primary);
	background: var(--wp--preset--color--primary);
	box-shadow: 0 14px 26px -14px color-mix(in srgb, var(--wp--preset--color--primary) 85%, transparent);
	transition: translate 200ms var(--avesta-bounce), box-shadow 200ms var(--avesta-ease);
}

.avesta-svc-cta:hover {
	translate: 0 -2px;
	box-shadow: 0 20px 34px -14px color-mix(in srgb, var(--wp--preset--color--primary) 95%, transparent);
}

.avesta-svc-cta svg {
	inline-size: 1rem;
	block-size: 1rem;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: translate 200ms var(--avesta-ease);
}

.avesta-svc-cta:hover svg {
	translate: -4px 0;
}

/* ---- Preview column: the work itself, plus the stack it is built on ---- */

.avesta-svc-side {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.avesta-svc-stack {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.avesta-svc-stack li {
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	font-size: 0.76rem;
	font-weight: 700;
	color: var(--wp--preset--color--muted);
	border: 1px solid var(--avesta-hairline);
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 4%, transparent);
}

/* ---- Responsive ---- */

@media (max-width: 1180px) {
	.avesta-svc-body {
		grid-template-columns: 15rem minmax(0, 1fr);
	}

	.avesta-svc-pane-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.avesta-svc-side {
		order: -1;
	}
}

@media (max-width: 860px) {
	.avesta-svc-body {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Source list collapses into a scrollable chip rail above the pane */
	.avesta-svc-rail {
		display: flex;
		gap: 0.5rem;
		align-items: center;
		padding: 0.85rem 1rem;
		overflow-x: auto;
		scrollbar-width: none;
		border-inline-end: 0;
		border-block-end: 1px solid var(--avesta-hairline);
	}

	.avesta-svc-rail::-webkit-scrollbar {
		display: none;
	}

	.avesta-svc-rail-label,
	.avesta-svc-rail-foot {
		display: none;
	}

	.avesta-svc-item {
		flex: 0 0 auto;
		padding: 0.45rem 0.8rem 0.45rem 0.5rem;
		border-radius: 999px;
		border: 1px solid var(--avesta-hairline);
	}

	.avesta-svc-item-title {
		font-size: 0.85rem;
		white-space: nowrap;
	}
}

@media (max-width: 600px) {
	.avesta-svc-titletext {
		display: none;
	}

	.avesta-svc-deliver {
		grid-template-columns: minmax(0, 1fr);
	}

	.avesta-svc-pane-foot > * {
		flex: 1 1 100%;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.avesta-svc-pane > * {
		animation: none;
	}
}
