/*
 * Service pages: what is specific to them on top of inner.css and components.css.
 * Numbered steps, the price line and the FAQ. Logical properties only.
 */

/* ---------------------------------------------------------------- Steps */

.ayh-steps {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: ayh-step;
}

.ayh-steps li {
	counter-increment: ayh-step;
	position: relative;
	padding-block: 1.1rem;
	padding-inline-start: 3.25rem;
	font-size: var(--wp--preset--font-size--large);
	border-block-end: 1px solid var(--wp--preset--color--line);
}

.ayh-steps li:first-child {
	padding-block-start: 0;
}

/* Persian numeral in a leaning brass plate */
.ayh-steps li::before {
	content: counter(ayh-step, persian);
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: 1.1rem;
	display: grid;
	place-items: center;
	inline-size: 2.25rem;
	block-size: 2.25rem;
	font-family: var(--wp--preset--font-family--peyda);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--brass-light);
	border-radius: 0.5rem;
	transform: skewX(var(--ayh-skew-el));
}

.ayh-steps li:first-child::before {
	inset-block-start: 0;
}

.ayh-steps strong {
	display: block;
	font-weight: 700;
}

/* ---------------------------------------------------------------- Price */

.ayh-price {
	font-family: var(--wp--preset--font-family--peyda);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 700;
	line-height: 1.5;
	color: var(--wp--preset--color--ink);
}

.ayh-price + p {
	max-inline-size: 36rem;
	margin-block-start: 0.75rem;
	color: var(--wp--preset--color--stone);
}

/* ---------------------------------------------------------------- FAQ */

.ayh-faq {
	border-block-start: 1px solid var(--wp--preset--color--line);
}

.ayh-faq__item {
	border-block-end: 1px solid var(--wp--preset--color--line);
}

