@keystone-sites/marketing-design-system 1.0.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 (130) hide show
  1. package/AGENTS.md +163 -0
  2. package/README.md +85 -0
  3. package/assets/media/brand/ks-lockup.svg +13 -0
  4. package/assets/media/brand/ks-logomark.svg +4 -0
  5. package/assets/media/brand/ks-wordmark-inline.svg +13 -0
  6. package/assets/media/brand/ks-wordmark.svg +11 -0
  7. package/assets/media/fonts/gt-standard-standard-vf.woff2 +0 -0
  8. package/assets/media/fonts/pp-kyoto-variable-upright-vf.woff2 +0 -0
  9. package/base.css +111 -0
  10. package/css-vars.d.ts +10 -0
  11. package/grid/engine.css +368 -0
  12. package/grid/field-hash.ts +31 -0
  13. package/grid/field.tsx +48 -0
  14. package/grid/gates.cjs +34 -0
  15. package/grid/region.tsx +97 -0
  16. package/icons.tsx +1224 -0
  17. package/index.css +77 -0
  18. package/lib/autoplay-gate.ts +88 -0
  19. package/lib/focus-trap.ts +42 -0
  20. package/lib/grader.ts +131 -0
  21. package/lib/legal-data.ts +1 -0
  22. package/lib/legal.ts +41 -0
  23. package/lib/noise.tsx +114 -0
  24. package/lib/render-boundary.tsx +27 -0
  25. package/lib/scroll-lock.ts +25 -0
  26. package/lib/swipe.ts +124 -0
  27. package/lib/use-active-section.ts +43 -0
  28. package/lib/use-count-up.ts +26 -0
  29. package/lib/use-grader-search.ts +118 -0
  30. package/lib/use-video-carousel.ts +271 -0
  31. package/media.ts +558 -0
  32. package/package.json +201 -0
  33. package/primitives/button-inline.css +52 -0
  34. package/primitives/button-inline.tsx +38 -0
  35. package/primitives/buttons.css +449 -0
  36. package/primitives/buttons.tsx +263 -0
  37. package/primitives/case-study-button.css +71 -0
  38. package/primitives/case-study-button.tsx +28 -0
  39. package/primitives/case-study-card.css +318 -0
  40. package/primitives/case-study-card.tsx +116 -0
  41. package/primitives/closer-row.css +14 -0
  42. package/primitives/closer-row.tsx +22 -0
  43. package/primitives/cta-row.css +41 -0
  44. package/primitives/cta-row.tsx +39 -0
  45. package/primitives/disclosure.css +210 -0
  46. package/primitives/disclosure.tsx +144 -0
  47. package/primitives/faq-question.css +220 -0
  48. package/primitives/faq-question.tsx +55 -0
  49. package/primitives/field.css +225 -0
  50. package/primitives/field.tsx +266 -0
  51. package/primitives/footer-item.css +72 -0
  52. package/primitives/footer-item.tsx +42 -0
  53. package/primitives/grader-menu.tsx +84 -0
  54. package/primitives/grader.css +302 -0
  55. package/primitives/grader.tsx +284 -0
  56. package/primitives/modal.css +151 -0
  57. package/primitives/modal.tsx +90 -0
  58. package/primitives/notice.css +39 -0
  59. package/primitives/notice.tsx +56 -0
  60. package/primitives/persona-card.css +374 -0
  61. package/primitives/persona-card.tsx +74 -0
  62. package/primitives/picture.css +11 -0
  63. package/primitives/picture.tsx +41 -0
  64. package/primitives/plan-card.css +378 -0
  65. package/primitives/plan-card.tsx +91 -0
  66. package/primitives/prose.css +118 -0
  67. package/primitives/prose.tsx +170 -0
  68. package/primitives/ramps.css +84 -0
  69. package/primitives/slider.css +179 -0
  70. package/primitives/slider.tsx +69 -0
  71. package/primitives/slug.css +87 -0
  72. package/primitives/slug.tsx +37 -0
  73. package/primitives/status.css +298 -0
  74. package/primitives/status.tsx +222 -0
  75. package/primitives/strip.css +40 -0
  76. package/primitives/surface.css +78 -0
  77. package/primitives/surface.tsx +95 -0
  78. package/primitives/table.css +226 -0
  79. package/primitives/table.tsx +122 -0
  80. package/primitives/tabs.css +85 -0
  81. package/primitives/tabs.tsx +122 -0
  82. package/primitives/text.css +110 -0
  83. package/primitives/toc.css +65 -0
  84. package/primitives/toc.tsx +42 -0
  85. package/rules/design-system.md +154 -0
  86. package/rules/grid-and-layout.md +166 -0
  87. package/scripts/generate-exports.mjs +61 -0
  88. package/scripts/generate-type-css.mjs +130 -0
  89. package/sections/faq-island.tsx +102 -0
  90. package/sections/faq.css +213 -0
  91. package/sections/faq.tsx +46 -0
  92. package/sections/footer-nav.tsx +95 -0
  93. package/sections/footer-signature.css +183 -0
  94. package/sections/footer-signature.tsx +114 -0
  95. package/sections/footer.css +735 -0
  96. package/sections/footer.tsx +283 -0
  97. package/sections/gallery-overlay.css +213 -0
  98. package/sections/gallery-overlay.tsx +267 -0
  99. package/sections/landing-benefits.css +59 -0
  100. package/sections/landing-benefits.tsx +81 -0
  101. package/sections/landing-closer.css +23 -0
  102. package/sections/landing-closer.tsx +26 -0
  103. package/sections/landing-hero.css +80 -0
  104. package/sections/landing-hero.tsx +69 -0
  105. package/sections/landing-quote.css +19 -0
  106. package/sections/landing-quote.tsx +30 -0
  107. package/sections/landing-sample.ts +66 -0
  108. package/sections/landing.css +45 -0
  109. package/sections/landing.tsx +69 -0
  110. package/sections/load-orchestrator.tsx +43 -0
  111. package/sections/load.css +138 -0
  112. package/sections/nav-desktop.css +530 -0
  113. package/sections/nav-desktop.tsx +155 -0
  114. package/sections/nav-mobile.css +571 -0
  115. package/sections/nav-mobile.tsx +222 -0
  116. package/sections/nav.css +126 -0
  117. package/sections/nav.tsx +394 -0
  118. package/sections/site-chat-data.ts +16 -0
  119. package/sections/site-chat-open.tsx +25 -0
  120. package/sections/site-chat.tsx +67 -0
  121. package/site-links.ts +36 -0
  122. package/site.ts +2 -0
  123. package/themes/inverted.css +139 -0
  124. package/tokens/fonts.css +38 -0
  125. package/tokens/motion.css +125 -0
  126. package/tokens/primitives.css +163 -0
  127. package/tokens/semantic.css +153 -0
  128. package/tokens/type-styles.json +145 -0
  129. package/tokens/type.css +1548 -0
  130. package/widgets.css +78 -0
