/* ==========================================================================
   base.css - global rules, shared building blocks, header, mobile menu, footer.
   Loaded on every page after tokens.css. Values come from tokens.css variables;
   fixed px font sizes, paddings and gaps from specs/SECTIONS.md are literals.

   Section CSS (home-1.css, home-2.css, updates.css) never edits this file. A missing
   shared piece is written in the section's own CSS and reported.

   SHARED CLASSES
   --------------------------------------------------------------------------
   .container            max-width var(--container) (1120px, gutters included),
                         centred, padding-inline var(--gutter). = "C" in SECTIONS.md.
   .container--wide      max-width var(--container-wide) (1280px). = "CW".
   .container--customer  max-width var(--container-customer) (1400px).

   .btn                  pill link/button: inline-flex, centred, weight 500, no border.
                         Always combine with one size and one style:
     .btn--lg            16px, padding 16px 30px (hero, CTA, menu).
     .btn--sm            14px, padding 9px 18px (header).
     .btn--primary       ink background, white text.
     .btn--secondary     1px ink border, ink text (transparent background).
     .btn--on-dark       on a dark section: primary -> white bg / ink text,
                         secondary -> 1px white border / white text.

   .eyebrow              17px, var(--text-secondary). Margins are set per section.
   .heading-h2           --fs-h2, line-height 1.08, letter-spacing -.03em.
   .heading-statement    --fs-h2-statement, line-height 1.15, letter-spacing -.025em.
   .on-dark              put on a dark section root: focus rings turn white there.
   .sr-only              visually hidden, still read by screen readers.

   .media                empty media placeholder box (position relative, overflow hidden).
                         Size, aspect-ratio, radius and shadow are set by the section.
                         A later <img>/<video> child fills it absolutely with
                         object-fit: cover, so dropping one in never changes the layout.
     .media--white | --surface | --muted | --grey | --ink
                         background var(--color-white) | --color-surface |
                         --color-surface-muted | --color-surface-hover |
                         --color-ink.
     .media--top-left    object-position: top left for the child img/video.

   .rail                 horizontal carousel track: flex, native overflow-x scroll,
                         scroll-snap x mandatory, hidden scrollbar, first card aligned to the
                         1120px container, bleeds to the viewport edge (inline padding and
                         scroll-padding = var(--rail-inset)). Children are flex:none and
                         snap to start. Gap = var(--rail-gap) (default 20px; set 24px on the
                         rail for quotes). Vertical padding is set per section.
                         Markup: <div class="rail" id="x-rail" data-rail tabindex="0"
                         aria-label="..."> (tabindex + aria-label make it keyboard-scrollable).
   .rail__controls       flex row, right-aligned, gap 12px. Use as
                         <div class="container rail__controls"> under a rail, or inline
                         in a section header.

   .icon-btn             44px round button, var(--color-surface) bg, ink glyph 20px,
                         hover var(--color-surface-hover).
     .icon-btn--white    white background (quotes-carousel on grey).
     .icon-btn--sm       40px, 16px glyph (header menu button).

   .post-card            shared post card (latest-updates + updates-grid). Markup:
     <a class="post-card" href="#" data-category="Product">
       <div class="post-card__cover post-card__cover--dark">
         <span class="post-card__cover-text">Introducing<br>Stories</span>
       </div>
       <div class="post-card__body">
         <h3 class="post-card__title">...</h3>
         <div class="post-card__meta"><span>Product</span>
           <span class="post-card__date">Sep 24, 2026</span></div>
       </div>
     </a>
     Themes: post-card__cover--dark | --image | --grey | --light.
     Sizes via custom properties on .post-card or a parent:
       --post-cover-fs (default clamp(26px,2.6vw,36px)), --post-title-fs (default 22px).
     An <img> inside the cover gets a var(--scrim-image) scrim automatically.

   JS HOOKS (public/js/site.js)
   --------------------------------------------------------------------------
   [data-menu-toggle]    the header menu button (aria-controls="mobile-menu").
   html[data-menu-open]  set while the mobile menu is open; a "leern:menu" event
                         (detail.open) is dispatched on document on every change.
   [data-rail]           a .rail with an id. Any button with data-rail-step="prev|next"
                         and aria-controls="<rail id>" scrolls it by one card + gap.
   ========================================================================== */