.ayh-faq__item summary {
	position: relative;
	cursor: pointer;
	list-style: none;
	padding-block: 1.25rem;
	padding-inline-end: 2.5rem;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

.ayh-faq__item summary::-webkit-details-marker {
	display: none;
}

/* A leaning brass bar that turns upright-ish when open */
.ayh-faq__item summary::after {
	content: "";
	position: absolute;
	inset-inline-end: 0.5rem;
	inset-block-start: 50%;
	inline-size: 3px;
	block-size: 1.2rem;
	margin-block-start: -0.6rem;
	background: var(--wp--preset--color--brass);
	border-radius: 999px;
	transform: skewX(var(--ayh-skew-el));
	transition: transform 0.3s ease;
}

.ayh-faq__item[open] summary::after {
	transform: skewX(var(--ayh-skew-el)) rotate(90deg);
}

.ayh-faq__item summary:focus-visible {
	outline: 3px solid var(--wp--preset--color--brass);
	outline-offset: 2px;
}

.ayh-faq__item p {
	max-inline-size: 40rem;
	margin: 0;
	padding-block-end: 1.5rem;
	color: var(--wp--preset--color--stone);
}

@media (prefers-reduced-motion: reduce) {
	.ayh-faq__item summary::after {
		transition: none;
	}
}

/* ---------------------------------------------------------------- Related work: one smooth row */

.ayh-work--row .ayh-work__list {
	display: flex;
	align-items: stretch;
	gap: 1.5rem;
	padding-block-end: 1.25rem;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scroll-behavior: smooth;
	scrollbar-width: thin;
}

.ayh-work--row .ayh-work__list > .wp-block-post,
.ayh-work--row .ayh-work__list > .wp-block-post:nth-child(n) {
	flex: 0 0 min(78vw, 22rem);
	grid-column: auto;
	margin-block: 0;
	aspect-ratio: 4 / 3;
	--ayh-d: 8%;
	scroll-snap-align: start;
}

.ayh-work--row .ayh-work__list > .wp-block-post:nth-child(n) .ayh-work__title {
	font-size: var(--wp--preset--font-size--large);
}

@media (prefers-reduced-motion: reduce) {
	.ayh-work--row .ayh-work__list {
		scroll-behavior: auto;
	}
}

/* Let the row scroll inside its column instead of widening it */
.ayh-work--row .ayh-work__inner {
	grid-template-columns: minmax(0, 1fr);
}

.ayh-work--row .ayh-work__query {
	min-inline-size: 0;
}

.ayh-work--row {
	padding-block-end: clamp(2rem, 4vw, 3rem);
}


/* Continuous loop (set up by service-row.js): the list shifts by exactly one set of tiles, then restarts
 * unseen. It stops under the pointer and while a tile has focus. */
.ayh-work--row.is-marquee .ayh-work__query {
	overflow: hidden;
}

.ayh-work--row.is-marquee .ayh-work__list {
	inline-size: max-content;
	overflow: visible;
	scroll-snap-type: none;
	padding-block-end: 0;
	animation: ayh-row-run var(--ayh-row-dur) linear infinite;
}

.ayh-work--row.is-marquee .ayh-work__list:has(.wp-block-post:hover),
.ayh-work--row.is-marquee .ayh-work__list:focus-within {
	animation-play-state: paused;
}

/* The loop repeats the tiles, so the running numbers would not make sense */
.ayh-work--row .ayh-work__title::before {
	display: none;
}

@keyframes ayh-row-run {
	to {
		transform: translateX(calc(var(--ayh-row-shift) * var(--ayh-row-dir)));
	}
}

/* ---------------------------------------------------------------- Graphic accents */

/* Included items as leaning tiles, each with a line icon on a brass plate */
.ayh-tiles {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 40rem) {
	.ayh-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.ayh-tile {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: 1.25rem;
	background: color-mix(in srgb, var(--wp--preset--color--brass-light) 14%, var(--wp--preset--color--ivory));
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 1rem;
	transition: transform 0.3s ease, border-color 0.3s ease;
}

.ayh-tile:hover {
	transform: translateY(-3px);
	border-color: var(--wp--preset--color--brass);
}

.ayh-tile__icon {
	flex: none;
	display: grid;
	place-items: center;
	inline-size: 2.75rem;
	block-size: 2.75rem;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--brass-light);
	border-radius: 0.6rem;
	transform: skewX(var(--ayh-skew-el));
}

.ayh-tile__icon svg {
	inline-size: 1.5rem;
	block-size: 1.5rem;
	transform: skewX(calc(var(--ayh-skew-el) * -1)); /* keep the icon upright inside the leaning plate */
}

.ayh-tile__text {
	line-height: 1.8;
}

/* The logo as a quiet accent: a tall bar with a shorter brass one beside it. Same lean (23deg), same gap at the
 * base everywhere, the short one standing on the tall one's right. The lean is the logo's, so it does not mirror
 * with the text direction and these use physical offsets. */
.ayh-deco {
	--ayh-deco-w: 1.5rem;
	--ayh-deco-gap: 1rem;
	position: relative;
	isolation: isolate;
	overflow: clip;
}

.ayh-deco::before,
.ayh-deco::after {
	content: "";
	position: absolute;
	z-index: -1;
	inset-block-end: 14%;
	left: 4%;
	border-radius: 999px;
	transform: skewX(var(--ayh-skew-el));
	transform-origin: 50% 100%; /* skew from the base, so the gap at the base never changes */
	pointer-events: none;
}

.ayh-deco::before {
	inline-size: var(--ayh-deco-w);
	block-size: 72%;
	background: color-mix(in srgb, var(--wp--preset--color--ink) 6%, transparent);
}

.ayh-deco::after {
	left: calc(4% + var(--ayh-deco-w) + var(--ayh-deco-gap));
	inline-size: 1rem;
	block-size: 34%;
	background: color-mix(in srgb, var(--wp--preset--color--brass) 28%, transparent);
}

/* The short bar swings in against the tall one as the section scrolls into view (where supported) */
@supports (animation-timeline: view()) {
	.ayh-deco::after {
		animation: ayh-deco-lean linear both;
		animation-timeline: view();
		animation-range: entry 0% cover 35%;
	}
}

@keyframes ayh-deco-lean {
	from {
		rotate: 16deg;
		opacity: 0;
	}

	to {
		rotate: 0deg;
		opacity: 1;
	}
}

@media (max-width: 63.9375rem) {
	.ayh-deco::before,
	.ayh-deco::after {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ayh-tile {
		transition: none;
	}
}

/* An odd last tile takes the whole row instead of sitting alone */
@media (min-width: 40rem) {
	.ayh-tile:last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ayh-deco::after {
		animation: none;
	}
}

/* ---------------------------------------------------------------- Process: a rail that draws itself between the numbers */

.ayh-steps li:not(:last-child)::after {
	content: "";
	position: absolute;
	inset-inline-start: 1.06rem;
	inset-block: 3.35rem -1.1rem;
	inline-size: 2px;
	background: color-mix(in srgb, var(--wp--preset--color--brass) 60%, transparent);
	border-radius: 999px;
	transform-origin: top;
}

.ayh-steps li:first-child:not(:last-child)::after {
	inset-block-start: 2.25rem;
}

@supports (animation-timeline: view()) {
	.ayh-steps li:not(:last-child)::after {
		animation: ayh-rail linear both;
		animation-timeline: view();
		animation-range: entry 30% cover 45%;
	}
}

@keyframes ayh-rail {
	from {
		transform: scaleY(0);
	}

	to {
		transform: scaleY(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ayh-steps li::after {
		animation: none;
	}
}

/* ---------------------------------------------------------------- Timeline (SEO): six leaning bars, rising */

.ayh-timeline {
	margin-block-start: 2.5rem;
}

.ayh-timeline__bars {
	display: flex;
	align-items: flex-end;
	gap: clamp(0.75rem, 3vw, 1.5rem);
	block-size: 12rem;
	margin: 0;
	padding: 0 0.75rem;
	list-style: none;
}

.ayh-timeline__bar {
	position: relative;
	flex: 1 1 0;
	block-size: calc(var(--ayh-h) * 1%);
	max-inline-size: 4rem;
	background: color-mix(in srgb, var(--wp--preset--color--ink) 14%, transparent);
	border-radius: 0.6rem;
	transform: skewX(var(--ayh-skew-el));
	transform-origin: 50% 100%;
	transition: background-color 0.3s ease, translate 0.3s ease;
}

.ayh-timeline__bar:hover,
.ayh-timeline__bar:focus-visible {
	translate: 0 -6px;
	background: color-mix(in srgb, var(--wp--preset--color--brass) 55%, transparent);
	outline: none;
}

.ayh-timeline__bar--mark {
	background: var(--wp--preset--color--brass);
}

.ayh-timeline__bar--soft {
	background: color-mix(in srgb, var(--wp--preset--color--brass) 38%, transparent);
}

/* The label stands upright over the leaning bar */
.ayh-timeline__tag {
	position: absolute;
	inset-block-end: calc(100% + 0.5rem);
	left: 50%; /* physical: the translate below is physical too */
	translate: -50% 0;
	transform: skewX(calc(var(--ayh-skew-el) * -1));
	padding: 0.15rem 0.6rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	white-space: nowrap;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--brass-light);
	border-radius: 999px;
}

.ayh-timeline__months {
	display: flex;
	gap: clamp(0.75rem, 3vw, 1.5rem);
	margin: 0.75rem 0 0;
	padding: 0 0.75rem;
	list-style: none;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--stone);
}

.ayh-timeline__months li {
	flex: 1 1 0;
	max-inline-size: 4rem;
	text-align: center;
}

.ayh-timeline__note {
	margin-block: 1rem 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--stone);
}

@supports (animation-timeline: view()) {
	.ayh-timeline__bar {
		animation: ayh-bar-rise linear both;
		animation-timeline: view();
		animation-range: entry calc(var(--ayh-i) * 5%) entry calc(55% + var(--ayh-i) * 5%);
	}
}

@keyframes ayh-bar-rise {
	from {
		scale: 1 0.04;
	}

	to {
		scale: 1 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ayh-timeline__bar {
		animation: none;
		transition: none;
	}
}

/* ---------------------------------------------------------------- Automation: workflow line and the three-way choice */

/* Four stops joined by a line; a brass dot travels along it as the block scrolls into view */
.ayh-flow {
	position: relative;
	display: flex;
	justify-content: space-between;
	margin: 2.5rem 0 0;
	padding: 0;
	list-style: none;
}

.ayh-flow::before,
.ayh-flow::after {
	content: "";
	position: absolute;
	border-radius: 999px;
}

.ayh-flow::before {
	inset-inline: 1.4rem;
	inset-block-start: 1.375rem;
	block-size: 2px;
	background: color-mix(in srgb, var(--wp--preset--color--brass) 45%, transparent);
}

.ayh-flow::after {
	inset-block-start: calc(1.375rem - 0.4rem + 1px);
	inset-inline-start: 1.4rem;
	inline-size: 0.8rem;
	block-size: 0.8rem;
	background: var(--wp--preset--color--brass);
}

.ayh-flow__stop {
	position: relative;
	z-index: 1;
	display: grid;
	justify-items: center;
	gap: 0.5rem;
}

.ayh-flow__label {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

@supports (animation-timeline: view()) {
	.ayh-flow::after {
		animation: ayh-flow-run linear both;
		animation-timeline: view();
		animation-range: entry 20% cover 55%;
	}
}

@keyframes ayh-flow-run {
	from {
		inset-inline-start: 1.4rem;
	}

	to {
		inset-inline-start: calc(100% - 1.4rem - 0.8rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ayh-flow::after {
		animation: none;
	}
}

/* Three equal choices: icon over text, three across when there is room */
@media (min-width: 48rem) {
	.ayh-tiles--three {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.ayh-tiles--three .ayh-tile {
		flex-direction: column;
	}

	.ayh-tiles--three .ayh-tile:last-child:nth-child(odd) {
		grid-column: auto;
	}
}

.ayh-tiles--three + p,
.ayh-tiles--three + .ayh-lines {
	margin-block-start: 1.5rem;
}

/* ---------------------------------------------------------------- Services index: four linked cards */

.ayh-svc-cards {
	display: grid;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 40rem) {
	.ayh-svc-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.75rem;
	}

	/* The second row steps down, like the front page's stepped tiles */
	.ayh-svc-card:nth-child(even) {
		margin-block-start: 2.5rem;
	}
}

.ayh-svc-card {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: grid;
	align-content: start;
	gap: 0.75rem;
	padding: 2rem 2rem 1.75rem;
	background: color-mix(in srgb, var(--wp--preset--color--brass-light) 14%, var(--wp--preset--color--ivory));
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 1.25rem;
	transition: border-color 0.3s ease, transform 0.3s ease;
}

/* The leaning brass wipe that fills the card on hover */
.ayh-svc-card::before {
	content: "";
	position: absolute;
	inset: -10% -30%;
	z-index: -1;
	background: color-mix(in srgb, var(--wp--preset--color--brass-light) 55%, transparent);
	transform: translateX(120%) skewX(var(--ayh-skew-el));
	transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.ayh-svc-card:dir(ltr)::before {
	transform: translateX(-120%) skewX(var(--ayh-skew-el));
}

.ayh-svc-card:hover::before,
.ayh-svc-card:focus-within::before {
	transform: translateX(0) skewX(var(--ayh-skew-el));
}

.ayh-svc-card:hover {
	border-color: var(--wp--preset--color--brass);
	transform: translateY(-4px);
}

.ayh-svc-card__num {
	position: absolute;
	inset-block-start: 1.25rem;
	inset-inline-end: 1.5rem;
	font-family: var(--wp--preset--font-family--peyda);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	line-height: 1;
	color: transparent;
	-webkit-text-stroke: 1px color-mix(in srgb, var(--wp--preset--color--ink) 35%, transparent);
}

.ayh-svc-card__icon {
	inline-size: 3.5rem;
	block-size: 3.5rem;
	margin-block-end: 0.5rem;
	transition: transform 0.4s ease;
}

.ayh-svc-card__icon svg {
	inline-size: 1.9rem;
	block-size: 1.9rem;
}

.ayh-svc-card:hover .ayh-svc-card__icon {
	transform: skewX(var(--ayh-skew-el)) translateY(-3px);
}

.ayh-svc-card__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.5;
}

/* The whole card is the click target */
.ayh-svc-card__title a,
.ayh-svc-card__title a:hover,
.ayh-svc-card__title a:focus-visible {
	color: inherit;
	text-decoration: none;
}

.ayh-svc-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

html[data-input="keyboard"] .ayh-svc-card:has(a:focus-visible) {
	outline: 3px solid var(--wp--preset--color--brass);
	outline-offset: -6px;
}

.ayh-svc-card__text {
	margin: 0;
	max-inline-size: 28rem;
	color: var(--wp--preset--color--stone);
}

.ayh-svc-card__more {
	margin-block-start: 0.5rem;
	font-weight: 700;
	color: var(--wp--preset--color--brass-dark);
}

.ayh-svc-card__more::after {
	content: "\2190";
	margin-inline-start: 0.5rem;
	display: inline-block;
	transition: translate 0.3s ease;
}

.ayh-svc-card__more:dir(ltr)::after {
	content: "\2192";
}

.ayh-svc-card:hover .ayh-svc-card__more::after {
	translate: -6px 0;
}

.ayh-svc-card:hover .ayh-svc-card__more:dir(ltr)::after {
	translate: 6px 0;
}

@media (prefers-reduced-motion: reduce) {
	.ayh-svc-card,
	.ayh-svc-card::before,
	.ayh-svc-card__icon,
	.ayh-svc-card__more::after {
		transition: none;
	}
}

/* ---------------------------------------------------------------- Web design: the deliverables, mapped on a mock page */

/* The section is an .ayh-split: title and mock page in the narrow column, the list in the wide one */
.ayh-deliver > * {
	margin-block: 0;
}

@media (min-width: 64rem) {
	.ayh-deliver .ayh-split__title {
		grid-column: 1;
		grid-row: 1;
	}

	.ayh-deliver .ayh-wf {
		grid-column: 1;
		grid-row: 2;
		position: sticky;
		inset-block-start: 7rem;
	}

	.ayh-deliver .ayh-deliver__list {
		grid-column: 2;
		grid-row: 1 / span 2;
	}
}

.ayh-wf {
	margin: 0;
}

.ayh-wf svg {
	display: block;
	inline-size: 100%;
	block-size: auto;
	overflow: visible;
}

.ayh-wf__frame {
	fill: color-mix(in srgb, var(--wp--preset--color--ivory) 55%, #fff);
	stroke: color-mix(in srgb, var(--wp--preset--color--ink) 40%, transparent);
	stroke-width: 1.5;
}

.ayh-wf__dot {
	fill: color-mix(in srgb, var(--wp--preset--color--ink) 30%, transparent);
}

.ayh-wf__zone {
	fill: none;
	stroke: color-mix(in srgb, var(--wp--preset--color--ink) 45%, transparent);
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	transform-box: fill-box;
	transform-origin: center;
	transition: transform 0.35s ease, fill 0.35s ease, stroke 0.35s ease;
}

.ayh-wf__zone > :first-child:is(rect, path) {
	fill: color-mix(in srgb, var(--wp--preset--color--ink) 4%, transparent);
}

.ayh-wf[data-active="design"] [data-zone="design"],
.ayh-wf[data-active="code"] [data-zone="code"],
.ayh-wf[data-active="speed"] [data-zone="speed"],
.ayh-wf[data-active="seo"] [data-zone="seo"],
.ayh-wf[data-active="mobile"] [data-zone="mobile"],
.ayh-wf[data-active="content"] [data-zone="content"],
.ayh-wf[data-active="support"] [data-zone="support"] {
	stroke: var(--wp--preset--color--ink);
	transform: translateY(-4px) scale(1.04);
}

.ayh-wf[data-active="design"] [data-zone="design"] > :first-child,
.ayh-wf[data-active="code"] [data-zone="code"] > :first-child,
.ayh-wf[data-active="speed"] [data-zone="speed"] > :first-child,
.ayh-wf[data-active="seo"] [data-zone="seo"] > :first-child,
.ayh-wf[data-active="mobile"] [data-zone="mobile"] > :first-child,
.ayh-wf[data-active="content"] [data-zone="content"] > :first-child,
.ayh-wf[data-active="support"] [data-zone="support"] > :first-child {
	fill: var(--wp--preset--color--brass-light);
}

.ayh-deliver__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ayh-deliver__item {
	position: relative;
	inline-size: 100%;
	padding-block: 1rem;
	padding-inline: 2rem 0.5rem;
	border: 0;
	border-block-end: 1px solid var(--wp--preset--color--line);
	background: none;
	font: inherit;
	font-size: var(--wp--preset--font-size--large);
	text-align: start;
	color: inherit;
	cursor: pointer;
	transition: color 0.25s ease, padding 0.25s ease;
}

.ayh-deliver__item::before {
	content: "";
	position: absolute;
	inset-inline-start: 0.5rem;
	inset-block-start: 1.3rem;
	inline-size: 3px;
	block-size: 1.2rem;
	background: var(--wp--preset--color--brass);
	border-radius: 999px;
	transform: skewX(var(--ayh-skew-el));
	transition: block-size 0.3s ease, background-color 0.3s ease;
}

.ayh-deliver__item[aria-pressed="true"] {
	font-weight: 700;
}

.ayh-deliver__item[aria-pressed="true"]::before {
	block-size: 2.2rem;
	background: var(--wp--preset--color--ink);
}

.ayh-deliver__item:focus-visible {
	outline: 3px solid var(--wp--preset--color--brass);
	outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
	.ayh-wf__zone,
	.ayh-deliver__item,
	.ayh-deliver__item::before {
		transition: none;
	}
}

/* Keeps the figure from jumping while the price counts up */
[data-ayh-count] {
	display: inline-block;
	min-inline-size: 2ch;
	text-align: center;
	font-variant-numeric: tabular-nums;
}
