/* Shared typography, spacing and action sizes for the landing site. */
body {
  --landing-control-radius: 4px;
  --landing-control-inset: 12px;
  --landing-control-arrow-gap: 8px;
  --landing-control-arrow-width: 16px;
}
.page-home {
  --landing-section-heading-size: clamp(31px, 2.25vw, 42px);
  --landing-section-copy-size: clamp(14.5px, 1.02vw, 16.5px);
  --landing-card-heading-size: clamp(21px, 1.65vw, 27px);
  --landing-copy-gap: 24px;
  --landing-compact-copy-gap: 8px;
  --landing-card-heading-gap: 22px;
  --landing-card-copy-gap: 12px;
}
@media (max-width: 700px) {
  .page-home {
    --landing-section-heading-size: clamp(24px, 7.35vw, 29px);
    --landing-section-copy-size: 14px;
    --landing-card-heading-size: 22px;
    --landing-copy-gap: 20px;
  }
}

/* Consistent corners and spacing for the site's rectangular actions. */
body .button { border-radius: var(--landing-control-radius) !important; }
body .button:not(.button-outline):not(.menu-login) { padding-inline: var(--landing-control-inset) !important; }
body .button:not(.button-outline):not(.menu-login):is(:hover, :active) { transform: none; }

/* Keep the same arrow on existing controls and reveal it gently on interaction. */
body .button .button-arrow { opacity: 0; transition: opacity 320ms ease-in-out; }
body .button:is(:hover, :focus-visible) .button-arrow { opacity: 1; }

/* Controls without an arrow reserve a small, stable space for the same cue. */
@supports selector(:has(*)) {
  body .button:not(.button-outline):not(.menu-login):not(:has(.button-arrow, .continuity-arrow, .product-overview-arrow, span[aria-hidden])) {
    position: relative;
    padding-right: calc(var(--landing-control-inset) + 20px) !important;
  }
  body .button:not(.button-outline):not(.menu-login):not(:has(.button-arrow, .continuity-arrow, .product-overview-arrow, span[aria-hidden]))::after {
    content: "→";
    position: absolute;
    right: var(--landing-control-inset);
    opacity: 0;
    transition: opacity 320ms ease-in-out;
  }
  body .button:not(.button-outline):not(.menu-login):not(:has(.button-arrow, .continuity-arrow, .product-overview-arrow, span[aria-hidden])):is(:hover, :focus-visible)::after { opacity: 1; }
  body .button.button-card { width: 116px !important; min-width: 116px !important; }
}

@media (prefers-reduced-motion: reduce) {
  body .button .button-arrow, body .button::after { transition: none; }
}

/* Optically center arrow glyphs with their button labels. */
body .button :is(.button-arrow, .continuity-arrow, .product-overview-arrow, .independent-arrow, .landing-footer-arrow, .landing-pricing-arrow),
body .button.nav-get-started > span[aria-hidden="true"],
body .button.landing-pricing-button > span[aria-hidden="true"] { position: relative; top: 1px; }
@supports selector(:has(*)) {
  body .button:not(.button-outline):not(.menu-login):not(:has(.button-arrow, .continuity-arrow, .product-overview-arrow, span[aria-hidden]))::after { transform: translateY(1px); }
}


/* A soft, directional glint follows the existing mark without changing its shape. */
@media (prefers-reduced-motion: no-preference) {
  .site-header .brand-mark::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(45deg, transparent 34%, rgba(255, 255, 255, .28) 43%, #fff 50%, rgba(255, 255, 255, .28) 57%, transparent 66%);
    background-size: 300% 300%;
    background-position: 100% 0%;
    -webkit-mask: url("../brand/talis-mark-white-transparent.png") center / 100% 100% no-repeat;
    mask: url("../brand/talis-mark-white-transparent.png") center / 100% 100% no-repeat;
  }
  .page-home .site-header .brand-mark::before {
    -webkit-mask-size: 150% 150%;
    mask-size: 150% 150%;
  }
  .page-home .site-header.is-over-intelligence .brand-mark::before {
    background-image: linear-gradient(45deg, transparent 34%, rgba(30, 30, 30, .18) 43%, rgba(30, 30, 30, .78) 50%, rgba(30, 30, 30, .18) 57%, transparent 66%);
  }
  .site-header .brand-mark:focus-visible::before { animation: talis-mark-shimmer 480ms cubic-bezier(.22, .61, .36, 1) both; }
  @media (hover: hover) {
    .site-header .brand-mark:hover::before { animation: talis-mark-shimmer 480ms cubic-bezier(.22, .61, .36, 1) both; }
  }
  @keyframes talis-mark-shimmer {
    0% { opacity: 0; background-position: 100% 0%; }
    16% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; background-position: 0% 100%; }
  }
}


