/* Shared best-of-breed chrome for the core Siftable marketing pages. */

/* ============================================================
   ONE HORIZONTAL CONTRACT
   Header, footer grid and footer bar previously each had their own
   container rule: the header uncapped, the footer grid capped at 1560px
   and centred, the bar uncapped again. They only agreed near 1440px,
   where 4vw still sat under every cap. Above ~1560px they split three
   ways (header 72, grid 252, bar 72 at 1920).

   --edge is the slack outside the canvas on wide screens. Every chrome
   container now derives its inline padding from --chrome-x, so the cap
   and the gutter come from one place. Pages that draw the pigment rail
   bind --rail-x to --chrome-x so the wordmark sits directly above it.
   ============================================================ */
:root {
  --canvas: 1360px;
  --edge: max(0px, (100% - var(--canvas)) / 2);
  --chrome-gutter: clamp(24px, 4vw, 72px);
  --chrome-x: calc(var(--edge) + var(--chrome-gutter));
}

.marketing-skip-link {
  position: fixed;
  inset: 10px auto auto 10px;
  z-index: 3000;
  padding: 10px 14px;
  border: 2px solid #16110c;
  border-radius: 4px;
  background: #fbf6ea;
  color: #16110c;
  font: 700 11px/1 var(--font-mono, "Space Mono", monospace);
  letter-spacing: 0.06em;
  text-decoration: none;
  transform: translateY(-160%);
}

.marketing-skip-link:focus { transform: translateY(0); }

.marketing-header {
  --marketing-ink: #16110c;
  position: relative;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 88px;
  align-items: center;
  gap: clamp(24px, 3vw, 56px);
  padding: 16px var(--chrome-x);
  border-bottom: 2px solid var(--marketing-ink);
  background: #fbf6ea;
  color: var(--marketing-ink);
  direction: ltr;
}

.marketing-header a { color: inherit; text-decoration: none; }

.marketing-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: max-content;
  font-family: var(--font-display, "Unbounded", system-ui, sans-serif);
  font-size: clamp(19px, 1.7vw, 25px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.marketing-header__brand img,
.marketing-footer__brand-name img { display: block; flex: none; }

.marketing-header__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 2.2vw, 38px);
}

.marketing-header__nav > a {
  position: relative;
  padding: 13px 0 11px;
  font: 700 11px/1 var(--font-mono, "Space Mono", monospace);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.marketing-header__nav > a::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 2px;
  background: #e0532b;
  content: "";
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 140ms ease-out;
}

.marketing-header__nav > a:hover::after,
.marketing-header__nav > a:focus-visible::after,
.marketing-header__nav > a[aria-current="page"]::after { transform: scaleX(1); }

.marketing-header__nav > a:focus-visible,
.marketing-header__brand:focus-visible,
.marketing-header__login:focus-visible,
.marketing-menu__summary:focus-visible,
.marketing-menu__link:focus-visible,
.marketing-footer a:focus-visible {
  outline: 3px solid #eca40e;
  outline-offset: 4px;
}

.marketing-header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.marketing-header .bauhaus-locale { color: var(--marketing-ink); }
.marketing-header .bauhaus-locale__summary { min-width: 58px; min-height: 44px; }

.marketing-header__login {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 2px solid #16110c;
  border-radius: 5px;
  background: #16110c;
  box-shadow: 6px 6px 0 #e0532b;
  color: #fbf6ea !important;
  font: 700 11px/1 var(--font-mono, "Space Mono", monospace);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: box-shadow 120ms ease-out, transform 120ms ease-out;
}

.marketing-header__login:hover { box-shadow: 8px 8px 0 #e0532b; transform: translate(-1px, -1px); }
.marketing-header__login:active { box-shadow: 3px 3px 0 #e0532b; transform: translate(3px, 3px); }

.marketing-menu { display: none; position: relative; }
.marketing-menu__summary { list-style: none; }
.marketing-menu__summary::-webkit-details-marker { display: none; }

.marketing-footer {
  position: relative;
  z-index: 2;
  display: block;
  margin: 0;
  border: 0;
  border-top: 2px solid #16110c;
  background: #16110c;
  color: #f3e9d6;
  direction: ltr;
}

.marketing-footer__grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) repeat(4, minmax(130px, 0.75fr));
  gap: clamp(34px, 4vw, 76px);
  /* --edge already caps the canvas; a second max-width put the grid on a
     different axis to the header and the bar. */
  margin: 0;
  padding: clamp(46px, 5vw, 76px) var(--chrome-x);
}

.marketing-footer__brand { max-width: 390px; }

.marketing-footer__brand-name {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
  color: #fbf6ea;
  font-family: var(--font-display, "Unbounded", system-ui, sans-serif);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  text-decoration: none;
}

.marketing-footer__brand p {
  margin: 0;
  color: #c9bea8;
  font-family: var(--font-body, "Jost", system-ui, sans-serif);
  font-size: 15px;
  line-height: 1.6;
}

.marketing-footer nav { min-width: 0; }

