Stepped service cards
A headline with a sparkle tile and four hairline cards stepped up and down. Hovering or focusing a card turns it into a black rounded inset that lifts, slides an arrow into the icon row and brings up the description.
Part of the style
Pressed Key Grid
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/pressed-key-grid/services/figma.html?palette=8d87f09c75a54e1a
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/pressed-key-grid/services/figma.html?palette=8d87f09c75a54e1a and pass that whole HTML document to the html_to_figma tool, so the part "Stepped service cards" lands as editable layers in my open Figma file. Fonts come from Google Fonts: if a face is missing in Figma, pick the closest one.
Code
<style>
/* Goes after the pack's base.css */
:root {
--ink: #1c0e05;
--paper: #997d68;
--white: #9c806a;
--pressed: #937863;
--sand: #937863;
--guide: #967c67;
--rule-dark: #231308;
--muted: #3f2b1b;
--muted-dark: #644d3b;
--glass: rgba(129, 102, 81, 0.64);
--phosphor-deep: #1c0f05;
--ember: #937c6d;
--ember-deep: #000000;
--plum: #2d1c0f;
--lilac: #c19e86;
--orchid: #937c6d;
--phosphor: #937c6d;
}
</style>
<section class="services" aria-labelledby="services-title">
<div class="services__head">
<div class="services__intro">
<h2 class="services__title" id="services-title">
<span class="services__rise">What we make</span>
<svg class="services__sparks" viewBox="0 0 48 40" aria-hidden="true"><path d="M17 8c.5 5.8 3.4 8.7 9.2 9.2-5.8.5-8.7 3.4-9.2 9.2-.5-5.8-3.4-8.7-9.2-9.2 5.8-.5 8.7-3.4 9.2-9.2z"></path><path d="M35 2c.3 3.4 2 5.1 5.4 5.4-3.4.3-5.1 2-5.4 5.4-.3-3.4-2-5.1-5.4-5.4 3.4-.3 5.1-2 5.4-5.4z"></path><path d="M36 24c.3 3 1.8 4.5 4.8 4.8-3 .3-4.5 1.8-4.8 4.8-.3-3-1.8-4.5-4.8-4.8 3-.3 4.5-1.8 4.8-4.8z"></path></svg>
</h2>
<p class="services__lead">We design and build machines, games and rooms that make strangers grin at each other.</p>
</div>
<a class="services__key" href="#">
<span class="services__key-panel">
<svg class="services__key-arrow" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 12h17M14 6l6 6-6 6"></path></svg>
<span class="services__key-text">All services</span>
<span class="services__key-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 3c.5 4.6 3.4 7.5 8 8-4.6.5-7.5 3.4-8 8-.5-4.6-3.4-7.5-8-8 4.6-.5 7.5-3.4 8-8z"></path></svg></span>
</span>
</a>
</div>
<ul class="services__grid">
<li class="services__item" style="--step: 0.48">
<a class="services__card" href="#">
<span class="services__icons" aria-hidden="true">
<svg class="services__arrow" viewBox="0 0 24 24"><path d="M3 12h17M14 6l6 6-6 6"></path></svg>
<svg viewBox="0 0 24 24"><path d="M7 21V5.5L9 3h6l2 2.5V21M7 10.5h10M7 15h10M10 18h4M10 6.5h4"></path></svg>
</span>
<span class="services__body">
<span class="services__name">Cabinets</span>
<span class="services__more"><span>Arcade cabinets from the plywood up: wiring, side art, sticks and a screen that hums.</span></span>
</span>
</a>
</li>
<li class="services__item" style="--step: 1.2">
<a class="services__card" href="#">
<span class="services__icons" aria-hidden="true">
<svg class="services__arrow" viewBox="0 0 24 24"><path d="M3 12h17M14 6l6 6-6 6"></path></svg>
<svg viewBox="0 0 24 24"><circle cx="10" cy="13" r="7.5"></circle><circle cx="10" cy="13" r="3.5"></circle><path d="M10 5.5v2M10 18.5v2M2.5 13h2M15.5 13h2"></path><circle cx="19.5" cy="4.5" r="2"></circle></svg>
</span>
<span class="services__body">
<span class="services__name">Pinball</span>
<span class="services__more"><span>Tables drawn, wired and tuned until every ramp feels earned and every drain feels fair.</span></span>
</span>
</a>
</li>
<li class="services__item" style="--step: 0.66">
<a class="services__card" href="#">
<span class="services__icons" aria-hidden="true">
<svg class="services__arrow" viewBox="0 0 24 24"><path d="M3 12h17M14 6l6 6-6 6"></path></svg>
<svg viewBox="0 0 24 24"><path d="M7.5 7.5h9a4.5 4.5 0 0 1 4.4 5.4l-.8 3.8a2.4 2.4 0 0 1-4.1 1.1L14 15.5h-4l-2 2.3a2.4 2.4 0 0 1-4.1-1.1l-.8-3.8a4.5 4.5 0 0 1 4.4-5.4zM8 10v4M6 12h4"></path><circle cx="16" cy="11" r=".6"></circle><circle cx="17.5" cy="13" r=".6"></circle></svg>
</span>
<span class="services__body">
<span class="services__name">Game design</span>
<span class="services__more"><span>Original games for our machines and yours, from one big button to four players at once.</span></span>
</span>
</a>
</li>
<li class="services__item" style="--step: 0">
<a class="services__card" href="#">
<span class="services__icons" aria-hidden="true">
<svg class="services__arrow" viewBox="0 0 24 24"><path d="M3 12h17M14 6l6 6-6 6"></path></svg>
<svg viewBox="0 0 24 24"><path d="M14.5 6.5a4 4 0 0 1 5.3-3.8l-2.6 2.6.4 2.4 2.4.4 2.6-2.6a4 4 0 0 1-5.4 5.1L7 20.8a1.9 1.9 0 0 1-2.7-2.7l9.2-10.2a4 4 0 0 1 1-1.4zM4 4l4.5 4.5M3 6l3-3"></path></svg>
</span>
<span class="services__body">
<span class="services__name">Care & repair</span>
<span class="services__more"><span>Old machines restored and new ones kept running, on a schedule or on a late call.</span></span>
</span>
</a>
</li>
</ul>
</section>
<style>
.services {
position: relative;
padding: var(--space-xl) var(--edge);
background: var(--paper);
color: var(--ink);
}
.services__head {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
align-items: start;
gap: var(--space-m) 0;
margin-bottom: calc(var(--cell) * 0.5);
}
.services__intro { grid-column: span 3; display: grid; gap: var(--space-s); }
.services__title {
position: relative;
justify-self: start;
margin: 0;
padding-right: 0.7em;
font: 900 var(--heading)/0.85 var(--font-sans);
letter-spacing: -0.02em;
text-transform: uppercase;
}
.services__rise { display: inline-block; }
.services__word { display: inline-block; white-space: nowrap; }
.services__char { display: inline-block; contain: paint; }
.services__glyph { display: inline-block; }
.services.is-armed .services__glyph { transform: translateY(100%); }
.services.is-armed.is-seen .services__glyph {
transform: translateY(0);
transition: transform var(--t-rise) var(--spring-rise-curve) var(--delay, 0ms);
}
.services__sparks {
position: absolute;
top: -0.3em;
right: 0;
width: 0.6em;
overflow: visible;
fill: none;
stroke: currentColor;
stroke-width: 1.3;
stroke-linejoin: round;
}
.services__sparks path { transform-box: fill-box; transform-origin: center; transition: transform var(--t-panel) var(--ease-back); }
.services__title:hover .services__sparks path { transform: scale(1.25); }
.services__lead {
max-width: 22em;
margin: 0;
font: 520 var(--opening)/1.47 var(--font-sans);
letter-spacing: 0.01em;
}
.services__key {
grid-column: 4;
position: relative;
display: block;
height: var(--cell);
background: var(--ink);
color: var(--ink);
font: 700 var(--key)/1.5 var(--font-sans);
letter-spacing: 0.1em;
text-transform: uppercase;
text-decoration: none;
outline: none;
-webkit-tap-highlight-color: transparent;
}
.services__key-panel {
position: relative;
display: flex;
align-items: center;
height: 100%;
padding-left: 2em;
overflow: hidden;
border: var(--hair) solid var(--ink);
background: var(--paper);
transform: translate(var(--lift-x, 0px), var(--lift-y, 0px));
transition: transform var(--t-panel) var(--ease-expo), background-color var(--t-panel) var(--ease-expo);
}
.services__key-arrow, .services__key-text { transition: transform var(--t-slide) var(--ease-expo); }
.services__key-arrow { position: absolute; left: 2em; width: 1.5em; fill: none; stroke: currentColor; stroke-width: 1.6; transform: translateX(-4em); transition-delay: 0.1s; }
.services__key-text { flex: 1; transition-delay: 0.05s; }
.services__key-icon { display: grid; place-items: center; flex: none; width: var(--cell); height: 100%; }
.services__key-icon svg { width: 1.6em; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; transition: transform var(--t-slide) var(--ease-back); }
@media (hover: hover) and (pointer: fine) {
.services__key:hover .services__key-panel { --lift-x: calc(0.8em - var(--pointer-x, 0) * 0.5em); --lift-y: calc(-0.8em - var(--pointer-y, 0) * 0.5em); }
.services__key:hover .services__key-arrow { transform: translateX(-0.2em); }
.services__key:hover .services__key-text { transform: translateX(2em); }
.services__key:hover .services__key-icon svg { transform: rotate(90deg) scale(1.15); }
}
.services__key:focus-visible .services__key-panel { --lift-x: 0.8em; --lift-y: -0.8em; outline: 2px solid var(--ink); outline-offset: 3px; }
.services__key:focus-visible .services__key-arrow { transform: translateX(-0.2em); }
.services__key:focus-visible .services__key-text { transform: translateX(2em); }
.services__key:active .services__key-panel { --lift-x: 0px; --lift-y: 0px; background: var(--pressed); }
/* Cards: hairline cells stepped down by part of a cell, sharing their edges. */
.services__grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
align-items: start;
margin: 0;
padding: 0 0 calc(var(--cell) * 1.2);
list-style: none;
}
.services__item { margin-top: calc(var(--cell) * var(--step)); margin-left: calc(var(--hair) * -1); border: var(--hair) solid var(--ink); background: var(--paper); }
.services__item:first-child { margin-left: 0; }
.services__card {
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-end;
aspect-ratio: 4 / 5;
overflow: hidden;
background: var(--paper);
color: var(--ink);
text-decoration: none;
outline: none;
clip-path: inset(0px round 0px);
transition:
clip-path var(--t-drift) var(--ease-expo),
transform var(--t-slide) var(--ease-expo),
background-color 0s,
color var(--t-quick) var(--ease-std);
-webkit-tap-highlight-color: transparent;
}
.services__icons {
position: absolute;
top: 0;
left: 0;
display: flex;
gap: var(--space-s);
padding: var(--space-m);
font-size: var(--unit);
transform: translateX(calc(-1.8em - var(--space-s)));
transition: transform var(--t-drift) var(--ease-drift);
}
.services__icons svg {
width: 1.8em;
fill: none;
stroke: currentColor;
stroke-width: 1.4;
stroke-linecap: round;
stroke-linejoin: round;
}
.services__icons .services__arrow { stroke-width: 1; }
.services__body {
display: grid;
padding: 0 var(--space-m) var(--space-m);
}
.services__name {
font: 500 var(--title)/1.25 var(--font-sans);
letter-spacing: -0.03em;
}
.services__more {
display: grid;
grid-template-rows: 0fr;
font: 450 calc(var(--text) * 0.86)/1.4 var(--font-sans);
transition: grid-template-rows var(--t-drift) var(--ease-drift);
}
.services__more > span { overflow: hidden; padding-top: 0; transition: padding-top var(--t-drift) var(--ease-drift); }
.services__card:is(:hover, :focus-visible) {
background: var(--ink);
color: var(--white);
clip-path: inset(var(--space-xs) round var(--radius));
}
.services__card:is(:hover, :focus-visible) .services__icons { transform: translateX(var(--space-xs)) translateY(var(--space-xs)); }
.services__card:is(:hover, :focus-visible) .services__body { padding-bottom: calc(var(--space-m) + var(--space-xs)); }
.services__card:is(:hover, :focus-visible) .services__more { grid-template-rows: 1fr; }
.services__card:is(:hover, :focus-visible) .services__more > span { padding-top: var(--space-xs); }
.services__card:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; clip-path: none; border-radius: var(--radius); }
.services__card:active { transform: scale(0.98); }
@media (min-width: 1280px) { .services__card { aspect-ratio: 7 / 10; } }
@media (min-width: 1537px) {
.services__card:is(:hover, :focus-visible) { transform: translateY(-1.2em); }
}
@media (max-width: 899px) {
.services__head { grid-template-columns: 1fr; }
.services__intro { grid-column: auto; }
.services__key { grid-column: auto; }
.services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.services__item:nth-child(3) { margin-left: 0; }
.services__item:nth-child(n + 3) { margin-top: calc(var(--cell) * var(--step) - var(--hair)); }
.services__icons { padding: var(--space-s); }
.services__body { padding: 0 var(--space-s) var(--space-s); }
}
@media (max-width: 479px) {
.services__more { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
.services.is-armed .services__glyph { transform: none; }
}
</style>
<script>
(() => {
const still = matchMedia('(prefers-reduced-motion: reduce)');
function splitIntoRisingLetters(target, charStep, wordStep) {
const words = target.textContent.trim().split(/\s+/);
target.setAttribute('aria-label', target.textContent.trim());
target.replaceChildren();
let index = 0;
words.forEach((text, wordIndex) => {
const word = document.createElement('span');
word.className = 'services__word';
word.setAttribute('aria-hidden', 'true');
for (const letter of text) {
const char = document.createElement('span');
char.className = 'services__char';
const glyph = document.createElement('span');
glyph.className = 'services__glyph';
glyph.textContent = letter;
glyph.style.setProperty('--delay', `${index * charStep + wordIndex * wordStep}ms`);
char.append(glyph);
word.append(char);
index++;
}
if (wordIndex) target.append(' ');
target.append(word);
});
}
for (const root of document.querySelectorAll('.services')) {
const style = getComputedStyle(root);
root.querySelectorAll('.services__rise').forEach((target) =>
splitIntoRisingLetters(target, parseFloat(style.getPropertyValue('--stagger-char')), parseFloat(style.getPropertyValue('--stagger-word'))));
root.querySelectorAll('.services__key').forEach((key) => key.addEventListener('pointermove', (event) => {
const box = key.getBoundingClientRect();
key.style.setProperty('--pointer-x', ((event.clientX - box.left) / box.width - 0.5).toFixed(3));
key.style.setProperty('--pointer-y', ((event.clientY - box.top) / box.height - 0.5).toFixed(3));
}));
if (still.matches) continue;
root.classList.add('is-armed');
const seen = new IntersectionObserver(([entry]) => {
if (!entry.isIntersecting) return;
seen.disconnect();
requestAnimationFrame(() => root.classList.add('is-seen'));
}, { threshold: 0.15 });
seen.observe(root);
}
})();
</script>