/* Consistent half-pixel reduction for action labels across the marketing site. */
body { --landing-button-label-reduction: .5px; }
body .button { font-size: calc(15px - var(--landing-button-label-reduction)); }
body.page-home .header-right .button,
body.page-home .continuity-copy .continuity-button,
body.page-home .product-overview-cta,
body.page-home .independent-cta,
body.page-home .landing-pricing-button,
body.request-access-page .request-submit { font-size: calc(13px - var(--landing-button-label-reduction)); }
body.pricing-page .pricing-plan-button,
body.product-page-v2 .product-v2-cta,
body.product-page-v2 .product-v2-feature-cta { font-size: calc(14px - var(--landing-button-label-reduction)); }
body.pricing-page .billing-toggle button { font-size: calc(13px - var(--landing-button-label-reduction)); }
body .cookie-panel-actions button { font-size: calc(12px - var(--landing-button-label-reduction)); }
@media (max-width: 900px) {
  body.page-home .continuity-copy .continuity-button,
  body.page-home .product-overview-cta,
  body.page-home .independent-cta,
  body.page-home .menu-actions .button { font-size: calc(14px - var(--landing-button-label-reduction)); }
  body .mobile-request-access { font-size: calc(13.5px - var(--landing-button-label-reduction)) !important; }
}
@media (max-width: 700px) {
  body .mobile-request-access { font-size: calc(14px - var(--landing-button-label-reduction)) !important; }
}
@media (max-width: 360px) {
  body .mobile-request-access { font-size: calc(13px - var(--landing-button-label-reduction)) !important; }
}

@media (max-width: 900px) {
  body.product-page-v2 .product-v2-cta { font-size: calc(13px - var(--landing-button-label-reduction)); }
  body.product-page-v2 .menu-actions .button { font-size: calc(15px - var(--landing-button-label-reduction)); }
}

@media (max-width: 900px) {
  body.product-page-v2 .product-v2-panel .product-v2-feature-cta { font-size: calc(14px - var(--landing-button-label-reduction)); }
}

/* Wordmark in the expanded navigation; the floating bar keeps its original icon. */
.page-home .site-header:not(.is-condensed) .brand-mark { width: 82px; }
.page-home .site-header .brand-mark .nav-wordmark { opacity: 0; transform: none; object-fit: contain; pointer-events: none; }
.page-home .site-header:not(.is-condensed) .brand-mark img:not(.nav-wordmark) { opacity: 0; }
.page-home .site-header:not(.is-condensed) .brand-mark .nav-wordmark { opacity: 1; filter: none; transform: none; }
.page-home .site-header:is(.is-over-intelligence, .is-on-dark):not(.is-condensed) .brand-mark .nav-wordmark { filter: invert(1); }
@media (max-width: 900px) { .page-home .site-header:not(.is-condensed) .brand-mark { width: 76px; } }
@media (prefers-reduced-motion: no-preference) {
  .page-home .site-header:not(.is-condensed) .brand-mark::before { -webkit-mask: url('../home/talis-footer-wordmark-lossless.svg') center / contain no-repeat; mask: url('../home/talis-footer-wordmark-lossless.svg') center / contain no-repeat; }
}

.page-home .site-header.is-condensed .brand-mark img.nav-wordmark { display: none; }

/* Swap marks while the navigation is faded out, not while it is visible. */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .page-home .site-header.is-condensed .brand-mark { overflow: visible; }
  .page-home .site-header.is-condensed .brand-mark img.nav-wordmark { display: block; width: 82px; height: 22px; filter: none; animation: talis-nav-wordmark-out 820ms steps(1, end) both; }
  .page-home .site-header.is-condensed .brand-mark img:not(.nav-wordmark) { animation: talis-nav-icon-in 820ms steps(1, end) both; }
  .page-home .site-header.is-unfolding .brand-mark img.nav-wordmark { animation: talis-nav-icon-in 820ms steps(1, end) both; }
  .page-home .site-header.is-unfolding .brand-mark img:not(.nav-wordmark) { animation: talis-nav-wordmark-out 820ms steps(1, end) both; }
  @keyframes talis-nav-wordmark-out { 0% { opacity: 1; } 25%, 100% { opacity: 0; } }
  @keyframes talis-nav-icon-in { 0% { opacity: 0; } 25%, 100% { opacity: 1; } }
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .page-home .site-header.is-condensed .brand-mark { animation: talis-nav-width-collapse 820ms steps(1, end) both; }
  .page-home .site-header.is-unfolding .brand-mark { overflow: visible; animation: talis-nav-width-expand 820ms steps(1, end) both; }
  @keyframes talis-nav-width-collapse { 0% { width: 82px; } 25%, 100% { width: 22px; } }
  @keyframes talis-nav-width-expand { 0% { width: 22px; } 25%, 100% { width: 82px; } }
}