.marketing-footer h2 {
  margin: 3px 0 22px;
  color: #eca40e;
  font: 700 11px/1 var(--font-mono, "Space Mono", monospace);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.marketing-footer ul { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }

.marketing-footer li { margin: 0; padding: 0; }

.marketing-footer nav a {
  color: #c9bea8;
  font-family: var(--font-mono, "Space Mono", monospace);
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
}

.marketing-footer nav a:hover { color: #fbf6ea; text-decoration: underline; text-decoration-color: #e0532b; text-underline-offset: 4px; }

.marketing-footer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--chrome-x);
  border-top: 1px solid #41351f;
  color: #b6a98e;
  font: 700 9px/1.4 var(--font-mono, "Space Mono", monospace);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.marketing-footer__bar i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #2da782;
}

[dir="rtl"] .marketing-header,
[dir="rtl"] .marketing-footer { direction: rtl; }

[dir="rtl"] .marketing-header__nav > a::after { transform-origin: right center; }

@media (max-width: 1120px) {
  .marketing-header { gap: 22px; }
  .marketing-header__nav { gap: 18px; }
  .marketing-header__nav > a { font-size: 10px; letter-spacing: 0.1em; }
  .marketing-header__actions { gap: 12px; }
  .marketing-header__login { padding-inline: 18px; }
  .marketing-footer__grid { grid-template-columns: 1.4fr repeat(2, minmax(150px, 1fr)); }
}

@media (max-width: 900px) {
  .marketing-header { grid-template-columns: minmax(0, 1fr) auto; min-height: 74px; padding: 13px var(--chrome-x); }
  .marketing-header__nav,
  .marketing-header__actions { display: none; }
  .marketing-menu { display: block; }
  .marketing-menu__summary {
    display: inline-flex;
    min-width: 82px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border: 2px solid #16110c;
    border-radius: 4px;
    background: #fbf6ea;
    color: #16110c;
    cursor: pointer;
    font: 700 10px/1 var(--font-mono, "Space Mono", monospace);
    letter-spacing: 0.14em;
    text-align: center;
    text-transform: uppercase;
  }
  /* The button had no open/closed affordance at all. */
  .marketing-menu__summary::after { content: "\25BE"; color: #be3f1b; }
  .marketing-menu[open] .marketing-menu__summary::after { content: "\25B4"; }
  /* Scrim. The panel is opaque and sits straight over live body copy, cutting
     a paragraph mid-line; without dimming that reads as breakage rather than
     layering. Dismissal is outside-pointerdown / Escape, wired in
     marketing-bauhaus-interactions.js, so the scrim is never a trap.

     It hangs off <body>, not off <details>: inside the menu's own stacking
     context the scrim covered the summary that opened it, and it dimmed the
     header's background. At z-index 90 the whole header (z-index 100) stays
     lit and everything below it dims. Browsers without :has() simply get no
     scrim, which is the previous behaviour.

     ::after, not ::before — body::before is the grain overlay, and sharing it
     meant the scrim inherited its opacity: 0.06 and rendered invisible. */
  body:has(.marketing-menu[open])::after {
    position: fixed;
    z-index: 90;
    background: rgba(28, 23, 18, 0.5);
    content: "";
    inset: 0;
  }
  .marketing-menu__panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 10px);
    right: 0;
    display: grid;
    width: min(340px, calc(100vw - 32px));
    gap: 14px;
    padding: 18px;
    border: 2px solid #16110c;
    border-radius: 6px;
    background: #fbf6ea;
    box-shadow: 8px 8px 0 #16110c;
  }
  .marketing-menu__links { display: grid; }
  .marketing-menu__link {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid #ddcdac;
    color: #16110c;
    font: 700 11px/1.2 var(--font-mono, "Space Mono", monospace);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .marketing-menu__link[aria-current="page"] { color: #be3f1b; }
  .marketing-menu .bauhaus-locale,
  .marketing-menu .bauhaus-locale__summary { width: 100%; }
  .marketing-menu .bauhaus-locale__summary { justify-content: space-between; }
  .marketing-menu .bauhaus-locale__menu { position: static; width: 100%; margin-top: 8px; box-shadow: 4px 4px 0 #16110c; }
  .marketing-menu__login { width: 100%; }
  /* Footer links computed to 18px tall — well under the 44px touch minimum.
     min-height now carries the rhythm, so the list gap drops to near zero. */
  .marketing-footer ul { gap: 2px; }
  .marketing-footer nav a { display: flex; min-height: 44px; align-items: center; }
}

@media (max-width: 720px) {
  [data-page-id="features"] .catalog-hero,
  [data-page-id="features"] .hero-copy,
  [data-page-id="features"] .hero-score {
    width: 100%;
    min-width: 0;
  }
  [data-page-id="features"] .hero-copy h1 { overflow-wrap: anywhere; }
  .marketing-header__brand { gap: 10px; font-size: 18px; }
  .marketing-header__brand img { width: 27px; height: 27px; }
  .marketing-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 38px 28px; }
  .marketing-footer__brand { grid-column: 1 / -1; }
  .marketing-footer__bar { align-items: flex-start; flex-direction: column; gap: 7px; }
}

@media (max-width: 420px) {
  /* inline padding stays on --chrome-x at every width */
  .marketing-footer__grid { grid-template-columns: 1fr; }
  .marketing-footer__brand { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .marketing-header__nav > a::after,
  .marketing-header__login { transition: none; }
}