/* ---- Global -------------------------------------------------------------- */
html { scroll-padding-top: var(--header-h); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
.on-dark :focus-visible { outline-color: var(--color-white); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
body.page--updates { background: var(--color-bg-subtle); }
html[data-menu-open] body { overflow: hidden; }
html[data-menu-open] [data-section="whats-new-widget"] { display: none !important; }

/* ---- Containers ---------------------------------------------------------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--wide { max-width: var(--container-wide); }
.container--customer { max-width: var(--container-customer); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--fw-medium); border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--text-primary); cursor: pointer; text-align: center;
}
.btn--lg { font-size: 16px; padding: 16px 30px; }
.btn--sm { font-size: 14px; padding: 9px 18px; }
.btn--primary, .btn--primary:hover { background: var(--color-ink); color: var(--color-white); }
.btn--secondary { border: 1px solid var(--border-rule); }
.btn--primary.btn--on-dark, .btn--primary.btn--on-dark:hover { background: var(--color-white); color: var(--text-primary); }
.btn--secondary.btn--on-dark, .btn--secondary.btn--on-dark:hover { border-color: var(--color-white); color: var(--color-white); }

/* ---- Type helpers -------------------------------------------------------- */
.eyebrow { font-size: 17px; color: var(--text-secondary); }
.heading-h2 { font-size: var(--fs-h2); line-height: 1.08; letter-spacing: -.03em; }
.heading-statement { font-size: var(--fs-h2-statement); line-height: 1.15; letter-spacing: -.025em; }

/* ---- Media placeholder --------------------------------------------------- */
.media { position: relative; overflow: hidden; }
.media > img, .media > video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.media--top-left > img, .media--top-left > video { object-position: top left; }
.media--white { background: var(--color-white); }
.media--surface { background: var(--color-surface); }
.media--muted { background: var(--color-surface-muted); }
.media--grey { background: var(--color-surface-hover); }
.media--ink { background: var(--color-ink); }

/* ---- Rail (carousel) ----------------------------------------------------- */
.rail {
  --rail-gap: 20px;
  display: flex; gap: var(--rail-gap); overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: var(--rail-inset); scroll-padding-inline: var(--rail-inset);
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: none; scroll-snap-align: start; }
.rail__controls { display: flex; justify-content: flex-end; gap: 12px; }

/* ---- Round icon button --------------------------------------------------- */
.icon-btn {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-surface); color: var(--text-primary);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: var(--color-surface-hover); }
.icon-btn--white { background: var(--color-white); }
.icon-btn--sm { width: 40px; height: 40px; font-size: 16px; }

/* ---- Post card ----------------------------------------------------------- */
.post-card { display: flex; flex-direction: column; gap: 22px; }
.post-card__cover {
  position: relative; overflow: hidden; aspect-ratio: 1; border-radius: var(--radius-card-m);
  display: flex; align-items: center; justify-content: center;
  transition: transform .5s ease;
}
.post-card__cover:hover { transform: scale(1.015); }
.post-card__cover--dark { background: var(--color-ink); color: var(--color-white); }
.post-card__cover--image { background: var(--dark-overlay); color: var(--color-white); }
.post-card__cover--grey { background: var(--color-surface-hover); color: var(--text-primary); }
.post-card__cover--light { background: var(--color-surface); color: var(--text-primary); }
.post-card__cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-card__cover:has(> img)::after { content: ""; position: absolute; inset: 0; background: var(--scrim-image); }
.post-card__cover-text {
  position: relative; z-index: 1; padding: 0 32px; text-align: center;
  font-size: var(--post-cover-fs, clamp(26px, 2.6vw, 36px)); line-height: 1.15; letter-spacing: -.02em;
}
.post-card__body { display: flex; flex-direction: column; gap: 10px; padding: 0 6px; }
.post-card__title { font-size: var(--post-title-fs, 22px); line-height: 1.3; letter-spacing: -.01em; }
.post-card__meta { display: flex; gap: 12px; font-size: 15px; color: var(--text-primary); }
.post-card__date { color: var(--text-secondary); }
@media (prefers-reduced-motion: reduce) { .post-card__cover:hover { transform: none; } }

/* ---- header -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-hairline);
}
.site-header__inner {
  max-width: var(--container); margin: 0 auto; padding: 0 clamp(20px, 4vw, 32px);
  height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.site-header__logo { font-size: 22px; font-weight: var(--fw-semibold); letter-spacing: -.03em; }
.site-header__nav { display: flex; gap: 36px; font-size: 14px; }
.site-header__nav a { color: var(--text-strong); }
.site-header__nav a:hover { color: var(--text-secondary); }
.site-header__nav a[aria-current="page"] { color: var(--text-primary); font-weight: var(--fw-medium); }
.site-header__actions { display: flex; align-items: center; gap: 8px; }
.site-header__menu-btn { display: none; }

/* ---- mobile-menu (< 760px) ----------------------------------------------- */
.mobile-menu {
  position: fixed; top: calc(var(--header-h) + 1px); left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--color-white); padding: 16px 20px 32px;
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
}
.mobile-menu__nav { display: flex; flex-direction: column; }
.mobile-menu__link {
  font-size: 22px; letter-spacing: -.01em; padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.mobile-menu__cta { margin-top: 32px; }

@media (max-width: 759.98px) {
  .site-header__nav { display: none; }
  .site-header__menu-btn { display: inline-flex; }
}
@media (min-width: 760px) {
  .mobile-menu { display: none !important; }
}

/* ---- footer -------------------------------------------------------------- */
.site-footer { background: var(--color-surface); color: var(--text-primary); }
.site-footer__inner {
  padding-block: clamp(80px, 10vw, 120px) 40px;
  display: flex; flex-wrap: wrap; gap: 56px 40px;
}
.site-footer__brand { flex: 1 1 220px; display: flex; flex-direction: column; gap: 36px; }
.site-footer__logo { font-size: 30px; font-weight: var(--fw-semibold); letter-spacing: -.03em; align-self: flex-start; }
.site-footer__entities {
  display: flex; flex-direction: column; gap: 28px;
  font-size: 14px; line-height: 1.6; color: var(--text-strong); font-style: normal;
}
.site-footer__entity-name { font-weight: var(--fw-semibold); color: var(--text-primary); }
.site-footer__social { display: flex; gap: 10px; }
.site-footer__social a {
  width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--color-white);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: var(--fw-semibold);
}
.site-footer__blog { flex: 1.7 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.site-footer__heading { font-size: 16px; font-weight: var(--fw-semibold); align-self: flex-start; }
.site-footer__post { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center; }
.site-footer__thumb { aspect-ratio: 16 / 10; border-radius: var(--radius-thumb); }
.site-footer__post-title { font-size: 15px; line-height: 1.45; }
.site-footer__col { flex: .75 1 130px; display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
.site-footer__col .site-footer__heading { margin-bottom: 8px; }
.site-footer__col a { color: var(--text-strong); }
.site-footer__col a:hover { color: var(--text-secondary); }
.site-footer__bottom {
  padding-block: 28px 40px; border-top: 1px solid var(--border-default);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-secondary);
}
.site-footer__legal { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer__legal a { color: var(--text-secondary); }
