/* ==========================================================================
   Homepage — Web Design Packages (template-parts/home/packages.php)
   Five cards with animated made-up example sites (canvas board C).
   Each scene is drawn at a fixed size (--w × --h) and home-packages.js sets
   --s on the media box so it scales down to the card width.
   ========================================================================== */

.sf-hpk .sf-section__header p {
	max-width: 780px;
	margin-inline: auto;
}

/* --- Grid: 7/5 over 4/4/4 --- */
.sf-hpk__grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 24px;
}

.sf-hpk__card--7 { grid-column: span 7; }
.sf-hpk__card--5 { grid-column: span 5; }
.sf-hpk__card--4 { grid-column: span 4; }

.sf-hpk__card {
	display: flex;
	flex-direction: column;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: 12px;
	overflow: hidden;
	color: var(--color-dark-grey);
	transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.sf-hpk__card:hover { color: var(--color-dark-grey); }

@media (hover: hover) {
	.sf-hpk__card:hover {
		transform: translateY(-4px);
		border-color: transparent;
		box-shadow: 0 18px 40px rgba(20, 25, 29, .12);
	}
	.sf-hpk__card:hover h3 { color: var(--color-orange); }
}

.sf-hpk__card:focus-visible {
	outline: 3px solid var(--color-orange);
	outline-offset: 3px;
}

.sf-hpk__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 22px 26px 26px;
}

.sf-hpk__body h3 {
	margin: 0;
	font-size: 1.3125rem;
	line-height: 1.25;
	color: inherit;
	transition: color var(--duration) var(--ease);
}

.sf-hpk__body p {
	margin: 0;
	font-size: .9375rem;
	line-height: 1.5;
	color: var(--color-mid-grey);
}

.sf-hpk__dots { display: none; }

.sf-hpk__cta {
	margin-top: var(--space-lg);
	text-align: center;
}

/* --- Scene box --- */
.sf-hpk__media {
	--w: 384px;
	--h: 280px;
	position: relative;
	overflow: hidden;
	height: calc(var(--h) * var(--s, 1));
	background: var(--color-beige);
	font-family: var(--font-sans);
	line-height: 1.2;
}

