/* Site footer, English pages: the dark design (owner decision 2026-12-01).
   The markup is stamped by infra/build-footer.py, which also stamps the <link> to this file as the
   footer's first child, so every page with the footer loads it. This is the ONLY place the dark
   footer is styled: nothing here depends on assets/main.css or assets/media.css, and the old
   footer rules there (.new-footer-section ...) now style the translated footers only.
   After editing, bump CSS_VERSION in infra/build-footer.py and re-stamp.

   Layout: >= 1242px link columns (.sf-cols); below that the same groups as a collapsible list
   (.footer-accordion, opened and closed by assets/js/app.js through aria-expanded). */

.sf-footer {
  --sf-bg: #0D0B1E;
  --sf-ink: #FFFFFF;
  --sf-text: #C9C6DD;
  --sf-muted: #A8A5C0;
  --sf-line: rgba(255, 255, 255, 0.14);
  --sf-box: rgba(255, 255, 255, 0.22);
  position: relative;
  margin: 0;
  padding: 0;
  background: var(--sf-bg);
  color: var(--sf-text);
  /* a dark band often sits right above the footer (the closing call to action on the AI agents
     pages): this rule keeps the two apart */
  border-top: 1px solid var(--sf-line);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  -webkit-text-size-adjust: 100%;
}
.sf-footer,
.sf-footer *,
.sf-footer *::before,
.sf-footer *::after {
  box-sizing: border-box;
}
.sf-footer button {
  font-family: inherit;
}
/* Pages in the AI agents design (they load ai-agents.css) set Inter; assets/main.css forces DM Sans
   on everything, so the footer is told to use Inter there too. Two separate rules: a browser
   without :has() drops the second and keeps the first. */
.ag-page ~ .sf-footer,
.ag-page ~ .sf-footer * {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif !important;
}
html:has(link[href*="/ai-agents.css"]) .sf-footer,
html:has(link[href*="/ai-agents.css"]) .sf-footer * {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif !important;
}
.sf-footer ul,
.sf-footer li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sf-footer p {
  margin: 0;
  padding: 0;
}
.sf-footer a {
  text-decoration: none;
}
.sf-footer a:focus-visible,
.sf-footer button:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
  border-radius: 4px;
}

.sf-footer .sf-wrap {
  display: flex;
  flex-direction: column;
  gap: 48px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 64px 24px 28px;
}

/* ---- brand row: logo, one line about the product, social boxes ---- */
.sf-footer .sf-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 560px;
}
.sf-footer .sf-logo {
  color: var(--sf-ink);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.sf-footer .sf-logo img {
  display: block;
  width: 141px;
  height: 30px;
  max-width: none;
}
.sf-footer .sf-blurb {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--sf-text);
}
.sf-footer .sf-follow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.sf-footer .sf-muted {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--sf-muted);
}
.sf-footer .sf-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sf-footer .sf-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--sf-box);
  border-radius: 10px;
  background: transparent;
  color: var(--sf-ink);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.sf-footer .sf-social a:hover,
.sf-footer .sf-social a:focus-visible {
  border-color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}
