/* Behavior states shared by the standalone JavaScript modules. */
html.has-modal,
html.has-mobile-menu {
  overflow: hidden;
}

.mobile-nav-backdrop[hidden],
.mobile-nav[hidden] {
  display: none;
}

/* Use the compact header below the desktop breakpoint. */
@media (width < 1024px) {
  .site-header__inner {
    gap: 12px;
  }

  .site-nav {
    display: none;
  }

  .site-header__inner > .brand,
  .site-header__toggle {
    flex-shrink: 0;
  }

  .site-header__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-left: auto;
    white-space: nowrap;
  }

  .site-header__toggle {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid color-mix(in oklab, var(--neon) 25%, var(--border));
    border-radius: 14px;
    background: color-mix(in oklab, var(--neon) 7%, var(--background));
    color: var(--foreground);
    transition: background-color .2s, border-color .2s;
  }

  .menu-toggle__line {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .25s ease;
  }

  .site-header__toggle[aria-expanded='true'] {
    border-color: var(--neon);
    background: color-mix(in oklab, var(--neon) 16%, var(--background));
    color: var(--neon);
  }

  .site-header__toggle[aria-expanded='true'] .menu-toggle__line:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  .site-header__toggle[aria-expanded='true'] .menu-toggle__line:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }

  .mobile-nav-backdrop {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 100dvh;
    background: #080410b8;
    backdrop-filter: blur(8px);
  }

  .mobile-nav {
    display: block;
    position: absolute;
    top: calc(100% + 12px);
    left: 16px;
    right: 16px;
    max-width: 560px;
    max-height: calc(100dvh - 104px);
    margin-left: auto;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--neon) var(--background);
    border: 1px solid color-mix(in oklab, var(--neon) 30%, var(--border));
    border-radius: 24px;
    background: radial-gradient(ellipse at 100% 0, color-mix(in oklab, var(--neon) 13%, transparent), transparent 65%), var(--background);
    box-shadow: 0 24px 70px #0008, 0 0 35px color-mix(in oklab, var(--neon) 8%, transparent);
    animation: mobile-menu-enter .25s ease-out;
  }

  .mobile-nav__eyebrow {
    margin: 0 0 16px;
    padding-inline: 12px;
    color: var(--neon);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
  }

  .mobile-nav__links {
    display: grid;
    gap: 4px;
  }

  .mobile-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--foreground);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    transition: color .2s, background-color .2s, border-color .2s;
  }

  .mobile-nav__link::after {
    content: '\2197';
    color: var(--muted-foreground);
    font-size: 18px;
    font-weight: 400;
    opacity: .6;
    transition: transform .2s, opacity .2s;
  }

  .mobile-nav__link[aria-current='page'] {
    border-color: color-mix(in oklab, var(--neon) 25%, transparent);
    background: color-mix(in oklab, var(--neon) 12%, transparent);
    color: var(--neon);
  }

  .mobile-nav__link[aria-current='page']::after {
    content: '';
    width: 6px;
    height: 6px;
    margin-right: 4px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 12px var(--neon);
    opacity: 1;
  }

  .mobile-nav__link:is(:hover, :focus-visible) {
    background: color-mix(in oklab, var(--neon) 10%, transparent);
    color: var(--neon);
  }

  .mobile-nav__footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
  }

  .mobile-nav__footer p {
    margin: 0 0 16px;
    padding-inline: 12px;
    color: var(--muted-foreground);
    font-size: 12px;
    line-height: 1.7;
  }

  .mobile-nav__cta {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
  }
}

/* The longest translations (German, Spanish and French) need a denser desktop
   header near the desktop breakpoint. Each label still keeps its own line. */
@media (1024px <= width < 1360px) {
  .site-header__inner {
    gap: 8px;
    padding-inline: 16px;
  }

  .brand {
    gap: 6px;
  }

  .brand__name {
    font-size: 16px;
  }

  .site-nav {
    gap: 0;
  }

  .site-nav__link,
  .site-nav__link-current {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding-inline: 7px;
    padding-block: 6px;
    font-size: 12px;
  }

  .site-header__cta {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding-inline: 14px;
    padding-block: 6px;
    border-radius: 12px;
    font-size: 12px;
  }
}

/* Extra compression at the lower edge of the desktop layout keeps even the
   longest translated navigation on one line. */
