/* =========================================================================
   Page — public marketing (U-701)
   -------------------------------------------------------------------------
   index.html and the marketing pages under {en,de}/: ecosystem, the three
   audience pages, crew and contact.

   ONLY what is genuinely page-level lives here. The blocks these pages share
   with each other — and that U-702 (pricing) and U-507 (blog, changelog) will
   want on sight — are components, and they are filed as components:

       components/band.css        the alternating full-bleed band
       components/split.css       prose beside something
       components/visual.css      a key-visual figure
       components/steps.css       a numbered <ol>
       components/facts.css       a <dl> of short facts
       components/note.css        an inline note
       components/anchor-row.css  in-page anchor chips
       components/card.css        (the .card-link affordance was added there)

   That split is not tidiness. Guideline §2 files one component per file
   precisely so two page branches touch two different files; leaving seven
   shared blocks in a stylesheet named after one page guarantees the next two
   frontend waves both edit this one.

   No literal colour here; every value comes from tokens.css.

   TWO STRUCTURAL DECISIONS, both learned rather than chosen:

   1. The subpages use the THEMED, sticky header and paint a COMPACT dark
      hero band below it. Only index.html has the full-viewport hero with the header
      floating over it — that arrangement needs the header taken out of flow
      (pages/splash.css explains why), and repeating it on six more pages would
      repeat the coupling six more times for no gain.

   2. The ground is painted BY the hero, never by a wrapper around it. A
      wrapper has to close before the content sections and drags <main> shut
      with it (LEARNING_FRONTEND.md L-FE-12).
   ========================================================================= */

/* ---- Page frame ---------------------------------------------------------- *
 * The footer sits at the bottom even on a short page.
 * ------------------------------------------------------------------------- */

.marketing-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.marketing-page > main {
  flex: 1;
}

/* An in-page anchor must not land under the sticky header — including `#main`,
 * which the skip link targets.
 *
 * 120 px, and the number is a deliberate over-estimate. The header measures
 * 65 px at every width in English, but it wraps to a second row as soon as a
 * translation is longer or a nav item is added (the failure pages/splash.css
 * documents), which is about 129 px. Guessing low hides the heading the visitor
 * just asked for; guessing high costs whitespace. There is no token for the
 * header's height, and CSS cannot read one element's height from another — so
 * this is a magic number, and it is the safe direction of one.
 */
.marketing-page main[id],
.marketing-page main [id] {
  scroll-margin-top: 120px;
}

/* ---- The frame of a public page (U-2277) --------------------------------- *
 * The marketing face of DESIGN_TOKENS.md §8.2: one measure, the marketing type,
 * sections, cards and the focus ring. Scoped to the two public page bodies,
 * because `.container`, `.card` and the headings are shared with the portal,
 * which keeps its panel language.
 * ------------------------------------------------------------------------- */

/* The measure: 1200 px of content and the page gutter each side. Set as the
   container's two properties rather than by a rule on `.container`, so the
   container keeps its one rule in base.css and a section's padding meets it
   at the same specificity there (U-1763, guards-narrow-render's gutter). */
:is(.marketing-page, .splash-page) {
  --container-max: calc(var(--page-max) + 2 * var(--page-gutter));
  --container-gutter: var(--page-gutter);
}

:is(.marketing-page, .splash-page) :focus-visible {
  outline: var(--border-w-strong) solid var(--ring);
  outline-offset: 2px;
}

/* On the dark bands the ring is the band's own ink: `--ring` follows the
   theme, and in light it is the dark ink on a dark ground. */
:is(.marketing-page, .splash-page) .on-brand :focus-visible {
  outline-color: var(--brand-on-dark);
}

:is(.marketing-page, .splash-page) .eyebrow {
  margin: 0;
  font: var(--font-eyebrow);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--sd-secondary);
}

:is(.marketing-page, .splash-page) .lede {
  margin: 0;
  font: var(--font-lead);
  color: var(--doc-ink-soft);
}

/* A section: 80 px above and below on a wide screen. Block padding only —
   the templates write `section container` on one element (U-1763). */
:is(.marketing-page, .splash-page) .section {
  padding-block: clamp(40px, 8vw, 80px);
}

:is(.marketing-page, .splash-page) .section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: 40px;
}