.sf-footer .sf-social svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ---- link columns (desktop) ---- */
.sf-footer .sf-cols {
  display: none;
}
.sf-footer .sf-h {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--sf-ink);
}
.sf-footer .sf-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sf-footer .sf-list li {
  display: block;
  min-height: 0;
}
.sf-footer .sf-link {
  display: inline-block;
  padding: 5px 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--sf-text);
  white-space: normal;
  transition: color 0.2s ease;
}
.sf-footer .sf-link:hover,
.sf-footer .sf-link:focus-visible {
  color: var(--sf-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- the same groups, collapsible (below 1242px) ---- */
.sf-footer .footer-accordion {
  display: block;
  width: 100%;
  border-top: 1px solid var(--sf-line);
}
.sf-footer .footer-accordion .footer-accordion-item {
  border-bottom: 1px solid var(--sf-line);
}
.sf-footer .footer-accordion button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 60px;
  margin: 0;
  padding: 16px 0 !important;
  border: 0;
  border-radius: 0;
  background: none;
  outline-offset: 2px;
  color: var(--sf-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sf-footer .footer-accordion button .footer-accordion-title {
  color: var(--sf-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.sf-footer .footer-accordion button .icon1 {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}
/* the arrow is drawn pointing up: down while closed, up while open. !important because app.js
   writes inline transforms that leave closed groups pointing the wrong way. */
.sf-footer .footer-accordion button .icon1 img {
  display: block;
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
  transform: rotate(180deg) !important;
  transition: transform 0.25s ease;
}
.sf-footer .footer-accordion button[aria-expanded="true"] .icon1 img {
  transform: rotate(0deg) !important;
}
/* open / closed follows aria-expanded alone (app.js also writes inline max-height and opacity) */
.sf-footer .footer-accordion .footer-accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  max-height: none !important;
  overflow: hidden;
  opacity: 0 !important;
  visibility: hidden;
  transition: grid-template-rows 0.25s ease, opacity 0.2s linear, visibility 0s linear 0.25s;
}
.sf-footer .footer-accordion button[aria-expanded="true"] + .footer-accordion-content {
  grid-template-rows: 1fr;
  opacity: 1 !important;
  visibility: visible;
  transition: grid-template-rows 0.25s ease, opacity 0.2s linear, visibility 0s;
}
.sf-footer .footer-accordion .footer-accordion-content > .sf-list {
  min-height: 0;
  overflow: hidden;
  gap: 0;
}
.sf-footer .footer-accordion .footer-accordion-content > .sf-list > li:last-child {
  padding-bottom: 12px;
}
.sf-footer .footer-accordion .sf-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  font-size: 15px;
}

/* ---- rule, trust row, bottom line ---- */
.sf-footer .sf-rule {
  height: 1px;
  background: var(--sf-line);
}
.sf-footer .sf-trust,
.sf-footer .sf-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.sf-footer .sf-trust {
  gap: 20px 32px;
}
.sf-footer .sf-bottom {
  gap: 12px 24px;
}
.sf-footer .sf-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}
/* The original certification icons (grey line art), lightened for the dark footer. */
.sf-footer .sf-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sf-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.sf-footer .sf-badge img {
  display: block;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  filter: brightness(1.75);
}
.sf-footer .sf-contact,
.sf-footer .sf-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
}
.sf-footer .sf-contact .sf-link,
.sf-footer .sf-legal .sf-link {
  display: inline-flex;
  align-items: center;
}
.sf-footer .sf-copy {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--sf-muted);
}

