Alex Dunmow a7a90ba3c1 fix(corporate-modernist): repair empty hero + tighten rhythm + mobile
Root cause of the missing home hero: the hero built-in's styled-text
fields (eyebrow/headline/subheadline, schema type=object x-editor=
styled-text) were seeded as BARE STRINGS. The override reads
`headline.text|default:headline`; ninjatpl hard-errors on `.text` field
access against a string ("can't access a field by name on type string")
BEFORE the |default filter runs, aborting the whole hero render → the
section rendered nothing, leaving a large void at the top of the page.
Fixed by seeding the object form `{ "text": "..." }` (matches the
built-in schema + sample). Same latent bug affects any theme that seeds
bare strings into hero styled-text fields.

Whitespace / layout:
- cm-section padding 4rem -> 3rem (3.5rem >=768px); cm-section-tight
  2.5rem -> 2rem. Kills the stacked ~8rem inter-section dead bands so the
  Swiss grid reads precise, not empty.
- hero padding 5rem -> 3.5rem.

Empty-media hardening:
- hero split variant only renders its media frame when backgroundImage
  is present (was an unconditional 4/3 muted box -> balloon).

Mobile:
- cm-form-grid now single-column base, 2-col >=640px (was fixed 2-col ->
  cramped half-fields at 375px); mirrored in the contact-form scoped
  style which wins on specificity.
- mobile nav toggle min 44x44 tap target.

No version bump. make + check-safety both exit 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 17:28:06 +08:00

311 lines
7.6 KiB
CSS