@media (1024px <= width < 1180px) {
  .site-header__inner {
    gap: 5px;
    padding-inline: 12px;
  }

  .brand {
    gap: 5px;
  }

  .brand__image {
    width: 32px;
    height: 32px;
  }

  .brand__name {
    font-size: 14px;
  }

  .site-nav__link,
  .site-nav__link-current {
    min-height: 32px;
    padding-inline: 5px;
    padding-block: 5px;
    font-size: 10px;
  }

  .site-header__cta {
    min-height: 32px;
    padding-inline: 10px;
    padding-block: 5px;
    border-radius: 10px;
    font-size: 10px;
  }
}

/* Navigation and CTA labels are controls: splitting them over two lines makes
   the header and action rows jump between languages. */
.site-nav__link,
.site-nav__link-current,
.site-header__cta,
.lead-form__submit,
.mobile-nav__link,
.mobile-nav__cta {
  white-space: nowrap;
}

/* The final word and its directional arrow are one visual token. */
.nowrap-arrow {
  display: inline-block;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  -webkit-hyphens: none;
  hyphens: none;
}

/* Grid items use min-width:auto by default. Long translated compound words can
   otherwise widen an entire grid beyond a narrow viewport. */
.hero__inner > *,
.features__grid > *,
.security__grid > *,
.data-sources__grid > *,
.onboarding__grid > *,
.verification__grid > *,
.principles__grid > *,
.stats__grid > *,
.connect__benefits > *,
.split-layout > *,
.contact__grid > *,
.connect__inner > *,
.audience__grid > *,
.technology-callout > *,
.site-footer__inner > * {
  min-width: 0;
}

.site-footer__links,
.site-footer__links > li,
.site-footer__link,
.site-footer__legal-link {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (width < 1024px) {
  main,
  .modal,
  .errors_modal {
    min-width: 0;
    max-width: 100%;
    word-break: normal;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
  }

  main :where(h1, h2, h3, h4, p, li, a, label, button, summary),
  .modal :where(h1, h2, h3, h4, p, li, a, label, button),
  .errors_modal :where(h1, h2, h3, h4, p, li, a, label, button) {
    min-width: 0;
    max-width: 100%;
    word-break: normal;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}

@media (width < 640px) {
  html {
    scrollbar-gutter: auto;
  }

  main :where(h1, h2, h3, h4),
  .modal :where(h1, h2, h3, h4),
  .errors_modal :where(h1, h2, h3, h4) {
    overflow-wrap: normal;
    word-break: normal;
    -webkit-hyphens: none;
    hyphens: none;
  }

  .lead-form__submit,
  .mobile-nav__cta {
    max-width: 100%;
    padding-inline: clamp(12px, 5vw, 28px);
    font-size: clamp(11px, 3.5vw, 14px);
  }

  .site-footer__links {
    font-size: 12px;
  }
}

/* Keep translated mobile headings on whole words. Their type scale is reduced
   before a compound word would need to be split inside the word. */
@media (width <= 480px) {
  .hero__title,
  .page-intro__title,
  .section__title,
  .section__subtitle,
  .faq__title,
  .contact__title,
  .legal__title,
  .about-intro .page-intro__title {
    font-size: clamp(21px, 6.5vw, 26px);
    line-height: 1.2;
  }

  .technology-callout__title,
  .verification__title,
  .glossary__title,
  .audience__title {
    font-size: clamp(18px, 5.8vw, 22px);
    line-height: 1.3;
  }

  .faq__question,
  .card__title,
  .card__subtitle,
  .feature__title,
  .data-sources__title,
  .audience__item-title,
  .methodology__source-title {
    font-size: clamp(15px, 4.5vw, 18px);
    line-height: 1.4;
  }

  html[lang="de"] .feature__title {
    font-size: clamp(14px, 4.3vw, 16px);
    line-height: 1.4;
    letter-spacing: -.02em;
  }
}

@media (width < 768px) {
  .site-header .brand__name {
    display: none;
  }
}

@keyframes mobile-menu-enter {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav { animation: none; }
  .menu-toggle__line { transition: none; }
}

.lead-form__legal-link {
  color: var(--neon);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.lead-form__legal-link:hover,
.lead-form__legal-link:focus-visible {
  color: var(--foreground);
  text-decoration-color: currentColor;
}

html {
  scrollbar-gutter: stable;
}

.modal {
  width: min(780px, calc(100% - 40px));
  max-width: none;
  max-height: min(860px, calc(100dvh - 64px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--neon) 35%, var(--border));
  border-radius: 24px;
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 32px 100px #0009, 0 0 60px color-mix(in oklab, var(--neon) 12%, transparent);
}

.modal[open] {
  display: flex;
  animation: modal-enter .22s ease-out;
}

.modal::backdrop {
  background: #090510cf;
  backdrop-filter: blur(10px);
}

.modal-content {
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--neon) var(--background);
  background: radial-gradient(ellipse at 0 0, color-mix(in oklab, var(--neon) 10%, transparent), transparent 420px);
}

.modal-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.modal-brand {
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .025em;
  color: var(--neon);
}

.modal-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--foreground);
  font: 26px/1 'Manrope', sans-serif;
  transition: background-color .2s, border-color .2s;
}

