Skip to content

The Open Standard for Generative UI

10.7 KB
Raw Blame
/* One product band. Colour comes from two token sets: the light tone reads the
   site theme, the dark tone pins itself, because it sits on the Cloud band's
   black in either theme. Every rule below styles through these, so the two
   tones never need parallel rules. */
.product {
  --ps-text: var(--openui-text-neutral-primary);
  --ps-muted: var(--openui-text-neutral-secondary);
  --ps-mark-bg: #0a0a0a;
  --ps-mark-fg: #fff;
  /* One fill and one edge for the stage, the cards and the icon tiles, so the
     band reads as a single material. */
  --ps-surface: #fff;
  /* The base colour FadedDither paints, so the stage's edge is the same grey as
     its fill. Keep in step with TONES in FadedDitherCanvas.tsx: light #f8f8f8,
     dark #0e0e0e. Which one applies follows the ground, exactly as the shader's
     own tone does. */
  --ps-stage-stroke: #f8f8f8;
  --ps-border: rgba(10, 10, 10, 0.035);
  /* A divider across the band, not a card edge: --ps-border is tuned to be
     almost invisible against the surface it outlines and disappears when used
     as a rule. */
  --ps-line: rgba(10, 10, 10, 0.09);
  --ps-shadow: none;

  display: flex;
  flex-direction: column;
  /* Matches the gap the cards use between each other, so the band's vertical
     rhythm is the same measure as its horizontal one. Change both together. */
  gap: 0.875rem;
  width: 100%;
  /* Caps its own measure so the three bands line up whether the host is the
     home content shell or the Cloud band's inner. Gutters stay the host's job,
     matching how the other home sections split it. */
  max-width: var(--home-container-max);
  margin-inline: auto;
  color: var(--ps-text);
}

[data-theme="dark"] .product {
  --ps-surface: rgba(255, 255, 255, 0.042);
  --ps-stage-stroke: #0e0e0e;
  --ps-border: rgba(255, 255, 255, 0.04);
  --ps-line: rgba(255, 255, 255, 0.14);
  --ps-mark-bg: #fff;
  --ps-mark-fg: #0a0a0a;
  --ps-shadow: none;
}

/* Pinned rather than theme-derived: on a light page this tone sits on black. */
.onDark {
  --ps-text: #fff;
  --ps-muted: rgba(255, 255, 255, 0.6);
  --ps-surface: rgba(255, 255, 255, 0.042);
  --ps-stage-stroke: #0e0e0e;
  --ps-border: rgba(255, 255, 255, 0.04);
  --ps-line: rgba(255, 255, 255, 0.14);
  --ps-mark-bg: #fff;
  --ps-mark-fg: #0a0a0a;
  --ps-shadow: none;
}

