ferst-core 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/LICENSE +102 -201
  2. package/LICENSE-Apache-2.0 +201 -0
  3. package/NOTICE +24 -5
  4. package/README.md +89 -73
  5. package/bin/check-thin.mjs +74 -0
  6. package/components/BlockRenderer.astro +89 -0
  7. package/components/Button.astro +85 -33
  8. package/components/CalendarEmbed.astro +188 -0
  9. package/components/Card.astro +7 -17
  10. package/components/Icon.astro +35 -0
  11. package/components/PostArticle.astro +133 -0
  12. package/components/PostCard.astro +85 -225
  13. package/components/SiteFooter.astro +2 -2
  14. package/components/SiteHeader.astro +104 -51
  15. package/components/blocks/Badge.astro +29 -0
  16. package/components/blocks/ButtonBlock.astro +13 -0
  17. package/components/blocks/Divider.astro +12 -0
  18. package/components/blocks/Grid.astro +48 -0
  19. package/components/blocks/Heading.astro +42 -0
  20. package/components/blocks/ImageBlock.astro +80 -0
  21. package/components/blocks/List.astro +78 -0
  22. package/components/blocks/Prose.astro +29 -0
  23. package/components/blocks/Quote.astro +32 -0
  24. package/components/blocks/Section.astro +52 -0
  25. package/components/blocks/Spacer.astro +20 -0
  26. package/components/blocks/Stack.astro +30 -0
  27. package/components/blocks/Stat.astro +30 -0
  28. package/components/recipes/Accordion.astro +84 -0
  29. package/components/recipes/Announcement.astro +74 -0
  30. package/components/recipes/Banner.astro +134 -0
  31. package/components/recipes/Bento.astro +138 -0
  32. package/components/recipes/ContactForm.astro +172 -0
  33. package/components/recipes/Cta.astro +83 -0
  34. package/components/recipes/Faq.astro +80 -0
  35. package/components/recipes/FeatureCards.astro +105 -0
  36. package/components/recipes/Gallery.astro +55 -0
  37. package/components/recipes/Hero.astro +191 -0
  38. package/components/recipes/Logos.astro +77 -0
  39. package/components/recipes/Marquee.astro +75 -0
  40. package/components/recipes/Pricing.astro +149 -0
  41. package/components/recipes/Stats.astro +124 -0
  42. package/components/recipes/Steps.astro +120 -0
  43. package/components/recipes/Tabs.astro +133 -0
  44. package/components/recipes/Testimonial.astro +66 -0
  45. package/components/recipes/Tiles.astro +248 -0
  46. package/content/blocks.ts +534 -0
  47. package/content/calendar.ts +40 -0
  48. package/content/collections.ts +25 -14
  49. package/content/posts.ts +89 -0
  50. package/content/schemas.ts +58 -123
  51. package/layouts/Base.astro +30 -56
  52. package/lib/calendar.ts +12 -0
  53. package/lib/icons.ts +64 -0
  54. package/lib/pages.ts +42 -0
  55. package/lib/posts.ts +93 -0
  56. package/lib/siteSettings.ts +18 -36
  57. package/lib/themeTokens.ts +163 -0
  58. package/package.json +61 -48
  59. package/styles/theme.css +42 -0
  60. package/components/DocLayout.astro +0 -292
  61. package/components/GroupCard.astro +0 -164
  62. package/components/LatestPostList.astro +0 -64
  63. package/components/PaginationNav.astro +0 -81
  64. package/components/PostsToolbar.astro +0 -83
  65. package/content/filters.ts +0 -107
  66. package/lib/mailLinks.ts +0 -13
  67. package/lib/mapsLink.ts +0 -7
  68. package/utils/excerpt.ts +0 -56
  69. package/utils/formatDate.ts +0 -22
  70. package/utils/freshness.ts +0 -5
