feat: design system — ambient motion, spacing/elevation/surface tokens, right-rail TOC, footer links, DESIGN.md
This commit is contained in:
+131
-65
@@ -3,6 +3,7 @@
|
||||
(April 2024): colors D.2, typography D.3 (Inter body / Space Grotesk display),
|
||||
flash D.4. All look-and-feel lives in the tokens below; WCAG 2.1 AA contrast.
|
||||
Light theme only (brand is light-first; navy bands carry the dark identity).
|
||||
System rules (spacing / elevation / surfaces / motion): see DESIGN.md.
|
||||
========================================================================== */
|
||||
:root {
|
||||
color-scheme: light;
|
||||
@@ -28,11 +29,25 @@
|
||||
--radius: 16px;
|
||||
--radius-pill: 999px;
|
||||
--maxw: 1120px;
|
||||
/* Spacing scale (4px base) — use these instead of ad-hoc paddings */
|
||||
/* Fluid spacing scale (ctao.org rhythm: sections breathe, mobile stays compact).
|
||||
Every section / container / card padding sits on this scale — no ad-hoc values. */
|
||||
--gutter: clamp(18px, 4vw, 28px); /* page side padding */
|
||||
--space-s: 12px;
|
||||
--space-m: 20px;
|
||||
--space-l: 32px;
|
||||
--space-xl: 56px;
|
||||
--space-l: clamp(24px, 2vw + 16px, 40px);
|
||||
--space-xl: clamp(40px, 3vw + 24px, 72px); /* section rhythm */
|
||||
--space-band: clamp(48px, 5vw + 28px, 96px); /* hero / auth band padding */
|
||||
/* Elevation — navy-tinted; the ONLY two shadows allowed in this codebase */
|
||||
--shadow-ambient: 0 1px 2px rgba(0, 0, 74, 0.05), 0 4px 14px rgba(0, 0, 74, 0.07);
|
||||
--shadow-lifted: 0 4px 10px rgba(0, 0, 74, 0.08), 0 18px 44px rgba(0, 0, 74, 0.18);
|
||||
/* Nebula glow (BRAND D.5) — one stack for hero + auth bands, static AND animated.
|
||||
Alphas are contrast ceilings (DESIGN.md): Cherenkov ≤.38, Azure ≤.35 keep the
|
||||
Cherenkov subtitle/eyebrow ≥4.5:1 even with a blob core right under the text.
|
||||
Cherenkov and Azure cores sit in opposite corners — cores never meet. */
|
||||
--nebula:
|
||||
radial-gradient(52% 58% at 78% 76%, rgba(0, 228, 216, 0.38), transparent 66%),
|
||||
radial-gradient(46% 52% at 12% 18%, rgba(0, 122, 255, 0.33), transparent 64%),
|
||||
radial-gradient(75% 85% at 40% 55%, rgba(0, 0, 156, 0.8), transparent 72%);
|
||||
}
|
||||
|
||||
/* Self-hosted brand fonts — latin subset, variable weight, swap + metric-matched fallback */
|
||||
@@ -92,17 +107,18 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
}
|
||||
.skip:focus { top: 0; }
|
||||
|
||||
/* Safety net: even third-party/UA leftovers never move for reduced-motion users */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after { transition: none !important; animation: none !important; }
|
||||
}
|
||||
|
||||
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
|
||||
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
|
||||
/* Surface rhythm: white (editorial) → Moon Gray (service/utility bands) → Galaxy (hero/footer) */
|
||||
.band--moon { background: var(--moon); }
|
||||
|
||||
/* Flash — the 4-point star brand asset (BRAND D.4), CSS-only approximation */
|
||||
.flash {
|
||||
display: inline-block; width: 14px; height: 14px; background: var(--cherenkov);
|
||||
clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
|
||||
}
|
||||
/* Flash — the REAL brand star (BRAND D.4): inline SVG path lifted from the
|
||||
official logo, never a CSS approximation. Budget: one accent per view; static. */
|
||||
.flash { width: 12px; height: 12px; color: var(--cherenkov); flex: none; }
|
||||
|
||||
/* Header — Galaxy Blue band, reverse (white) logo per BRAND B.1.2 */
|
||||
.site-header { background: var(--galaxy); position: sticky; top: 0; z-index: 10; }
|
||||
@@ -131,9 +147,9 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
.menu summary::-webkit-details-marker { display: none; }
|
||||
.menu nav {
|
||||
position: absolute; left: 0; right: 0; top: 100%;
|
||||
display: flex; flex-direction: column; padding: 6px 20px 14px;
|
||||
display: flex; flex-direction: column; padding: 6px var(--gutter) 14px;
|
||||
background: var(--galaxy); border-top: 1px solid rgba(255, 255, 255, 0.15);
|
||||
box-shadow: 0 20px 32px rgba(0, 0, 74, 0.35);
|
||||
box-shadow: var(--shadow-lifted);
|
||||
}
|
||||
.menu nav a {
|
||||
display: flex; align-items: center; min-height: 44px;
|
||||
@@ -181,15 +197,14 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
mask: var(--ico-ext) center / contain no-repeat;
|
||||
}
|
||||
|
||||
/* Hero — navy band with a subtle nebula gradient (BRAND D.5) */
|
||||
/* Hero — navy band with a nebula glow (BRAND D.5). The static gradient below is
|
||||
the reduced-motion fallback; with motion allowed, the glow moves to an animated
|
||||
pseudo-layer (see the motion block at the end of this file). */
|
||||
.hero-band {
|
||||
background:
|
||||
radial-gradient(700px 340px at 85% 115%, rgba(0,228,216,0.28), transparent 65%),
|
||||
radial-gradient(500px 260px at -5% -40%, rgba(0,0,156,0.55), transparent 60%),
|
||||
var(--galaxy);
|
||||
color: #fff; padding: var(--space-xl) 0; position: relative; overflow: hidden;
|
||||
background: var(--nebula), var(--galaxy);
|
||||
color: #fff; padding: var(--space-band) 0; position: relative; overflow: hidden;
|
||||
}
|
||||
.hero-band .flash { position: absolute; right: 8%; top: 22%; width: 22px; height: 22px; }
|
||||
.hero { position: relative; } /* content above the animated nebula layer */
|
||||
.hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); margin: 0 0 10px; line-height: 1.12; font-weight: 700; }
|
||||
.hero p { color: var(--cherenkov); font-size: 1.08rem; max-width: 62ch; margin: 0; } /* subtitle per BRAND D.3.4 */
|
||||
.eyebrow {
|
||||
@@ -212,7 +227,7 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5;
|
||||
list-style: none; margin: 0; padding: 6px; text-align: left;
|
||||
background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
|
||||
box-shadow: 0 16px 40px rgba(0, 0, 74, 0.25);
|
||||
box-shadow: var(--shadow-lifted);
|
||||
}
|
||||
.suggest:empty { display: none; }
|
||||
.suggest li { display: flex; align-items: center; gap: var(--space-s); padding: 0 12px; border-radius: calc(var(--radius) - 8px); }
|
||||
@@ -251,18 +266,12 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
whole card clickable via stretched link (research: NN/g & card-UI guides 2025). */
|
||||
.card {
|
||||
position: relative; background: #fff; border: 1px solid var(--border);
|
||||
border-radius: var(--radius); overflow: hidden;
|
||||
border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-ambient);
|
||||
display: flex; flex-direction: column;
|
||||
transition: border-color 0.15s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
.card:hover, .card:focus-within {
|
||||
border-color: var(--azure);
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 74, 0.06), 0 12px 28px rgba(0, 0, 74, 0.10);
|
||||
}
|
||||
.card:hover, .card:focus-within { border-color: var(--azure); box-shadow: var(--shadow-lifted); }
|
||||
/* Visible focus ring for the whole-card stretched link (WCAG 2.4.7) */
|
||||
.card:focus-within {
|
||||
box-shadow: 0 0 0 2px var(--azure), 0 2px 6px rgba(0, 0, 74, 0.06), 0 12px 28px rgba(0, 0, 74, 0.10);
|
||||
}
|
||||
.card:focus-within { box-shadow: 0 0 0 2px var(--azure), var(--shadow-lifted); }
|
||||
.card .cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
|
||||
.card .body { padding: var(--space-m); display: flex; flex-direction: column; gap: 10px; flex: 1; }
|
||||
/* Cover-less cards get a Cherenkov top accent instead of an image */
|
||||
@@ -274,7 +283,7 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
padding: 4px 10px; border-radius: var(--radius-pill);
|
||||
}
|
||||
.card h3 {
|
||||
margin: 2px 0 0; font-size: 1.1rem; line-height: 1.35; font-family: var(--font-body);
|
||||
margin: 2px 0 0; font-size: 1.1rem; line-height: 1.35; font-family: var(--font-body), sans-serif;
|
||||
display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
|
||||
}
|
||||
.card h3 a { color: var(--galaxy); text-decoration: none; }
|
||||
@@ -291,25 +300,19 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
@container (min-width: 640px) {
|
||||
.card--featured { grid-column: 1 / -1; display: grid; grid-template-columns: 3fr 2fr; }
|
||||
.card--featured .cover { height: 100%; aspect-ratio: auto; }
|
||||
.card--featured .body { padding: 26px 28px; justify-content: center; }
|
||||
.card--featured h3 { font-size: 1.6rem; font-family: var(--font-display); -webkit-line-clamp: 3; line-clamp: 3; }
|
||||
.card--featured .body { padding: var(--space-l); justify-content: center; }
|
||||
.card--featured h3 { font-size: 1.6rem; font-family: var(--font-display), sans-serif; -webkit-line-clamp: 3; line-clamp: 3; }
|
||||
.card--featured .desc { -webkit-line-clamp: 3; line-clamp: 3; }
|
||||
}
|
||||
/* Motion (only when the user allows it): view transitions, smooth scroll, hover lift */
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
@view-transition { navigation: auto; }
|
||||
html { scroll-behavior: smooth; }
|
||||
.card { transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease; }
|
||||
.card:hover { transform: translateY(-2px); }
|
||||
}
|
||||
|
||||
/* Service tiles — card tokens, text-first */
|
||||
.tile { padding: var(--space-m); gap: 8px; }
|
||||
.tile h3 { margin: 0; }
|
||||
.tile .badge-mock, .tile .badge-ext { margin: auto 0 0; align-self: flex-start; }
|
||||
|
||||
/* Article */
|
||||
.article { padding: 40px 0 72px; max-width: 70ch; }
|
||||
/* Article — 70ch column; on ≥1200px a sticky "On this page" rail sits to the right */
|
||||
.article-layout { display: grid; grid-template-columns: minmax(0, 70ch); }
|
||||
.article { padding: var(--space-l) 0 var(--space-xl); max-width: 70ch; }
|
||||
.article .back { color: var(--muted); font-size: 0.9rem; }
|
||||
.article h1 {
|
||||
color: var(--galaxy); font-size: clamp(2rem, 5vw, 3rem);
|
||||
@@ -322,20 +325,34 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
.article .cover { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--space-l); }
|
||||
/* Lead paragraph — slightly larger and muted */
|
||||
.prose > p:first-of-type { font-size: 1.08rem; color: var(--muted); }
|
||||
/* Article TOC — boxed "On this page" list (rendered only when ≥3 h2/h3) */
|
||||
/* Article TOC (MDN/Stripe pattern, rendered only when ≥3 h2/h3): sticky right rail
|
||||
on wide screens, collapsed <details> under the title otherwise. */
|
||||
.toc {
|
||||
background: var(--moon); border: 1px solid var(--border); border-radius: var(--radius);
|
||||
padding: var(--space-s) var(--space-m); margin-bottom: var(--space-l); font-size: 0.92rem;
|
||||
padding: var(--space-s) var(--space-m); font-size: 0.92rem;
|
||||
}
|
||||
.toc strong {
|
||||
display: block; font-size: 0.72rem; text-transform: uppercase;
|
||||
letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px;
|
||||
.toc strong, .toc summary {
|
||||
font-size: 0.72rem; text-transform: uppercase; font-weight: 600;
|
||||
letter-spacing: 0.08em; color: var(--muted);
|
||||
}
|
||||
.toc strong { display: block; margin-bottom: 4px; }
|
||||
.toc summary { cursor: pointer; padding: 6px 0; }
|
||||
.toc ol { list-style: none; margin: 0; padding: 0; }
|
||||
.toc li { margin: 8px 0; }
|
||||
.toc .d3 { padding-left: var(--space-s); }
|
||||
.toc a { text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
|
||||
.toc a:hover { text-decoration: underline; }
|
||||
.toc--inline { margin-bottom: var(--space-l); }
|
||||
.toc--rail { display: none; }
|
||||
@media (min-width: 1200px) {
|
||||
.article-layout { grid-template-columns: minmax(0, 70ch) 15rem; column-gap: var(--space-xl); justify-content: space-between; }
|
||||
.toc--inline { display: none; }
|
||||
.toc--rail {
|
||||
display: block; position: sticky; top: 88px; align-self: start;
|
||||
margin-top: calc(var(--space-l) + 44px); /* aligns with the article h1 */
|
||||
max-height: calc(100dvh - 112px); overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.prose h2 { color: var(--galaxy); margin: 34px 0 10px; font-size: clamp(1.25rem, 2.6vw, 1.45rem); }
|
||||
.prose h3 { color: var(--galaxy); margin: 26px 0 8px; font-size: 1.15rem; }
|
||||
@@ -354,9 +371,12 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
|
||||
.prose thead th { border-bottom: 2px solid var(--cherenkov); }
|
||||
|
||||
/* Generic page / mockup */
|
||||
.page { padding: 40px 0 72px; }
|
||||
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-m); }
|
||||
/* Generic page section — one rhythm token for all pages */
|
||||
.page { padding: var(--space-xl) 0; }
|
||||
.panel {
|
||||
background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
|
||||
padding: var(--space-m); box-shadow: var(--shadow-ambient);
|
||||
}
|
||||
.panel--narrow { max-width: 640px; }
|
||||
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
|
||||
.form-row label { font-size: 0.88rem; font-weight: 500; }
|
||||
@@ -378,12 +398,9 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
.search-results li {
|
||||
display: flex; justify-content: space-between; align-items: center; gap: var(--space-s);
|
||||
background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
|
||||
padding: 12px 18px; transition: border-color 0.15s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
.search-results li:hover {
|
||||
border-color: var(--azure);
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 74, 0.06), 0 12px 28px rgba(0, 0, 74, 0.10);
|
||||
padding: 12px 18px; box-shadow: var(--shadow-ambient);
|
||||
}
|
||||
.search-results li:hover { border-color: var(--azure); box-shadow: var(--shadow-lifted); }
|
||||
.search-results a { text-decoration: none; font-weight: 500; }
|
||||
.search-results a:hover { text-decoration: underline; }
|
||||
/* Date chips on results and suggestions */
|
||||
@@ -423,25 +440,23 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
|
||||
/* Auth (login mock) — nebula backdrop + floating card, modern auth pattern */
|
||||
.auth-band {
|
||||
min-height: calc(100dvh - 64px);
|
||||
display: grid; place-items: center; padding: var(--space-xl) 20px;
|
||||
background:
|
||||
radial-gradient(900px 500px at 80% 110%, rgba(0,228,216,0.35), transparent 60%),
|
||||
radial-gradient(700px 420px at 10% -20%, rgba(0,0,156,0.6), transparent 60%),
|
||||
var(--galaxy);
|
||||
min-height: calc(100dvh - 64px); position: relative; overflow: hidden;
|
||||
display: grid; place-items: center; padding: var(--space-band) var(--gutter);
|
||||
background: var(--nebula), var(--galaxy);
|
||||
}
|
||||
.auth-card {
|
||||
background: #fff; border-radius: calc(var(--radius) + 8px);
|
||||
padding: 40px 36px; max-width: 440px; width: 100%;
|
||||
box-shadow: 0 24px 64px rgba(0, 0, 74, 0.35);
|
||||
position: relative; background: #fff; border-radius: calc(var(--radius) + 8px);
|
||||
padding: clamp(24px, 5vw, 40px) clamp(20px, 4.5vw, 36px); max-width: 440px; width: 100%;
|
||||
box-shadow: var(--shadow-lifted);
|
||||
}
|
||||
.auth-logo { height: 24px; width: auto; margin-bottom: var(--space-m); }
|
||||
.auth-card h1 { color: var(--galaxy); margin: 6px 0 10px; font-size: 1.8rem; }
|
||||
.auth-card .muted { color: var(--muted); font-size: 0.95rem; }
|
||||
.btn-wide { width: 100%; margin-top: var(--space-s); }
|
||||
|
||||
/* Footer — brand band: logo + descriptor / spec links (§3.3.1) / demo note + flash */
|
||||
.footer { background: var(--galaxy); color: var(--on-galaxy-muted); font-size: 0.85rem; margin-top: var(--space-l); }
|
||||
/* Footer — brand band: logo + descriptor / spec links (§3.3.1) / demo note + flash.
|
||||
No top margin: Moon/Galaxy bands meet it flush; white pages pad via .page/.article. */
|
||||
.footer { background: var(--galaxy); color: var(--on-galaxy-muted); font-size: 0.85rem; }
|
||||
.footer .container { display: grid; gap: var(--space-m); padding-top: var(--space-xl); padding-bottom: var(--space-l); }
|
||||
.foot-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-s) var(--space-m); }
|
||||
.foot-top img { height: 30px; width: auto; }
|
||||
@@ -451,4 +466,55 @@ img { max-width: 100%; height: auto; display: block; }
|
||||
.foot-links a[href]:hover { text-decoration: underline; }
|
||||
.foot-links a:not([href]) { color: var(--on-galaxy-muted); }
|
||||
.foot-note { display: flex; align-items: center; gap: var(--space-s); border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: var(--space-m); }
|
||||
.foot-note .flash { width: 10px; height: 10px; flex: none; }
|
||||
|
||||
/* Whole-page ambient (2026 pattern) — a fixed brand-hue wash behind everything,
|
||||
opt-in per page via <Base ambient> (home only). Clearly visible pastel fields
|
||||
(alphas .16/.12/.10 — ceilings: links on the worst blob overlap stay ≥ 5.3:1);
|
||||
all reading surfaces (cards, panels, bands) are solid and cover it. Static
|
||||
when motion is reduced. */
|
||||
.has-ambient::before {
|
||||
content: ""; position: fixed; inset: -30%; z-index: -1; pointer-events: none;
|
||||
background:
|
||||
radial-gradient(44% 38% at 82% 10%, rgba(0, 228, 216, 0.16), transparent 70%),
|
||||
radial-gradient(50% 44% at 6% 38%, rgba(0, 122, 255, 0.12), transparent 70%),
|
||||
radial-gradient(46% 40% at 68% 90%, rgba(0, 0, 156, 0.1), transparent 70%);
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Motion — ALL animation/transition lives in this block (WCAG 2.3.3; the
|
||||
reduce block above is a second safety net). Nebula translation of ctao.org:
|
||||
they drift looping videos under Galaxy-Blue vignettes; here an oversized
|
||||
gradient layer drifts via transform only (compositor-friendly, no repaints).
|
||||
Worst-case blob-over-text contrast verified ≥4.5:1 (see DESIGN.md).
|
||||
========================================================================== */
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
@view-transition { navigation: auto; }
|
||||
html { scroll-behavior: smooth; }
|
||||
/* Bands hand their glow to a slowly roaming pseudo-layer (same --nebula stack) */
|
||||
.hero-band, .auth-band { background: var(--galaxy); }
|
||||
.hero-band::before, .auth-band::before {
|
||||
content: ""; position: absolute; inset: -45% -30%;
|
||||
background: var(--nebula);
|
||||
animation: nebula 22s ease-in-out infinite alternate;
|
||||
}
|
||||
/* Whole-page wash — slow drift, clearly alive within ~15s of looking */
|
||||
.has-ambient::before { animation: ambient 60s ease-in-out infinite alternate; }
|
||||
/* Hero content rises in once, gently staggered */
|
||||
.hero > * { animation: rise 0.5s ease-out backwards; }
|
||||
.hero > :nth-child(2) { animation-delay: 0.08s; }
|
||||
.hero > :nth-child(3) { animation-delay: 0.16s; }
|
||||
.hero > :nth-child(4) { animation-delay: 0.24s; }
|
||||
/* Hover feedback */
|
||||
.card, .search-results li { transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease; }
|
||||
.card:hover { transform: translateY(-2px); }
|
||||
.btn, .login-mock, .navlink { transition: background-color 0.15s ease, color 0.15s ease; }
|
||||
}
|
||||
@keyframes nebula { /* inert unless applied inside the block above */
|
||||
from { transform: translate3d(-6%, -4%, 0) rotate(-5deg) scale(1); }
|
||||
to { transform: translate3d(6%, 5%, 0) rotate(5deg) scale(1.22); }
|
||||
}
|
||||
@keyframes ambient {
|
||||
from { transform: translate3d(-4%, -3%, 0) rotate(-9deg) scale(1); opacity: 0.85; }
|
||||
to { transform: translate3d(4%, 4%, 0) rotate(9deg) scale(1.14); opacity: 1; }
|
||||
}
|
||||
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
|
||||
|
||||
Reference in New Issue
Block a user