.modal-close:hover {
  border-color: var(--neon);
  background: color-mix(in oklab, var(--neon) 18%, var(--surface));
}

.modal .legal-copy {
  padding: 32px 40px 12px;
}

.legal-copy {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.85;
}

.legal-copy h2 {
  margin: 0 0 16px;
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.03em;
}

.legal-copy h2:focus {
  outline: none;
}

.legal-copy :is(h3, h4) {
  color: var(--foreground);
  font-weight: 700;
  line-height: 1.5;
}

.legal-copy h3 {
  margin: 30px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 18px;
}

.legal-copy h4 {
  margin: 22px 0 8px;
  font-size: 15px;
}

.legal-copy p {
  margin: 0 0 16px;
  color: var(--muted-foreground, #bdb4cf);
}

.legal-copy :is(h1, h2) + p {
  margin-bottom: 24px;
  color: var(--neon);
  font-size: 12px;
  letter-spacing: .035em;
}

.legal-copy ul {
  margin: 12px 0 20px;
  padding-left: 22px;
  list-style: disc;
  color: var(--muted-foreground, #bdb4cf);
}

.legal-copy li {
  margin: 8px 0;
  padding-left: 4px;
}

.legal-copy li::marker {
  color: var(--neon);
}

.modal-actions {
  padding: 12px 40px 36px;
}

.modal-button {
  justify-content: center;
  min-width: 180px;
}

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (width < 640px) {
  .modal {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 20px;
  }
  .modal-toolbar { padding: 14px 20px; }
  .modal .legal-copy { padding: 24px 22px 8px; }
  .legal-copy { font-size: 14px; line-height: 1.8; }
  .legal-copy h3 { font-size: 16px; }
  .modal-actions { padding: 12px 22px 24px; }
  .modal-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .modal[open] { animation: none; }
}

.notification {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  width: min(356px, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--foreground);
  box-shadow: 0 4px 24px #0004;
  font-size: 14px;
  line-height: 1.5;
}

.lead-form__submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

/* Native ordered-list items own the reveal animation. The inner article keeps
   the reference's card geometry and text-hover appearance. */
/* Show focused controls immediately, including their surrounding content. */
.reveal:focus-within {
  opacity: 1;
  transform: none;
  transition: none;
}

main :is(ol, ul) > .list-reveal {
  border-radius: 0;
  transition: opacity .75s cubic-bezier(.22, 1, .36, 1), transform .95s cubic-bezier(.16, 1, .3, 1);
}

main :is(ol, ul) > .list-reveal:hover {
  color: inherit;
  background-color: transparent;
  box-shadow: none;
}

main .list-card {
  border-radius: .25rem;
  transition: color .3s, text-shadow .3s, background-color .3s;
}

@supports (color: color-mix(in lab, red, red)) {
  main .list-card:hover {
    background-color: color-mix(in oklab, var(--neon) 7%, transparent);
  }
}

button, summary, input[type='checkbox'] {
  cursor: pointer;
}

:focus-visible:not(.lead-form__field) {
  outline: 2px solid var(--neon);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .reveal.reveal--visible,
  main :is(ol, ul) > .list-reveal {
    transform: none;
    transition: opacity .65s ease-out;
    transition-delay: var(--reveal-delay, 0ms);
  }

  .reveal.reveal--pending {
    opacity: 0;
    transform: none;
    transition: none;
  }

  .reveal:focus-within {
    opacity: 1;
    transition: none;
  }
}