/* Corporate Modernist — Swiss-grid B2B theme styles. */
/* All colors come from theme HSL token variables via hsl(var(--token)). */
/* All font families come from --font-heading / --font-body / --font-mono with fallbacks. */
/* Content well capped at 1280px per the 12-column Swiss grid. */
.cm-content-well {
width: 100%;
max-width: 1280px;
margin-left: auto;
margin-right: auto;
padding-left: 1.5rem;
padding-right: 1.5rem;
box-sizing: border-box;
}
/* Swiss 12-column grid. */
.cm-swiss-12 {
display: grid;
grid-template-columns: repeat(12, minmax(0, 1fr));
column-gap: 1.5rem;
row-gap: 1.5rem;
}
/* Hairline 1px separator using the border token. */
.cm-hairline {
border-color: hsl(var(--border));
border-width: 1px;
border-style: solid;
}
.cm-hairline-top {
border-top: 1px solid hsl(var(--border));
}
.cm-hairline-bottom {
border-bottom: 1px solid hsl(var(--border));
}
/* Tabular numerics for financial alignment. */
.numeric-tabular {
font-variant-numeric: tabular-nums;
}
/* Typography — explicit fallback stacks from spec §3. */
.cm-display {
font-family: var(--font-heading, "Inter Tight", "Inter", system-ui, sans-serif);
font-weight: 600;
letter-spacing: -0.02em;
}
.cm-body {
font-family: var(--font-body, "Inter", system-ui, sans-serif);
font-size: 17px;
line-height: 28px;
font-variant-numeric: tabular-nums;
}
.cm-mono {
font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
font-variant-numeric: tabular-nums;
}
/* Accent rule — single deep accent at the top of cards or sections. */
.cm-accent-rule {
border-top: 2px solid hsl(var(--accent));
}
/* Buttons — squared 4px corners, accent fill or 1px outline, no shadow, no gradient. */
.cm-btn-primary {
display: inline-block;
padding: 0.625rem 1.25rem;
background-color: hsl(var(--accent));
color: hsl(var(--accent-foreground));
border: 1px solid hsl(var(--accent));
border-radius: 4px;
font-family: var(--font-heading, "Inter Tight", "Inter", system-ui, sans-serif);
font-weight: 500;
text-decoration: none;
line-height: 1.4;
box-shadow: none;
background-image: none;
transition: background-color 150ms ease;
}
.cm-btn-primary:hover {
background-color: hsl(var(--accent) / 0.9);
}
.cm-btn-primary:focus-visible {
outline: 2px solid hsl(var(--ring));
outline-offset: 2px;
}
.cm-btn-outline {
display: inline-block;
padding: 0.625rem 1.25rem;
background-color: transparent;
color: hsl(var(--foreground));
border: 1px solid hsl(var(--border));
border-radius: 4px;
font-family: var(--font-heading, "Inter Tight", "Inter", system-ui, sans-serif);
font-weight: 500;
text-decoration: none;
line-height: 1.4;
box-shadow: none;
background-image: none;
transition: border-color 150ms ease;
}
.cm-btn-outline:hover {
border-color: hsl(var(--foreground));
}
.cm-btn-outline:focus-visible {
outline: 2px solid hsl(var(--ring));
outline-offset: 2px;
}
/* Card surface — flat, hairline border, no elevation. */
.cm-card {
background-color: hsl(var(--card));
color: hsl(var(--card-foreground));
border: 1px solid hsl(var(--border));
border-radius: 4px;
padding: 1.5rem;
box-shadow: none;
}
.cm-card.cm-card-accent {
border-top: 2px solid hsl(var(--accent));
}
/* Heading override — tighter tracking, restricted weights. */
.cm-heading {
font-family: var(--font-heading, "Inter Tight", "Inter", system-ui, sans-serif);
font-weight: 600;
letter-spacing: -0.02em;
color: hsl(var(--foreground));
margin: 0;
}
.cm-heading-h2-accent {
border-bottom: 2px solid hsl(var(--accent));
padding-bottom: 0.25rem;
display: inline-block;
}
/* Text block — Inter at 17/28, hanging punctuation, tabular figures. */
.cm-text {
font-family: var(--font-body, "Inter", system-ui, sans-serif);
font-size: 17px;
line-height: 28px;
color: hsl(var(--foreground));
font-variant-numeric: tabular-nums;
hanging-punctuation: first last;
}
/* Logo strip — greyscale, hover desaturate-off. */
.cm-logo {
filter: grayscale(1);
opacity: 0.7;
transition: filter 200ms ease, opacity 200ms ease;
}
.cm-logo:hover {
filter: grayscale(0);
opacity: 1;
}
/* Pull quote rule — used by testimonial. */
.cm-pull-quote {
border-top: 2px solid hsl(var(--accent));
padding-top: 1.25rem;
font-family: var(--font-heading, "Inter Tight", "Inter", system-ui, sans-serif);
font-size: 1.5rem;
line-height: 1.4;
font-weight: 500;
color: hsl(var(--foreground));
}
/* Big tabular numeral for case-study metric. */
.cm-metric {
font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
font-size: 3rem;
line-height: 1;
font-weight: 500;
font-variant-numeric: tabular-nums;
color: hsl(var(--accent));
}
/* Stat pair figure. */
.cm-stat-figure {
font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
font-size: 2.5rem;
line-height: 1;
font-weight: 500;
font-variant-numeric: tabular-nums;
color: hsl(var(--foreground));
}
.cm-stat-label {
font-family: var(--font-body, "Inter", system-ui, sans-serif);
font-size: 0.875rem;
color: hsl(var(--muted-foreground));
text-transform: uppercase;
letter-spacing: 0.05em;
margin-top: 0.5rem;
}
/* Eyebrow label above hero headline. */
.cm-eyebrow {
font-family: var(--font-heading, "Inter Tight", "Inter", system-ui, sans-serif);
font-size: 0.875rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.1em;
color: hsl(var(--accent));
margin-bottom: 1rem;
}
/* Inverted CTA strip — accent background. */
.cm-cta-strip-accent {
background-color: hsl(var(--accent));
color: hsl(var(--accent-foreground));
}
.cm-cta-strip-accent .cm-btn-primary {
background-color: hsl(var(--accent-foreground));
color: hsl(var(--accent));
border-color: hsl(var(--accent-foreground));
}
.cm-cta-strip-quiet {
background-color: hsl(var(--muted));
color: hsl(var(--foreground));
}
/* Footer columns. */
.cm-footer {
background-color: hsl(var(--background));
color: hsl(var(--foreground));
border-top: 1px solid hsl(var(--border));
padding: 3rem 0;
}
.cm-footer-legal {
color: hsl(var(--muted-foreground));
font-size: 0.875rem;
border-top: 1px solid hsl(var(--border));
padding-top: 1.5rem;
margin-top: 2rem;
}
/* Leadership grid responsive helpers. */
.cm-leadership-grid {
display: grid;
grid-template-columns: repeat(1, minmax(0, 1fr));
gap: 1.5rem;
}
@media (min-width: 640px) {
.cm-leadership-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (min-width: 1024px) {
.cm-leadership-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@media (min-width: 1280px) {
.cm-leadership-grid {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
}
/* Article measure — long-form centered well between 60-78ch. */
.cm-article-measure {
max-width: 70ch;
margin-left: auto;
margin-right: auto;
font-family: var(--font-body, "Inter", system-ui, sans-serif);
font-size: 17px;
line-height: 28px;
color: hsl(var(--foreground));
}
/* Section spacing. */
.cm-section {
padding-top: 3rem;
padding-bottom: 3rem;
}
@media (min-width: 768px) {
.cm-section {
padding-top: 3.5rem;
padding-bottom: 3.5rem;
}
}
/* Image empty-state — when media missing. */
.cm-img-empty {
display: block;
width: 100%;
aspect-ratio: 4 / 3;
background-color: hsl(var(--muted));
border: 1px solid hsl(var(--border));
}