/* ---- language picker: the page's own markup and script (toggleLangPopup), restyled dark ---- */
.sf-footer .sf-lang {
  position: relative;
  display: flex;
  align-items: center;
}
/* a page whose picker is switched off (inside a comment) gets no empty box in the row */
.sf-footer .sf-lang:empty {
  display: none;
}
.sf-footer .sf-lang > div {
  position: relative;
}
.sf-footer .sf-lang .icon-btn.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: auto;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--sf-box);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sf-ink);
  cursor: pointer;
}
.sf-footer .sf-lang .icon-btn.lang:hover {
  border-color: #FFFFFF;
}
.sf-footer .sf-lang .icon-btn.lang .language-code {
  color: var(--sf-ink) !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.sf-footer .sf-lang .icon-btn.lang img {
  display: block;
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}
.sf-footer .sf-lang .language-popup {
  position: absolute;
  top: auto;
  bottom: calc(100% + 8px);
  right: 0;
  left: auto;
  z-index: 1000;
  display: none;
  width: 168px;
  max-width: calc(100vw - 48px);
  border: 1px solid var(--sf-box);
  border-radius: 10px;
  background: #1A1731;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.sf-footer .sf-lang .ai-popup-content {
  padding: 12px 8px;
}
.sf-footer .sf-lang .ai-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sf-footer .sf-lang .ai-grid > div {
  padding: 0 8px;
  color: var(--sf-muted) !important;
  font-size: 12px !important;
  line-height: 1.4;
}
.sf-footer .sf-lang .multi-language-option {
  display: flex;
  align-items: center;
  height: auto;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--sf-text);
  transition: background 0.2s ease;
}
.sf-footer .sf-lang .multi-language-option:hover,
.sf-footer .sf-lang .multi-language-option:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sf-ink);
}
/* !important: several pages carry their own light-theme rules for the active language */
.sf-footer .sf-lang .multi-language-option.active {
  background: rgba(139, 124, 246, 0.28) !important;
  color: var(--sf-ink) !important;
}
.sf-footer .sf-lang .multi-language-option span {
  color: inherit !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

/* ---- desktop: link columns, sized to their longest link and spread across the row ---- */
@media (min-width: 1242px) {
  .sf-footer .footer-accordion {
    display: none;
  }
  .sf-footer .sf-cols {
    display: grid;
    grid-template-columns: repeat(6, auto);
    justify-content: space-between;
    align-items: start;
    column-gap: 24px;
  }
  .sf-footer .sf-col {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
  }
  .sf-footer .sf-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
  }
}

/* ---- phones and tablets ---- */
@media (max-width: 1241px) {
  .sf-footer .sf-wrap {
    gap: 32px;
    padding: 48px 24px 28px;
  }
  /* the collapsible list draws its own lines */
  .sf-footer .sf-rule {
    display: none;
  }
  /* tap targets: 44px */
  .sf-footer .sf-contact .sf-link,
  .sf-footer .sf-legal .sf-link {
    min-height: 44px;
  }
  .sf-footer .sf-lang .icon-btn.lang,
  .sf-footer .sf-lang .multi-language-option {
    min-height: 44px;
  }
}
@media (max-width: 767px) {
  .sf-footer .sf-wrap {
    padding: 40px 20px 24px;
  }
  .sf-footer .sf-trust,
  .sf-footer .sf-bottom,
  .sf-footer .sf-contact {
    flex-direction: column;
    align-items: flex-start;
  }
  /* the picker sits at the left edge here: open the list to the right of it, inside the screen */
  .sf-footer .sf-lang .language-popup {
    right: auto;
    left: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sf-footer *,
  .sf-footer *::before,
  .sf-footer *::after {
    transition: none !important;
  }
}

/* Default language dropdown (pages without their own picker): a <details>, opens upward. */
.sf-footer .sf-langd { position: relative; }
.sf-footer .sf-langd summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; box-sizing: border-box;
  padding: 0 14px; border: 1px solid var(--sf-line); border-radius: 10px; cursor: pointer;
  color: var(--sf-ink); font-size: 14px; list-style: none; white-space: nowrap;
}
.sf-footer .sf-langd summary::-webkit-details-marker { display: none; }
.sf-footer .sf-langd summary:hover { border-color: rgba(255, 255, 255, 0.4); }
.sf-footer .sf-langd[open] summary svg { transform: rotate(180deg); }
.sf-footer .sf-langd ul {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 5; margin: 0; padding: 6px;
  list-style: none; min-width: 170px; background: #1A1830; border: 1px solid var(--sf-line);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.sf-footer .sf-langd a {
  display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px;
  color: var(--sf-ink); font-size: 14px; text-decoration: none;
}
.sf-footer .sf-langd a:hover, .sf-footer .sf-langd a[aria-current] { background: rgba(255, 255, 255, 0.08); }
@media (max-width: 720px) { .sf-footer .sf-langd ul { right: auto; left: 0; } }

/* "All ..." links close their column: bold, white, with an arrow. */
.sf-footer .sf-link.sf-link--all { color: var(--sf-ink); font-weight: 600; }
.sf-footer .sf-link.sf-link--all::after { content: " \2192"; }