@@ -0,0 +1,130 @@
1
+ // Generates tokens/type.css from the Figma text-style data.
2
+ // Run with: node scripts/generate-type-css.mjs
3
+
4
+ import { readFileSync, writeFileSync } from "node:fs";
5
+ import { dirname, join } from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ const root = join(dirname(fileURLToPath(import.meta.url)), "..");
9
+ const src = join(root, "tokens/type-styles.json");
10
+ const out = join(root, "tokens/type.css");
11
+
12
+ const { styles, extracted } = JSON.parse(readFileSync(src, "utf8"));
13
+
14
+ const WEIGHTS = {
15
+ Thin: 100,
16
+ Extralight: 200,
17
+ Light: 300,
18
+ Regular: 400,
19
+ Medium: 500,
20
+ Semibold: 600,
21
+ };
22
+
23
+ // GT Standard sets weight and optical size independently.
24
+ const TEXT_OPSZ = {
25
+ "3xs": 24,
26
+ "2xs": 24,
27
+ xs: 24,
28
+ "nav-label": 24,
29
+ sm: 26,
30
+ md: 26,
31
+ lg: 26,
32
+ xl: 26,
33
+ "2xl": 26,
34
+ };
35
+ const DISPLAY_SANS_OPSZ = {
36
+ "2xs": 28,
37
+ };
38
+
39
+ function weightName(style) {
40
+ const [head, ...rest] = style.split(" ");
41
+ if (head === "S" || head === "M" || head === "L") return rest.join(" ");
42
+ return style;
43
+ }
44
+
45
+ function gtOpsz(name) {
46
+ const [family, step] = name.split("/");
47
+ if (family === "text") {
48
+ if (!(step in TEXT_OPSZ)) throw new Error(`unknown text step: ${name}`);
49
+ return TEXT_OPSZ[step];
50
+ }
51
+ if (family === "display-sans") {
52
+ return DISPLAY_SANS_OPSZ[step] ?? 30;
53
+ }
54
+ throw new Error(`unknown GT style: ${name}`);
55
+ }
56
+
57
+ function parseStyle(s) {
58
+ const weight = WEIGHTS[weightName(s.style)];
59
+ if (!weight) throw new Error(`unknown weight in ${s.name}: ${s.style}`);
60
+ if (s.family === "PP Kyoto") {
61
+ return { font: "var(--font-serif)", weight, opsz: null };
62
+ }
63
+ if (s.family !== "GT Standard Standard VF") {
64
+ throw new Error(`unknown family: ${s.family}`);
65
+ }
66
+ return { font: "var(--font-sans)", weight, opsz: gtOpsz(s.name) };
67
+ }
68
+
69
+ function varBase(name) {
70
+ return `--ts-${name.toLowerCase().replaceAll("/", "-").replaceAll("+", "-plus")}`;
71
+ }
72
+
73
+ function em(percent) {
74
+ const n = parseFloat(percent) / 100;
75
+ return n === 0 ? "0em" : `${Number(n.toFixed(4))}em`;
76
+ }
77
+
78
+ const lines = [];
79
+ lines.push(`/* Generated typography tokens. Do not edit directly.`);
80
+ lines.push(` Source: type-styles.json (Figma text styles, extracted ${extracted}).`);
81
+ lines.push(` Regenerate: node scripts/generate-type-css.mjs`);
82
+ lines.push(``);
83
+ lines.push(` Per style: -font is a CSS font shorthand (weight size/lh family);`);
84
+ lines.push(` -fs and -lh are the same size and line-height as unitless design`);
85
+ lines.push(` px (for .type ramps: --fs-rm: var(--ts-x-fs)); -ls is letter-spacing;`);
86
+ lines.push(` -opsz is the pinned GT Standard optical size; -ps is Figma`);
87
+ lines.push(` paragraph spacing; -case is text-transform. Kyoto styles have no`);
88
+ lines.push(` -opsz. Consume through the .type class (primitives/text.css),`);
89
+ lines.push(` usually via the .ts-<style> class generated below. */`);
90
+ lines.push(``);
91
+ lines.push(`/* Per-style opsz:`);
92
+ lines.push(``);
93
+ lines.push(` opsz is set on the variable font directly (not via Figma L/M/S`);
94
+ lines.push(` named instances): text 3xs/2xs/xs/nav-label = 24; text sm–2xl`);
95
+ lines.push(` = 26; display-sans 2xs = 28; display-sans xs and up = 30. */`);
96
+ lines.push(``);
97
+ lines.push(`:root {`);
98
+
99
+ for (const s of styles) {
100
+ const { font, weight, opsz } = parseStyle(s);
101
+ const b = varBase(s.name);
102
+ lines.push(` ${b}-font: ${weight} ${s.size}px/${s.lh}px ${font};`);
103
+ lines.push(` ${b}-fs: ${s.size};`);
104
+ lines.push(` ${b}-lh: ${s.lh};`);
105
+ lines.push(` ${b}-ls: ${em(s.ls)};`);
106
+ if (opsz !== null) lines.push(` ${b}-opsz: ${opsz};`);
107
+ if (s.ps) lines.push(` ${b}-ps: ${s.ps}px;`);
108
+ if (s.case === "UPPER") lines.push(` ${b}-case: uppercase;`);
109
+ }
110
+
111
+ lines.push(`}`);
112
+ lines.push(``);
113
+ lines.push(`/* One class per style. \`type ts-<style>\` is the whole declaration for`);
114
+ lines.push(` text that keeps one style; a band that switches style restates the`);
115
+ lines.push(` variables in its own @container block, which wins by layer order. */`);
116
+ lines.push(``);
117
+
118
+ for (const s of styles) {
119
+ const { opsz } = parseStyle(s);
120
+ const b = varBase(s.name);
121
+ const decls = [`--font: var(${b}-font)`, `--ls: var(${b}-ls)`];
122
+ if (opsz !== null) decls.push(`--opsz: var(${b}-opsz)`);
123
+ if (s.case === "UPPER") decls.push(`--case: var(${b}-case)`);
124
+ decls.push(`--fs-rm: var(${b}-fs)`, `--lh-rm: var(${b}-lh)`);
125
+ lines.push(`.${b.slice(2)} {`, ...decls.map((d) => ` ${d};`), `}`);
126
+ }
127
+ lines.push(``);
128
+
129
+ writeFileSync(out, lines.join("\n"));
130
+ console.log(`wrote ${out} (${styles.length} styles)`);
@@ -0,0 +1,102 @@
1
+ "use client";
2
+
3
+ /** Single-open FAQ state, content measurement, and rail extension cells. */
4
+
5
+ import { useLayoutEffect, useRef, useState, type ReactNode } from "react";
6
+ import { FaqQuestion } from "../primitives/faq-question";
7
+
8
+ export interface FaqItem {
9
+ id: string;
10
+ question: string;
11
+ answer: ReactNode;
12
+ }
13
+
14
+ /* The first growth row follows the static rail run in each band. */
15
+ const EXT_BANDS = [
16
+ { band: "rm", gx: [11], gy0: 15 },
17
+ { band: "rs", gx: [11], gy0: 9 },
18
+ { band: "rt", gx: [11], gy0: 6 },
19
+ { band: "rd1", gx: [11], gy0: 6 },
20
+ { band: "rd2", gx: [11], gy0: 6 },
21
+ ] as const;
22
+
23
+ export function FaqIsland({ items }: { items: readonly FaqItem[] }) {
24
+ const listRef = useRef<HTMLUListElement>(null);
25
+ const [openId, setOpenId] = useState<string | null>(null);
26
+ /** Measured open − closed ticks per item, current band. */
27
+ const [extras, setExtras] = useState<number[]>([]);
28
+
29
+ useLayoutEffect(() => {
30
+ const list = listRef.current;
31
+ if (!list) return;
32
+ const sec = list.closest<HTMLElement>(".sec");
33
+ const rows = [...list.querySelectorAll<HTMLElement>(".fq")];
34
+ if (!sec || rows.length === 0) return;
35
+ const answers = rows.map((row) => row.querySelector<HTMLElement>(".fq-answer"));
36
+
37
+ const measure = () => {
38
+ const t = sec.getBoundingClientRect().width / 12;
39
+ if (!(t > 0)) return;
40
+ const next = rows.map((row, i) => {
41
+ const answer = answers[i];
42
+ if (!answer) return 0;
43
+ const style = getComputedStyle(row);
44
+ const closed = parseFloat(style.getPropertyValue("--fq-closed")) || 1;
45
+ /* The drawer's margin-top is --fq-gap resolved to px. */
46
+ const gap = parseFloat(getComputedStyle(answer).marginTop) || 0;
47
+ const contentBottom =
48
+ answer.getBoundingClientRect().bottom - row.getBoundingClientRect().top;
49
+ /* The smallest whole tick that leaves at least the drawer gap
50
+ beneath the answer; mirroring the top pad rounded four-line
51
+ answers up a whole tick of air. */
52
+ const open = Math.max(closed, Math.ceil((contentBottom + gap - 0.5) / t));
53
+ row.style.setProperty("--fq-open", String(open));
54
+ row.style.setProperty("--drawer-extra", String(open - closed));
55
+ return open - closed;
56
+ });
57
+ setExtras((prev) =>
58
+ prev.length === next.length && prev.every((v, i) => v === next[i]) ? prev : next,
59
+ );
60
+ };
61
+
62
+ /* Re-measure on every tick, band, or height change. */
63
+ const ro = new ResizeObserver(measure);
64
+ ro.observe(sec);
65
+ document.fonts?.ready.then(measure).catch(() => {});
66
+ return () => ro.disconnect();
67
+ }, []);
68
+
69
+ const openIdx = items.findIndex((item) => item.id === openId);
70
+ const activeExtra = openIdx >= 0 ? (extras[openIdx] ?? 0) : 0;
71
+ const maxExtra = extras.reduce((a, b) => Math.max(a, b), 0);
72
+
73
+ return (
74
+ <>
75
+ <div className="faq-railext" aria-hidden="true">
76
+ {EXT_BANDS.map(({ band, gx, gy0 }) =>
77
+ gx.flatMap((col) =>
78
+ Array.from({ length: maxExtra }, (_, i) => (
79
+ <i
80
+ key={`${band}-${col}-${i}`}
81
+ className={`faq-ext ${band}${i < activeExtra ? " on" : ""}`}
82
+ style={{ "--gx": col, "--gy": gy0 + i, "--i": i }}
83
+ />
84
+ )),
85
+ ),
86
+ )}
87
+ </div>
88
+ <ul className="faq-questions" data-landmark="questions" ref={listRef}>
89
+ {items.map((item) => (
90
+ <FaqQuestion
91
+ key={item.id}
92
+ id={`faq-${item.id}`}
93
+ open={openId === item.id}
94
+ onToggle={() => setOpenId((prev) => (prev === item.id ? null : item.id))}
95
+ question={item.question}
96
+ answer={item.answer}
97
+ />
98
+ ))}
99
+ </ul>
100
+ </>
101
+ );
102
+ }
@@ -0,0 +1,213 @@
1
+ /* FAQ. 384 (1176:41769): header 11t × 3t over six 2t rows. 768
2
+ (1176:41460): header 4t × 6t beside six 1t rows of 7t. 1344
3
+ (1161:26591): header 5t beside six 1t rows of 6t. The east rail runs
4
+ down column 12; the island extends it as drawers open. */
5
+
6
+ .faq-section {
7
+ --faq-u: calc(var(--wA) + var(--wB));
8
+ width: 100%;
9
+ }
10
+
11
+ /* Header. */
12
+
13
+ /* The header owns its tick rows as a minimum and grows with the heading. */
14
+ .faq-header {
15
+ border-top: 1px solid var(--color-border-000);
16
+ display: flex;
17
+ flex-direction: column;
18
+ justify-content: center;
19
+ box-sizing: border-box;
20
+ width: calc(var(--t) * 11);
21
+ min-height: calc(var(--t) * 3);
22
+ /* The hairline sits inside the designed 18, so the pad gives up its pixel. */
23
+ padding: calc(var(--faq-u) * 18 - 1px) 0 calc(var(--faq-u) * 18) calc(var(--t) / 2);
24
+ }
25
+ @container (--rt) {
26
+ .faq-header {
27
+ position: absolute;
28
+ top: 0;
29
+ left: 0;
30
+ justify-content: flex-start;
31
+ width: calc(var(--t) * 4);
32
+ min-height: calc(var(--t) * 6);
33
+ padding: 0 0 0 var(--t);
34
+ }
35
+ }
36
+ @container (--rd2) {
37
+ .faq-header {
38
+ width: calc(var(--t) * 5);
39
+ padding: calc(var(--faq-u) * 40) calc(var(--faq-u) * 128) calc(var(--faq-u) * 32) var(--t);
40
+ }
41
+ }
42
+
43
+ /* The 768 heading occupies a centred two-tick sub-box. */
44
+ .faq-head-box {
45
+ display: contents;
46
+ }
47
+ @container (--rt) {
48
+ .faq-head-box {
49
+ display: flex;
50
+ align-items: center;
51
+ height: calc(var(--t) * 2);
52
+ }
53
+ }
54
+ @container (--rd2) {
55
+ .faq-head-box {
56
+ display: contents;
57
+ }
58
+ }
59
+
60
+ /* Typography: 24/30 until the 1344 design lifts it to 42/50. */
61
+ .faq-head {
62
+ margin: var(--space-none);
63
+ color: var(--color-text-100);
64
+ max-width: calc(var(--faq-u) * 176);
65
+ --fs-rt: var(--fs-rm);
66
+ --lh-rt: var(--lh-rm);
67
+ --fs-rd2: var(--ts-display-serif-md-plus-extralight-fs);
68
+ --lh-rd2: var(--ts-display-serif-md-plus-extralight-lh);
69
+ --fs-px: calc(var(--faq-u) * var(--fs-band));
70
+ --lh-px: calc(var(--faq-u) * var(--lh-band));
71
+ }
72
+ @container (--rt) {
73
+ .faq-head {
74
+ max-width: calc(var(--faq-u) * 160);
75
+ }
76
+ }
77
+ @container (--rd2) {
78
+ .faq-head {
79
+ max-width: calc(var(--faq-u) * 320);
80
+ --font: var(--ts-display-serif-md-plus-extralight-font);
81
+ --ls: var(--ts-display-serif-md-plus-extralight-ls);
82
+ }
83
+ }
84
+
85
+ /* Questions. */
86
+
87
+ .faq-questions {
88
+ list-style: none;
89
+ margin: var(--space-none);
90
+ padding: var(--space-none);
91
+ width: calc(var(--t) * 11);
92
+ }
93
+ @container (--rt) {
94
+ .faq-questions {
95
+ width: calc(var(--t) * 7);
96
+ margin-left: calc(var(--t) * 4);
97
+ }
98
+ }
99
+ @container (--rd2) {
100
+ .faq-questions {
101
+ width: calc(var(--t) * 6);
102
+ margin-left: calc(var(--t) * 5);
103
+ }
104
+ }
105
+
106
+ /* Per-band disclosure geometry. Rows are two ticks at 384 and one from
107
+ rs up; rs keeps the 384 type in a one-tick row with tighter padding. */
108
+ .faq-section .fq {
109
+ width: 100%;
110
+ height: calc(var(--t) * 2);
111
+ --fq-closed: 2;
112
+ --fq-pt: calc(var(--faq-u) * 20);
113
+ --fq-pr: calc(var(--faq-u) * 16);
114
+ --fq-pb: calc(var(--faq-u) * 20);
115
+ --fq-pl: calc(var(--faq-u) * 16);
116
+ --fq-qrow: calc(var(--faq-u) * 24);
117
+ --fq-gap: calc(var(--faq-u) * 16);
118
+ --fq-a-inset: 0px;
119
+ --fq-u: var(--faq-u);
120
+ --fq-q-f: var(--ts-text-md-light-font);
121
+ --fq-q-fs-rm: 16; --fq-q-fs-rd2: 18;
122
+ --fq-q-lh-rm: 22; --fq-q-lh-rd2: 26;
123
+ --fq-q-ls: var(--ts-text-md-light-ls);
124
+ --fq-q-opsz: var(--ts-text-md-light-opsz);
125
+ --fq-a-f: var(--ts-text-md-light-font);
126
+ --fq-a-fs-rm: 16; --fq-a-fs-rd2: 18;
127
+ --fq-a-lh-rm: 22; --fq-a-lh-rd2: 26;
128
+ --fq-a-ls: var(--ts-text-md-light-ls);
129
+ --fq-a-opsz: var(--ts-text-md-light-opsz);
130
+ }
131
+ @container (--rs) {
132
+ .faq-section .fq {
133
+ height: var(--t);
134
+ --fq-closed: 1;
135
+ --fq-pt: calc(var(--faq-u) * 12);
136
+ --fq-pb: calc(var(--faq-u) * 12);
137
+ }
138
+ }
139
+ @container (--rt) {
140
+ .faq-section .fq {
141
+ --fq-pt: calc(var(--faq-u) * 20);
142
+ --fq-pr: calc(var(--faq-u) * 40);
143
+ --fq-pb: calc(var(--faq-u) * 20);
144
+ --fq-pl: calc(var(--faq-u) * 40);
145
+ }
146
+ }
147
+ @container (--rd2) {
148
+ .faq-section .fq {
149
+ --fq-pt: calc(var(--faq-u) * 40);
150
+ --fq-pb: calc(var(--faq-u) * 40);
151
+ --fq-qrow: calc(var(--faq-u) * 32);
152
+ --fq-a-inset: calc(var(--faq-u) * 96);
153
+ --fq-q-f: var(--ts-text-lg-light-font);
154
+ --fq-q-ls: var(--ts-text-lg-light-ls);
155
+ --fq-q-opsz: var(--ts-text-lg-light-opsz);
156
+ --fq-a-f: var(--ts-text-lg-light-font);
157
+ --fq-a-ls: var(--ts-text-lg-light-ls);
158
+ --fq-a-opsz: var(--ts-text-lg-light-opsz);
159
+ }
160
+ }
161
+ .faq-section .fq[data-open] {
162
+ height: calc(var(--t) * var(--fq-open, var(--fq-closed)));
163
+ }
164
+
165
+ /* Rail cells extend with drawer growth. */
166
+
167
+ .faq-railext {
168
+ position: absolute;
169
+ inset: 0;
170
+ z-index: -1;
171
+ pointer-events: none;
172
+ }
173
+ .faq-ext {
174
+ position: absolute;
175
+ box-sizing: border-box;
176
+ left: calc(var(--t) * var(--gx));
177
+ top: calc(var(--t) * var(--gy));
178
+ width: calc(var(--t) + 1px);
179
+ height: calc(var(--t) + 1px);
180
+ border: 1px solid var(--line);
181
+ opacity: 0;
182
+ transition: opacity var(--motion-drawer-duration) var(--motion-drawer-ease);
183
+ }
184
+ .faq-ext.on {
185
+ opacity: 1;
186
+ /* cascade away from the drawer, nearest cell first; close fades with
187
+ the collapse — no stagger (the base rule above) */
188
+ transition-delay: calc(var(--i) * var(--motion-rail-stagger));
189
+ }
190
+
191
+ /* Compound band gating. */
192
+ .faq-ext.rs,
193
+ .faq-ext.rt,
194
+ .faq-ext.rd1,
195
+ .faq-ext.rd2 {
196
+ display: none;
197
+ }
198
+ @container (--rs) {
199
+ .faq-ext.rm { display: none; }
200
+ .faq-ext.rs { display: block; }
201
+ }
202
+ @container (--rt) {
203
+ .faq-ext.rs { display: none; }
204
+ .faq-ext.rt { display: block; }
205
+ }
206
+ @container (--rd1) {
207
+ .faq-ext.rt { display: none; }
208
+ .faq-ext.rd1 { display: block; }
209
+ }
210
+ @container (--rd2) {
211
+ .faq-ext.rd1 { display: none; }
212
+ .faq-ext.rd2 { display: block; }
213
+ }
@@ -0,0 +1,46 @@
1
+ /** Pricing FAQ (1161:26591 · 1176:41460 · 1176:41769): a heading beside
2
+ * a single-open accordion, with the east rail painted down the twelfth
3
+ * column. The footer follows directly; there is no gap row. */
4
+
5
+ import { GridRegion, type GridBand } from "../grid/region";
6
+ import { FaqIsland, type FaqItem } from "./faq-island";
7
+
8
+ export type { FaqItem };
9
+
10
+ interface Rail {
11
+ gx: number;
12
+ gy: number;
13
+ gh: number;
14
+ }
15
+
16
+ /* The static rail run per band: header rows plus six closed rows. */
17
+ const RAIL: Record<GridBand, Rail> = {
18
+ rm: { gx: 11, gy: 0, gh: 15 },
19
+ rs: { gx: 11, gy: 0, gh: 9 },
20
+ rt: { gx: 11, gy: 0, gh: 6 },
21
+ rd1: { gx: 11, gy: 0, gh: 6 },
22
+ rd2: { gx: 11, gy: 0, gh: 6 },
23
+ };
24
+
25
+ const BANDS = Object.keys(RAIL) as GridBand[];
26
+
27
+ export function FaqSection({ head, items }: { head: string; items: readonly FaqItem[] }) {
28
+ return (
29
+ <section className="sec faq-section" data-landmark="faq">
30
+ <div className="gx" aria-hidden="true">
31
+ {BANDS.map((band) => (
32
+ <GridRegion key={band} band={band} {...RAIL[band]} />
33
+ ))}
34
+ </div>
35
+
36
+ <div className="faq-header" data-landmark="header">
37
+ {/* The 768 frame centres the heading in a two-tick sub-box. */}
38
+ <div className="faq-head-box">
39
+ <h2 className="type ts-display-serif-xs-extralight faq-head">{head}</h2>
40
+ </div>
41
+ </div>
42
+
43
+ <FaqIsland items={items} />
44
+ </section>
45
+ );
46
+ }
@@ -0,0 +1,95 @@
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import type { ReactNode } from "react";
5
+ import { IconChevronDownMedium } from "../icons";
6
+
7
+ export interface FooterNavGroup {
8
+ id: string;
9
+ label: string;
10
+ /** Open drawer heights in ticks per accordion band. */
11
+ openRm: number;
12
+ openRs: number;
13
+ list: ReactNode;
14
+ }
15
+
16
+ const EXT_RM = { gx: [11], gy0: 18, max: 5 };
17
+ const EXT_RS = { gx: [0, 11], gy0: 15, max: 4 };
18
+
19
+ function extCells(
20
+ band: "rm" | "rs",
21
+ cfg: { gx: number[]; gy0: number; max: number },
22
+ active: number,
23
+ ) {
24
+ return cfg.gx.flatMap((gx) =>
25
+ Array.from({ length: cfg.max }, (_, i) => (
26
+ <div
27
+ key={`${band}-${gx}-${i}`}
28
+ className={`f-ext ${band}${i < active ? " on" : ""}`}
29
+ style={{
30
+ "--gx": gx,
31
+ "--gy": cfg.gy0 + i,
32
+ "--i": i,
33
+ }}
34
+ />
35
+ )),
36
+ );
37
+ }
38
+
39
+ export function FooterNav({ groups }: { groups: FooterNavGroup[] }) {
40
+ const [openId, setOpenId] = useState<string | null>(null);
41
+ const open = groups.find((g) => g.id === openId);
42
+
43
+ return (
44
+ <>
45
+ <div className="f-railext" aria-hidden="true">
46
+ {extCells("rm", EXT_RM, open ? open.openRm - 2 : 0)}
47
+ {extCells("rs", EXT_RS, open ? open.openRs - 2 : 0)}
48
+ </div>
49
+ <nav className="f-nav" data-landmark="nav" aria-label="Footer">
50
+ <ul className="fnav-groups">
51
+ {groups.map((g) => {
52
+ const isOpen = g.id === openId;
53
+ return (
54
+ <li
55
+ key={g.id}
56
+ className="fnav-group"
57
+ data-drawer=""
58
+ data-open={isOpen || undefined}
59
+ style={{
60
+ "--open-rm": g.openRm,
61
+ "--open-rs": g.openRs,
62
+ "--fnav-extra-rm": g.openRm - 2,
63
+ "--fnav-extra-rs": g.openRs - 2,
64
+ }}
65
+ >
66
+ <h3 className="fnav-h">
67
+ <button
68
+ type="button"
69
+ className="fnav-trigger"
70
+ aria-expanded={isOpen}
71
+ aria-controls={`fnav-${g.id}`}
72
+ onClick={() => setOpenId(isOpen ? null : g.id)}
73
+ >
74
+ <span className="fnav-hg">
75
+ <span className="fnav-dot" data-g={g.id} aria-hidden="true" />
76
+ <span className="type ts-display-serif-3xs-medium fnav-name">{g.label}</span>
77
+ </span>
78
+ <IconChevronDownMedium className="fnav-chevron" />
79
+ </button>
80
+ <span className="fnav-static">
81
+ <span className="fnav-dot" data-g={g.id} aria-hidden="true" />
82
+ <span className="type ts-display-serif-3xs-medium fnav-name">{g.label}</span>
83
+ </span>
84
+ </h3>
85
+ <div className="fnav-listwrap" id={`fnav-${g.id}`}>
86
+ {g.list}
87
+ </div>
88
+ </li>
89
+ );
90
+ })}
91
+ </ul>
92
+ </nav>
93
+ </>
94
+ );
95
+ }