@@ -0,0 +1,124 @@
1
+ ---
2
+ /** Stats — a Level-2 recipe: a band of headline numbers over an optional
3
+ * heading/intro. Composes the Heading primitive; numbers use the brand accent. */
4
+ import Heading from '../blocks/Heading.astro';
5
+
6
+ interface Item { value: string; label: string; description?: string }
7
+ interface Props {
8
+ title?: string;
9
+ intro?: string;
10
+ background?: 'none' | 'muted' | 'accent';
11
+ columns?: 2 | 3 | 4;
12
+ items?: Item[];
13
+ }
14
+ const { title, intro, background = 'muted', columns = 3, items = [] } = Astro.props;
15
+ ---
16
+
17
+ <section class="b-stats" data-bg={background}>
18
+ <div class="b-stats__inner">
19
+ {(title || intro) && (
20
+ <div class="b-stats__head">
21
+ {title && <Heading text={title} level={2} align="center" />}
22
+ {intro && <p class="b-stats__intro">{intro}</p>}
23
+ </div>
24
+ )}
25
+ <div class="b-stats__grid" data-cols={columns}>
26
+ {items.map((item) => (
27
+ <div class="b-stats__item">
28
+ <span class="b-stats__value">{item.value}</span>
29
+ <span class="b-stats__label">{item.label}</span>
30
+ {item.description && <span class="b-stats__desc">{item.description}</span>}
31
+ </div>
32
+ ))}
33
+ </div>
34
+ </div>
35
+ </section>
36
+
37
+ <style>
38
+ .b-stats { padding-block: clamp(2.5rem, 6vw, 4rem); }
39
+ .b-stats[data-bg='muted'] { background: var(--bg-section); }
40
+ .b-stats[data-bg='accent'] { background: var(--gold-light); }
41
+ .b-stats__inner {
42
+ max-width: 72rem;
43
+ margin-inline: auto;
44
+ padding-inline: 1rem;
45
+ display: flex;
46
+ flex-direction: column;
47
+ gap: 2rem;
48
+ }
49
+ .b-stats__head {
50
+ max-width: var(--max);
51
+ margin-inline: auto;
52
+ text-align: center;
53
+ display: flex;
54
+ flex-direction: column;
55
+ gap: 0.75rem;
56
+ }
57
+ .b-stats__intro { margin: 0; color: var(--muted); line-height: 1.6; }
58
+ .b-stats__grid {
59
+ display: grid;
60
+ grid-template-columns: 1fr;
61
+ gap: 1.5rem 2rem;
62
+ }
63
+ @media (min-width: 40em) {
64
+ .b-stats__grid { grid-template-columns: repeat(2, 1fr); }
65
+ }
66
+ @media (min-width: 60em) {
67
+ .b-stats__grid[data-cols='3'] { grid-template-columns: repeat(3, 1fr); }
68
+ .b-stats__grid[data-cols='4'] { grid-template-columns: repeat(4, 1fr); }
69
+ }
70
+ .b-stats__item {
71
+ display: flex;
72
+ flex-direction: column;
73
+ align-items: center;
74
+ text-align: center;
75
+ gap: 0.35rem;
76
+ }
77
+ .b-stats__value {
78
+ font-family: var(--font-heading);
79
+ font-weight: 700;
80
+ font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
81
+ line-height: 1;
82
+ color: var(--gold);
83
+ }
84
+ .b-stats__label { font-weight: 600; color: var(--fg); }
85
+ .b-stats__desc { font-size: 0.875rem; color: var(--muted); line-height: 1.5; }
86
+ </style>
87
+
88
+ <script>
89
+ // Count-up: numbers tick from 0 to their value when they scroll into view.
90
+ // Progressive — the final value is server-rendered, so with no JS (or under
91
+ // reduced-motion) it just shows the number. Non-numeric values (One, Any…) are
92
+ // left untouched; a leading sign / trailing suffix (+, %, " day") is preserved.
93
+ const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
94
+ const values = document.querySelectorAll<HTMLElement>('.b-stats__value');
95
+ if (!reduce && 'IntersectionObserver' in window && values.length) {
96
+ const parse = (t: string) => {
97
+ const m = t.match(/^(\D*)(\d[\d,]*(?:\.\d+)?)(.*)$/);
98
+ if (!m) return null;
99
+ const decimals = (m[2].split('.')[1] || '').length;
100
+ return { pre: m[1], num: parseFloat(m[2].replace(/,/g, '')), suf: m[3], decimals };
101
+ };
102
+ const fmt = (n: number, d: number) => (d > 0 ? n.toFixed(d) : Math.round(n).toLocaleString());
103
+ const run = (el: HTMLElement) => {
104
+ const final = (el.textContent || '').trim();
105
+ const p = parse(final);
106
+ if (!p) return;
107
+ const dur = 1100;
108
+ const t0 = performance.now();
109
+ const tick = (now: number) => {
110
+ const t = Math.min(1, (now - t0) / dur);
111
+ const eased = 1 - Math.pow(1 - t, 3);
112
+ el.textContent = p.pre + fmt(p.num * eased, p.decimals) + p.suf;
113
+ if (t < 1) requestAnimationFrame(tick);
114
+ else el.textContent = final;
115
+ };
116
+ requestAnimationFrame(tick);
117
+ };
118
+ const io = new IntersectionObserver(
119
+ (entries) => entries.forEach((e) => { if (e.isIntersecting) { run(e.target as HTMLElement); io.unobserve(e.target); } }),
120
+ { threshold: 0.4 }
121
+ );
122
+ values.forEach((v) => io.observe(v));
123
+ }
124
+ </script>
@@ -0,0 +1,120 @@
1
+ ---
2
+ /** Steps — a Level-2 recipe: a numbered process. `horizontal` lays connected
3
+ * cards in a row; `vertical` a stacked timeline. Composes Heading + Icon. */
4
+ import Heading from '../blocks/Heading.astro';
5
+ import Icon from '../Icon.astro';
6
+ import { isIconKey } from '../../lib/icons';
7
+
8
+ interface Item { title: string; text?: string; icon?: string }
9
+ interface Props {
10
+ title?: string;
11
+ intro?: string;
12
+ layout?: 'horizontal' | 'vertical';
13
+ items?: Item[];
14
+ }
15
+ const { title, intro, layout = 'horizontal', items = [] } = Astro.props;
16
+ ---
17
+
18
+ <section class="b-steps" data-layout={layout}>
19
+ {(title || intro) && (
20
+ <div class="b-steps__head">
21
+ {title && <Heading text={title} level={2} align="center" />}
22
+ {intro && <p class="b-steps__intro">{intro}</p>}
23
+ </div>
24
+ )}
25
+ <ol class="b-steps__list">
26
+ {items.map((item, i) => (
27
+ <li class="b-steps__item">
28
+ <span class="b-steps__marker" aria-hidden="true">
29
+ {item.icon && isIconKey(item.icon) ? <Icon name={item.icon} size={20} /> : i + 1}
30
+ </span>
31
+ <div class="b-steps__body">
32
+ <h3 class="b-steps__title">{item.title}</h3>
33
+ {item.text && <p class="b-steps__text">{item.text}</p>}
34
+ </div>
35
+ </li>
36
+ ))}
37
+ </ol>
38
+ </section>
39
+
40
+ <style>
41
+ .b-steps {
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: 2rem;
45
+ max-width: 72rem;
46
+ margin-inline: auto;
47
+ padding-inline: 1rem;
48
+ }
49
+ .b-steps__head {
50
+ max-width: var(--max);
51
+ margin-inline: auto;
52
+ text-align: center;
53
+ display: flex;
54
+ flex-direction: column;
55
+ gap: 0.75rem;
56
+ }
57
+ .b-steps__intro { margin: 0; color: var(--muted); line-height: 1.6; }
58
+ .b-steps__list {
59
+ list-style: none;
60
+ margin: 0;
61
+ padding: 0;
62
+ display: grid;
63
+ gap: 1.5rem;
64
+ }
65
+ /* Base (and mobile): marker left, body right. */
66
+ .b-steps__item {
67
+ display: flex;
68
+ gap: 1rem;
69
+ align-items: flex-start;
70
+ }
71
+ .b-steps__marker {
72
+ flex-shrink: 0;
73
+ width: 2.5rem;
74
+ height: 2.5rem;
75
+ display: inline-flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ border-radius: var(--radius-pill);
79
+ background: var(--gold);
80
+ color: var(--text-light);
81
+ font-family: var(--font-heading);
82
+ font-weight: 700;
83
+ font-size: 1.05rem;
84
+ }
85
+ .b-steps__title { margin: 0 0 0.35rem; font-size: 1.1rem; color: var(--fg); }
86
+ .b-steps__text { margin: 0; color: var(--muted); line-height: 1.6; }
87
+
88
+ /* Vertical: a centred, stacked timeline. */
89
+ .b-steps[data-layout='vertical'] .b-steps__list { max-width: 40rem; margin-inline: auto; }
90
+
91
+ /* Horizontal (≥48em): connected cards in a row, marker over centred body. */
92
+ @media (min-width: 48em) {
93
+ .b-steps[data-layout='horizontal'] .b-steps__list {
94
+ grid-auto-flow: column;
95
+ grid-auto-columns: 1fr;
96
+ gap: 1rem;
97
+ }
98
+ .b-steps[data-layout='horizontal'] .b-steps__item {
99
+ flex-direction: column;
100
+ align-items: center;
101
+ text-align: center;
102
+ gap: 0.85rem;
103
+ position: relative;
104
+ }
105
+ /* Connector from this marker's right edge to the next marker's left edge.
106
+ The +1.5rem / -2rem account for the 2.5rem marker AND the 1rem grid gap,
107
+ so the line sits centred between markers (not falling short). */
108
+ .b-steps[data-layout='horizontal'] .b-steps__item:not(:last-child)::after {
109
+ content: '';
110
+ position: absolute;
111
+ top: calc(1.25rem - 1px);
112
+ left: calc(50% + 1.5rem);
113
+ width: calc(100% - 2rem);
114
+ height: 2px;
115
+ background: var(--border);
116
+ z-index: 0;
117
+ }
118
+ .b-steps[data-layout='horizontal'] .b-steps__marker { position: relative; z-index: 1; }
119
+ }
120
+ </style>
@@ -0,0 +1,133 @@
1
+ ---
2
+ /** Tabs — a Level-2 recipe: labelled panels, one open at a time. Progressive:
3
+ * the first panel is visible with no JavaScript; a small script adds selection,
4
+ * ARIA state and arrow-key navigation. Composes the Heading primitive. */
5
+ import Heading from '../blocks/Heading.astro';
6
+
7
+ interface Item { label: string; heading?: string; text?: string; image?: { src: string; alt?: string } }
8
+ interface Props {
9
+ title?: string;
10
+ items?: Item[];
11
+ }
12
+ const { title, items = [] } = Astro.props;
13
+ const uid = 'tabs-' + Math.random().toString(36).slice(2, 9);
14
+ ---
15
+
16
+ <section class="b-tabs">
17
+ {title && <Heading text={title} level={2} align="center" />}
18
+ <div class="b-tabs__inner">
19
+ <div class="b-tabs__list" role="tablist" aria-label={title ?? 'Tabs'}>
20
+ {items.map((item, i) => (
21
+ <button
22
+ type="button"
23
+ role="tab"
24
+ id={`${uid}-tab-${i}`}
25
+ aria-controls={`${uid}-panel-${i}`}
26
+ aria-selected={i === 0 ? 'true' : 'false'}
27
+ tabindex={i === 0 ? 0 : -1}
28
+ class="b-tabs__tab"
29
+ >
30
+ {item.label}
31
+ </button>
32
+ ))}
33
+ </div>
34
+ {items.map((item, i) => (
35
+ <div
36
+ role="tabpanel"
37
+ id={`${uid}-panel-${i}`}
38
+ aria-labelledby={`${uid}-tab-${i}`}
39
+ class="b-tabs__panel"
40
+ hidden={i !== 0}
41
+ tabindex="0"
42
+ >
43
+ {item.image && (
44
+ <img class="b-tabs__img" src={item.image.src} alt={item.image.alt ?? ''} loading="lazy" decoding="async" />
45
+ )}
46
+ <div class="b-tabs__copy">
47
+ {item.heading && <h3 class="b-tabs__heading">{item.heading}</h3>}
48
+ {item.text && <p class="b-tabs__text">{item.text}</p>}
49
+ </div>
50
+ </div>
51
+ ))}
52
+ </div>
53
+ </section>
54
+
55
+ <style>
56
+ .b-tabs {
57
+ display: flex;
58
+ flex-direction: column;
59
+ gap: 1.5rem;
60
+ max-width: 60rem;
61
+ margin-inline: auto;
62
+ padding-inline: 1rem;
63
+ }
64
+ .b-tabs__list {
65
+ display: flex;
66
+ flex-wrap: wrap;
67
+ gap: 0.25rem;
68
+ border-bottom: 1px solid var(--border);
69
+ }
70
+ .b-tabs__tab {
71
+ appearance: none;
72
+ background: none;
73
+ border: none;
74
+ border-bottom: 2px solid transparent;
75
+ margin-bottom: -1px;
76
+ padding: 0.7rem 1rem;
77
+ font-family: var(--font-heading);
78
+ font-size: 0.95rem;
79
+ font-weight: 600;
80
+ color: var(--muted);
81
+ cursor: pointer;
82
+ transition: color 0.15s, border-color 0.15s;
83
+ }
84
+ .b-tabs__tab:hover { color: var(--fg); }
85
+ .b-tabs__tab[aria-selected='true'] { color: var(--gold); border-bottom-color: var(--gold); }
86
+ .b-tabs__tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
87
+ .b-tabs__panel {
88
+ display: grid;
89
+ gap: 1.25rem;
90
+ }
91
+ /* A class `display` beats the UA `[hidden]{display:none}` (equal specificity,
92
+ author origin wins), so make the hidden state explicit — for the first paint
93
+ and every JS toggle. */
94
+ .b-tabs__panel[hidden] {
95
+ display: none;
96
+ }
97
+ @media (min-width: 48em) {
98
+ .b-tabs__panel:has(.b-tabs__img) { grid-template-columns: 1fr 1fr; align-items: center; }
99
+ }
100
+ .b-tabs__panel:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: var(--radius-sm); }
101
+ .b-tabs__img { width: 100%; height: auto; border-radius: var(--radius); }
102
+ .b-tabs__heading { margin: 0 0 0.5rem; color: var(--fg); }
103
+ .b-tabs__text { margin: 0; color: var(--muted); line-height: 1.65; }
104
+ </style>
105
+
106
+ <script>
107
+ // Wire every tabs group on the page: selection, ARIA state, arrow-key nav.
108
+ document.querySelectorAll<HTMLElement>('.b-tabs').forEach((root) => {
109
+ const tabs = Array.from(root.querySelectorAll<HTMLButtonElement>('[role="tab"]'));
110
+ const panels = Array.from(root.querySelectorAll<HTMLElement>('[role="tabpanel"]'));
111
+ if (!tabs.length) return;
112
+
113
+ function select(index: number, focus = true) {
114
+ tabs.forEach((tab, i) => {
115
+ const on = i === index;
116
+ tab.setAttribute('aria-selected', on ? 'true' : 'false');
117
+ tab.tabIndex = on ? 0 : -1;
118
+ panels[i]?.toggleAttribute('hidden', !on);
119
+ });
120
+ if (focus) tabs[index]?.focus();
121
+ }
122
+
123
+ tabs.forEach((tab, i) => {
124
+ tab.addEventListener('click', () => select(i, false));
125
+ tab.addEventListener('keydown', (e) => {
126
+ if (e.key === 'ArrowRight' || e.key === 'ArrowDown') { e.preventDefault(); select((i + 1) % tabs.length); }
127
+ else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') { e.preventDefault(); select((i - 1 + tabs.length) % tabs.length); }
128
+ else if (e.key === 'Home') { e.preventDefault(); select(0); }
129
+ else if (e.key === 'End') { e.preventDefault(); select(tabs.length - 1); }
130
+ });
131
+ });
132
+ });
133
+ </script>
@@ -0,0 +1,66 @@
1
+ ---
2
+ /** Testimonial — a Level-2 recipe: a centred quotation with author, optional
3
+ * role, and optional avatar. */
4
+ interface Props {
5
+ quote: string;
6
+ author: string;
7
+ role?: string;
8
+ avatar?: { src: string; alt?: string };
9
+ }
10
+ const { quote, author, role, avatar } = Astro.props;
11
+ ---
12
+
13
+ <figure class="b-testimonial">
14
+ <blockquote class="b-testimonial__quote">{`“${quote}”`}</blockquote>
15
+ <figcaption class="b-testimonial__by">
16
+ {avatar && <img class="b-testimonial__avatar" src={avatar.src} alt={avatar.alt ?? ''} loading="lazy" decoding="async" />}
17
+ <span class="b-testimonial__meta">
18
+ <span class="b-testimonial__author">{author}</span>
19
+ {role && <span class="b-testimonial__role">{role}</span>}
20
+ </span>
21
+ </figcaption>
22
+ </figure>
23
+
24
+ <style>
25
+ .b-testimonial {
26
+ max-width: var(--max);
27
+ margin-inline: auto;
28
+ padding-inline: 1rem;
29
+ text-align: center;
30
+ display: flex;
31
+ flex-direction: column;
32
+ gap: 1.25rem;
33
+ align-items: center;
34
+ }
35
+ .b-testimonial__quote {
36
+ margin: 0;
37
+ font-size: 1.375rem;
38
+ line-height: 1.5;
39
+ color: var(--fg);
40
+ font-style: italic;
41
+ }
42
+ .b-testimonial__by {
43
+ display: inline-flex;
44
+ align-items: center;
45
+ gap: 0.75rem;
46
+ }
47
+ .b-testimonial__avatar {
48
+ width: 44px;
49
+ height: 44px;
50
+ border-radius: 999px;
51
+ object-fit: cover;
52
+ }
53
+ .b-testimonial__meta {
54
+ display: flex;
55
+ flex-direction: column;
56
+ text-align: left;
57
+ }
58
+ .b-testimonial__author {
59
+ font-weight: 600;
60
+ color: var(--fg);
61
+ }
62
+ .b-testimonial__role {
63
+ color: var(--muted);
64
+ font-size: 0.875rem;
65
+ }
66
+ </style>
@@ -0,0 +1,248 @@
1
+ ---
2
+ /**
3
+ * Tiles — a Level-2 recipe: a responsive grid of tiles in one of five looks,
4
+ * chosen with `variant`:
5
+ * outline — stroke only, no shadow (the "wireframe" look)
6
+ * elevated — soft shadow, lifts on hover
7
+ * filled — soft brand-tinted background
8
+ * gradient — brand → derived accent-2 gradient, light text
9
+ * image — full-bleed photo with a legibility scrim, light text
10
+ *
11
+ * Radius, stroke and elevation come from the GLOBAL surface tokens (--radius,
12
+ * --card-border, --shadow-*), so tiles stay consistent with every other card and
13
+ * a single knob restyles them all. A tile with `href` becomes one big link.
14
+ * Composes the Icon primitive.
15
+ */
16
+ import Heading from '../blocks/Heading.astro';
17
+ import Icon from '../Icon.astro';
18
+ import { isIconKey } from '../../lib/icons';
19
+
20
+ interface Tile {
21
+ icon?: string;
22
+ eyebrow?: string;
23
+ title: string;
24
+ text?: string;
25
+ href?: string;
26
+ image?: { src: string; alt?: string };
27
+ }
28
+ interface Props {
29
+ title?: string;
30
+ intro?: string;
31
+ columns?: 2 | 3 | 4;
32
+ variant?: 'outline' | 'elevated' | 'filled' | 'gradient' | 'image';
33
+ spotlight?: boolean;
34
+ tiles?: Tile[];
35
+ }
36
+ const { title, intro, columns = 3, variant = 'elevated', spotlight = false, tiles = [] } = Astro.props;
37
+ ---
38
+
39
+ <section class="b-tiles">
40
+ {(title || intro) && (
41
+ <div class="b-tiles__head">
42
+ {title && <Heading text={title} level={2} align="center" />}
43
+ {intro && <p class="b-tiles__intro">{intro}</p>}
44
+ </div>
45
+ )}
46
+ <div class="b-tiles__grid" data-cols={columns} data-variant={variant} data-spotlight={spotlight ? 'true' : 'false'}>
47
+ {tiles.map((tile) => {
48
+ const Tag = tile.href ? 'a' : 'div';
49
+ const bg =
50
+ variant === 'image' && tile.image
51
+ ? `--tile-image: url('${tile.image.src}')`
52
+ : undefined;
53
+ return (
54
+ <Tag class="b-tile" href={tile.href} style={bg}>
55
+ {tile.icon && isIconKey(tile.icon) && (
56
+ <span class="b-tile__icon"><Icon name={tile.icon} size={26} /></span>
57
+ )}
58
+ {tile.eyebrow && <span class="b-tile__eyebrow">{tile.eyebrow}</span>}
59
+ <h3 class="b-tile__title">{tile.title}</h3>
60
+ {tile.text && <p class="b-tile__text">{tile.text}</p>}
61
+ {tile.href && <span class="b-tile__more" aria-hidden="true">Learn more &rarr;</span>}
62
+ </Tag>
63
+ );
64
+ })}
65
+ </div>
66
+ </section>
67
+
68
+ <style>
69
+ .b-tiles {
70
+ display: flex;
71
+ flex-direction: column;
72
+ gap: 2rem;
73
+ max-width: 72rem;
74
+ margin-inline: auto;
75
+ padding-inline: 1rem;
76
+ }
77
+ .b-tiles__head {
78
+ max-width: var(--max);
79
+ margin-inline: auto;
80
+ text-align: center;
81
+ display: flex;
82
+ flex-direction: column;
83
+ gap: 0.75rem;
84
+ }
85
+ .b-tiles__intro {
86
+ margin: 0;
87
+ color: var(--muted);
88
+ font-size: 1.0625rem;
89
+ line-height: 1.6;
90
+ }
91
+ .b-tiles__grid {
92
+ display: grid;
93
+ grid-template-columns: 1fr;
94
+ gap: 1.25rem;
95
+ }
96
+ @media (min-width: 48em) {
97
+ .b-tiles__grid[data-cols='2'] { grid-template-columns: repeat(2, 1fr); }
98
+ .b-tiles__grid[data-cols='3'] { grid-template-columns: repeat(3, 1fr); }
99
+ .b-tiles__grid[data-cols='4'] { grid-template-columns: repeat(2, 1fr); }
100
+ }
101
+ @media (min-width: 64em) {
102
+ .b-tiles__grid[data-cols='4'] { grid-template-columns: repeat(4, 1fr); }
103
+ }
104
+
105
+ /* Base tile — radius/stroke/shadow all from the global surface tokens. */
106
+ .b-tile {
107
+ position: relative;
108
+ display: flex;
109
+ flex-direction: column;
110
+ gap: 0.5rem;
111
+ padding: 1.5rem;
112
+ border-radius: var(--radius);
113
+ background: var(--bg-surface);
114
+ color: var(--fg);
115
+ text-decoration: none;
116
+ overflow: hidden;
117
+ isolation: isolate;
118
+ transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
119
+ }
120
+
121
+ /* ── Variants ── */
122
+ .b-tiles__grid[data-variant='outline'] .b-tile {
123
+ border: var(--card-border);
124
+ }
125
+ .b-tiles__grid[data-variant='elevated'] .b-tile {
126
+ box-shadow: var(--shadow-md);
127
+ border: var(--card-border);
128
+ }
129
+ .b-tiles__grid[data-variant='filled'] .b-tile {
130
+ background: var(--gold-light);
131
+ }
132
+ .b-tiles__grid[data-variant='gradient'] .b-tile {
133
+ background: linear-gradient(135deg, var(--gold), var(--accent-2, var(--gold)));
134
+ color: var(--text-light);
135
+ }
136
+ .b-tiles__grid[data-variant='image'] .b-tile {
137
+ color: #fff;
138
+ min-height: 15rem;
139
+ justify-content: flex-end;
140
+ background: var(--bg-section);
141
+ }
142
+ .b-tiles__grid[data-variant='image'] .b-tile::before {
143
+ content: '';
144
+ position: absolute;
145
+ inset: 0;
146
+ z-index: -1;
147
+ background-image: linear-gradient(to top, rgba(10, 12, 20, 0.85), rgba(10, 12, 20, 0.15)), var(--tile-image);
148
+ background-size: cover;
149
+ background-position: center;
150
+ }
151
+
152
+ /* Hover: only tiles that link lift. */
153
+ a.b-tile:hover {
154
+ transform: translateY(-4px);
155
+ }
156
+ .b-tiles__grid[data-variant='elevated'] a.b-tile:hover {
157
+ box-shadow: var(--shadow-lg);
158
+ }
159
+ .b-tiles__grid[data-variant='outline'] a.b-tile:hover {
160
+ border-color: var(--gold);
161
+ }
162
+ a.b-tile:focus-visible {
163
+ outline: 2px solid var(--gold);
164
+ outline-offset: 2px;
165
+ }
166
+ @media (prefers-reduced-motion: reduce) {
167
+ .b-tile { transition: none; }
168
+ a.b-tile:hover { transform: none; }
169
+ }
170
+
171
+ .b-tile__icon {
172
+ display: inline-flex;
173
+ color: var(--gold);
174
+ margin-bottom: 0.25rem;
175
+ }
176
+ .b-tiles__grid[data-variant='gradient'] .b-tile__icon,
177
+ .b-tiles__grid[data-variant='image'] .b-tile__icon {
178
+ color: currentColor;
179
+ }
180
+ .b-tile__eyebrow {
181
+ font-size: 0.75rem;
182
+ font-weight: 700;
183
+ letter-spacing: 0.1em;
184
+ text-transform: uppercase;
185
+ color: var(--gold);
186
+ }
187
+ .b-tiles__grid[data-variant='gradient'] .b-tile__eyebrow,
188
+ .b-tiles__grid[data-variant='image'] .b-tile__eyebrow {
189
+ color: currentColor;
190
+ opacity: 0.85;
191
+ }
192
+ .b-tile__title {
193
+ margin: 0;
194
+ font-size: 1.2rem;
195
+ color: inherit;
196
+ }
197
+ .b-tile__text {
198
+ margin: 0;
199
+ color: var(--muted);
200
+ line-height: 1.6;
201
+ }
202
+ .b-tiles__grid[data-variant='gradient'] .b-tile__text,
203
+ .b-tiles__grid[data-variant='image'] .b-tile__text,
204
+ .b-tiles__grid[data-variant='filled'] .b-tile__text {
205
+ color: inherit;
206
+ opacity: 0.92;
207
+ }
208
+ .b-tile__more {
209
+ margin-top: auto;
210
+ padding-top: 0.5rem;
211
+ font-size: 0.85rem;
212
+ font-weight: 600;
213
+ color: var(--gold);
214
+ }
215
+ .b-tiles__grid[data-variant='gradient'] .b-tile__more,
216
+ .b-tiles__grid[data-variant='image'] .b-tile__more {
217
+ color: currentColor;
218
+ }
219
+
220
+ /* Spotlight — a soft glow that follows the pointer on hover (opt-in). The glow
221
+ sits above the surface but below the content, so text stays crisp. */
222
+ .b-tiles__grid[data-spotlight='true'] .b-tile > * { position: relative; z-index: 1; }
223
+ .b-tiles__grid[data-spotlight='true'] .b-tile::after {
224
+ content: '';
225
+ position: absolute;
226
+ inset: 0;
227
+ z-index: 0;
228
+ border-radius: inherit;
229
+ background: radial-gradient(18rem 18rem at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%);
230
+ opacity: 0;
231
+ transition: opacity 0.25s ease;
232
+ pointer-events: none;
233
+ }
234
+ .b-tiles__grid[data-spotlight='true'] .b-tile:hover::after { opacity: 1; }
235
+ </style>
236
+
237
+ <script>
238
+ // Spotlight: track the pointer over opt-in tiles and drive the glow position.
239
+ if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
240
+ document.querySelectorAll<HTMLElement>('.b-tiles__grid[data-spotlight="true"] .b-tile').forEach((tile) => {
241
+ tile.addEventListener('pointermove', (e) => {
242
+ const r = tile.getBoundingClientRect();
243
+ tile.style.setProperty('--mx', `${((e.clientX - r.left) / r.width) * 100}%`);
244
+ tile.style.setProperty('--my', `${((e.clientY - r.top) / r.height) * 100}%`);
245
+ });
246
+ });
247
+ }
248
+ </script>