.sf-hpk__media--peach { background: #fbe4da; }
.hpk-m-marrow  { --w: 686px; --h: 350px; }
.hpk-m-bayline { --w: 490px; --h: 350px; }

.sf-hpk__scene {
	position: absolute;
	top: 0;
	left: calc((100% - var(--w) * var(--s, 1)) / 2);
	width: var(--w);
	height: var(--h);
	transform: scale(var(--s, 1));
	transform-origin: 0 0;
}

.sf-hpk__scene img { max-width: none; }
.sf-hpk__scene b { font-weight: 700; }
.sf-hpk__scene em { font-style: normal; }

/* Shared bits */
.hpk-photo {
	position: absolute;
	object-fit: cover;
	border-radius: 10px;
	border: 4px solid #fff;
	box-shadow: 0 16px 38px rgba(37, 45, 58, .2);
	animation: hpk-drift 6s ease-in-out infinite;
}

.hpk-note {
	position: absolute;
	z-index: 4;
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 9px 14px 9px 9px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 16px 38px rgba(37, 45, 58, .22);
	white-space: nowrap;
}

.hpk-note b { display: block; font-size: 12.5px; color: #14191D; }
.hpk-note span span { font-size: 11px; color: #666; }

.hpk-dot {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
}

.hpk-dot--green { background: #e3f4e6; }
.hpk-dot--peach { background: #fde3d8; }

.hpk-pop { animation: hpk-pop 7s cubic-bezier(.34, 1.56, .64, 1) infinite both; }

.hpk-sk { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.hpk-sk i { display: block; height: 8px; border-radius: 3px; background: #e4e0da; }
.hpk-sk .hpk-sk__img { height: 44px; }
.hpk-sk .hpk-sk__btn { width: 40%; height: 12px; margin-top: 4px; }

@keyframes hpk-pop {
	0%, 10%  { opacity: 0; transform: translateY(14px) scale(.88); }
	18%, 86% { opacity: 1; transform: none; }
	94%, 100% { opacity: 0; transform: translateY(-6px); }
}
@keyframes hpk-drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* --- 1. Marrow (first impression) --- */
.mw-site {
	position: absolute;
	left: 36px;
	top: 36px;
	width: 480px;
	height: 314px;
	border-radius: 12px 12px 0 0;
	overflow: hidden;
}

.mw-site__bg { width: 100%; height: 100%; object-fit: cover; }
.mw-site__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 10, 8, .85), rgba(14, 10, 8, .1) 75%); }

.mw-logo {
	position: absolute;
	left: 22px;
	top: 16px;
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .22em;
	color: #fff;
}

.mw-logo i { display: block; width: 10px; height: 13px; border-radius: 50% / 60% 60% 40% 40%; background: #C9A46A; }

.mw-h {
	position: absolute;
	left: 22px;
	top: 52px;
	width: 350px;
	font: 600 36px/1.06 var(--font-serif);
	color: #fff;
}

.mw-book {
	position: absolute;
	left: 22px;
	top: 150px;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 9px 10px;
	background: #fff;
	border-radius: 8px;
	font-size: 11px;
	color: #6b625a;
}

.mw-book b { display: block; color: #1c1714; }
.mw-book span { padding: 8px 12px; border-radius: 5px; background: #C9A46A; color: #1c1714; font-weight: 700; }

.mw-ph1 { right: 34px; top: 44px; width: 170px; height: 112px; }
.mw-ph2 { right: 74px; top: 176px; width: 150px; height: 100px; animation-delay: 1.5s; }
.mw-note { left: 60px; bottom: 30px; }

/* --- 2. Bayline (enquiries) --- */
.bl-phone {
	position: absolute;
	left: 50%;
	top: 34px;
	width: 176px;
	height: 350px;
	margin-left: -88px;
	padding: 8px;
	box-sizing: border-box;
	border-radius: 26px;
	background: #14191D;
	box-shadow: 0 16px 38px rgba(37, 45, 58, .2);
}

.bl-screen {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: 19px;
	background: #fff;
}

.bl-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 10px 7px; font-size: 9px; color: #0d2b45; }
.bl-bar b { letter-spacing: .14em; }
.bl-bar b span { color: #F05A28; }

.bl-hero { position: relative; height: 92px; }
.bl-hero img { width: 100%; height: 100%; object-fit: cover; }
.bl-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13, 43, 69, .85), rgba(13, 43, 69, .1)); }
.bl-hero b { position: absolute; z-index: 1; left: 9px; top: 12px; width: 110px; font-size: 12px; line-height: 1.2; color: #fff; }

.bl-form { display: flex; flex-direction: column; gap: 5px; padding: 9px 10px; font-size: 8.5px; color: #33414f; }
.bl-form b { font-size: 10.5px; color: #0d2b45; }
.bl-form span { padding: 5px 6px; border: 1px solid #e1e6ea; border-radius: 4px; }
.bl-form .bl-go { padding: 7px; border: 0; background: #F05A28; color: #fff; font-weight: 700; text-align: center; }

.bl-note1 { left: 18px; top: 74px; animation-delay: .3s; }
.bl-note2 { right: 16px; top: 180px; animation-delay: 1.1s; }

/* --- 3. Solvern (stand out) --- */
.so-card {
	position: absolute;
	top: 44px;
	width: 104px;
	height: 144px;
	overflow: hidden;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 20px rgba(37, 45, 58, .1);
}

.so-left  { left: 26px; }
.so-right { left: 254px; }
.so-you   { left: 140px; z-index: 2; animation: hpk-hero 6s cubic-bezier(.34, 1.4, .64, 1) infinite; }
.so-dim   { animation: hpk-dim 6s ease infinite; }

.so-bar { display: flex; align-items: center; gap: 2px; height: 10px; padding: 0 4px; background: #efebe5; }
.so-bar i { display: block; width: 3px; height: 3px; border-radius: 50%; background: #cfc8bf; }

.so-hero { position: relative; height: 76px; }
.so-hero img { width: 100%; height: 100%; object-fit: cover; }
.so-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 30, 50, .55), rgba(4, 30, 50, .05)); }
.so-logo { position: absolute; z-index: 1; left: 6px; top: 5px; font-size: 6px; letter-spacing: .18em; color: #fff; }
.so-h { position: absolute; z-index: 1; left: 6px; top: 18px; width: 80px; font: 600 11px/1.05 var(--font-serif); color: #fff; }

.so-body { display: flex; flex-direction: column; gap: 4px; padding: 7px 6px; }
.so-cta { align-self: flex-start; padding: 3px 6px; border-radius: 2px; background: #f5b335; color: #0b2233; font-size: 6.5px; font-weight: 700; }
.so-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-top: 3px; }
.so-tiles img { width: 100%; height: 22px; object-fit: cover; border-radius: 2px; }

.so-cover { position: absolute; top: 10px; right: 0; bottom: 0; left: 0; background: #fff; animation: hpk-unveil 6s ease infinite; }

.so-labels {
	position: absolute;
	top: 206px;
	left: 26px;
	right: 26px;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	color: #b9b2a8;
}

.so-me { animation: hpk-you 6s ease infinite; }
.so-cursor { position: absolute; z-index: 3; left: 196px; top: 118px; animation: hpk-cur 6s ease infinite; }
.so-chip { left: 50%; top: 228px; margin-left: -76px; animation: hpk-chip 6s cubic-bezier(.34, 1.56, .64, 1) infinite; }

@keyframes hpk-dim { 0%, 22% { opacity: 1; filter: none; } 32%, 90% { opacity: .45; filter: grayscale(1); } 100% { opacity: 1; } }
@keyframes hpk-hero {
	0%, 20%, 100% { transform: none; box-shadow: 0 8px 20px rgba(37, 45, 58, .1); }
	32%, 90% { transform: translateY(-12px) scale(1.16); box-shadow: 0 26px 46px rgba(240, 90, 40, .3); }
}
@keyframes hpk-unveil { 0%, 20%, 100% { opacity: 1; } 30%, 90% { opacity: 0; } }
@keyframes hpk-cur {
	0%, 40% { transform: translate(90px, 70px); opacity: 0; }
	46% { opacity: 1; }
	56% { transform: translate(0, 0); }
	60% { transform: translate(0, 0) scale(.8); }
	64%, 88% { transform: translate(0, 0) scale(1); opacity: 1; }
	94%, 100% { opacity: 0; transform: translate(0, 0); }
}
@keyframes hpk-chip { 0%, 60% { opacity: 0; transform: translateY(10px) scale(.9); } 66%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
@keyframes hpk-you { 0%, 22%, 100% { color: #b9b2a8; } 32%, 90% { color: #F05A28; } }

/* --- 4. Explain what you do --- */
.ex-node {
	position: absolute;
	z-index: 1;
	top: 30px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 48px;
	border: 1px solid #d6dee5;
	border-radius: 10px;
	background: #fff;
	font-size: 10.5px;
	font-weight: 700;
	color: #0f2a3d;
}

.ex-node em { font-size: 8px; letter-spacing: .05em; color: #0f6fbf; }
.ex-node--on { background: #0f2a3d; border-color: #0f2a3d; color: #fff; animation: hpk-ring 1.8s ease-out infinite; }
.ex-node--on em { color: #7fc0f5; }

.ex-pipe {
	position: absolute;
	top: 52px;
	width: 28px;
	height: 4px;
	border-radius: 2px;
	background: repeating-linear-gradient(90deg, #0f6fbf 0 7px, #cfe0ef 7px 13px);
	background-size: 13px 4px;
	animation: hpk-flow .6s linear infinite;
}

.ex-panel {
	position: absolute;
	left: 20px;
	right: 20px;
	top: 100px;
	height: 158px;
	box-sizing: border-box;
	padding: 12px 14px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 16px 38px rgba(37, 45, 58, .2);
}

.ex-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; }
.ex-top b { color: #0f2a3d; }
.ex-top span { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #F05A28; }
.ex-top svg { animation: hpk-bob 1.4s ease-in-out infinite; }

.ex-read { display: flex; align-items: baseline; gap: 22px; margin-top: 8px; }
.ex-read > span { font-size: 10px; color: #6b7783; }
.ex-read b { display: block; font-size: 22px; line-height: 1.1; color: #0f2a3d; }
.ex-read small { font-size: 11px; color: #6b7783; }
.ex-read .ex-live { display: flex; align-items: center; gap: 5px; margin-left: auto; font-size: 10.5px; font-weight: 700; color: #2f9a46; }
.ex-live i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #2f9a46; animation: hpk-blink 1.2s ease-in-out infinite; }

.ex-panel > svg { display: block; margin-top: 8px; }
.ex-line { animation: hpk-draw 4s ease-out infinite; }

@keyframes hpk-flow { from { background-position: 0 0; } to { background-position: 13px 0; } }
@keyframes hpk-ring { 0% { box-shadow: 0 0 0 0 rgba(240, 90, 40, .5); } 100% { box-shadow: 0 0 0 16px rgba(240, 90, 40, 0); } }
@keyframes hpk-draw { 0%, 8% { stroke-dashoffset: 1; } 70%, 100% { stroke-dashoffset: 0; } }
@keyframes hpk-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes hpk-bob { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(2px); } }

/* --- 5. Several audiences --- */
.au-seg {
	position: absolute;
	top: 24px;
	left: 50%;
	display: flex;
	width: 296px;
	height: 38px;
	margin-left: -148px;
	padding: 4px;
	box-sizing: border-box;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 10px 24px rgba(37, 45, 58, .12);
}

.au-ind { position: absolute; left: 4px; top: 4px; width: 72px; height: 30px; border-radius: 15px; background: #0b1b2b; animation: hpk-slide 12s cubic-bezier(.6, 0, .3, 1) infinite; }
.au-lab { position: relative; width: 72px; text-align: center; font-size: 11px; font-weight: 700; line-height: 30px; color: #33414f; animation: hpk-lab 12s linear infinite; }

.au-box {
	position: absolute;
	left: 30px;
	right: 30px;
	top: 76px;
	height: 178px;
	overflow: hidden;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 16px 38px rgba(37, 45, 58, .16);
}

.au-slot { position: absolute; inset: 0; padding: 14px 16px; opacity: 0; animation: hpk-slot 12s ease infinite; }
.au-h { margin-bottom: 8px; font-size: 10px; font-weight: 700; letter-spacing: .12em; color: #8a96a3; }

.au-price { display: flex; align-items: baseline; gap: 8px; }
.au-price b { font-size: 22px; color: #0b1b2b; }
.au-price span { font-size: 12px; font-weight: 700; color: #2f9a46; }
.au-slot svg { display: block; margin: 6px 0 8px; }
.au-doc { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #0b1b2b; }
.au-doc span { padding: 3px 4px; border-radius: 3px; background: #F05A28; color: #fff; font-size: 8.5px; font-weight: 700; }
.au-doc em { margin-left: auto; color: #F05A28; font-weight: 700; }

.au-jobs { display: flex; gap: 14px; }
.au-jobs img { flex: none; width: 104px; height: 148px; object-fit: cover; border-radius: 8px; }
.au-jobs > div { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: #6b7783; }
.au-jobs .au-h { margin-bottom: 2px; }
.au-jobs b { font-size: 16px; line-height: 1.2; color: #0b1b2b; }
.au-jobs .au-apply { align-self: flex-start; margin-top: 10px; padding: 8px 14px; border-radius: 16px; background: #F05A28; color: #fff; font-weight: 700; }
.au-jobs span:last-child { margin-top: 6px; font-size: 11px; }

.au-biz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; font-size: 11px; font-weight: 700; color: #0b1b2b; }
.au-biz img { width: 100%; height: 44px; margin-bottom: 3px; object-fit: cover; border-radius: 6px; }

.au-news { margin-bottom: 9px; padding-bottom: 9px; border-bottom: 1px solid #eef1f4; }
.au-news span { font-size: 10px; color: #8a96a3; }
.au-news b { display: block; margin-top: 2px; font-size: 13px; line-height: 1.3; color: #0b1b2b; }
.au-more { font-size: 11.5px; font-weight: 700; color: #F05A28; }

@keyframes hpk-slide {
	0%, 22%  { transform: translateX(0); }
	25%, 47% { transform: translateX(72px); }
	50%, 72% { transform: translateX(144px); }
	75%, 97% { transform: translateX(216px); }
	100%     { transform: translateX(0); }
}
@keyframes hpk-lab { 0%, 23% { color: #fff; } 25%, 100% { color: #33414f; } }
@keyframes hpk-slot { 0% { opacity: 0; transform: translateY(10px); } 3%, 22% { opacity: 1; transform: none; } 25%, 100% { opacity: 0; transform: translateY(-6px); } }

/* Paused while off screen (home-packages.js) */
.sf-hpk.is-paused *,
.sf-hpk.is-paused *::after { animation-play-state: paused !important; }

/* --- Tablet and phone: one swipeable row, every scene drawn at 384 × 280 --- */
@media (max-width: 900px) {
	.sf-hpk__grid {
		display: flex;
		gap: 12px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--space-md);
		margin-inline: calc(-1 * var(--space-md));
		padding: 4px var(--space-md) 18px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.sf-hpk__grid::-webkit-scrollbar { display: none; }

	.sf-hpk__card {
		flex: 0 0 min(330px, calc(100% - 28px));
		scroll-snap-align: start;
	}

	.sf-hpk__media,
	.hpk-m-marrow,
	.hpk-m-bayline { --w: 384px; --h: 280px; }

	.sf-hpk__body { gap: 5px; padding: 18px 20px 22px; }
	.sf-hpk__body h3 { font-size: 1.1875rem; }
	.sf-hpk__body p { font-size: .875rem; }

	.sf-hpk__dots {
		display: flex;
		justify-content: center;
		gap: 8px;
		margin-top: 4px;
	}

	.sf-hpk__dots i {
		display: block;
		width: 8px;
		height: 8px;
		border-radius: 4px;
		background: #d9d2c8;
		transition: width var(--duration), background var(--duration);
	}

	.sf-hpk__dots i.is-on { width: 22px; background: var(--color-orange); }

	.sf-hpk__cta { margin-top: var(--space-md); }

	/* Marrow, redrawn for the narrower scene */
	.mw-site { left: 24px; top: 26px; width: 336px; height: 254px; }
	.mw-site__shade { background: linear-gradient(90deg, rgba(14, 10, 8, .85), rgba(14, 10, 8, .15) 80%); }
	.mw-logo { left: 18px; top: 14px; font-size: 11px; }
	.mw-logo i { width: 9px; height: 12px; }
	.mw-h { left: 18px; top: 44px; width: 230px; font-size: 30px; }
	.mw-book { left: 18px; top: 150px; gap: 14px; padding: 8px 9px; font-size: 10.5px; }
	.mw-book span { padding: 7px 10px; }
	.mw-ph1 { right: 12px; top: 18px; width: 118px; height: 80px; border-width: 3px; border-radius: 8px; }
	.mw-ph2 { display: none; }
	.mw-note { left: auto; right: 14px; bottom: 12px; }

	/* Bayline */
	.bl-phone { top: 28px; width: 168px; height: 330px; margin-left: -84px; }
	.bl-bar { padding-top: 13px; }
	.bl-hero { height: 86px; }
	.bl-hero b { top: 11px; }
	.bl-extra { display: none; }
	.bl-note1 { left: 12px; top: 64px; }
	.bl-note2 { right: 12px; top: 178px; }
}

@media (max-width: 900px) and (hover: hover) {
	.sf-hpk__card:hover { transform: none; box-shadow: none; border-color: var(--color-border); }
}

/* --- Reduced motion: hold each scene on its finished state --- */
@media (prefers-reduced-motion: reduce) {
	.sf-hpk *,
	.sf-hpk *::after { animation: none !important; }
	.sf-hpk__card,
	.sf-hpk__card:hover { transform: none; }
	.so-cover,
	.so-cursor { display: none; }
	.so-dim { opacity: .45; filter: grayscale(1); }
	.so-you { transform: translateY(-12px) scale(1.16); box-shadow: 0 26px 46px rgba(240, 90, 40, .3); }
	.so-me { color: #F05A28; }
	.au-slot--first { opacity: 1; }
	.au-lab:first-of-type { color: #fff; }
}