/* The compact navigation uses only the symbol, including on dark surfaces. */
.page-home .site-header.is-condensed .brand-mark img.nav-wordmark { display: none !important; opacity: 0 !important; animation: none !important; }

/* Give the expanded wordmark a distinct space from the navigation links. */
@media (min-width: 901px) {
  .page-home .site-header:not(.is-condensed) .header-left { gap: 48px; }
}

/* Keep the compact mark visible throughout the logo swap. */
.page-home .site-header.is-condensed .brand-mark img:not(.nav-wordmark) { animation: none !important; opacity: 1 !important; }

/* Reversible transitions keep the floating navigation steady on quick scroll reversals. */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .page-home .site-header:is(.is-condensed, .is-unfolding)::before { animation: none; }
  .page-home .site-header .header-left,
  .page-home .site-header .header-right {
    animation: none !important;
    transition: transform 560ms var(--ease-premium), gap 560ms var(--ease-premium), background-color 440ms ease, border-color 440ms ease, box-shadow 440ms ease;
  }
  .page-home .site-header .brand-mark {
    animation: none !important; overflow: visible;
    transition: width 560ms var(--ease-premium);
  }
  .page-home .site-header .brand-mark img.nav-wordmark {
    display: block !important; width: 82px; height: 22px; animation: none !important;
    opacity: 1; transition: opacity 140ms ease, filter 380ms ease 100ms;
  }
  .page-home .site-header.is-condensed .brand-mark img.nav-wordmark { opacity: 0 !important; }
  .page-home .site-header .brand-mark img:not(.nav-wordmark) {
    width: 22px; height: 22px; animation: none !important;
    transition: opacity 140ms ease, filter 380ms ease 100ms;
  }
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .page-home .site-header.is-condensed .brand-mark img.nav-wordmark { display: block !important; }
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .page-home .site-header .brand-mark img.nav-wordmark { max-width: none; }
}

/* Dissolve before repositioning; let the compact surface open from its centre. */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .page-home .site-header::before {
    transform: translateX(-50%) scaleX(.64);
    transition: opacity 300ms ease-out, transform 480ms cubic-bezier(.2,.7,.2,1), background-color 380ms ease 100ms, box-shadow 380ms ease 100ms;
  }
  .page-home .site-header.is-condensed::before { transform: translateX(-50%) scaleX(1); }
  .page-home .site-header .header-left,
  .page-home .site-header .header-right {
    filter: blur(0);
    transition: opacity 300ms ease-out 30ms, filter 300ms ease-out 30ms, background-color 380ms ease, border-color 380ms ease, box-shadow 380ms ease;
  }
  .page-home .site-header.is-nav-dissolving .header-left,
  .page-home .site-header.is-nav-dissolving .header-right {
    opacity: 0;
    filter: blur(3px);
    transition: opacity 160ms ease-in, filter 160ms ease-in;
  }
  .page-home .site-header .brand-mark { transition: none; }
  .page-home .site-header .brand-mark img.nav-wordmark,
  .page-home .site-header .brand-mark img:not(.nav-wordmark) { transition: filter 380ms ease 100ms; }
}

/* Mobile menu actions use symmetrical padding and the shared button shape. */
@media (max-width: 900px) {
  body.page-home .mobile-menu .menu-actions .button { display: inline-flex; align-items: center; justify-content: center; padding: 0 16px !important; text-align: center; border-radius: var(--landing-control-radius) !important; }
  body.page-home .mobile-menu .menu-actions .menu-start::after { content: none !important; display: none !important; }
}

@media (max-width: 900px) {
  body.page-home .mobile-menu .menu-actions .button:is(.menu-login, .menu-start) { box-sizing: border-box; width: 112px; min-width: 112px; height: 44px; min-height: 44px; padding: 0 !important; display: inline-flex; justify-content: center; align-items: center; line-height: 1; text-align: center; }
}