/* ---- Lockup ---- */
.lockup {
  /* The band's single gap keeps stage and cards tight together; the copy above
     wants more air than that, so this tops up only the lockup-to-stage
     boundary rather than loosening the whole rhythm. */
  margin-bottom: clamp(0.75rem, 2vw, 1.75rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: start;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.lead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--home-font-text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

/* The outlined chip from the Cloud hero, not the nav's solid status tag: it
   reads as part of the product name rather than as a badge stuck to it. Sized
   just under the eyebrow and drawn in currentColor, so it inverts with the
   band's tone for free. */
.eyebrowTag {
  display: inline-flex;
  align-items: center;
  /* Optically centres the chip against the cap height beside it. */
  margin-top: -2px;
  padding: 2px 6px 3px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-family: var(--home-font-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  vertical-align: middle;
}

.headline {
  max-width: 20ch;
  margin: 0;
  /* Same display face and weight the section headings use. Only the size is
     local, because a band heading sits below them in the hierarchy. */
  font-family: var(--home-font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: var(--home-title-weight);
  line-height: var(--home-title-leading);
  letter-spacing: var(--home-title-tracking);
  text-wrap: balance;
}

.description {
  margin: 0;
  /* Optically aligned with the headline rather than the eyebrow above it. */
  padding-top: clamp(0.5rem, 3vw, 3.25rem);
  font-family: var(--home-font-text);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ps-muted);
  text-wrap: pretty;
}

.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

/* ---- Stage ---- */
.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  /* 16/9 with the height at 70%. */
  aspect-ratio: var(--product-stage-aspect, 16 / 6.3);
  padding: clamp(0.375rem, 0.7vw, 0.625rem);
  border: 1px solid var(--ps-border);
  border-radius: 20px;
  background: var(--ps-surface);
  box-shadow: var(--ps-shadow);
}

/* Some final illustrations already contain their own app frame. Nesting those
   inside the default stage inset creates a conspicuous double border, so they
   crop directly to the section bounds instead. */
.stageFullBleed {
  padding: 0;
  /* The shader's own grey, used as an edge, so the stage's outline is the same
     shade as the fill inside it. */
  border: 1px solid var(--ps-stage-stroke);
  border-radius: 24px;
  background: transparent;
  /* The cards keep --ps-shadow; a full-bleed stage does not want the lift. */
  box-shadow: none;
}

/* No frame of its own: the art inside draws its panels. */
.stageBare {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Fills the stage behind the artwork. The stage clips it, so it picks up the
   rounded corners without needing its own. */
.stageShader {
  position: absolute;
  z-index: 0;
  inset: 0;
}

.stageShader > * {
  width: 100%;
  height: 100%;
}

.stageImage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* The breakpoint switches these wrappers; the theme rules below pick which
   image inside the visible one shows. */
.stageWide {
  display: contents;
}

.stageCompact {
  display: none;
}

.stageDark {
  display: none;
}

[data-theme="dark"] .stageLight {
  display: none;
}

[data-theme="dark"] .stageDark {
  display: block;
}

/* The dark band is black in light theme, so it wants the dark artwork. The
   pair under [data-theme="dark"] below flips this back, because the band
   inverts to white there. */
.onDark .stageLight {
  display: none;
}

.onDark .stageDark {
  display: block;
}

/* ---- Cards ---- */
/* The phone-only accordion. The band's own tokens are handed to the grid here:
   it defaults to the page tokens, which go invisible on the Cloud band because
   that band inverts independently of the page theme. */
.cardsCompact {
  display: none;
  --feature-grid-text: var(--ps-text);
  --feature-grid-muted: var(--ps-muted);
  --feature-grid-faint: var(--ps-muted);
  --feature-grid-line: var(--ps-line);
  --feature-grid-surface: var(--ps-surface);
  --feature-grid-border: var(--ps-border);
  --feature-grid-shadow: var(--ps-shadow);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.875rem;
}

.card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 184px;
  padding: 15px;
  border: 1px solid var(--ps-border);
  border-radius: 16px;
  background: var(--ps-surface);
  box-shadow: var(--ps-shadow);
}

.cardIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  color: var(--ps-text);
}

.cardCopy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cardTitle {
  margin: 0;
  font-family: var(--home-font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.2px;
  line-height: 1.25;
  text-wrap: balance;
}

.cardDescription {
  margin: 0;
  font-family: var(--home-font-text);
  font-size: 14px;
  line-height: 21px;
  color: var(--ps-muted);
  text-wrap: pretty;
}

/* ---- Narrower ---- */
@media (max-width: 1023px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .stageWide {
    display: none;
  }

  .stageCompact {
    display: contents;
  }

  /* The lockup stops being a container here: display:contents drops its
     children into the band's own column, so the description can be ordered
     below the stage. The desktop grid has the description beside the headline
     and no room for that, which is why it is an order swap and not markup. */
  .lockup {
    display: contents;
  }

  .lead {
    /* The lockup's own bottom margin, which display:contents discards. */
    margin-bottom: clamp(0.75rem, 2vw, 1.75rem);
    order: 1;
  }

  .stage {
    order: 2;
  }

  .description {
    padding-top: 0;
    order: 3;
  }

  .cardsCompact {
    order: 4;
  }

  .headline {
    max-width: none;
  }

  .stage {
    /* Taller than the desktop ratio, which gets too thin at phone width. */
    aspect-ratio: var(--product-stage-mobile-aspect, 4 / 2.4);
    border-radius: 16px;
  }

  .cards {
    display: none;
  }

  .cardsCompact {
    display: block;
  }

  /* The buttons go full width on phones, so stack them rather than wrapping. */
  .ctas {
    flex-direction: column;
    align-self: stretch;
  }
}

/* ---- The dark tone inverts with the page ----
   CloudSection's own .section flips from #000 to #f4f4f5 under a dark theme, so
   a band sitting on it has to flip too. Without this the band keeps white text
   and white fills on a light ground and disappears. */
[data-theme="dark"] .onDark {
  --ps-text: #0a0a0a;
  --ps-muted: rgba(10, 10, 10, 0.6);
  --ps-surface: #fff;
  --ps-stage-stroke: #f8f8f8;
  /* The band is white here and so are the cards, so the edge and the lift are
     the only things separating them from the ground. */
  --ps-border: rgba(10, 10, 10, 0.08);
  --ps-line: rgba(10, 10, 10, 0.12);
  --ps-shadow: 0 1px 2px rgba(10, 10, 10, 0.04), 0 2px 8px rgba(10, 10, 10, 0.04);
  --ps-mark-bg: #0a0a0a;
  --ps-mark-fg: #fff;
}

/* The band is light here, so it wants the light artwork. */
[data-theme="dark"] .onDark .stageLight {
  display: block;
}

[data-theme="dark"] .onDark .stageDark {
  display: none;
}

/* The buttons use the theme-independent variants for this tone, which means
   they do not invert on their own. Same declarations CloudSection applied to
   its own CTAs before they moved here. */
[data-theme="dark"] .onDark .primaryCta {
  border-color: rgba(255, 255, 255, 0.2);
  background: #0a0a0a;
  box-shadow: var(--home-bevel-on-dark);
  color: #fff;
  --bevel-badge-bg: #fff;
  --bevel-badge-fg: #0a0a0a;
}

[data-theme="dark"] .onDark .secondaryCta {
  border-color: rgba(0, 0, 0, 0.08);
  background: var(--home-surface-raised);
  box-shadow: var(--home-bevel);
  color: #0a0a0a;
  --bevel-badge-bg: #0a0a0a;
  --bevel-badge-fg: #fff;
}