/* A section's heading is the display-md step: in a section head, and wherever
   it follows its eyebrow (a split's copy column). */
:is(.marketing-page, .splash-page) .section-head h2,
:is(.marketing-page, .splash-page) .eyebrow + h2 {
  margin: 0;
  font: var(--font-display-md);
}

:is(.marketing-page, .splash-page) .section-head .lede {
  margin-top: var(--space-xs);
}

/* Cards: the panel without its hairline, 24 px inside. A card on the
   alternating band takes the muted ground (components/band.css). */
:is(.marketing-page, .splash-page) .card {
  padding: var(--space-lg);
  gap: 12px;
  border-color: transparent;
}

:is(.marketing-page, .splash-page) .card > p {
  font-size: var(--text-body);
  line-height: var(--text-body-lh);
}

/* A card that is one link carries the accent bar on its leading edge, and
   the hairline and the one SIDES shadow on hover. An inset shadow is a line,
   not elevation (DESIGN_TOKENS.md §9.1). */
:is(.marketing-page, .splash-page) .card-link {
  color: var(--doc-ink);
  box-shadow: inset var(--border-w-strong) 0 0 var(--accent-bar);
  transition: box-shadow .15s, border-color .15s;
}

:is(.marketing-page, .splash-page) .card-link:hover {
  color: var(--doc-ink);
  border-color: var(--doc-line);
  box-shadow: inset var(--border-w-strong) 0 0 var(--accent-bar), var(--shadow-overlay);
}

/* Four columns, two below 1024 px, one below 640 px (§8.2). Three cards close
   as 3 or 1 (U-1954, guards-narrow-render's lone tile), so a three-card grid is
   three columns from 768 px — about 230 to 310 px a card up to 1023 px — and
   one below, never two beside a lone third (the redesign session, U-2278). */
:is(.marketing-page, .splash-page) .grid-auto {
  gap: var(--space-md);
}

:is(.marketing-page, .splash-page) .grid-auto:has(> :nth-child(3):last-child) {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  :is(.marketing-page, .splash-page) .grid-four {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  :is(.marketing-page, .splash-page) .grid-auto:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  :is(.marketing-page, .splash-page) .grid-four {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---- The inner-page hero band -------------------------------------------- *
 * Dark in both themes, so it carries `.on-brand` and the theme-invariant inks
 * of DESIGN_TOKENS.md §8.2. Computed from the tokens, at the mint bloom's
 * centre (16 % over #08110E, #163326), where the ground is lightest: white
 * 13.63:1, the lead ink 9.10:1, the quiet ink 6.18:1. Painted pixels are not
 * measured yet.
 * ------------------------------------------------------------------------- */

.page-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(640px 420px at 90% 30%, var(--hero-glow), transparent 70%),
    radial-gradient(520px 380px at 0% 100%, var(--hero-glow-deep), transparent 70%),
    var(--hero-ground);
  color: var(--brand-on-dark);
  padding: 56px 0 64px;
}

.page-hero > .container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}

/* `.eyebrow` is teal on the themed surfaces; on the band it is the mint. */
.page-hero .eyebrow {
  color: var(--brand-mint);
}

.page-hero h1 {
  margin: 0;
  max-width: 820px;
  font: var(--font-display-xl);
  letter-spacing: var(--display-xl-tracking);
  color: var(--brand-on-dark);
}

.page-hero-lede {
  margin: 0;
  font: var(--font-lead);
  color: var(--hero-ink-lead);
}

.page-hero-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}

/* ---- The contact page's anchor row --------------------------------------- *
 * The chips themselves are components/anchor-row.css; this is only where the
 * row sits. It hangs directly under the hero rather than inside a full
 * `.section`, which left a band of empty page between the chips and the first
 * heading.
 * ------------------------------------------------------------------------- */

.anchor-nav {
  padding-top: clamp(24px, 4vw, 40px);
}

/* ---- Contact and statutory details --------------------------------------- *
 * <address> is italic by default in every UA stylesheet, which is wrong for a
 * postal address and actively unhelpful for an e-mail address.
 * ------------------------------------------------------------------------- */

.contact-address {
  font-style: normal;
  font-size: 14.5px;
  line-height: 1.8;
  margin: 0 0 24px;
}
